@asymmetric-effort/specifyjs 0.2.150 → 0.2.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
- "use strict";var Pt=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var As=Object.getOwnPropertyNames;var Ls=Object.prototype.hasOwnProperty;var Fs=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ns=(e,t)=>{for(var n in t)Pt(e,n,{get:t[n],enumerable:!0})},Ws=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of As(t))!Ls.call(e,i)&&i!==n&&Pt(e,i,{get:()=>t[i],enumerable:!(r=zs(t,i))||r.enumerable});return e};var Bs=e=>Ws(Pt({},"__esModule",{value:!0}),e);var Ve=(e,t,n)=>Fs(e,typeof t!="symbol"?t+"":t,n);var au={};Ns(au,{Accordion:()=>tr,Alert:()=>ho,AnalogClock:()=>to,AppContextProvider:()=>Xe,Avatar:()=>ro,Badge:()=>io,BarGraph:()=>Er,BigNumber:()=>Bi,BlochSphere:()=>Oi,BoxPlot:()=>Hi,Breadcrumb:()=>nr,BubbleChart:()=>Yi,Button:()=>Li,CalendarHeatMap:()=>ji,Card:()=>Oo,Carousel:()=>Zo,CartesianGraph2D:()=>zr,Checkbox:()=>wo,ChordDiagram:()=>Gi,ColorPicker:()=>Co,ColorWheel:()=>Mo,ComplexGraph2D:()=>Nr,ContextMenu:()=>Lt,DataGrid:()=>co,DatePicker:()=>Po,DecompositionTree:()=>Xi,DigitalClock:()=>uo,DiscreteCartesian2D:()=>Cs,DragDropProvider:()=>St,Drawer:()=>xr,Dropdown:()=>rr,EmptyState:()=>bo,FileUpload:()=>Io,FlexContainer:()=>Ho,FlexItem:()=>_o,Footer:()=>Kr,ForceGraph:()=>Ji,FormFieldWrapper:()=>we,FunnelChart:()=>es,GanttChart:()=>os,Gauge:()=>is,GoogleAnalytics:()=>qr,Grid:()=>Yo,GridItem:()=>Vo,HeatMap:()=>as,Histogram:()=>ls,HypercubeGraph:()=>jr,IDE:()=>Ot,Image:()=>Jo,LineGraph:()=>Hr,ListView:()=>po,LollipopChart:()=>cs,Matrix:()=>ds,Menubar:()=>sr,MessageBusProvider:()=>xt,Modal:()=>yr,MultilineField:()=>$o,NavWrapper:()=>Pe,NumberSpinner:()=>Do,Pagination:()=>lr,Panel:()=>jo,Partition:()=>us,PieGraph:()=>_r,PivotTable:()=>fs,PolarGraph2D:()=>Vr,Popover:()=>vr,ProgressBar:()=>xo,RadarChart:()=>gs,RadioGroup:()=>To,SankeyDiagram:()=>ms,ScrollContainer:()=>Xo,Select:()=>zo,Sidebar:()=>dr,Skeleton:()=>yo,Slider:()=>Ao,Spinner:()=>vo,Splitter:()=>qo,Stepper:()=>ur,Sunburst:()=>hs,Tabs:()=>Ko,Tag:()=>fo,TextEditor:()=>Lo,TextField:()=>Fo,ThreeDLayers:()=>Wi,TimePicker:()=>No,ToastContainer:()=>cn,Toggle:()=>Wo,Toolbar:()=>fr,Tooltip:()=>kr,TradingDashboard:()=>Yt,TreeMap:()=>xs,TreeNav:()=>hr,TreeNode:()=>rt,USStateMap:()=>ss,US_STATE_PATHS:()=>Et,UnityApp:()=>Ti,UnityDesktop:()=>Di,VectorField:()=>vs,VideoPlayer:()=>er,VirtualScroll:()=>go,VizWrapper:()=>Xr,WaterfallChart:()=>ws,WordCloud:()=>ks,WordProcessor:()=>Bt,applyGate:()=>Bn,blochToCartesian:()=>gt,buildInputStyle:()=>Be,buildNavItemStyle:()=>ot,buildRotationMatrix:()=>hn,cartesianToBloch:()=>jt,computeBoxStats:()=>Hn,computeMandelbrotGrid:()=>Fr,computeSlices:()=>fn,createToaster:()=>ln,describeArc:()=>pn,generateEdges:()=>mn,generateHypercube:()=>mt,generatePalette:()=>Wt,generateVertices:()=>gn,numRotationAngles:()=>ht,projectTo2D:()=>xn,transformVec:()=>bn,useAppId:()=>at,useBarGraphScales:()=>dn,useChannel:()=>yt,useDragDrop:()=>Qe,useDraggable:()=>vt,useDropZone:()=>wt,useHover:()=>Ce,useHypercube:()=>Gr,useLineGraphScales:()=>un,useMessageBus:()=>qe,useToast:()=>wr});module.exports=Bs(au);var It=Symbol.for("spec.element"),Os=Symbol.for("spec.fragment"),cu=Symbol.for("spec.portal"),Xn=Symbol.for("spec.provider"),qn=Symbol.for("spec.consumer"),Hs=Symbol.for("spec.forward_ref"),_s=Symbol.for("spec.memo"),Ys=Symbol.for("spec.lazy"),Vs=Symbol.for("spec.suspense"),Us=Symbol.for("spec.strict_mode"),js=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:It,type:e,props:s,key:r,ref:i}}function We(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Xn,_context:t},r={$$typeof:qn,_context:t};return t.Provider=n,t.Consumer=r,t}var tt=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){}};tt.prototype.isSpecComponent=!0;var $t=class extends tt{shouldComponentUpdate(t,n){return!Zn(this.props,t)||!Zn(this.state,n)}};$t.prototype.isPureSpecComponent=!0;function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var Jn=null;function je(){if(Jn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Jn}function G(e){return je().useState(e)}function re(e,t){return je().useEffect(e,t)}function Ae(e){return je().useContext(e)}function en(e,t,n){return je().useReducer(e,t,n)}function S(e,t){return je().useCallback(e,t)}function q(e,t){return je().useMemo(e,t)}function te(e){return je().useRef(e)}function xe(){return je().useId()}var nt=We({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Qn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Xs={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""},qs=new Set;function Ks(){Xs={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""};for(let e of qs)e()}typeof window<"u"&&window.addEventListener("hashchange",Ks);var Up=We({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function eo(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function aa(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 He={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function to(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=G(eo(a));re(()=>{let I=setInterval(()=>{u(eo(a))},1e3);return()=>clearInterval(I)},[a]);let b=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),f=b%12*30+m*.5,g=m*6+c*.1,y=c*6,h=n/2,p=n/2,x=n/2-10,v=x-4,T=x-22,D=[];D.push(o("circle",{cx:String(h),cy:String(p),r:String(x),fill:He.face,stroke:He.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let F=(I*30-90)*Math.PI/180,R=v-6;D.push(o("line",{x1:String(h+R*Math.cos(F)),y1:String(p+R*Math.sin(F)),x2:String(h+v*Math.cos(F)),y2:String(p+v*Math.sin(F)),stroke:He.border,"stroke-width":"2"}));let N=String(I===0?12:I);if(D.push(o("text",{x:String(h+T*Math.cos(F)),y:String(p+T*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:He.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let A=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(h+A*Math.cos(F)),y:String(p+A*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:He.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(I,M,F,R)=>{let N=(I-90)*Math.PI/180;return o("line",{x1:String(h),y1:String(p),x2:String(h+M*Math.cos(N)),y2:String(p+M*Math.sin(N)),stroke:R,"stroke-width":F,"stroke-linecap":"round"})};D.push(C(f,x*.5,"4",He.hand)),D.push(C(g,x*.75,"3",He.hand)),s&&D.push(C(y,x*.85,"1.5",He.second)),D.push(o("circle",{cx:String(h),cy:String(p),r:"4",fill:He.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...D)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:He.numbers}},aa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var nn={xs:24,sm:32,md:40,lg:56,xl:80};function la(e){return e==null?nn.md:typeof e=="number"?e:nn[e]??nn.md}function ca(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var no=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function da(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return no[Math.abs(t)%no.length]}var oo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ua(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function ro(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,b]=G(!1),m=la(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,f=a??da(r),g=`${Math.round(m*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${m}px`,height:`${m}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},h;if(t&&!u)h=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>b(!0)});else{let T=ca(r);h=o("span",{style:{fontSize:g,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},T)}let p=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":f},role:"img","aria-label":n??r??"avatar"},h);if(!l)return p;let x=Math.max(8,Math.round(m*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:oo[l]??oo.offline,border:"2px solid #fff",boxSizing:"border-box",...ua(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},p,o("span",{style:v,"aria-label":l}))}var pa={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 io(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,b=r?{...fa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...pa[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},m=u?o("span",{style:b,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...b,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var ga={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},so={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},on={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ma="6px 8px",ha={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},ba={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},xa={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Ze={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},ya={...Ze,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ao={...Ze,opacity:"0.5",cursor:"default"},lo={cursor:"pointer",width:"16px",height:"16px"};function Sa(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function co(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:b,onSelectionChange:m,striped:c=!1,bordered:f=!1,compact:g=!1,stickyHeader:y=!1}=e,[h,p]=G(0),[x,v]=G(void 0),[T,D]=G("asc"),[C,P]=G([]),[L,I]=G({}),M=i??h,F=a??x,R=l??T,N=b??C,A=q(()=>{let J=Object.entries(L).filter(([,ae])=>ae.length>0);return J.length===0?n:n.filter(ae=>J.every(([de,le])=>String(ae[de]??"").toLowerCase().includes(le.toLowerCase())))},[n,L]),k=q(()=>{if(!F)return A;let J=[...A];return J.sort((ae,de)=>{let le=ae[F],ne=de[F];if(le==null&&ne==null)return 0;if(le==null)return 1;if(ne==null)return-1;if(typeof le=="number"&&typeof ne=="number")return R==="asc"?le-ne:ne-le;let fe=String(le),oe=String(ne),ie=fe.localeCompare(oe);return R==="asc"?ie:-ie}),J},[A,F,R]),w=k.length,$=r?Math.max(1,Math.ceil(w/r)):1,E=r?k.slice(M*r,(M+1)*r):k,W=S(J=>{s?s(J):p(J)},[s]),z=S(J=>{let ae=F===J&&R==="asc"?"desc":"asc";d?d(J,ae):(v(J),D(ae))},[F,R,d]),B=S(J=>{let ae=N.includes(J)?N.filter(de=>de!==J):[...N,J];m?m(ae):P(ae)},[N,m]),O=S(()=>{let J=E.map((le,ne)=>r?M*r+ne:ne),de=J.every(le=>N.includes(le))?N.filter(le=>!J.includes(le)):[...new Set([...N,...J])];m?m(de):P(de)},[E,N,r,M,m]),_=S((J,ae)=>{I(de=>({...de,[J]:ae})),W(0)},[W]),U=t.some(J=>J.filterable),X=g?ma:on.padding,ee=[];if(u){let J=E.map((de,le)=>r?M*r+le:le),ae=J.length>0&&J.every(de=>N.includes(de));ee.push(o("th",{key:"__select_all",style:{...so,padding:X,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ae,onChange:O,style:lo,"aria-label":"Select all rows"})))}for(let J of t){let ae={...so,padding:X,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...f?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},de=[J.header];J.sortable&&de.push(o("span",{style:ha},Sa(J.key,F,R))),ee.push(o("th",{key:J.key,style:ae,onClick:J.sortable?()=>z(J.key):void 0,onKeyDown:J.sortable?le=>{let ne=le.key;(ne==="Enter"||ne===" ")&&(le.preventDefault(),z(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":F===J.key?R==="asc"?"ascending":"descending":void 0},...de))}let Z=null;if(U){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:X}}));for(let ae of t)J.push(o("th",{key:`filter_${ae.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},ae.filterable?o("input",{type:"text",placeholder:`Filter ${ae.header}...`,style:ba,value:L[ae.key]??"",onInput:de=>_(ae.key,de.target.value),"aria-label":`Filter by ${ae.header}`}):null));Z=o("tr",{key:"__filter_row"},...J)}let V=[];for(let J=0;J<E.length;J++){let ae=E[J],de=r?M*r+J:J,le=N.includes(de),ne={};c&&J%2===1&&(ne.backgroundColor="#f9fafb"),le&&(ne.backgroundColor="#eff6ff");let fe=[];u&&fe.push(o("td",{key:"__select",style:{padding:X,textAlign:"center",...on,...f?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:le,onChange:()=>B(de),style:lo,"aria-label":`Select row ${de+1}`})));for(let oe of t){let ie=ae[oe.key],ue=oe.render?oe.render(ie,ae):String(ie??"");fe.push(o("td",{key:oe.key,style:{...on,padding:X,...f?{border:"1px solid #e5e7eb"}:{}}},ue))}V.push(o("tr",{key:String(de),style:ne},...fe))}let j=null;if(r){let J=w===0?0:M*r+1,ae=Math.min((M+1)*r,w),de=[];de.push(o("button",{key:"prev",style:M===0?ao:Ze,onClick:M>0?()=>W(M-1):void 0,disabled:M===0,"aria-label":"Previous page"},"\u2190 Prev"));let le=7,ne=Math.max(0,M-Math.floor(le/2)),fe=Math.min($,ne+le);fe-ne<le&&(ne=Math.max(0,fe-le)),ne>0&&(de.push(o("button",{key:"p0",style:Ze,onClick:()=>W(0)},"1")),ne>1&&de.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let oe=ne;oe<fe;oe++)de.push(o("button",{key:`p${oe}`,style:oe===M?ya:Ze,onClick:oe!==M?()=>W(oe):void 0,"aria-current":oe===M?"page":void 0},String(oe+1)));fe<$&&(fe<$-1&&de.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),de.push(o("button",{key:`p${$-1}`,style:Ze,onClick:()=>W($-1)},String($)))),de.push(o("button",{key:"next",style:M>=$-1?ao:Ze,onClick:M<$-1?()=>W(M+1):void 0,disabled:M>=$-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:xa},o("span",null,`Showing ${J}\u2013${ae} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...de))}let H={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ga,...f?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...ee),Z),Q=o("tbody",null,...V),se=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},K,Q);return o("div",{style:H},se,j)}function Je(e){return e<10?`0${e}`:String(e)}function va(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 wa(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"?`${Je(e.getMonth()+1)}/${Je(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Je(e.getMonth()+1)}-${Je(e.getDate())}`}var ka={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"},Ca={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ma={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ea={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function uo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);re(()=>{let p=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(p)},[]);let{hours:u,minutes:b,seconds:m}=va(l,s),c,f=null;t==="12h"?(f=u>=12?"PM":"AM",c=u%12||12):c=u;let g=`${Je(c)}:${Je(b)}`;i&&(g+=`:${Je(m)}`);let y=[g];f!=null&&y.push(o("span",{style:Ma},f));let h=[o("span",{style:Ca},...y)];return n&&h.push(o("span",{style:Ea},wa(l,r,s))),o("div",{style:ka,...a?{class:a}:{}},...h)}var Ra={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Pa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Ia={borderBottom:"1px solid var(--color-border, #e5e7eb)"},$a={cursor:"pointer",transition:"background-color 0.15s ease"},Da={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Ta={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Dt={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function po(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:b}=e;if(t.length===0)return o("div",null,u?o("div",{style:Dt},u):null,o("div",{style:Ta},d),b?o("div",{style:{...Dt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null);let m=[];for(let c=0;c<t.length;c++){let f=t[c],g=r(f,c),y=a===c,h=c===t.length-1,p={...Pa,...s?$a:{},...y?Da:{},...i&&!h?Ia:{}};m.push(o("li",{key:g,style:p,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let v=x.key;(v==="Enter"||v===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(f,c)))}return o("div",null,u?o("div",{style:Dt},u):null,o("ul",{style:Ra,role:l?"listbox":"list"},...m),b?o("div",{style:{...Dt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null)}function za(e){return e??"#3b82f6"}function Aa(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 La={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 Fa(e,t,n,r,i){let s=La[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:Aa(e,.12),color:e,border:"none"};default:return a}}var Na={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function fo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,b=za(n),m=Fa(b,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Na,onClick:f=>{f.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?f=>{let g=f.key;(g==="Enter"||g===" ")&&(f.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Wa={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function go(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=te(null),u=t.length*r,b=parseInt(s,10)||400,m=Math.ceil(b/r),c=Math.max(0,Math.floor(a/r)-i),f=Math.min(t.length,Math.floor(a/r)+m+i),g=S(h=>{let p=h.target;l(p.scrollTop)},[]),y=[];for(let h=c;h<f;h++)y.push(o("div",{key:String(h),style:{position:"absolute",top:`${h*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[h],h)));return o("div",{ref:d,style:{...Wa,height:s},onScroll:g},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var mo={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function ho(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=mo[r]??mo.info,a=e.icon??s.icon,l=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function bo(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function xo(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=xe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let f=typeof e.size=="number"?e.size:48,g=Math.max(2,Math.round(f/10)),y=(f-g)/2,h=2*Math.PI*y,p=e.indeterminate?h*.75:h-r/100*h,x=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},x?o("style",null,x):null,o("svg",{width:String(f),height:String(f),viewBox:`0 0 ${f} ${f}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(g)}),o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(g),"stroke-dasharray":String(h),"stroke-dashoffset":String(p),"stroke-linecap":"round",transform:`rotate(-90 ${f/2} ${f/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",b=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let f={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(f.position="absolute",f.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,f.backgroundColor=i):(f.width=`${r}%`,f.backgroundColor=i),e.animated&&!e.indeterminate&&(f.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Ba(i)} 50%, ${i} 100%)`,f.backgroundSize="200% 100%",f.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),f},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||b?o("style",null,u+b):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function Ba(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function yo(e){let t=e.variant??"text",n=e.animated!==!1,r=xe().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let b=u===l-1&&l>1;d.push(o("div",{key:String(u),style:rn({width:b?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:rn({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:rn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function rn(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 Oa={sm:16,md:24,lg:40},So={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function vo(e){let t=typeof e.size=="number"?e.size:Oa[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=So[e.speed??"normal"]??So.normal,s=e.label??"Loading",l=xe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,b=q(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,b),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function we(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 Be(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 Ha={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function wo(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,b=te(null);re(()=>{b.current&&(b.current.indeterminate=a)},[a]);let m=S(()=>{l||i(!r)},[l,r,i]),c=S(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),f=Ha[u],g=`${f.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",h=r||a?"#3b82f6":"#ffffff",p={width:g,height:g,minWidth:g,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:h,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${f.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,T={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},D=o("input",{ref:b,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:p},v),P=s?o("span",{style:{fontSize:f.fontSize,color:"#374151"}},s):null;return o(we,{error:d,htmlFor:n},o("div",{style:T,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},D,C,P))}var _a=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function ko(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Tt(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Co(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=_a,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[b,m]=G(!1),[c,f]=G(r),g=te(null);re(()=>{f(r)},[r]),re(()=>{let I=M=>{g.current&&!g.current.contains(M.target)&&m(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=S(I=>{d||i(Tt(I))},[d,i]),h=S(I=>{let M=I.target.value;f(M);let F=M.startsWith("#")?M:`#${M}`;ko(F)&&i(Tt(F))},[i]),p=S(()=>{ko(c.startsWith("#")?c:`#${c}`)||f(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},v={display:"flex",alignItems:"center",gap:"8px"},T={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"},D={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(I=>{let M=Tt(I)===Tt(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:d?"not-allowed":"pointer",border:M?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:R=>{let N=R.key;(N==="Enter"||N===" ")&&(R.preventDefault(),y(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${I}`})}),P=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:h,onBlur:p,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,L=b?o("div",{style:T},o("div",{style:D},...C),P):null;return o(we,{label:u,disabled:d,htmlFor:n},o("div",{ref:g,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>m(!b),onKeyDown:d?void 0:I=>{let M=I.key;(M==="Enter"||M===" ")&&(I.preventDefault(),m(!b))},role:"button",tabIndex:d?-1:0,"aria-expanded":b?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function Mo(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,b]=G(r),m=te(null),c=S(((...h)=>{let x=h[0].target.value;b(x),i?.(x)}),[i]),f={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},g={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(we,{label:d,htmlFor:n},o("div",{style:f},o("div",{style:g},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 Eo=["January","February","March","April","May","June","July","August","September","October","November","December"],Ya=["Su","Mo","Tu","We","Th","Fr","Sa"];function sn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Va(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ua(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Po(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:b,error:m}=e,c=q(()=>sn(r),[r]),f=q(()=>sn(a),[a]),g=q(()=>sn(l),[l]),[y,h]=G(!1),[p,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,T]=G(()=>c?c.getMonth():new Date().getMonth()),D=te(null),C=q(()=>new Date,[]);re(()=>{let z=B=>{D.current&&!D.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let P=S(()=>{T(z=>z===0?(x(B=>B-1),11):z-1)},[]),L=S(()=>{T(z=>z===11?(x(B=>B+1),0):z+1)},[]),I=S(z=>{let B=new Date(p,v,z);f&&B<f||g&&B>g||(i(Ua(B)),h(!1))},[p,v,i,f,g]),M=c?Va(c,s):"",F=q(()=>{let z=new Date(p,v,1).getDay(),B=new Date(p,v+1,0).getDate(),O=[],_=[];for(let U=0;U<z;U++)_.push(null);for(let U=1;U<=B;U++)_.push(U),_.length===7&&(O.push(_),_=[]);for(;_.length>0&&_.length<7;)_.push(null);return _.length&&O.push(_),O},[p,v]),R={...Be({},{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"},A={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},k={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},$=Ya.map(z=>o("div",{key:z,style:{padding:"4px"}},z)),E=F.map((z,B)=>{let O=z.map((_,U)=>{if(_===null)return o("div",{key:`empty-${B}-${U}`,style:{padding:"4px"}});let X=new Date(p,v,_),ee=Ro(X,C),Z=c?Ro(X,c):!1,V=f&&X<f||g&&X>g,j={padding:"4px",textAlign:"center",cursor:V?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ee?"700":"400",backgroundColor:Z?"#3b82f6":"transparent",color:Z?"#ffffff":V?"#d1d5db":ee?"#3b82f6":"#1f2937",border:ee&&!Z?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${_}`,style:j,onClick:V?void 0:()=>I(_),onKeyDown:V?void 0:H=>{let Y=H.key;(Y==="Enter"||Y===" ")&&(H.preventDefault(),I(_))},role:V?void 0:"button",tabIndex:V?void 0:0,"aria-label":`${Eo[v]} ${_}, ${p}`,"aria-disabled":V?"true":void 0},String(_))});return o("div",{key:`row-${B}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...O)}),W=y?o("div",{style:N},o("div",{style:A},o("button",{type:"button",style:k,onClick:P},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Eo[v]} ${p}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...$),...E):null;return o(we,{label:b,error:m,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:R,onClick:d?void 0:()=>h(!y),onKeyDown:d?void 0:z=>{let B=z.key;(B==="Enter"||B===" ")&&(z.preventDefault(),h(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:M?"#1f2937":"#9ca3af"}},M||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),W))}function an(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function Io(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[b,m]=G([]),[c,f]=G(!1),[g,y]=G(""),h=te(null),p=S(k=>{y("");let w=[];for(let E of k){if(a&&E.size>a){y(`File "${E.name}" exceeds maximum size of ${an(a)}`);continue}w.push(E)}let $=s?[...b,...w]:w.slice(0,1);m($),r($)},[b,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),f(!1),l)return;let w=k.dataTransfer;if(!w)return;let $=Array.from(w.files);p($)},[l,p]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||f(!0)},[l]),T=S(k=>{k.preventDefault(),k.stopPropagation(),f(!1)},[]),D=S(k=>{let w=k.target;w.files&&(p(Array.from(w.files)),w.value="")},[p]),C=S(k=>{let w=b.filter(($,E)=>E!==k);m(w),r(w)},[b,r]),P=S(()=>{l||h.current&&h.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":g?"#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"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},M={fontSize:"14px",color:"#374151",marginBottom:"4px"},F={fontSize:"12px",color:"#9ca3af"},R=o("input",{id:n,ref:h,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:P,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),P())},onDrop:x,onDragOver:v,onDragLeave:T,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\u2191"),o("div",{style:M},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:F},i):null,a?o("div",{style:F},`Max size: ${an(a)}`):null),A=b.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...b.map((k,w)=>{let $={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},E={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:$},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"}},an(k.size))),o("button",{type:"button",style:E,onClick:W=>{W.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(we,{label:d,helpText:u,error:g||void 0,disabled:l,htmlFor:n},o("div",null,R,N,A))}function $o(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=xe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Be(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=S(c=>{let f=c.target,g=f.value;i(g.length),e.onChange&&e.onChange(g),e.autoResize&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)},[e.onChange,e.autoResize]),b=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),m=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(we,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},b,m)}function Do(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:b,label:m,error:c}=e,[f,g]=G(!1),y=S(w=>{let $=w;return s!==void 0&&$<s&&($=s),a!==void 0&&$>a&&($=a),$},[s,a]),h=S(()=>{d||i(y(r+l))},[d,r,l,y,i]),p=S(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=S(w=>{let $=w.target.value;if($===""||$==="-")return;let E=parseFloat($);isNaN(E)||i(y(E))},[y,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),h()):w.key==="ArrowDown"&&(w.preventDefault(),p()))},[d,h,p]),T=s===void 0||r>s,D=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":f?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...f&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},P=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"},I={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},M=o("button",{type:"button",style:P(T),onClick:p,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),F=u?o("span",{style:I},u):null,R=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>g(!0),onBlur:()=>g(!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=b?o("span",{style:I},b):null,A=o("button",{type:"button",style:P(D),onClick:h,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[M];return F&&k.push(F),k.push(R),N&&k.push(N),k.push(A),o(we,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function To(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:b}=e,m=S(y=>{d||s(y)},[d,s]),c=S(y=>{if(d)return;let h=r.filter(v=>!v.disabled);if(h.length===0)return;let p=h.findIndex(v=>v.value===i),x=p;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=p<h.length-1?p+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=p>0?p-1:h.length-1;else return;s(h[x].value)},[d,r,i,s]),f={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},g=r.map((y,h)=>{let p=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${h}`,T={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":p?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},D={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:p?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:v,style:C,onClick:x?void 0:P=>{P.preventDefault(),m(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:p,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:T},o("div",{style:D})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(we,{label:b,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:f,role:"radiogroup","aria-label":b,onKeyDown:c,tabIndex:d?-1:0},...g))}function zo(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:b=!1,error:m,label:c,helpText:f}=e,[g,y]=G(!1),[h,p]=G(""),[x,v]=G(-1),T=te(null),D=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=q(()=>{if(!l||!h)return r;let z=h.toLowerCase();return r.filter(B=>B.label.toLowerCase().includes(z))},[r,h,l]),P=q(()=>{let z={},B=[];for(let O of C)O.group?(z[O.group]||(z[O.group]=[]),z[O.group].push(O)):B.push(O);return{groups:z,ungrouped:B}},[C]),L=q(()=>D.length===0?"":D.map(B=>r.find(O=>O.value===B)).filter(Boolean).map(B=>B.label).join(", "),[D,r]);re(()=>{let z=B=>{let O=B.target;T.current&&!T.current.contains(O)&&(y(!1),p(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let I=S(z=>{if(d){let B=D.includes(z)?D.filter(O=>O!==z):[...D,z];s(B)}else s(z),y(!1),p("")},[d,D,s]),M=S(z=>{z.stopPropagation(),s(d?[]:"")},[d,s]),F=S(z=>{if(b)return;let B=z.key;if(!g&&(B==="Enter"||B===" "||B==="ArrowDown")){z.preventDefault(),y(!0),v(0);return}if(g){if(B==="Escape"){y(!1),p("");return}if(B==="ArrowDown")z.preventDefault(),v(O=>Math.min(O+1,C.length-1));else if(B==="ArrowUp")z.preventDefault(),v(O=>Math.max(O-1,0));else if(B==="Enter"&&x>=0&&x<C.length){z.preventDefault();let O=C[x];O.disabled||I(O.value)}}},[b,g,x,C,I]),R={...Be({},{focused:g,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:b?"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"},A=(z,B)=>{let O=D.includes(z.value),_=B===x,U={padding:"8px 12px",cursor:z.disabled?"not-allowed":"pointer",backgroundColor:_?"#f3f4f6":O?"#eff6ff":"transparent",color:z.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:z.value,style:U,onClick:z.disabled?void 0:()=>I(z.value),onMouseEnter:()=>v(B),role:"option","aria-selected":O?"true":"false","aria-disabled":z.disabled?"true":void 0},d&&O?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,z.label)},k=()=>{let z=[],B=0,{groups:O,ungrouped:_}=P;for(let U of _)z.push(A(U,B++));for(let U of Object.keys(O)){z.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let X of O[U])z.push(A(X,B++))}return z.length===0&&z.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),z},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:g?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),$=o("div",{style:R,id:n,onClick:b?void 0:()=>{y(!g),v(-1)},onKeyDown:F,tabIndex:b?-1:0,role:"combobox","aria-expanded":g?"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&&D.length>0?o("span",{onClick:M,onKeyDown:z=>{let B=z.key;(B==="Enter"||B===" ")&&(z.preventDefault(),z.stopPropagation(),M(z))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),E=l&&g?o("input",{type:"text",value:h,onInput:z=>{p(z.target.value),v(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,W=g?o("div",{style:N,role:"listbox"},E,...k()):null;return o(we,{label:c,error:m,helpText:f,disabled:b,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},$,W))}function Ao(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:b=!1,marks:m,range:c=!1,label:f,error:g}=e,y=te(null),h=te(i);h.current=i;let[p,x]=G(null),v=q(()=>{if(c&&Array.isArray(r))return r;let B=typeof r=="number"?r:0;return[B,B]},[r,c]),T=te(v);T.current=v;let D=B=>{let O=Math.round((B-s)/l)*l+s;return Math.max(s,Math.min(a,O))},C=B=>(B-s)/(a-s)*100,P=S(B=>{if(!y.current)return s;let O=y.current.getBoundingClientRect(),_=Math.max(0,Math.min(1,(B.clientX-O.left)/O.width));return D(s+_*(a-s))},[s,a,l]),L=S(B=>O=>{b||(O.preventDefault(),x(B))},[b]),I=S(B=>{if(b)return;let O=P(B);if(c){let _=Math.abs(O-v[0]),U=Math.abs(O-v[1]);_<=U?i([D(O),v[1]]):i([v[0],D(O)])}else i(D(O))},[b,P,c,v,i,s,a,l]);re(()=>{if(!p)return;let B=_=>{let U=P(_),X=T.current,ee=h.current;p==="single"?ee(D(U)):p==="start"?ee([Math.min(D(U),X[1]),X[1]]):p==="end"&&ee([X[0],Math.max(X[0],D(U))])},O=()=>x(null);return document.addEventListener("mousemove",B),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",O)}},[p,P,s,a,l]);let M=S(B=>{if(b)return;let O=0;if(B.key==="ArrowRight"||B.key==="ArrowUp")O=l;else if(B.key==="ArrowLeft"||B.key==="ArrowDown")O=-l;else return;B.preventDefault(),c||i(D((typeof r=="number"?r:0)+O))},[b,l,c,r,i,s,a]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:b?"not-allowed":"pointer"},R=c?C(v[0]):0,N=C(c?v[1]:v[0]),A={position:"absolute",top:"0",left:`${R}%`,width:`${N-R}%`,height:"100%",backgroundColor:b?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=B=>f?B==="start"?`${f} minimum`:B==="end"?`${f} maximum`:f:B==="start"?"Minimum value":B==="end"?"Maximum value":"Value",w=(B,O,_)=>{let U={position:"absolute",top:"50%",left:`${B}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${b?"#9ca3af":"#3b82f6"}`,cursor:b?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},X={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:O==="single"||O==="start"?n:void 0,style:U,onMouseDown:L(O),role:"slider","aria-valuenow":String(_),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(O),tabIndex:b?-1:0,onKeyDown:M},d?o("div",{style:X},String(_)):null)},$=[];if(u)for(let B=s;B<=a;B+=l)$.push(o("div",{key:`tick-${B}`,style:{position:"absolute",top:"10px",left:`${C(B)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let E=[];if(m)for(let B of m)E.push(o("div",{key:`mark-${B.value}`,style:{position:"absolute",top:"18px",left:`${C(B.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},B.label));let W={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:b?"0.6":"1"},z=[];return c?(z.push(w(C(v[0]),"start",v[0])),z.push(w(C(v[1]),"end",v[1]))):z.push(w(C(v[0]),"single",v[0])),o(we,{label:f,error:g,htmlFor:n},o("div",{style:W},o("div",{ref:y,style:F,role:"presentation",onClick:I},o("div",{style:A}),...z,...$,...E)))}var ja=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ga={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Lo(e){let[t,n]=G(!1),r=te(null),i=xe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??ja,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=S((g,y)=>{if(!(e.disabled||e.readOnly)){if(g==="createLink"){let h=prompt("Enter URL:");if(!h)return;document.execCommand(g,!1,h)}else y&&g==="formatBlock"?document.execCommand(g,!1,`<${y}>`):document.execCommand(g,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),b=S(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=S(()=>{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(g=>{let y=Ga[g];return y?o("button",{key:g,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:g==="bold"?"700":g==="italic"?"400":"500",fontStyle:g==="italic"?"italic":"normal",textDecoration:g==="underline"?"underline":g==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),f=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:b});return o(we,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,f))}function Fo(e){let[t,n]=G(!1),r=xe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Be(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let b=u.target.value;e.onInput&&e.onInput(b),e.onChange&&e.onChange(b)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(we,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Xa=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Ge(e){return String(e).padStart(2,"0")}function qa(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 No(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:b=!1,timezone:m,showTimezone:c=!1,timezones:f=Xa,onTimezoneChange:g}=e,[y,h]=G(!1),p=q(()=>qa(r),[r]),x=s==="12h",v=p.hour>=12,T=x?p.hour%12||12:p.hour,D=S((j,H,Y)=>{let K=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,H)),se=Math.max(0,Math.min(59,Y??0));i(b?`${Ge(K)}:${Ge(Q)}:${Ge(se)}`:`${Ge(K)}:${Ge(Q)}`)},[i,b]),C=S(j=>{let H=parseInt(j.target.value,10)||0;x&&(H=H%12,v&&(H+=12)),D(H,p.minute,p.second)},[x,v,p.minute,p.second,D]),P=S(j=>{let H=parseInt(j.target.value,10)||0;D(p.hour,H,p.second)},[p.hour,p.second,D]),L=S(j=>{let H=parseInt(j.target.value,10)||0;D(p.hour,p.minute,H)},[p.hour,p.minute,D]),I=S(()=>{if(l)return;let j=v?p.hour-12:p.hour+12;D(j,p.minute,p.second)},[l,v,p.hour,p.minute,p.second,D]),M=S(j=>{l||D(p.hour+j,p.minute,p.second)},[l,p.hour,p.minute,p.second,D]),F=S(j=>{l||D(p.hour,p.minute+j*a,p.second)},[l,p.hour,p.minute,p.second,a,D]),R=S(j=>{l||D(p.hour,p.minute,p.second+j)},[l,p.hour,p.minute,p.second,D]),N=S(j=>{let H=j.target.value;g&&g(H)},[g]),A={display:"inline-flex",alignItems:"center",gap:"4px",...Be({},{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"},$={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},E={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>M(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(T),onChange:C,style:$,disabled:l,"aria-label":"Hour",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>M(-1),disabled:l},"\u25BC")),z=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),B=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>F(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(p.minute),onChange:P,style:$,disabled:l,"aria-label":"Minute",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>F(-1),disabled:l},"\u25BC")),O=b?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,_=b?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>R(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(p.second),onChange:L,style:$,disabled:l,"aria-label":"Second",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>R(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:E,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,X={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ee=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,Z=c?o("select",{style:X,value:m??f[0],onChange:N,disabled:l,"aria-label":"Timezone"},...f.map(j=>o("option",{key:j,value:j},j))):null,V=[W,z,B];return O&&V.push(O),_&&V.push(_),U&&V.push(U),ee&&V.push(ee),Z&&V.push(Z),o(we,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...V))}var Ka={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 Wo(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=Ka[a],b=S(()=>{s||n(!t)},[s,t,n]),m=S(v=>{s||(v.key===" "||v.key==="Enter")&&(v.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},f=t?u.trackW-u.thumbSize-u.offset:u.offset,g={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${f}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},h=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,p=o("div",{style:c},o("div",{style:g}));return o("div",{style:y,onClick:b,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[h,p]:[p,h]).filter(Boolean))}var Bo={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 Oo(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let b={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(b.border="1px solid #e5e7eb"),b.boxShadow=Bo[n]??Bo.sm,e.hoverable&&(b.cursor="pointer"),{...b,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function Ho(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function _o(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Yo(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function Vo(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var Uo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function jo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=te(null),[a,l]=G("auto");re(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=S(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=S(y=>{if(!e.collapsible)return;let h=y.key;(h==="Enter"||h===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),b=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Uo[n]??Uo.none,{...y,...e.style??{}}},[t,n,e.style]),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"},f={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},g={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:b},o("div",{className:"panel__header",style:m,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?f:{},ref:s},o("div",{className:"panel__body",style:g},e.children)))}function Go(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Za(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Xo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=te(null),[s,a]=G(!0),[l,d]=G(!1),[u,b]=G(!0),[m,c]=G(!1),f=S(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),b(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);re(()=>{f()},[f]);let g=S(()=>{r&&f()},[r,f]),y=q(()=>{let x={position:"relative",overflowX:Go(t,"x"),overflowY:Go(t,"y"),...Za(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),h=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&h.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&h.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&h.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!m&&h.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let p={...y};return h.length>0&&(p.boxShadow=h.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:p,ref:i,onScroll:g},e.children)}function qo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=te(null),d=te(!1),u=S(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=p=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,T=n?p.clientX-x.left:p.clientY-x.top;if(v<=0)return;let D=i/v*100,C=e.maxSize?e.maxSize/v*100:100-D,P=T/v*100;P=Math.max(D,Math.min(C,P)),a(P)},h=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",h),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",h)}},[n,i,e.maxSize]);let b=q(()=>({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"},f={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},g=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:b,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},g[0]??null),o("div",{className:"splitter__divider",style:f,onMouseDown:u,onKeyDown:y=>{let h=y.key,p=2;n&&(h==="ArrowLeft"||h==="ArrowRight")?(y.preventDefault(),a(x=>{let v=h==="ArrowRight"?p:-p;return Math.max(5,Math.min(95,x+v))})):!n&&(h==="ArrowUp"||h==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=h==="ArrowDown"?p:-p;return Math.max(5,Math.min(95,x+v))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},g[1]??null))}function Ko(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(p=>!p.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=te(null),d=S(p=>{s(p),e.onChange&&e.onChange(p)},[e.onChange]),u=S(p=>{let x=e.tabs.filter(L=>!L.disabled),v=x.findIndex(L=>L.id===a);if(v===-1)return;let T=t==="left"||t==="right",D=T?"ArrowUp":"ArrowLeft",C=T?"ArrowDown":"ArrowRight",P=-1;if(p.key===D?P=v>0?v-1:x.length-1:p.key===C?P=v<x.length-1?v+1:0:p.key==="Home"?P=0:p.key==="End"&&(P=x.length-1),P>=0){p.preventDefault(),d(x[P].id);let L=l.current;if(L){let M=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[P])];M&&M.focus()}}},[e.tabs,a,t,d]),b=t==="left"||t==="right",m=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:b?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[b,m,e.style]),f={display:"flex",flexDirection:b?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!b?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&b?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},g={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(p=>p.id===a),h=e.tabs.map(p=>{let x=p.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?b?t==="left"?(v.borderRight=x?"2px solid #3b82f6":"2px solid transparent",v.marginRight="-2px"):(v.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",v.marginLeft="-2px"):(v.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",v.marginBottom="-2px"):n==="card"?(v.backgroundColor=x?"#ffffff":"transparent",v.borderRadius="6px 6px 0 0",x&&(v.border="1px solid #e5e7eb",v.borderBottom="1px solid #ffffff")):n==="pill"&&(v.borderRadius="9999px",v.backgroundColor=x?"#3b82f6":"transparent",v.color=x?"#ffffff":"#6b7280"),o("button",{key:p.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${p.id}`,"aria-disabled":p.disabled?"true":void 0,id:`tab-${p.id}`,tabIndex:x?"0":"-1",style:v,onClick:p.disabled?void 0:()=>d(p.id),onKeyDown:u},p.icon?o("span",{className:"tabs__tab-icon"},p.icon):null,p.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":b?"vertical":"horizontal",style:f,ref:l},...h),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:g,tabIndex:"0"},y?y.content:null))}function Zo(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=xe().replace(/[^a-zA-Z0-9_-]/g,""),[u,b]=G(0),m=te(null),c=te(null),f=S(C=>{let P=C;r?P=(C%n+n)%n:P=Math.max(0,Math.min(C,n-1)),b(P),e.onChange&&e.onChange(P)},[n,r,e.onChange]),g=S(()=>f(u+1),[u,f]),y=S(()=>f(u-1),[u,f]);re(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(g,l);return()=>clearInterval(C)},[e.autoPlay,l,g,n]),re(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&g()},P=c.current;if(P)return P.addEventListener("keydown",C),()=>P.removeEventListener("keydown",C)},[g,y]);let h=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",p={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),v={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},T=t.map((C,P)=>{let L=a==="fade"?{position:P===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:P===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(P),style:L},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),D=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,P)=>o("button",{key:String(P),"aria-label":`Go to slide ${P+1}`,onclick:()=>f(P),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:P===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:p,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let P=C.clientX-m.current;P>50?y():P<-50&&g(),m.current=null}},h?o("style",null,h):null,o("div",{style:x},...T),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:g,style:{...v,right:"8px"}},"\u203A"):null,D)}function Jo(e){let[t,n]=G("loading"),r=te(null),i=xe().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=q(()=>{let f={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(f.width=a),l&&(f.height=l),e.borderRadius&&(f.borderRadius=e.borderRadius),f},[a,l,e.borderRadius]),u=q(()=>{let f={display:"block",width:"100%",height:"100%"};return e.objectFit&&(f.objectFit=e.objectFit),t==="loading"&&(f.opacity="0",f.position="absolute"),t==="error"&&(f.display="none"),f},[e.objectFit,t]),b=null;if(t==="loading")if(e.placeholder==="skeleton"){let f=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;b=o("div",null,o("style",null,f),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?b=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(b=e.placeholder);let m=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?m=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):m=e.fallback);let c=o("div",{style:d},b,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function Qo(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function er(e){let t=e.controls!==!1,n=te(null),r=xe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[b,m]=G(e.muted?0:1),[c,f]=G(!!e.muted),[g,y]=G(!0),h=typeof e.width=="number"?`${e.width}px`:e.width??"100%",p=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let I=n.current;if(!I)return;let M=()=>{s(!0),e.onPlay&&e.onPlay()},F=()=>{s(!1),e.onPause&&e.onPause()},R=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(I.currentTime),u(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},A=()=>{u(I.duration)};return I.addEventListener("play",M),I.addEventListener("pause",F),I.addEventListener("ended",R),I.addEventListener("timeupdate",N),I.addEventListener("loadedmetadata",A),()=>{I.removeEventListener("play",M),I.removeEventListener("pause",F),I.removeEventListener("ended",R),I.removeEventListener("timeupdate",N),I.removeEventListener("loadedmetadata",A)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=S(()=>{let I=n.current;I&&(I.paused?I.play():I.pause())},[]),v=S(I=>{let M=n.current;if(!M||!isFinite(M.duration))return;let F=I.currentTarget.getBoundingClientRect(),R=Math.max(0,Math.min(1,(I.clientX-F.left)/F.width));M.currentTime=R*M.duration},[]),T=S(I=>{let M=n.current,F=parseFloat(I.target.value);M&&(M.volume=F,M.muted=F===0,m(F),f(F===0))},[]),D=S(()=>{let I=n.current;I&&I.requestFullscreen&&I.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:h,height:p,display:"block"}});let C=d>0?a/d*100:0,P={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:g?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:P},i?"\u23F8":"\u25B6"),o("div",{onclick:v,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Qo(a)} / ${Qo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:b),oninput:T,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:P},"\u26F6"));return o("div",{style:{position:"relative",width:h,height:p,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function Pe(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=te(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=S(d=>{if(!r)return;let u=d,b=s.current;if(!b)return;let m=Array.from(b.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let f=t==="vertical",g=f?"ArrowDown":"ArrowRight",y=f?"ArrowUp":"ArrowLeft";if(u.key===g){u.preventDefault();let h=m[c+1];h&&h.focus()}else if(u.key===y){u.preventDefault();let h=m[c-1];h&&h.focus()}else u.key==="Home"?(u.preventDefault(),m[0]?.focus()):u.key==="End"&&(u.preventDefault(),m[m.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function ot(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 Ce(){let[e,t]=G(!1);return{hover:e,onMouseEnter:S(()=>t(!0),[]),onMouseLeave:S(()=>t(!1),[])}}function Ja(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:b}=Ce(),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 f=S(v=>{let T=v;m||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),r())},[m,r]),g=S(()=>{m||r()},[m,r]),h=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),p=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[h,p]:[p,h];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:g,onKeyDown:f,onMouseEnter:u,onMouseLeave:b},...x)}function Qa(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function tr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:b=!0,onChange:m}=e,[c,f]=G(()=>n??[]),g=S(h=>{f(p=>{let x=p.includes(h),v;return x?v=p.filter(T=>T!==h):r?v=[...p,h]:v=[h],m&&m(v),v})},[r,m]),y=q(()=>t.map(h=>{let p=c.includes(h.id),x=o(Ja,{key:`header-${h.id}`,section:h,expanded:p,onToggle:()=>g(h.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Qa,{key:`content-${h.id}`,section:h,expanded:p,contentStyle:s,animated:b});return o("div",{key:h.id,"data-accordion-section":h.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,b,g]);return o(Pe,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var el={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function nr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=el[i],d=S(()=>{a(!0)},[]),u=t,b=!1;if(r&&r>1&&t.length>r&&!s){b=!0;let g=1,y=r-1;u=[...t.slice(0,g),{label:"..."},...t.slice(t.length-y)]}let m=g=>typeof g=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},g):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},g),c=(g,y,h)=>{let p=y===h.length-1,x=b&&g.label==="..."&&y===1,v=[];return y>0&&v.push(m(n)),x?v.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):p?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},g.label)):g.href?v.push(o("a",{href:g.href,onClick:g.onClick?T=>{T.preventDefault(),g.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},g.label)):g.onClick?v.push(o("button",{type:"button",onClick:g.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},g.label)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},g.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},f=u.map((g,y)=>c(g,y,u));return o(Pe,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...f))}function or(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Ce(),[d,u]=G(!1),b=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,f={...ot(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},g=S(()=>{if(!m){if(b){u(T=>!T);return}t.onClick&&t.onClick(),r&&i()}},[m,b,t,r,i]),y=S(()=>{a(),b&&u(!0)},[b,a]),h=S(()=>{l(),b&&u(!1)},[b,l]),p=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=b?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=b&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Pe,{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(T=>o(or,{key:T.id,item:T,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:h},o("button",{type:"button",role:"menuitem",style:f,onClick:g,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":b||void 0,"aria-expanded":b?String(d):void 0},p,x),v)}function rr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,b]=G(!1),m=te(null),c=S(()=>{b(T=>!T)},[]),f=S(()=>{b(!1)},[]);re(()=>{if(!u)return;let T=D=>{let C=m.current;C&&!C.contains(D.target)&&b(!1)};return document.addEventListener("click",T,!0),()=>{document.removeEventListener("click",T,!0)}},[u]),re(()=>{if(!u)return;let T=D=>{D.key==="Escape"&&b(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[u]);let g={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:g,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),h=typeof d=="number"?`${d}px`:d,p={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:h,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:p},o(Pe,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(T=>o(or,{key:T.id,item:T,itemStyle:s,closeOnSelect:l,onClose:f})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,v)}function ir(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ce(),[l,d]=G(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let b=t.disabled===!0,m=S(()=>{if(!b){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[b,u,t,n]),c=S(()=>{s(),u&&d(!0)},[u,s]),f=S(()=>{a(),u&&d(!1)},[u,a]),g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:b?"default":"pointer",backgroundColor:!b&&i?"#f3f4f6":"transparent",color:b?"#9ca3af":"#1f2937",opacity:b?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),h=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,p=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((x,v)=>o(ir,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:f},o("button",{type:"button",role:"menuitem",style:g,onClick:m,disabled:b||void 0,tabIndex:-1,"aria-disabled":b||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,h),p)}function tl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Ce(),b=te(null),m=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),f={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},g=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,h)=>o(ir,{key:String(h),item:y,onClose:a,index:h})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:b,type:"button",role:"menuitem",style:f,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),g)}function sr(e){let{menus:t}=e,[n,r]=G(null),i=te(null),s=S(d=>{r(d)},[]),a=S(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let b=i.current;b&&!b.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=b=>{let m=b;if(m.key==="Escape"){r(null);return}if(m.key==="ArrowRight"){m.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(m.key==="ArrowLeft"){m.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(m.key==="ArrowDown"&&n!==null){m.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let f=c.querySelector('[role="menuitem"]');f&&f.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(tl,{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 zt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function nl(e,t,n){let r=n*2+5;if(e<=r)return zt(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?[...zt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...zt(e-n*2-2,e)]:[1,"ellipsis",...zt(i,s),"ellipsis",e]}var At={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"},ol={...At,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},ar={...At,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 lr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),b=Math.min(Math.max(1,r),u),m=S(h=>{!d&&h>=1&&h<=u&&h!==b&&i(h)},[d,u,b,i]),c=(h,p,x)=>{let v=d||p<1||p>u||p===b;return o("button",{type:"button",onClick:()=>m(p),disabled:v||void 0,"aria-label":x,style:v?ar:At},h)},f=nl(u,b,s),g=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",b-1,"Go to previous page"));for(let h of f)if(h==="ellipsis")y.push(o("span",{key:`ellipsis-${g++}`,style:rl},"..."));else{let p=h===b;y.push(o("button",{key:String(h),type:"button",onClick:()=>m(h),disabled:d||void 0,"aria-label":`Page ${h}`,"aria-current":p?"page":void 0,style:d?ar:p?ol:At},String(h)))}return l&&y.push(c("\u203A",b+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(Pe,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function cr(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Ce(),[u,b]=G(!1),m=t.children&&t.children.length>0,c=t.id===r,f=S(()=>{m&&!n&&b(P=>!P),i&&i(t.id)},[m,n,i,t.id]),g=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${g}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},h=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,p=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,v=!n&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,T=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,D=o("button",{type:"button",style:y,onClick:f,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},h,p,x,v,T),C=!n&&m&&u?t.children.map(P=>o(cr,{key:P.id,item:P,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},D,C?o("div",{role:"group"},...C):null)}function dr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,b=t.map(m=>o(cr,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Pe,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...b)}var Le={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function ur(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,b=S(h=>{s&&i&&i(h)},[s,i]),m=h=>h<n?"completed":h===n?"active":"pending",c=(h,p,x)=>{let v=a==="dot"?u:d,T={width:`${v}px`,height:`${v}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...T,backgroundColor:Le.completedBg,color:Le.completedText,border:`2px solid ${Le.completed}`}},a==="circle"?p.icon||"\u2713":null):x==="active"?o("div",{style:{...T,backgroundColor:"#ffffff",color:Le.activeText,border:`2px solid ${Le.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?p.icon||String(h+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Le.active}})):o("div",{style:{...T,backgroundColor:"#ffffff",color:Le.pendingText,border:`2px solid ${Le.pending}`}},a==="circle"?p.icon||String(h+1):null)},f=h=>{if(h>=t.length-1)return null;let x=h<n?Le.lineCompleted:Le.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},g=(h,p)=>{let x=m(p),v=x==="active",T=x==="completed",D=c(p,h,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||T?Le.labelActive:Le.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},P={fontSize:"11px",color:Le.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},h.label),h.description?o("span",{style:P},h.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},D,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},D,L);return o(s?"button":"div",{key:String(p),onClick:s?()=>b(p):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},I)},y=[];return t.forEach((h,p)=>{y.push(g(h,p));let x=f(p);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var pr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function il(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ce(),l=pr[n],d=t.disabled===!0,u=t.type==="toggle",[b,m]=G(!1),c=u?t.active===!0:b,f=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),g=S(()=>{!d&&!u&&m(!0)},[d,u]),y=S(()=>{u||m(!1)},[u]),h=S(()=>{a(),u||m(!1)},[u,a]),p={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,T=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:p,onClick:f,onMouseDown:g,onMouseUp:y,onMouseEnter:s,onMouseLeave:h,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,T)}function fr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=pr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(il,{key:a.id,item:a,size:n,variant:r}));return o(Pe,{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 rt=class e{constructor(t,n){Ve(this,"id");Ve(this,"label");Ve(this,"children");Ve(this,"expanded");Ve(this,"icon");Ve(this,"metadata");Ve(this,"parent");Ve(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 gr(e){e.expanded=!0;for(let t of e.children)gr(t)}function mr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)mr(n,t);return t}function sl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function al(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:b,onClick:m,focusedId:c}=e,f=Ce(),g=te(null),y=c===t.id;re(()=>{y&&g.current&&g.current.focus()},[y]);let h=t.isLeaf(),p=t.depth,x=[];for(let P=0;P<p;P++){let L=t;for(let M=0;M<p-P;M++)L=L?L.parent:null;let I=L?!sl(L):!1;x.push(o("span",{key:`connector-${P}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=p>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,T=h?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:P=>{P.stopPropagation(),b(t)}},t.expanded?a:l),D=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=ot(d,{hover:f.hover,active:n});return o("div",{ref:g,role:"treeitem","aria-expanded":h?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":p+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onClick:()=>m(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},T,D))}function hr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:b="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:f,renderNode:g}=e,[y,h]=G(()=>{let I=rt.fromData(t);return a&&gr(I),I}),[p,x]=G(t.id),v=q(()=>mr(y),[y]),T=S(()=>{h(I=>{let M=Object.create(Object.getPrototypeOf(I));return Object.assign(M,I),M})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),T()},[r,i,T]),C=S(I=>{x(I.id),n?.(I)},[n]),P=S(I=>{let M=I;if(!p)return;let F=v.findIndex(N=>N.id===p);if(F===-1)return;let R=v[F];switch(M.key){case"ArrowDown":{M.preventDefault();let N=v[F+1];N&&x(N.id);break}case"ArrowUp":{M.preventDefault();let N=v[F-1];N&&x(N.id);break}case"ArrowRight":{M.preventDefault(),R.isLeaf()||(R.expanded?R.children.length>0&&x(R.children[0].id):D(R));break}case"ArrowLeft":{M.preventDefault(),!R.isLeaf()&&R.expanded?D(R):R.parent&&x(R.parent.id);break}case"Enter":{M.preventDefault(),C(R);break}case" ":{M.preventDefault(),R.isLeaf()||D(R);break}case"Home":{M.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{M.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[p,v,D,C]),L=v.map(I=>o(al,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:b,iconCollapsed:m,nodeStyle:c,renderNode:g,onToggle:D,onClick:C,focusedId:p}));return o(Pe,{role:"tree",ariaLabel:"Tree navigation",styling:f,keyboardNav:!1},o("div",{onKeyDown:P,style:{outline:"none"}},...L))}function br(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=te(null);re(()=>{if(!u.current)return;u.current.focus();let c=g=>{let y=g,h=t.map((p,x)=>({item:p,i:x})).filter(({item:p})=>!p.divider);if(y.key==="ArrowDown")y.preventDefault(),a(p=>{let v=(h.findIndex(({i:T})=>T===p)+1)%h.length;return h[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(p=>{let x=h.findIndex(({i:T})=>T===p),v=x<=0?h.length-1:x-1;return h[v].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let p=t[s];p.children?d(s):!p.disabled&&p.onClick&&(p.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let f=u.current;return()=>f.removeEventListener("keydown",c)},[t,s,i,r]);let b={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},m=t.map((c,f)=>{if(c.divider)return o("div",{key:`divider-${f}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=s===f,y=!!c.disabled,h=!!(c.children&&c.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:g&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(f),d(h?f:null)},v=()=>{if(!y){if(h){d(f);return}c.onClick&&c.onClick(),r()}},T=[];c.icon&&T.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),T.push(o("span",{style:{flex:"1"}},c.label??"")),h&&T.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${f}`,style:p,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...T)];return h&&l===f&&D.push(o(br,{key:`submenu-${f}`,items:c.children,position:{x:n.x+178,y:n.y+f*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${f}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:b,tabIndex:-1,role:"menu"},...m)}function Lt(e){let{items:t,children:n}=e,[r,i]=G(null),s=S(u=>{u.preventDefault();let b=u;i({x:b.clientX,y:b.clientY})},[]),a=S(()=>{i(null)},[]);re(()=>{if(!r)return;let u=m=>{a()},b=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(b),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=b=>{b.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(br,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function ll(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 cl(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function xr(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[b,m]=G(!1),[c,f]=G(!1),g=te(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)m(!0),requestAnimationFrame(()=>f(!0));else{f(!1);let I=setTimeout(()=>m(!1),300);return()=>clearTimeout(I)}},[t]),re(()=>{if(!t||!d)return;let I=M=>{M.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,d,n]),re(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),re(()=>{t&&g.current&&g.current.focus()},[t]),!b)return null;let h={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},p={...cl(r,i),transform:ll(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},v={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},T={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},D={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},P=[];s&&P.push(o("div",{style:x},o("h3",{id:y,style:v},s),o("button",{type:"button",style:T,onClick:n,"aria-label":"Close drawer"},"\xD7"))),P.push(o("div",{style:D},u));let L=[];return a&&L.push(o("div",{style:h,onClick:C})),L.push(o("div",{ref:g,style:p,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...P)),o("div",null,...L)}var dl={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function yr(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,b=te(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=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),re(()=>{t&&b.current&&b.current.focus()},[t]),!t)return null;let m={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:dl[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},g={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},h={padding:"24px",overflow:"auto",flex:"1"},p={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},v=[],T=r?"modal-title":void 0;r?v.push(o("h2",{id:T,style:g},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let D=[o("div",{style:f},...v),o("div",{style:h},u)];return l&&D.push(o("div",{style:p},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":T},o("div",{ref:b,style:c,tabIndex:-1,role:"document"},...D))}var Sr=8;function ul(e,t){let n=t+Sr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function pl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Sr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function vr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[b,m]=G(!1),c=u?r:b,f=te(null),g=S(()=>{u?d&&d(!r):m(T=>!T)},[u,r,d]);re(()=>{if(!c||!l)return;let T=D=>{f.current&&!f.current.contains(D.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},h={...ul(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},p=[n];a&&p.push(o("div",{style:pl(i)}));let x=S(T=>{let D=T.key;(D==="Enter"||D===" ")&&(T.preventDefault(),g())},[g]),v=[o("div",{onClick:g,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:h},...p)),o("div",{ref:f,style:y},...v)}var fl=0;function gl(){return`toast-${++fl}-${Date.now()}`}function ln(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let b=gl();return n=[{id:b,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),b}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var ml={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 hl(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 bl(e){let{item:t,onDismiss:n}=e,r=ml[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 cn(e){let{toaster:t}=e,[,n]=G(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=hl(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 kt=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Cs=Object.getOwnPropertyNames;var Ms=Object.prototype.hasOwnProperty;var Es=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Rs=(e,t)=>{for(var n in t)kt(e,n,{get:t[n],enumerable:!0})},Ps=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cs(t))!Ms.call(e,i)&&i!==n&&kt(e,i,{get:()=>t[i],enumerable:!(r=ks(t,i))||r.enumerable});return e};var Is=e=>Ps(kt({},"__esModule",{value:!0}),e);var Be=(e,t,n)=>Es(e,typeof t!="symbol"?t+"":t,n);var ou={};Rs(ou,{Accordion:()=>tr,Alert:()=>ho,AnalogClock:()=>to,AppContextProvider:()=>_e,Avatar:()=>ro,Badge:()=>io,BarGraph:()=>Er,BigNumber:()=>Fi,BlochSphere:()=>Ni,BoxPlot:()=>Wi,Breadcrumb:()=>nr,BubbleChart:()=>Oi,Button:()=>Di,CalendarHeatMap:()=>Vi,Card:()=>_o,Carousel:()=>Zo,CartesianGraph2D:()=>Dr,Checkbox:()=>wo,ChordDiagram:()=>Ui,ColorPicker:()=>Co,ColorWheel:()=>Mo,ComplexGraph2D:()=>Fr,ContextMenu:()=>$t,DataGrid:()=>co,DatePicker:()=>Po,DecompositionTree:()=>ji,DigitalClock:()=>uo,DiscreteCartesian2D:()=>ws,DragDropProvider:()=>gt,Drawer:()=>xr,Dropdown:()=>rr,EmptyState:()=>bo,FileUpload:()=>Io,FlexContainer:()=>Oo,FlexItem:()=>Ho,Footer:()=>Kr,ForceGraph:()=>Ki,FormFieldWrapper:()=>xe,FunnelChart:()=>Ji,GanttChart:()=>ts,Gauge:()=>os,GoogleAnalytics:()=>qr,Grid:()=>Yo,GridItem:()=>Vo,HeatMap:()=>is,Histogram:()=>ss,HypercubeGraph:()=>jr,IDE:()=>Lt,Image:()=>Jo,LineGraph:()=>Or,ListView:()=>po,LollipopChart:()=>as,Matrix:()=>ls,Menubar:()=>sr,MessageBusProvider:()=>ft,Modal:()=>yr,MultilineField:()=>$o,NavWrapper:()=>ke,NumberSpinner:()=>To,Pagination:()=>lr,Panel:()=>jo,Partition:()=>cs,PieGraph:()=>Hr,PivotTable:()=>us,PolarGraph2D:()=>Vr,Popover:()=>vr,ProgressBar:()=>xo,RadarChart:()=>ps,RadioGroup:()=>zo,SankeyDiagram:()=>fs,ScrollContainer:()=>Xo,Select:()=>Do,Sidebar:()=>dr,Skeleton:()=>yo,Slider:()=>Ao,Spinner:()=>vo,Splitter:()=>qo,Stepper:()=>ur,Sunburst:()=>ms,Tabs:()=>Ko,Tag:()=>fo,TextEditor:()=>Lo,TextField:()=>Bo,ThreeDLayers:()=>Bi,TimePicker:()=>Fo,ToastContainer:()=>ln,Toggle:()=>No,Toolbar:()=>fr,Tooltip:()=>kr,TradingDashboard:()=>Nt,TreeMap:()=>hs,TreeNav:()=>hr,TreeNode:()=>et,USStateMap:()=>rs,US_STATE_PATHS:()=>vt,UnityApp:()=>$i,UnityDesktop:()=>Ii,VectorField:()=>ys,VideoPlayer:()=>er,VirtualScroll:()=>mo,VizWrapper:()=>Xr,WaterfallChart:()=>Ss,WordCloud:()=>vs,WordProcessor:()=>At,applyGate:()=>Wn,blochToCartesian:()=>lt,buildInputStyle:()=>Te,buildNavItemStyle:()=>Qe,buildRotationMatrix:()=>gn,cartesianToBloch:()=>Ut,computeBoxStats:()=>On,computeMandelbrotGrid:()=>Br,computeSlices:()=>pn,createToaster:()=>an,describeArc:()=>un,generateEdges:()=>mn,generateHypercube:()=>dt,generatePalette:()=>Dt,generateVertices:()=>fn,numRotationAngles:()=>ut,projectTo2D:()=>bn,transformVec:()=>hn,useAppId:()=>ot,useBarGraphScales:()=>cn,useChannel:()=>mt,useDragDrop:()=>Xe,useDraggable:()=>wn,useDropZone:()=>ht,useHover:()=>Se,useHypercube:()=>Gr,useLineGraphScales:()=>dn,useMessageBus:()=>Oe,useToast:()=>wr});module.exports=Is(ou);var Ct=Symbol.for("spec.element"),$s=Symbol.for("spec.fragment"),iu=Symbol.for("spec.portal"),Xn=Symbol.for("spec.provider"),qn=Symbol.for("spec.consumer"),Ts=Symbol.for("spec.forward_ref"),zs=Symbol.for("spec.memo"),Ds=Symbol.for("spec.lazy"),As=Symbol.for("spec.suspense"),Ls=Symbol.for("spec.strict_mode"),Bs=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:Ct,type:e,props:s,key:r,ref:i}}function $e(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Xn,_context:t},r={$$typeof:qn,_context:t};return t.Provider=n,t.Consumer=r,t}var Ze=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};Ze.prototype.isSpecComponent=!0;var Mt=class extends Ze{shouldComponentUpdate(t,n){return!Zn(this.props,t)||!Zn(this.state,n)}};Mt.prototype.isPureSpecComponent=!0;function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var Jn=null;function Ne(){if(Jn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Jn}function G(e){return Ne().useState(e)}function se(e,t){return Ne().useEffect(e,t)}function Re(e){return Ne().useContext(e)}function Qt(e,t,n){return Ne().useReducer(e,t,n)}function w(e,t){return Ne().useCallback(e,t)}function q(e,t){return Ne().useMemo(e,t)}function ne(e){return Ne().useRef(e)}function ge(){return Ne().useId()}var Je=$e({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Qn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Ns={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""},Ws=new Set;function _s(){Ns={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""};for(let e of Ws)e()}typeof window<"u"&&window.addEventListener("hashchange",_s);var Op=$e({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function eo(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function Zs(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var Ae={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function to(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=G(eo(a));se(()=>{let z=setInterval(()=>{u(eo(a))},1e3);return()=>clearInterval(z)},[a]);let g=d.getHours(),h=d.getMinutes(),c=d.getSeconds(),f=g%12*30+h*.5,p=h*6+c*.1,y=c*6,b=n/2,m=n/2,x=n/2-10,v=x-4,D=x-22,T=[];T.push(o("circle",{cx:String(b),cy:String(m),r:String(x),fill:Ae.face,stroke:Ae.border,"stroke-width":"3"}));for(let z=0;z<12;z++){let B=(z*30-90)*Math.PI/180,I=v-6;T.push(o("line",{x1:String(b+I*Math.cos(B)),y1:String(m+I*Math.sin(B)),x2:String(b+v*Math.cos(B)),y2:String(m+v*Math.sin(B)),stroke:Ae.border,"stroke-width":"2"}));let N=String(z===0?12:z);if(T.push(o("text",{x:String(b+D*Math.cos(B)),y:String(m+D*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ae.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let L=x-38,M=String(z===0?0:z+12);T.push(o("text",{x:String(b+L*Math.cos(B)),y:String(m+L*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ae.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},M))}}let C=(z,P,B,I)=>{let N=(z-90)*Math.PI/180;return o("line",{x1:String(b),y1:String(m),x2:String(b+P*Math.cos(N)),y2:String(m+P*Math.sin(N)),stroke:I,"stroke-width":B,"stroke-linecap":"round"})};T.push(C(f,x*.5,"4",Ae.hand)),T.push(C(p,x*.75,"3",Ae.hand)),s&&T.push(C(y,x*.85,"1.5",Ae.second)),T.push(o("circle",{cx:String(b),cy:String(m),r:"4",fill:Ae.hand}));let A=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...T)];return r&&A.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ae.numbers}},Zs(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...A)}var tn={xs:24,sm:32,md:40,lg:56,xl:80};function Js(e){return e==null?tn.md:typeof e=="number"?e:tn[e]??tn.md}function Qs(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var no=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function ea(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return no[Math.abs(t)%no.length]}var oo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ta(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function ro(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,g]=G(!1),h=Js(i),c=s==="circle"?"50%":`${Math.round(h*.15)}px`,f=a??ea(r),p=`${Math.round(h*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${h}px`,height:`${h}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},b;if(t&&!u)b=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>g(!0)});else{let D=Qs(r);b=o("span",{style:{fontSize:p,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},D)}let m=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":f},role:"img","aria-label":n??r??"avatar"},b);if(!l)return m;let x=Math.max(8,Math.round(h*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:oo[l]??oo.offline,border:"2px solid #fff",boxSizing:"border-box",...ta(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${h}px`,height:`${h}px`,flexShrink:"0"}},m,o("span",{style:v,"aria-label":l}))}var na={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},oa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function io(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,g=r?{...oa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...na[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},h=u?o("span",{style:g,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return h??o("span",null);let c={...g,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var ra={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},so={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},nn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ia="6px 8px",sa={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},aa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},la={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},je={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},ca={...je,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ao={...je,opacity:"0.5",cursor:"default"},lo={cursor:"pointer",width:"16px",height:"16px"};function da(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function co(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:g,onSelectionChange:h,striped:c=!1,bordered:f=!1,compact:p=!1,stickyHeader:y=!1}=e,[b,m]=G(0),[x,v]=G(void 0),[D,T]=G("asc"),[C,$]=G([]),[A,z]=G({}),P=i??b,B=a??x,I=l??D,N=g??C,L=q(()=>{let ee=Object.entries(A).filter(([,te])=>te.length>0);return ee.length===0?n:n.filter(te=>ee.every(([le,ce])=>String(te[le]??"").toLowerCase().includes(ce.toLowerCase())))},[n,A]),M=q(()=>{if(!B)return L;let ee=[...L];return ee.sort((te,le)=>{let ce=te[B],oe=le[B];if(ce==null&&oe==null)return 0;if(ce==null)return 1;if(oe==null)return-1;if(typeof ce=="number"&&typeof oe=="number")return I==="asc"?ce-oe:oe-ce;let ue=String(ce),re=String(oe),ie=ue.localeCompare(re);return I==="asc"?ie:-ie}),ee},[L,B,I]),S=M.length,k=r?Math.max(1,Math.ceil(S/r)):1,E=r?M.slice(P*r,(P+1)*r):M,F=w(ee=>{s?s(ee):m(ee)},[s]),R=w(ee=>{let te=B===ee&&I==="asc"?"desc":"asc";d?d(ee,te):(v(ee),T(te))},[B,I,d]),W=w(ee=>{let te=N.includes(ee)?N.filter(le=>le!==ee):[...N,ee];h?h(te):$(te)},[N,h]),_=w(()=>{let ee=E.map((ce,oe)=>r?P*r+oe:oe),le=ee.every(ce=>N.includes(ce))?N.filter(ce=>!ee.includes(ce)):[...new Set([...N,...ee])];h?h(le):$(le)},[E,N,r,P,h]),O=w((ee,te)=>{z(le=>({...le,[ee]:te})),F(0)},[F]),H=t.some(ee=>ee.filterable),X=p?ia:nn.padding,J=[];if(u){let ee=E.map((le,ce)=>r?P*r+ce:ce),te=ee.length>0&&ee.every(le=>N.includes(le));J.push(o("th",{key:"__select_all",style:{...so,padding:X,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:te,onChange:_,style:lo,"aria-label":"Select all rows"})))}for(let ee of t){let te={...so,padding:X,...ee.width?{width:ee.width}:{},...ee.sortable?{cursor:"pointer"}:{},...f?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[ee.header];ee.sortable&&le.push(o("span",{style:sa},da(ee.key,B,I))),J.push(o("th",{key:ee.key,style:te,onClick:ee.sortable?()=>R(ee.key):void 0,onKeyDown:ee.sortable?ce=>{let oe=ce.key;(oe==="Enter"||oe===" ")&&(ce.preventDefault(),R(ee.key))}:void 0,tabIndex:ee.sortable?0:void 0,role:ee.sortable?"columnheader":void 0,"aria-sort":B===ee.key?I==="asc"?"ascending":"descending":void 0},...le))}let K=null;if(H){let ee=[];u&&ee.push(o("th",{key:"__filter_spacer",style:{padding:X}}));for(let te of t)ee.push(o("th",{key:`filter_${te.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},te.filterable?o("input",{type:"text",placeholder:`Filter ${te.header}...`,style:aa,value:A[te.key]??"",onInput:le=>O(te.key,le.target.value),"aria-label":`Filter by ${te.header}`}):null));K=o("tr",{key:"__filter_row"},...ee)}let U=[];for(let ee=0;ee<E.length;ee++){let te=E[ee],le=r?P*r+ee:ee,ce=N.includes(le),oe={};c&&ee%2===1&&(oe.backgroundColor="#f9fafb"),ce&&(oe.backgroundColor="#eff6ff");let ue=[];u&&ue.push(o("td",{key:"__select",style:{padding:X,textAlign:"center",...nn,...f?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:ce,onChange:()=>W(le),style:lo,"aria-label":`Select row ${le+1}`})));for(let re of t){let ie=te[re.key],de=re.render?re.render(ie,te):String(ie??"");ue.push(o("td",{key:re.key,style:{...nn,padding:X,...f?{border:"1px solid #e5e7eb"}:{}}},de))}U.push(o("tr",{key:String(le),style:oe},...ue))}let j=null;if(r){let ee=S===0?0:P*r+1,te=Math.min((P+1)*r,S),le=[];le.push(o("button",{key:"prev",style:P===0?ao:je,onClick:P>0?()=>F(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let ce=7,oe=Math.max(0,P-Math.floor(ce/2)),ue=Math.min(k,oe+ce);ue-oe<ce&&(oe=Math.max(0,ue-ce)),oe>0&&(le.push(o("button",{key:"p0",style:je,onClick:()=>F(0)},"1")),oe>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let re=oe;re<ue;re++)le.push(o("button",{key:`p${re}`,style:re===P?ca:je,onClick:re!==P?()=>F(re):void 0,"aria-current":re===P?"page":void 0},String(re+1)));ue<k&&(ue<k-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${k-1}`,style:je,onClick:()=>F(k-1)},String(k)))),le.push(o("button",{key:"next",style:P>=k-1?ao:je,onClick:P<k-1?()=>F(P+1):void 0,disabled:P>=k-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:la},o("span",null,`Showing ${ee}\u2013${te} of ${S}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let V={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ra,...f?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...J),K),Q=o("tbody",null,...U),ae=o("table",{style:Y,role:"grid","aria-rowcount":String(S)},Z,Q);return o("div",{style:V},ae,j)}function Ge(e){return e<10?`0${e}`:String(e)}function ua(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function pa(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${Ge(e.getMonth()+1)}/${Ge(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Ge(e.getMonth()+1)}-${Ge(e.getDate())}`}var fa={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},ma={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},ga={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},ha={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function uo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);se(()=>{let m=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(m)},[]);let{hours:u,minutes:g,seconds:h}=ua(l,s),c,f=null;t==="12h"?(f=u>=12?"PM":"AM",c=u%12||12):c=u;let p=`${Ge(c)}:${Ge(g)}`;i&&(p+=`:${Ge(h)}`);let y=[p];f!=null&&y.push(o("span",{style:ga},f));let b=[o("span",{style:ma},...y)];return n&&b.push(o("span",{style:ha},pa(l,r,s))),o("div",{style:fa,...a?{class:a}:{}},...b)}var ba={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},xa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},ya={borderBottom:"1px solid var(--color-border, #e5e7eb)"},Sa={cursor:"pointer",transition:"background-color 0.15s ease"},va={backgroundColor:"var(--color-bg-muted, #eff6ff)"},wa={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Et={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function po(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:g}=e;if(t.length===0)return o("div",null,u?o("div",{style:Et},u):null,o("div",{style:wa},d),g?o("div",{style:{...Et,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},g):null);let h=[];for(let c=0;c<t.length;c++){let f=t[c],p=r(f,c),y=a===c,b=c===t.length-1,m={...xa,...s?Sa:{},...y?va:{},...i&&!b?ya:{}};h.push(o("li",{key:p,style:m,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let v=x.key;(v==="Enter"||v===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(f,c)))}return o("div",null,u?o("div",{style:Et},u):null,o("ul",{style:ba,role:l?"listbox":"list"},...h),g?o("div",{style:{...Et,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},g):null)}function ka(e){return e??"#3b82f6"}function Ca(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var Ma={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function Ea(e,t,n,r,i){let s=Ma[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:Ca(e,.12),color:e,border:"none"};default:return a}}var Ra={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function fo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,g=ka(n),h=Ea(g,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Ra,onClick:f=>{f.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:h,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?f=>{let p=f.key;(p==="Enter"||p===" ")&&(f.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Pa={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function mo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=ne(null),u=t.length*r,g=parseInt(s,10)||400,h=Math.ceil(g/r),c=Math.max(0,Math.floor(a/r)-i),f=Math.min(t.length,Math.floor(a/r)+h+i),p=w(b=>{let m=b.target;l(m.scrollTop)},[]),y=[];for(let b=c;b<f;b++)y.push(o("div",{key:String(b),style:{position:"absolute",top:`${b*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[b],b)));return o("div",{ref:d,style:{...Pa,height:s},onScroll:p},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var go={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function ho(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=go[r]??go.info,a=e.icon??s.icon,l=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function bo(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function xo(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=ge().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let f=typeof e.size=="number"?e.size:48,p=Math.max(2,Math.round(f/10)),y=(f-p)/2,b=2*Math.PI*y,m=e.indeterminate?b*.75:b-r/100*b,x=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},x?o("style",null,x):null,o("svg",{width:String(f),height:String(f),viewBox:`0 0 ${f} ${f}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(p)}),o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(p),"stroke-dasharray":String(b),"stroke-dashoffset":String(m),"stroke-linecap":"round",transform:`rotate(-90 ${f/2} ${f/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",g=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let f={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(f.position="absolute",f.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,f.backgroundColor=i):(f.width=`${r}%`,f.backgroundColor=i),e.animated&&!e.indeterminate&&(f.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Ia(i)} 50%, ${i} 100%)`,f.backgroundSize="200% 100%",f.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),f},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||g?o("style",null,u+g):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:c})))}function Ia(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function yo(e){let t=e.variant??"text",n=e.animated!==!1,r=ge().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let g=u===l-1&&l>1;d.push(o("div",{key:String(u),style:on({width:g?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:on({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:on({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function on(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var $a={sm:16,md:24,lg:40},So={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function vo(e){let t=typeof e.size=="number"?e.size:$a[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=So[e.speed??"normal"]??So.normal,s=e.label??"Loading",l=ge().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,g=q(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,g),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function xe(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function Te(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var Ta={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function wo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,g=ne(null);se(()=>{g.current&&(g.current.indeterminate=a)},[a]);let h=w(()=>{l||i(!r)},[l,r,i]),c=w(A=>{l||(A.key===" "||A.key==="Enter")&&(A.preventDefault(),i(!r))},[l,r,i]),f=Ta[u],p=`${f.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",b=r||a?"#3b82f6":"#ffffff",m={width:p,height:p,minWidth:p,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:b,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${f.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,D={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},T=o("input",{ref:g,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:m},v),$=s?o("span",{style:{fontSize:f.fontSize,color:"#374151"}},s):null;return o(xe,{error:d,htmlFor:n},o("div",{style:D,onClick:h,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},T,C,$))}var za=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function ko(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Rt(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Co(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=za,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[g,h]=G(!1),[c,f]=G(r),p=ne(null);se(()=>{f(r)},[r]),se(()=>{let z=P=>{p.current&&!p.current.contains(P.target)&&h(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let y=w(z=>{d||i(Rt(z))},[d,i]),b=w(z=>{let P=z.target.value;f(P);let B=P.startsWith("#")?P:`#${P}`;ko(B)&&i(Rt(B))},[i]),m=w(()=>{ko(c.startsWith("#")?c:`#${c}`)||f(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},v={display:"flex",alignItems:"center",gap:"8px"},D={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},T={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(z=>{let P=Rt(z)===Rt(r);return o("div",{key:z,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:z,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(z),onKeyDown:I=>{let N=I.key;(N==="Enter"||N===" ")&&(I.preventDefault(),y(z))},role:"button",tabIndex:d?-1:0,title:z,"aria-label":`Select color ${z}`})}),$=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:b,onBlur:m,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,A=g?o("div",{style:D},o("div",{style:T},...C),$):null;return o(xe,{label:u,disabled:d,htmlFor:n},o("div",{ref:p,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>h(!g),onKeyDown:d?void 0:z=>{let P=z.key;(P==="Enter"||P===" ")&&(z.preventDefault(),h(!g))},role:"button",tabIndex:d?-1:0,"aria-expanded":g?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),A))}function Mo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,g]=G(r),h=ne(null),c=w(((...b)=>{let x=b[0].target.value;g(x),i?.(x)}),[i]),f={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},p={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(xe,{label:d,htmlFor:n},o("div",{style:f},o("div",{style:p},o("input",{id:n,ref:h,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var Eo=["January","February","March","April","May","June","July","August","September","October","November","December"],Da=["Su","Mo","Tu","We","Th","Fr","Sa"];function rn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Aa(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function La(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Po(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:g,error:h}=e,c=q(()=>rn(r),[r]),f=q(()=>rn(a),[a]),p=q(()=>rn(l),[l]),[y,b]=G(!1),[m,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,D]=G(()=>c?c.getMonth():new Date().getMonth()),T=ne(null),C=q(()=>new Date,[]);se(()=>{let R=W=>{T.current&&!T.current.contains(W.target)&&b(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let $=w(()=>{D(R=>R===0?(x(W=>W-1),11):R-1)},[]),A=w(()=>{D(R=>R===11?(x(W=>W+1),0):R+1)},[]),z=w(R=>{let W=new Date(m,v,R);f&&W<f||p&&W>p||(i(La(W)),b(!1))},[m,v,i,f,p]),P=c?Aa(c,s):"",B=q(()=>{let R=new Date(m,v,1).getDay(),W=new Date(m,v+1,0).getDate(),_=[],O=[];for(let H=0;H<R;H++)O.push(null);for(let H=1;H<=W;H++)O.push(H),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[m,v]),I={...Te({},{focused:y,error:!!h}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},L={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},M={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},S={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},k=Da.map(R=>o("div",{key:R,style:{padding:"4px"}},R)),E=B.map((R,W)=>{let _=R.map((O,H)=>{if(O===null)return o("div",{key:`empty-${W}-${H}`,style:{padding:"4px"}});let X=new Date(m,v,O),J=Ro(X,C),K=c?Ro(X,c):!1,U=f&&X<f||p&&X>p,j={padding:"4px",textAlign:"center",cursor:U?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:J?"700":"400",backgroundColor:K?"#3b82f6":"transparent",color:K?"#ffffff":U?"#d1d5db":J?"#3b82f6":"#1f2937",border:J&&!K?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:j,onClick:U?void 0:()=>z(O),onKeyDown:U?void 0:V=>{let Y=V.key;(Y==="Enter"||Y===" ")&&(V.preventDefault(),z(O))},role:U?void 0:"button",tabIndex:U?void 0:0,"aria-label":`${Eo[v]} ${O}, ${m}`,"aria-disabled":U?"true":void 0},String(O))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},..._)}),F=y?o("div",{style:N},o("div",{style:L},o("button",{type:"button",style:M,onClick:$},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Eo[v]} ${m}`),o("button",{type:"button",style:M,onClick:A},"\u25B6")),o("div",{style:S},...k),...E):null;return o(xe,{label:g,error:h,disabled:d,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},o("div",{id:n,style:I,onClick:d?void 0:()=>b(!y),onKeyDown:d?void 0:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),b(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function sn(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function Io(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[g,h]=G([]),[c,f]=G(!1),[p,y]=G(""),b=ne(null),m=w(M=>{y("");let S=[];for(let E of M){if(a&&E.size>a){y(`File "${E.name}" exceeds maximum size of ${sn(a)}`);continue}S.push(E)}let k=s?[...g,...S]:S.slice(0,1);h(k),r(k)},[g,s,a,r]),x=w(M=>{if(M.preventDefault(),M.stopPropagation(),f(!1),l)return;let S=M.dataTransfer;if(!S)return;let k=Array.from(S.files);m(k)},[l,m]),v=w(M=>{M.preventDefault(),M.stopPropagation(),l||f(!0)},[l]),D=w(M=>{M.preventDefault(),M.stopPropagation(),f(!1)},[]),T=w(M=>{let S=M.target;S.files&&(m(Array.from(S.files)),S.value="")},[m]),C=w(M=>{let S=g.filter((k,E)=>E!==M);h(S),r(S)},[g,r]),$=w(()=>{l||b.current&&b.current.click()},[l]),A={border:`2px dashed ${c?"#3b82f6":p?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},z={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},I=o("input",{id:n,ref:b,type:"file",accept:i,multiple:s,onChange:T,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:A,onClick:$,onKeyDown:M=>{let S=M.key;(S==="Enter"||S===" ")&&(M.preventDefault(),$())},onDrop:x,onDragOver:v,onDragLeave:D,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:z},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:B},i):null,a?o("div",{style:B},`Max size: ${sn(a)}`):null),L=g.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...g.map((M,S)=>{let k={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},E={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${S}`,style:k},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},M.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},sn(M.size))),o("button",{type:"button",style:E,onClick:F=>{F.stopPropagation(),C(S)},"aria-label":`Remove ${M.name}`},"\u2715"))})):null;return o(xe,{label:d,helpText:u,error:p||void 0,disabled:l,htmlFor:n},o("div",null,I,N,L))}function $o(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=ge().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Te(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=w(c=>{let f=c.target,p=f.value;i(p.length),e.onChange&&e.onChange(p),e.autoResize&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)},[e.onChange,e.autoResize]),g=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),h=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(xe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},g,h)}function To(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:g,label:h,error:c}=e,[f,p]=G(!1),y=w(S=>{let k=S;return s!==void 0&&k<s&&(k=s),a!==void 0&&k>a&&(k=a),k},[s,a]),b=w(()=>{d||i(y(r+l))},[d,r,l,y,i]),m=w(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=w(S=>{let k=S.target.value;if(k===""||k==="-")return;let E=parseFloat(k);isNaN(E)||i(y(E))},[y,i]),v=w(S=>{d||(S.key==="ArrowUp"?(S.preventDefault(),b()):S.key==="ArrowDown"&&(S.preventDefault(),m()))},[d,b,m]),D=s===void 0||r>s,T=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":f?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...f&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=S=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!S?"not-allowed":"pointer",color:d||!S?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),A={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},z={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},P=o("button",{type:"button",style:$(D),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:z},u):null,I=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:d,style:A,"aria-label":h||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),N=g?o("span",{style:z},g):null,L=o("button",{type:"button",style:$(T),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),M=[P];return B&&M.push(B),M.push(I),N&&M.push(N),M.push(L),o(xe,{label:h,error:c,disabled:d,htmlFor:n},o("div",{style:C},...M))}function zo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:g}=e,h=w(y=>{d||s(y)},[d,s]),c=w(y=>{if(d)return;let b=r.filter(v=>!v.disabled);if(b.length===0)return;let m=b.findIndex(v=>v.value===i),x=m;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=m<b.length-1?m+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=m>0?m-1:b.length-1;else return;s(b[x].value)},[d,r,i,s]),f={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},p=r.map((y,b)=>{let m=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${b}`,D={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":m?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},T={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:m?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:v,style:C,onClick:x?void 0:$=>{$.preventDefault(),h(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:m,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:D},o("div",{style:T})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(xe,{label:g,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:f,role:"radiogroup","aria-label":g,onKeyDown:c,tabIndex:d?-1:0},...p))}function Do(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:g=!1,error:h,label:c,helpText:f}=e,[p,y]=G(!1),[b,m]=G(""),[x,v]=G(-1),D=ne(null),T=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=q(()=>{if(!l||!b)return r;let R=b.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(R))},[r,b,l]),$=q(()=>{let R={},W=[];for(let _ of C)_.group?(R[_.group]||(R[_.group]=[]),R[_.group].push(_)):W.push(_);return{groups:R,ungrouped:W}},[C]),A=q(()=>T.length===0?"":T.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[T,r]);se(()=>{let R=W=>{let _=W.target;D.current&&!D.current.contains(_)&&(y(!1),m(""))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let z=w(R=>{if(d){let W=T.includes(R)?T.filter(_=>_!==R):[...T,R];s(W)}else s(R),y(!1),m("")},[d,T,s]),P=w(R=>{R.stopPropagation(),s(d?[]:"")},[d,s]),B=w(R=>{if(g)return;let W=R.key;if(!p&&(W==="Enter"||W===" "||W==="ArrowDown")){R.preventDefault(),y(!0),v(0);return}if(p){if(W==="Escape"){y(!1),m("");return}if(W==="ArrowDown")R.preventDefault(),v(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")R.preventDefault(),v(_=>Math.max(_-1,0));else if(W==="Enter"&&x>=0&&x<C.length){R.preventDefault();let _=C[x];_.disabled||z(_.value)}}},[g,p,x,C,z]),I={...Te({},{focused:p,error:!!h}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:g?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},L=(R,W)=>{let _=T.includes(R.value),O=W===x,H={padding:"8px 12px",cursor:R.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#eff6ff":"transparent",color:R.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:R.value,style:H,onClick:R.disabled?void 0:()=>z(R.value),onMouseEnter:()=>v(W),role:"option","aria-selected":_?"true":"false","aria-disabled":R.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,R.label)},M=()=>{let R=[],W=0,{groups:_,ungrouped:O}=$;for(let H of O)R.push(L(H,W++));for(let H of Object.keys(_)){R.push(o("div",{key:`group-${H}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},H));for(let X of _[H])R.push(L(X,W++))}return R.length===0&&R.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),R},S=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:p?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),k=o("div",{style:I,id:n,onClick:g?void 0:()=>{y(!p),v(-1)},onKeyDown:B,tabIndex:g?-1:0,role:"combobox","aria-expanded":p?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:A?"#1f2937":"#9ca3af"}},A||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&T.length>0?o("span",{onClick:P,onKeyDown:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),R.stopPropagation(),P(R))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,S)),E=l&&p?o("input",{type:"text",value:b,onInput:R=>{m(R.target.value),v(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,F=p?o("div",{style:N,role:"listbox"},E,...M()):null;return o(xe,{label:c,error:h,helpText:f,disabled:g,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},k,F))}function Ao(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:g=!1,marks:h,range:c=!1,label:f,error:p}=e,y=ne(null),b=ne(i);b.current=i;let[m,x]=G(null),v=q(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),D=ne(v);D.current=v;let T=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,$=w(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return T(s+O*(a-s))},[s,a,l]),A=w(W=>_=>{g||(_.preventDefault(),x(W))},[g]),z=w(W=>{if(g)return;let _=$(W);if(c){let O=Math.abs(_-v[0]),H=Math.abs(_-v[1]);O<=H?i([T(_),v[1]]):i([v[0],T(_)])}else i(T(_))},[g,$,c,v,i,s,a,l]);se(()=>{if(!m)return;let W=O=>{let H=$(O),X=D.current,J=b.current;m==="single"?J(T(H)):m==="start"?J([Math.min(T(H),X[1]),X[1]]):m==="end"&&J([X[0],Math.max(X[0],T(H))])},_=()=>x(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[m,$,s,a,l]);let P=w(W=>{if(g)return;let _=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")_=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")_=-l;else return;W.preventDefault(),c||i(T((typeof r=="number"?r:0)+_))},[g,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:g?"not-allowed":"pointer"},I=c?C(v[0]):0,N=C(c?v[1]:v[0]),L={position:"absolute",top:"0",left:`${I}%`,width:`${N-I}%`,height:"100%",backgroundColor:g?"#9ca3af":"#3b82f6",borderRadius:"3px"},M=W=>f?W==="start"?`${f} minimum`:W==="end"?`${f} maximum`:f:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",S=(W,_,O)=>{let H={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${g?"#9ca3af":"#3b82f6"}`,cursor:g?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},X={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:_==="single"||_==="start"?n:void 0,style:H,onMouseDown:A(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":M(_),tabIndex:g?-1:0,onKeyDown:P},d?o("div",{style:X},String(O)):null)},k=[];if(u)for(let W=s;W<=a;W+=l)k.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let E=[];if(h)for(let W of h)E.push(o("div",{key:`mark-${W.value}`,style:{position:"absolute",top:"18px",left:`${C(W.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},W.label));let F={paddingTop:d?"28px":"8px",paddingBottom:h||u?"28px":"8px",opacity:g?"0.6":"1"},R=[];return c?(R.push(S(C(v[0]),"start",v[0])),R.push(S(C(v[1]),"end",v[1]))):R.push(S(C(v[0]),"single",v[0])),o(xe,{label:f,error:p,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:B,role:"presentation",onClick:z},o("div",{style:L}),...R,...k,...E)))}var Ba=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Fa={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Lo(e){let[t,n]=G(!1),r=ne(null),i=ge().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Ba,l=e.toolbarStyle??{},d=e.editorStyle??{};se(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=w((p,y)=>{if(!(e.disabled||e.readOnly)){if(p==="createLink"){let b=prompt("Enter URL:");if(!b)return;document.execCommand(p,!1,b)}else y&&p==="formatBlock"?document.execCommand(p,!1,`<${y}>`):document.execCommand(p,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),g=w(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),h=w(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(p=>{let y=Fa[p];return y?o("button",{key:p,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:p==="bold"?"700":p==="italic"?"400":"500",fontStyle:p==="italic"?"italic":"normal",textDecoration:p==="underline"?"underline":p==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),f=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:h,onInput:g});return o(xe,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,f))}function Bo(e){let[t,n]=G(!1),r=ge().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Te(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let g=u.target.value;e.onInput&&e.onInput(g),e.onChange&&e.onChange(g)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(xe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Na=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function We(e){return String(e).padStart(2,"0")}function Wa(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function Fo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:g=!1,timezone:h,showTimezone:c=!1,timezones:f=Na,onTimezoneChange:p}=e,[y,b]=G(!1),m=q(()=>Wa(r),[r]),x=s==="12h",v=m.hour>=12,D=x?m.hour%12||12:m.hour,T=w((j,V,Y)=>{let Z=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,V)),ae=Math.max(0,Math.min(59,Y??0));i(g?`${We(Z)}:${We(Q)}:${We(ae)}`:`${We(Z)}:${We(Q)}`)},[i,g]),C=w(j=>{let V=parseInt(j.target.value,10)||0;x&&(V=V%12,v&&(V+=12)),T(V,m.minute,m.second)},[x,v,m.minute,m.second,T]),$=w(j=>{let V=parseInt(j.target.value,10)||0;T(m.hour,V,m.second)},[m.hour,m.second,T]),A=w(j=>{let V=parseInt(j.target.value,10)||0;T(m.hour,m.minute,V)},[m.hour,m.minute,T]),z=w(()=>{if(l)return;let j=v?m.hour-12:m.hour+12;T(j,m.minute,m.second)},[l,v,m.hour,m.minute,m.second,T]),P=w(j=>{l||T(m.hour+j,m.minute,m.second)},[l,m.hour,m.minute,m.second,T]),B=w(j=>{l||T(m.hour,m.minute+j*a,m.second)},[l,m.hour,m.minute,m.second,a,T]),I=w(j=>{l||T(m.hour,m.minute,m.second+j)},[l,m.hour,m.minute,m.second,T]),N=w(j=>{let V=j.target.value;p&&p(V)},[p]),L={display:"inline-flex",alignItems:"center",gap:"4px",...Te({},{focused:y,error:!!u})},M={display:"flex",flexDirection:"column",alignItems:"center"},S={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},k={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},E={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},F=o("div",{style:M},o("button",{type:"button",style:S,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:We(D),onChange:C,style:k,disabled:l,"aria-label":"Hour",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:S,onClick:()=>P(-1),disabled:l},"\u25BC")),R=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:M},o("button",{type:"button",style:S,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:We(m.minute),onChange:$,style:k,disabled:l,"aria-label":"Minute",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:S,onClick:()=>B(-1),disabled:l},"\u25BC")),_=g?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=g?o("div",{style:M},o("button",{type:"button",style:S,onClick:()=>I(1),disabled:l},"\u25B2"),o("input",{type:"text",value:We(m.second),onChange:A,style:k,disabled:l,"aria-label":"Second",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:S,onClick:()=>I(-1),disabled:l},"\u25BC")):null,H=x?o("button",{type:"button",style:E,onClick:z,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,X={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},J=h&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},h):null,K=c?o("select",{style:X,value:h??f[0],onChange:N,disabled:l,"aria-label":"Timezone"},...f.map(j=>o("option",{key:j,value:j},j))):null,U=[F,R,W];return _&&U.push(_),O&&U.push(O),H&&U.push(H),J&&U.push(J),K&&U.push(K),o(xe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:L},...U))}var _a={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function No(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=_a[a],g=w(()=>{s||n(!t)},[s,t,n]),h=w(v=>{s||(v.key===" "||v.key==="Enter")&&(v.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},f=t?u.trackW-u.thumbSize-u.offset:u.offset,p={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${f}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},b=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,m=o("div",{style:c},o("div",{style:p}));return o("div",{style:y,onClick:g,onKeyDown:h,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[b,m]:[m,b]).filter(Boolean))}var Wo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function _o(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let g={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(g.border="1px solid #e5e7eb"),g.boxShadow=Wo[n]??Wo.sm,e.hoverable&&(g.cursor="pointer"),{...g,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function Oo(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function Ho(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Yo(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function Vo(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var Uo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function jo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=ne(null),[a,l]=G("auto");se(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=w(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=w(y=>{if(!e.collapsible)return;let b=y.key;(b==="Enter"||b===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),g=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Uo[n]??Uo.none,{...y,...e.style??{}}},[t,n,e.style]),h={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},f={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},p={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:g},o("div",{className:"panel__header",style:h,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?f:{},ref:s},o("div",{className:"panel__body",style:p},e.children)))}function Go(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Oa(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Xo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ne(null),[s,a]=G(!0),[l,d]=G(!1),[u,g]=G(!0),[h,c]=G(!1),f=w(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),g(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);se(()=>{f()},[f]);let p=w(()=>{r&&f()},[r,f]),y=q(()=>{let x={position:"relative",overflowX:Go(t,"x"),overflowY:Go(t,"y"),...Oa(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),b=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&b.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&b.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&b.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!h&&b.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let m={...y};return b.length>0&&(m.boxShadow=b.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:m,ref:i,onScroll:p},e.children)}function qo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=ne(null),d=ne(!1),u=w(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);se(()=>{let y=m=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,D=n?m.clientX-x.left:m.clientY-x.top;if(v<=0)return;let T=i/v*100,C=e.maxSize?e.maxSize/v*100:100-T,$=D/v*100;$=Math.max(T,Math.min(C,$)),a($)},b=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b)}},[n,i,e.maxSize]);let g=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),h=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},f={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},p=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:g,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:h},p[0]??null),o("div",{className:"splitter__divider",style:f,onMouseDown:u,onKeyDown:y=>{let b=y.key,m=2;n&&(b==="ArrowLeft"||b==="ArrowRight")?(y.preventDefault(),a(x=>{let v=b==="ArrowRight"?m:-m;return Math.max(5,Math.min(95,x+v))})):!n&&(b==="ArrowUp"||b==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=b==="ArrowDown"?m:-m;return Math.max(5,Math.min(95,x+v))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},p[1]??null))}function Ko(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(m=>!m.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=ne(null),d=w(m=>{s(m),e.onChange&&e.onChange(m)},[e.onChange]),u=w(m=>{let x=e.tabs.filter(A=>!A.disabled),v=x.findIndex(A=>A.id===a);if(v===-1)return;let D=t==="left"||t==="right",T=D?"ArrowUp":"ArrowLeft",C=D?"ArrowDown":"ArrowRight",$=-1;if(m.key===T?$=v>0?v-1:x.length-1:m.key===C?$=v<x.length-1?v+1:0:m.key==="Home"?$=0:m.key==="End"&&($=x.length-1),$>=0){m.preventDefault(),d(x[$].id);let A=l.current;if(A){let P=A.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[$])];P&&P.focus()}}},[e.tabs,a,t,d]),g=t==="left"||t==="right",h=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:g?h?"row-reverse":"row":h?"column-reverse":"column",width:"100%",...e.style??{}}),[g,h,e.style]),f={display:"flex",flexDirection:g?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!g?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&g?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},p={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(m=>m.id===a),b=e.tabs.map(m=>{let x=m.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:m.disabled?"not-allowed":"pointer",opacity:m.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?g?t==="left"?(v.borderRight=x?"2px solid #3b82f6":"2px solid transparent",v.marginRight="-2px"):(v.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",v.marginLeft="-2px"):(v.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",v.marginBottom="-2px"):n==="card"?(v.backgroundColor=x?"#ffffff":"transparent",v.borderRadius="6px 6px 0 0",x&&(v.border="1px solid #e5e7eb",v.borderBottom="1px solid #ffffff")):n==="pill"&&(v.borderRadius="9999px",v.backgroundColor=x?"#3b82f6":"transparent",v.color=x?"#ffffff":"#6b7280"),o("button",{key:m.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${m.id}`,"aria-disabled":m.disabled?"true":void 0,id:`tab-${m.id}`,tabIndex:x?"0":"-1",style:v,onClick:m.disabled?void 0:()=>d(m.id),onKeyDown:u},m.icon?o("span",{className:"tabs__tab-icon"},m.icon):null,m.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":g?"vertical":"horizontal",style:f,ref:l},...b),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:p,tabIndex:"0"},y?y.content:null))}function Zo(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=ge().replace(/[^a-zA-Z0-9_-]/g,""),[u,g]=G(0),h=ne(null),c=ne(null),f=w(C=>{let $=C;r?$=(C%n+n)%n:$=Math.max(0,Math.min(C,n-1)),g($),e.onChange&&e.onChange($)},[n,r,e.onChange]),p=w(()=>f(u+1),[u,f]),y=w(()=>f(u-1),[u,f]);se(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(p,l);return()=>clearInterval(C)},[e.autoPlay,l,p,n]),se(()=>{let C=A=>{A.key==="ArrowLeft"?y():A.key==="ArrowRight"&&p()},$=c.current;if($)return $.addEventListener("keydown",C),()=>$.removeEventListener("keydown",C)},[p,y]);let b=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",m={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),v={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},D=t.map((C,$)=>{let A=a==="fade"?{position:$===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:$===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String($),style:A},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),T=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,$)=>o("button",{key:String($),"aria-label":`Go to slide ${$+1}`,onclick:()=>f($),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:$===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:m,onpointerdown:C=>{h.current=C.clientX},onpointerup:C=>{if(h.current==null)return;let $=C.clientX-h.current;$>50?y():$<-50&&p(),h.current=null}},b?o("style",null,b):null,o("div",{style:x},...D),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:p,style:{...v,right:"8px"}},"\u203A"):null,T)}function Jo(e){let[t,n]=G("loading"),r=ne(null),i=ge().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;se(()=>{n("loading")},[e.src]);let d=q(()=>{let f={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(f.width=a),l&&(f.height=l),e.borderRadius&&(f.borderRadius=e.borderRadius),f},[a,l,e.borderRadius]),u=q(()=>{let f={display:"block",width:"100%",height:"100%"};return e.objectFit&&(f.objectFit=e.objectFit),t==="loading"&&(f.opacity="0",f.position="absolute"),t==="error"&&(f.display="none"),f},[e.objectFit,t]),g=null;if(t==="loading")if(e.placeholder==="skeleton"){let f=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;g=o("div",null,o("style",null,f),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?g=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(g=e.placeholder);let h=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?h=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):h=e.fallback);let c=o("div",{style:d},g,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),h);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function Qo(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function er(e){let t=e.controls!==!1,n=ne(null),r=ge().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[g,h]=G(e.muted?0:1),[c,f]=G(!!e.muted),[p,y]=G(!0),b=typeof e.width=="number"?`${e.width}px`:e.width??"100%",m=typeof e.height=="number"?`${e.height}px`:e.height??"auto";se(()=>{let z=n.current;if(!z)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},I=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(z.currentTime),u(z.duration),e.onTimeUpdate&&e.onTimeUpdate(z.currentTime,z.duration)},L=()=>{u(z.duration)};return z.addEventListener("play",P),z.addEventListener("pause",B),z.addEventListener("ended",I),z.addEventListener("timeupdate",N),z.addEventListener("loadedmetadata",L),()=>{z.removeEventListener("play",P),z.removeEventListener("pause",B),z.removeEventListener("ended",I),z.removeEventListener("timeupdate",N),z.removeEventListener("loadedmetadata",L)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=w(()=>{let z=n.current;z&&(z.paused?z.play():z.pause())},[]),v=w(z=>{let P=n.current;if(!P||!isFinite(P.duration))return;let B=z.currentTarget.getBoundingClientRect(),I=Math.max(0,Math.min(1,(z.clientX-B.left)/B.width));P.currentTime=I*P.duration},[]),D=w(z=>{let P=n.current,B=parseFloat(z.target.value);P&&(P.volume=B,P.muted=B===0,h(B),f(B===0))},[]),T=w(()=>{let z=n.current;z&&z.requestFullscreen&&z.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:b,height:m,display:"block"}});let C=d>0?a/d*100:0,$={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},A=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:p?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:$},i?"\u23F8":"\u25B6"),o("div",{onclick:v,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Qo(a)} / ${Qo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:g),oninput:D,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:T,style:$},"\u26F6"));return o("div",{style:{position:"relative",width:b,height:m,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),A)}function ke(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=ne(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=w(d=>{if(!r)return;let u=d,g=s.current;if(!g)return;let h=Array.from(g.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=h.indexOf(document.activeElement);if(c<0)return;let f=t==="vertical",p=f?"ArrowDown":"ArrowRight",y=f?"ArrowUp":"ArrowLeft";if(u.key===p){u.preventDefault();let b=h[c+1];b&&b.focus()}else if(u.key===y){u.preventDefault();let b=h[c-1];b&&b.focus()}else u.key==="Home"?(u.preventDefault(),h[0]?.focus()):u.key==="End"&&(u.preventDefault(),h[h.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function Qe(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function Se(){let[e,t]=G(!1);return{hover:e,onMouseEnter:w(()=>t(!0),[]),onMouseLeave:w(()=>t(!1),[])}}function Ha(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:g}=Se(),h=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:h?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:h?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:h?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let f=w(v=>{let D=v;h||(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),r())},[h,r]),p=w(()=>{h||r()},[h,r]),b=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),m=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[b,m]:[m,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":h?"true":void 0,"data-section-id":t.id,tabIndex:h?-1:0,style:c,onClick:p,onKeyDown:f,onMouseEnter:u,onMouseLeave:g},...x)}function Ya(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function tr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:g=!0,onChange:h}=e,[c,f]=G(()=>n??[]),p=w(b=>{f(m=>{let x=m.includes(b),v;return x?v=m.filter(D=>D!==b):r?v=[...m,b]:v=[b],h&&h(v),v})},[r,h]),y=q(()=>t.map(b=>{let m=c.includes(b.id),x=o(Ha,{key:`header-${b.id}`,section:b,expanded:m,onToggle:()=>p(b.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Ya,{key:`content-${b.id}`,section:b,expanded:m,contentStyle:s,animated:g});return o("div",{key:b.id,"data-accordion-section":b.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,g,p]);return o(ke,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var Va={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function nr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=Va[i],d=w(()=>{a(!0)},[]),u=t,g=!1;if(r&&r>1&&t.length>r&&!s){g=!0;let p=1,y=r-1;u=[...t.slice(0,p),{label:"..."},...t.slice(t.length-y)]}let h=p=>typeof p=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},p):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},p),c=(p,y,b)=>{let m=y===b.length-1,x=g&&p.label==="..."&&y===1,v=[];return y>0&&v.push(h(n)),x?v.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):m?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},p.label)):p.href?v.push(o("a",{href:p.href,onClick:p.onClick?D=>{D.preventDefault(),p.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},p.label)):p.onClick?v.push(o("button",{type:"button",onClick:p.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},p.label)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},p.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},f=u.map((p,y)=>c(p,y,u));return o(ke,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...f))}function or(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Se(),[d,u]=G(!1),g=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let h=t.disabled===!0,f={...Qe(n,{hover:!h&&s,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},p=w(()=>{if(!h){if(g){u(D=>!D);return}t.onClick&&t.onClick(),r&&i()}},[h,g,t,r,i]),y=w(()=>{a(),g&&u(!0)},[g,a]),b=w(()=>{l(),g&&u(!1)},[g,l]),m=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=g?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=g&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(ke,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(D=>o(or,{key:D.id,item:D,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:b},o("button",{type:"button",role:"menuitem",style:f,onClick:p,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":g||void 0,"aria-expanded":g?String(d):void 0},m,x),v)}function rr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,g]=G(!1),h=ne(null),c=w(()=>{g(D=>!D)},[]),f=w(()=>{g(!1)},[]);se(()=>{if(!u)return;let D=T=>{let C=h.current;C&&!C.contains(T.target)&&g(!1)};return document.addEventListener("click",D,!0),()=>{document.removeEventListener("click",D,!0)}},[u]),se(()=>{if(!u)return;let D=T=>{T.key==="Escape"&&g(!1)};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[u]);let p={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:p,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),b=typeof d=="number"?`${d}px`:d,m={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:b,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:m},o(ke,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(D=>o(or,{key:D.id,item:D,itemStyle:s,closeOnSelect:l,onClose:f})))):null;return o("div",{ref:h,style:{position:"relative",display:"inline-block"}},y,v)}function ir(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Se(),[l,d]=G(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=t.disabled===!0,h=w(()=>{if(!g){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[g,u,t,n]),c=w(()=>{s(),u&&d(!0)},[u,s]),f=w(()=>{a(),u&&d(!1)},[u,a]),p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:g?"default":"pointer",backgroundColor:!g&&i?"#f3f4f6":"transparent",color:g?"#9ca3af":"#1f2937",opacity:g?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,m=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((x,v)=>o(ir,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:f},o("button",{type:"button",role:"menuitem",style:p,onClick:h,disabled:g||void 0,tabIndex:-1,"aria-disabled":g||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,b),m)}function Ua(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Se(),g=ne(null),h=w(()=>{r?a():s(n)},[r,n,s,a]),c=w(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),f={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},p=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,b)=>o(ir,{key:String(b),item:y,onClose:a,index:b})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:g,type:"button",role:"menuitem",style:f,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),p)}function sr(e){let{menus:t}=e,[n,r]=G(null),i=ne(null),s=w(d=>{r(d)},[]),a=w(()=>{r(null)},[]);se(()=>{if(n===null)return;let d=u=>{let g=i.current;g&&!g.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),se(()=>{let d=i.current;if(!d)return;let u=g=>{let h=g;if(h.key==="Escape"){r(null);return}if(h.key==="ArrowRight"){h.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(h.key==="ArrowLeft"){h.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(h.key==="ArrowDown"&&n!==null){h.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let f=c.querySelector('[role="menuitem"]');f&&f.focus()}return}h.key==="Enter"||h.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(Ua,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function Pt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ja(e,t,n){let r=n*2+5;if(e<=r)return Pt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...Pt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Pt(e-n*2-2,e)]:[1,"ellipsis",...Pt(i,s),"ellipsis",e]}var It={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},Ga={...It,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},ar={...It,color:"#9ca3af",cursor:"default",opacity:"0.5"},Xa={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function lr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),g=Math.min(Math.max(1,r),u),h=w(b=>{!d&&b>=1&&b<=u&&b!==g&&i(b)},[d,u,g,i]),c=(b,m,x)=>{let v=d||m<1||m>u||m===g;return o("button",{type:"button",onClick:()=>h(m),disabled:v||void 0,"aria-label":x,style:v?ar:It},b)},f=ja(u,g,s),p=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",g-1,"Go to previous page"));for(let b of f)if(b==="ellipsis")y.push(o("span",{key:`ellipsis-${p++}`,style:Xa},"..."));else{let m=b===g;y.push(o("button",{key:String(b),type:"button",onClick:()=>h(b),disabled:d||void 0,"aria-label":`Page ${b}`,"aria-current":m?"page":void 0,style:d?ar:m?Ga:It},String(b)))}return l&&y.push(c("\u203A",g+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(ke,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function cr(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Se(),[u,g]=G(!1),h=t.children&&t.children.length>0,c=t.id===r,f=w(()=>{h&&!n&&g($=>!$),i&&i(t.id)},[h,n,i,t.id]),p=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${p}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},b=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,m=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,v=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,D=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,T=o("button",{type:"button",style:y,onClick:f,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},b,m,x,v,D),C=!n&&h&&u?t.children.map($=>o(cr,{key:$.id,item:$,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},T,C?o("div",{role:"group"},...C):null)}function dr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,g=t.map(h=>o(cr,{key:h.id,item:h,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(ke,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...g)}var Ie={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function ur(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,g=w(b=>{s&&i&&i(b)},[s,i]),h=b=>b<n?"completed":b===n?"active":"pending",c=(b,m,x)=>{let v=a==="dot"?u:d,D={width:`${v}px`,height:`${v}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...D,backgroundColor:Ie.completedBg,color:Ie.completedText,border:`2px solid ${Ie.completed}`}},a==="circle"?m.icon||"\u2713":null):x==="active"?o("div",{style:{...D,backgroundColor:"#ffffff",color:Ie.activeText,border:`2px solid ${Ie.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?m.icon||String(b+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ie.active}})):o("div",{style:{...D,backgroundColor:"#ffffff",color:Ie.pendingText,border:`2px solid ${Ie.pending}`}},a==="circle"?m.icon||String(b+1):null)},f=b=>{if(b>=t.length-1)return null;let x=b<n?Ie.lineCompleted:Ie.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},p=(b,m)=>{let x=h(m),v=x==="active",D=x==="completed",T=c(m,b,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||D?Ie.labelActive:Ie.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},$={fontSize:"11px",color:Ie.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},A=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},b.label),b.description?o("span",{style:$},b.description):null),z=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},T,A):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},T,A);return o(s?"button":"div",{key:String(m),onClick:s?()=>g(m):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},z)},y=[];return t.forEach((b,m)=>{y.push(p(b,m));let x=f(m);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var pr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function qa(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Se(),l=pr[n],d=t.disabled===!0,u=t.type==="toggle",[g,h]=G(!1),c=u?t.active===!0:g,f=w(()=>{!d&&t.onClick&&t.onClick()},[d,t]),p=w(()=>{!d&&!u&&h(!0)},[d,u]),y=w(()=>{u||h(!1)},[u]),b=w(()=>{a(),u||h(!1)},[u,a]),m={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,D=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:m,onClick:f,onMouseDown:p,onMouseUp:y,onMouseEnter:s,onMouseLeave:b,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,D)}function fr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=pr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(qa,{key:a.id,item:a,size:n,variant:r}));return o(ke,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var et=class e{constructor(t,n){Be(this,"id");Be(this,"label");Be(this,"children");Be(this,"expanded");Be(this,"icon");Be(this,"metadata");Be(this,"parent");Be(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function mr(e){e.expanded=!0;for(let t of e.children)mr(t)}function gr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)gr(n,t);return t}function Ka(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function Za(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:g,onClick:h,focusedId:c}=e,f=Se(),p=ne(null),y=c===t.id;se(()=>{y&&p.current&&p.current.focus()},[y]);let b=t.isLeaf(),m=t.depth,x=[];for(let $=0;$<m;$++){let A=t;for(let P=0;P<m-$;P++)A=A?A.parent:null;let z=A?!Ka(A):!1;x.push(o("span",{key:`connector-${$}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...z?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=m>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,D=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:$=>{$.stopPropagation(),g(t)}},t.expanded?a:l),T=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),C=Qe(d,{hover:f.hover,active:n});return o("div",{ref:p,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":m+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onClick:()=>h(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},D,T))}function hr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:g="\u2212",iconCollapsed:h="+",nodeStyle:c={},wrapperStyle:f,renderNode:p}=e,[y,b]=G(()=>{let z=et.fromData(t);return a&&mr(z),z}),[m,x]=G(t.id),v=q(()=>gr(y),[y]),D=w(()=>{b(z=>{let P=Object.create(Object.getPrototypeOf(z));return Object.assign(P,z),P})},[]),T=w(z=>{z.toggle(),z.expanded?r?.(z):i?.(z),D()},[r,i,D]),C=w(z=>{x(z.id),n?.(z)},[n]),$=w(z=>{let P=z;if(!m)return;let B=v.findIndex(N=>N.id===m);if(B===-1)return;let I=v[B];switch(P.key){case"ArrowDown":{P.preventDefault();let N=v[B+1];N&&x(N.id);break}case"ArrowUp":{P.preventDefault();let N=v[B-1];N&&x(N.id);break}case"ArrowRight":{P.preventDefault(),I.isLeaf()||(I.expanded?I.children.length>0&&x(I.children[0].id):T(I));break}case"ArrowLeft":{P.preventDefault(),!I.isLeaf()&&I.expanded?T(I):I.parent&&x(I.parent.id);break}case"Enter":{P.preventDefault(),C(I);break}case" ":{P.preventDefault(),I.isLeaf()||T(I);break}case"Home":{P.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{P.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[m,v,T,C]),A=v.map(z=>o(Za,{key:z.id,node:z,isSelected:z.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:g,iconCollapsed:h,nodeStyle:c,renderNode:p,onToggle:T,onClick:C,focusedId:m}));return o(ke,{role:"tree",ariaLabel:"Tree navigation",styling:f,keyboardNav:!1},o("div",{onKeyDown:$,style:{outline:"none"}},...A))}function br(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=ne(null);se(()=>{if(!u.current)return;u.current.focus();let c=p=>{let y=p,b=t.map((m,x)=>({item:m,i:x})).filter(({item:m})=>!m.divider);if(y.key==="ArrowDown")y.preventDefault(),a(m=>{let v=(b.findIndex(({i:D})=>D===m)+1)%b.length;return b[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(m=>{let x=b.findIndex(({i:D})=>D===m),v=x<=0?b.length-1:x-1;return b[v].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let m=t[s];m.children?d(s):!m.disabled&&m.onClick&&(m.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let f=u.current;return()=>f.removeEventListener("keydown",c)},[t,s,i,r]);let g={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},h=t.map((c,f)=>{if(c.divider)return o("div",{key:`divider-${f}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let p=s===f,y=!!c.disabled,b=!!(c.children&&c.children.length>0),m={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:p&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(f),d(b?f:null)},v=()=>{if(!y){if(b){d(f);return}c.onClick&&c.onClick(),r()}},D=[];c.icon&&D.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),D.push(o("span",{style:{flex:"1"}},c.label??"")),b&&D.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let T=[o("div",{key:`item-${f}`,style:m,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...D)];return b&&l===f&&T.push(o(br,{key:`submenu-${f}`,items:c.children,position:{x:n.x+178,y:n.y+f*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${f}`,style:{position:"relative"}},...T)});return o("div",{ref:u,style:g,tabIndex:-1,role:"menu"},...h)}function $t(e){let{items:t,children:n}=e,[r,i]=G(null),s=w(u=>{u.preventDefault();let g=u;i({x:g.clientX,y:g.clientY})},[]),a=w(()=>{i(null)},[]);se(()=>{if(!r)return;let u=h=>{a()},g=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(g),document.removeEventListener("mousedown",u)}},[r,a]),se(()=>{if(!r)return;let u=g=>{g.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(br,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Ja(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function Qa(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function xr(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[g,h]=G(!1),[c,f]=G(!1),p=ne(null),y=s?"drawer-title":void 0;if(se(()=>{if(t)h(!0),requestAnimationFrame(()=>f(!0));else{f(!1);let z=setTimeout(()=>h(!1),300);return()=>clearTimeout(z)}},[t]),se(()=>{if(!t||!d)return;let z=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[t,d,n]),se(()=>{if(!t)return;let z=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=z}},[t]),se(()=>{t&&p.current&&p.current.focus()},[t]),!g)return null;let b={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},m={...Qa(r,i),transform:Ja(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},v={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},D={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},T={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},$=[];s&&$.push(o("div",{style:x},o("h3",{id:y,style:v},s),o("button",{type:"button",style:D,onClick:n,"aria-label":"Close drawer"},"\xD7"))),$.push(o("div",{style:T},u));let A=[];return a&&A.push(o("div",{style:b,onClick:C})),A.push(o("div",{ref:p,style:m,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...$)),o("div",null,...A)}var el={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function yr(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,g=ne(null);if(se(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),se(()=>{if(!t||!a)return;let C=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),se(()=>{t&&g.current&&g.current.focus()},[t]),!t)return null;let h={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:el[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},p={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},b={padding:"24px",overflow:"auto",flex:"1"},m={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},v=[],D=r?"modal-title":void 0;r?v.push(o("h2",{id:D,style:p},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let T=[o("div",{style:f},...v),o("div",{style:b},u)];return l&&T.push(o("div",{style:m},l)),o("div",{style:h,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":D},o("div",{ref:g,style:c,tabIndex:-1,role:"document"},...T))}var Sr=8;function tl(e,t){let n=t+Sr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function nl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Sr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function vr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[g,h]=G(!1),c=u?r:g,f=ne(null),p=w(()=>{u?d&&d(!r):h(D=>!D)},[u,r,d]);se(()=>{if(!c||!l)return;let D=T=>{f.current&&!f.current.contains(T.target)&&(u?d&&d(!1):h(!1))};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},b={...tl(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},m=[n];a&&m.push(o("div",{style:nl(i)}));let x=w(D=>{let T=D.key;(T==="Enter"||T===" ")&&(D.preventDefault(),p())},[p]),v=[o("div",{onClick:p,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:b},...m)),o("div",{ref:f,style:y},...v)}var ol=0;function rl(){return`toast-${++ol}-${Date.now()}`}function an(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let g=rl();return n=[{id:g,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),g}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var il={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function sl(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function al(e){let{item:t,onDismiss:n}=e,r=il[t.type];se(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function ln(e){let{toaster:t}=e,[,n]=G(0);se(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=sl(t.config.position);se(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
3
3
  @keyframes specifyjs-toast-slide-in {
4
4
  from { opacity: 0; transform: translateY(-12px); }
5
5
  to { opacity: 1; transform: translateY(0); }
6
6
  }
7
- `,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=S(l=>t.dismiss(l),[t]),a=r.map(l=>o(bl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function wr(e={}){let t=te(null);t.current||(t.current=ln(e));let n=t.current,r=S(()=>o(cn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var xl=6,yl=8;function Sl(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 vl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${xl}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function kr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),b=te(null),m=te(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,f=S(()=>{m.current=setTimeout(()=>{if(b.current){let x=b.current.getBoundingClientRect();u(Sl(x,n))}l(!0)},r)},[r,n]),g=S(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);re(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},h={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},p=[o("div",{ref:b,style:y,onMouseEnter:f,onMouseLeave:g,onFocus:f,onBlur:g,"aria-describedby":a?c:void 0},s)];return a&&d&&p.push(o("div",{id:c,style:h,role:"tooltip"},t,o("div",{style:vl(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...p)}function dn(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function wl(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 kl(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 Cl(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var Cr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Mr(e,t){return t||Cr[e%Cr.length]}function Er(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:b="#e5e7eb",title:m,padding:c=50,animate:f=!1,stacked:g,grouped:y=!1}=e,h=i==="vertical",p=n-c*2,x=r-c*2,v=h?x:p,T=h?p:x,D=g!==void 0&&g.length>0,C=q(()=>D?Cl(g):[],[D,g]),P=D?g.length:t.length,L=q(()=>wl(t,g,y),[t,g,y]),I=L>0?L:1,M=dn(P,I,v,T,a),F=S(()=>{if(!u)return[];let _=kl(I),U=[];for(let X=_;X<=I;X+=_){let ee=M.valueScale(X);if(h){let Z=c+x-ee;U.push(o("line",{key:`grid-${X}`,x1:String(c),y1:String(Z),x2:String(c+p),y2:String(Z),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${X}`,x:String(c-6),y:String(Z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}else{let Z=c+ee;U.push(o("line",{key:`grid-${X}`,x1:String(Z),y1:String(c),x2:String(Z),y2:String(c+x),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${X}`,x:String(Z),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}}return U},[u,I,M,h,c,p,x,b]),R=S(()=>{let _=[];return h?(_.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"})),_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),_.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"}))),_},[h,c,p,x]),N=S(()=>{let _=[];for(let U=0;U<t.length;U++){let X=t[U],ee=M.valueScale(X.value),Z=M.categoryScale(U),V=X.color??s,j,H,Y=String(X.value);if(h){let K=c+Z,Q=c+x-ee;j={x:String(K),y:String(Q),width:String(M.barThickness),height:String(ee),rx:String(l),ry:String(l),fill:V},H={x:String(K+M.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+Z,Q=c;j={x:String(Q),y:String(K),width:String(ee),height:String(M.barThickness),rx:String(l),ry:String(l),fill:V},H={x:String(Q+ee+6),y:String(K+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(f&&(j.style=h?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),_.push(o("rect",{key:`bar-${U}`,...j})),d&&_.push(o("text",{key:`val-${U}`,...H},Y)),h){let K=c+Z+M.barThickness/2,Q=c+x+16;_.push(o("text",{key:`cat-${U}`,x:String(K),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${K}, ${Q})`},X.label))}else _.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+Z+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return _},[t,M,s,l,d,f,h,c,x]),A=S(()=>{if(!g)return[];let _=[];for(let U=0;U<g.length;U++){let X=g[U],ee=M.categoryScale(U),Z=0;for(let V=0;V<X.values.length;V++){let j=X.values[V],H=M.valueScale(j.value),Y=M.valueScale(Z),K=Mr(V,j.color);if(h){let Q=c+ee,se=c+x-Y-H;_.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(M.barThickness),height:String(H),rx:V===X.values.length-1?String(l):"0",ry:V===X.values.length-1?String(l):"0",fill:K,...f?{style:`animation: barGrow 0.6s ease-out ${(U*X.values.length+V)*.03}s both`}:{}})),d&&H>14&&_.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+M.barThickness/2),y:String(se+H/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,se=c+ee;_.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(H),height:String(M.barThickness),rx:V===X.values.length-1?String(l):"0",ry:V===X.values.length-1?String(l):"0",fill:K,...f?{style:`animation: barGrow 0.6s ease-out ${(U*X.values.length+V)*.03}s both`}:{}})),d&&H>20&&_.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+H/2),y:String(se+M.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}Z+=j.value}if(d){let V=M.valueScale(Z);h?_.push(o("text",{key:`stotal-${U}`,x:String(c+ee+M.barThickness/2),y:String(c+x-V-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z))):_.push(o("text",{key:`stotal-${U}`,x:String(c+V+6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z)))}if(h){let V=c+ee+M.barThickness/2,j=c+x+16;_.push(o("text",{key:`scat-${U}`,x:String(V),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${j})`},X.label))}else _.push(o("text",{key:`scat-${U}`,x:String(c-6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return _},[g,M,l,d,f,h,c,x]),k=S(()=>{if(!g)return[];let _=C.length,U=[];for(let X=0;X<g.length;X++){let ee=g[X],Z=M.categoryScale(X),V=2,j=Math.max(1,(M.barThickness-V*(_-1))/_);for(let H=0;H<ee.values.length;H++){let Y=ee.values[H],K=C.indexOf(Y.category),Q=K*(j+V),se=M.valueScale(Y.value),J=Mr(K>=0?K:H,Y.color);if(h){let ae=c+Z+Q,de=c+x-se;U.push(o("rect",{key:`gbar-${X}-${H}`,x:String(ae),y:String(de),width:String(j),height:String(se),rx:String(l),ry:String(l),fill:J,...f?{style:`animation: barGrow 0.6s ease-out ${(X*_+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${X}-${H}`,x:String(ae+j/2),y:String(de-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let ae=c,de=c+Z+Q;U.push(o("rect",{key:`gbar-${X}-${H}`,x:String(ae),y:String(de),width:String(se),height:String(j),rx:String(l),ry:String(l),fill:J,...f?{style:`animation: barGrow 0.6s ease-out ${(X*_+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${X}-${H}`,x:String(ae+se+4),y:String(de+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(h){let H=c+Z+M.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${X}`,x:String(H),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${Y})`},ee.label))}else U.push(o("text",{key:`gcat-${X}`,x:String(c-6),y:String(c+Z+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return U},[g,C,M,l,d,f,h,c,x]),w=S(()=>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]),$=S(()=>f?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},h?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[f,h]),E=F(),W=R(),z=w(),B=$(),O;return D&&y?O=k():D?O=A():O=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...B,...z,...E,...W,...O)}function it(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 Ft(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 Nt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let b=t[u],m=e(b);isFinite(m)&&a.push({input:b,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Rr(l)};return Rr(l),()=>{i=!0}}function Rr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Ml(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function Pr(e,t){let n=t-e;if(n<=0)return[e];let r=Ml(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function Ir(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Se=40,$r=1.1,Dr=.01,Tr=1e6;function zr(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:b=!0,showAxes:m=!0,pointRadius:c=3,pointColor:f="#3b82f6",curveColor:g="#3b82f6",gridColor:y="#e2e8f0",axisColor:h="#94a3b8",onPointClick:p,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:T}=e,[D,C]=G(d[0]),[P,L]=G(d[1]),[I,M]=G(u[0]),[F,R]=G(u[1]),N=te(!1),A=te(null),k=S(Y=>Se+(Y-D)/(P-D)*(t-2*Se),[D,P,t]),w=S(Y=>n-Se-(Y-I)/(F-I)*(n-2*Se),[I,F,n]),$=S(Y=>D+(Y-Se)/(t-2*Se)*(P-D),[D,P,t]),E=S(Y=>I+(n-Se-Y)/(n-2*Se)*(F-I),[I,F,n]),W=S(Y=>{let K=Y;N.current=!0,A.current={mx:K.clientX,my:K.clientY,x0:D,x1:P,y0:I,y1:F}},[D,P,I,F]),z=S(Y=>{if(!N.current||!A.current)return;let K=Y,Q=A.current,se=K.clientX-Q.mx,J=K.clientY-Q.my,ae=se/(t-2*Se)*(Q.x1-Q.x0),de=J/(n-2*Se)*(Q.y1-Q.y0);C(Q.x0-ae),L(Q.x1-ae),M(Q.y0+de),R(Q.y1+de)},[t,n]),B=S(()=>{N.current=!1,A.current=null},[]),O=S(Y=>{let K=Y;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),se=K.clientX-Q.left,J=K.clientY-Q.top,ae=$(se),de=E(J),le=K.deltaY>0?$r:1/$r,ne=(P-D)*le,fe=(F-I)*le;if(ne<Dr||fe<Dr||ne>Tr||fe>Tr)return;let oe=(ae-D)/(P-D),ie=(de-I)/(F-I);C(ae-oe*ne),L(ae+(1-oe)*ne),M(de-ie*fe),R(de+(1-ie)*fe)},[D,P,I,F,$,E]),_=[];if(_.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),b){let Y=Pr(D,P),K=Pr(I,F);for(let Q=0;Q<Y.length;Q++){let se=k(Y[Q]);_.push(o("line",{x1:se,y1:Se,x2:se,y2:n-Se,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),_.push(o("text",{x:se,y:n-Se+14,"text-anchor":"end","font-size":10,fill:h,transform:`rotate(-45, ${se}, ${n-Se+14})`,key:`lx-${Q}`},Ir(Y[Q])))}for(let Q=0;Q<K.length;Q++){let se=w(K[Q]);_.push(o("line",{x1:Se,y1:se,x2:t-Se,y2:se,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),_.push(o("text",{x:Se-6,y:se+3,"text-anchor":"end","font-size":10,fill:h,key:`ly-${Q}`},Ir(K[Q])))}}if(m){let Y=Math.max(Se,Math.min(t-Se,k(0))),K=Math.max(Se,Math.min(n-Se,w(0)));_.push(o("line",{x1:Se,y1:K,x2:t-Se,y2:K,stroke:h,"stroke-width":1,key:"x-axis"})),_.push(o("line",{x1:Y,y1:Se,x2:Y,y2:n-Se,stroke:h,"stroke-width":1,key:"y-axis"}))}let U=q(()=>{if(!i||!l)return[];let Y=a??(P-D)/s,K=it({start:D,end:P,step:Y});return Ft(i,K)},[i,D,P,a,s,l]),[X,ee]=G([]),Z=te(null);re(()=>{if(!i||l){ee([]);return}let Y=a??(P-D)/s,K=it({start:D,end:P,step:Y});return Z.current&&Z.current(),Z.current=Nt(i,K,200,Q=>{ee([...Q])}),()=>{Z.current&&Z.current()}},[i,D,P,a,s,l]);let V=l?U:X;if(V.length>0){let Y=[];for(let K=0;K<V.length;K++){let Q=V[K],se=k(Q.input),J=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${se},${J}`)}_.push(o("path",{d:Y.join(" "),fill:"none",stroke:g,"stroke-width":1.5,key:"curve"}))}let j=(Y,K,Q,se)=>{if(K)return J=>K({x:se.x,y:se.y,index:Q,event:J})};for(let Y=0;Y<r.length;Y++){let K=r[Y],Q=k(K.x),se=w(K.y),J={cx:Q,cy:se,r:c,fill:f,cursor:"pointer",key:`pt-${Y}`};p&&(J.onClick=j("click",p,Y,K)),x&&(J.onDblClick=j("dblclick",x,Y,K)),v&&(J.onContextMenu=j("contextmenu",v,Y,K)),T&&(J.onMouseOver=j("mouseover",T,Y,K)),_.push(o("circle",J))}let H=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Se,y:Se,width:t-2*Se,height:n-2*Se})));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:W,onMouseMove:z,onMouseUp:B,onMouseLeave:B,onWheel:O},H,..._)}function Lr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function Ar(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,b=0,m=0,c=0;return i<60?(b=l,m=d):i<120?(b=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(b=d,c=l):(b=l,c=d),[Math.floor((b+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function Fr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Lr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let b=0;b<e;b++){let m=n[0]+b/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function Nr(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Lr,data:d,resolution:u=2,onPointClick:b,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:f}=e;if(d){let E=d.length,W=E>0?d[0].length:0,z=W>0?t/W:1,B=E>0?n/E:1,O=[];for(let _=0;_<E;_++){let U=d[_];for(let X=0;X<W;X++){let ee=U[X]??0,[Z,V,j]=Ar(ee,s,a);O.push(o("rect",{key:`${_}-${X}`,x:String(X*z),y:String(_*B),width:String(Math.ceil(z)),height:String(Math.ceil(B)),fill:`rgb(${Z},${V},${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%"}},...O)}let[g,y]=G(r[0]),[h,p]=G(r[1]),[x,v]=G(i[0]),[T,D]=G(i[1]),C=te(null),P=te(!1),L=te(null),I=S((E,W)=>{let z=g+E/t*(h-g),B=T-W/n*(T-x);return{re:z,im:B}},[g,h,x,T,t,n]);re(()=>{let E=C.current;if(!E)return;let W=E.getContext("2d");if(!W)return;let z=W.createImageData(t,n),B=z.data;for(let O=0;O<n;O++)for(let _=0;_<t;_++){let{re:U,im:X}=I(_,O),ee=l(U,X,s),[Z,V,j]=Ar(ee,s,a),H=(O*t+_)*4;B[H]=Z,B[H+1]=V,B[H+2]=j,B[H+3]=255}W.putImageData(z,0,0)},[g,h,x,T,t,n,s,a,l,I]);let M=S(E=>{let W=E.target.getBoundingClientRect(),z=E.clientX-W.left,B=E.clientY-W.top,{re:O,im:_}=I(z,B),U=l(O,_,s);return{re:O,im:_,iterations:U,event:E}},[I,l,s]),F=S(E=>{P.current=!0,L.current={x:E.clientX,y:E.clientY,rMin:g,rMax:h,iMin:x,iMax:T}},[g,h,x,T]),R=S(E=>{if(m&&m(M(E)),!P.current||!L.current)return;let W=L.current,z=E.clientX-W.x,B=E.clientY-W.y,O=(W.rMax-W.rMin)/t,_=(W.iMax-W.iMin)/n;y(W.rMin-z*O),p(W.rMax-z*O),v(W.iMin+B*_),D(W.iMax+B*_)},[t,n,m,M]),N=S(()=>{P.current=!1},[]),A=S(E=>{E.preventDefault();let W=E.deltaY>0?1.15:1/1.15,z=E.target.getBoundingClientRect(),B=E.clientX-z.left,O=E.clientY-z.top,{re:_,im:U}=I(B,O);y(_+(g-_)*W),p(_+(h-_)*W),v(U+(x-U)*W),D(U+(T-U)*W)},[I,g,h,x,T]),k=S(E=>{b&&b(M(E))},[b,M]),w=S(E=>{c&&c(M(E))},[c,M]),$=S(E=>{E.preventDefault(),f&&f(M(E))},[f,M]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:F,onMouseMove:R,onMouseUp:N,onMouseLeave:N,onWheel:A,onClick:k,onDblClick:w,onContextMenu:$})}function Wr(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 El(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,b=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,f=Wr(i,s,c),g=Wr(a,l,c);return{xScale:b,yScale:m,xTicks:f,yTicks:g,xMin:i,xMax:s,yMin:a,yMax:l}}function un(e,t,n,r){return q(()=>El(e,t,n,r),[e,t,n,r])}function Br(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Or(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 Hr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:b=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:f,yLabel:g,title:y,padding:h=50,animate:p=!1,multiLine:x}=e,v=q(()=>{let F=[...t];if(x)for(let R of x)F.push(...R.data);return F},[t,x]),T=un(v,n,r,h),{xScale:D,yScale:C,xTicks:P,yTicks:L}=T,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),b){for(let F=0;F<P.length;F++){let R=D(P[F]);I.push(o("line",{x1:R,y1:h,x2:R,y2:r-h,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${F}`}))}for(let F=0;F<L.length;F++){let R=C(L[F]);I.push(o("line",{x1:h,y1:R,x2:n-h,y2:R,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${F}`}))}}I.push(o("line",{x1:h,y1:r-h,x2:n-h,y2:r-h,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:h,y1:h,x2:h,y2:r-h,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let F=0;F<P.length;F++){let R=D(P[F]);I.push(o("line",{x1:R,y1:r-h,x2:R,y2:r-h+5,stroke:"#374151",key:`xtick-${F}`})),I.push(o("text",{x:R,y:r-h+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${R}, ${r-h+18})`,key:`xlabel-${F}`},Br(P[F])))}for(let F=0;F<L.length;F++){let R=C(L[F]);I.push(o("line",{x1:h-5,y1:R,x2:h,y2:R,stroke:"#374151",key:`ytick-${F}`})),I.push(o("text",{x:h-10,y:R+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${F}`},Br(L[F])))}function M(F,R,N,A,k,w,$,E,W,z){if(F.length===0)return;let B=[...F].sort((U,X)=>U.x-X.x);if(A){let U=C(T.yMin),X=B.map(j=>`${D(j.x)},${C(j.y)}`).join(" "),ee=D(B[0].x),Z=D(B[B.length-1].x),V=`${ee},${U} ${X} ${Z},${U}`;I.push(o("polygon",{points:V,fill:k,key:`${z}-area`}))}let _={points:B.map(U=>`${D(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:R,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${z}-line`};if(p?(_["stroke-dasharray"]="1000",_["stroke-dashoffset"]="1000",I.push(o("polyline",_,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",_)),w)for(let U=0;U<B.length;U++){let X=D(B[U].x),ee=C(B[U].y),Z=B[U].shape??W,V=B[U].radius??E,j=`${z}-pt-${U}`;if(p){let H=Or(Z,X,ee,V,$,j,{opacity:0});I.push(o("g",{key:`${j}-g`},H,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(Or(Z,X,ee,V,$,j))}}if(M(t,i,s,m,c,u,l,a,d,"primary"),x)for(let F=0;F<x.length;F++){let R=x[F];M(R.data,R.color,s,!1,"transparent",u,R.color,R.pointRadius??a,R.pointShape??d,`series-${F}`)}if(x&&x.length>0){let F=[],R=[{color:i,label:"Primary"},...x.map((O,_)=>({color:O.color,label:O.label??`Series ${_+1}`}))],N=h+10,A=16,k=22,w=7.2,$=14,E=6,W=n-h*2-20,z=0,B=0;for(let O=0;O<R.length;O++){let _=R[O].label.length*w,U=$+E+_;z>0&&z+U>W&&(z=0,B+=k);let X=N+z,ee=h-30-B;F.push(o("rect",{x:X,y:ee,width:$,height:14,fill:R[O].color,rx:2,key:`legend-rect-${O}`})),F.push(o("text",{x:X+$+E,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${O}`},R[O].label)),z+=U+A}I.push(o("g",{key:"legend"},...F))}return f&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},f)),g&&I.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"},g)),y&&I.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"},...I)}function Rl(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 Pl(e,t){let n=t??Rl(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 pn(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),b=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=st(e,t,n,l),c=st(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${b} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function fn(e,t){let n=t?.padAngle??0,r=Pl(e,t?.colors),i=e.reduce((u,b)=>u+b.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let b=e[u],m=b.value/i*a,c=d+n/2,f=c+m;l.push({label:b.label,value:b.value,startAngle:c,endAngle:f,percentage:b.value/i*100,color:r[u]}),d=f+n/2}return l}function _r(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:b,centerLabel:m,colors:c,strokeColor:f="#fff",strokeWidth:g=2,textColor:y="currentColor"}=e,h=d&&u==="right"?140:0,p=b?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-h,T=r-p-x,D=v/2,C=p+T/2,P=Math.min(v,T)/2-10,L=e.outerRadius??P,I=q(()=>fn(t,{padAngle:s,colors:c}),[t,s,c]),M=[];b&&M.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},b));for(let F=0;F<I.length;F++){let R=I[F],N=pn(D,C,i,L,R.startAngle,R.endAngle);if(M.push(o("path",{key:`slice-${F}`,d:N,fill:R.color,stroke:f,strokeWidth:g})),a||l){let A=(R.startAngle+R.endAngle)/2,k=R.percentage<5,w=k?L+14:i+(L-i)*.65,$=st(D,C,w,A-Math.PI/2),E=k?y:"#fff",W=k?11:12,z=[];if(a&&z.push(R.label),l&&z.push(`${R.percentage.toFixed(1)}%`),k){let B=st(D,C,L+2,A-Math.PI/2);M.push(o("line",{key:`connector-${F}`,x1:B.x,y1:B.y,x2:$.x,y2:$.y,stroke:"#999",strokeWidth:1}))}a&&M.push(o("text",{key:`label-${F}`,x:$.x,y:$.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W,fill:E,pointerEvents:"none"},R.label)),l&&M.push(o("text",{key:`value-${F}`,x:$.x,y:$.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W-1,fill:E,pointerEvents:"none"},`${R.percentage.toFixed(1)}%`))}}if(m&&i>0&&M.push(o("text",{key:"center-label",x:D,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let F=[];if(u==="right"){let R=v+10,N=p+20;for(let A=0;A<I.length;A++){let k=I[A],w=N+A*22;F.push(o("circle",{key:`legend-dot-${A}`,cx:R+6,cy:w,r:6,fill:k.color})),F.push(o("text",{key:`legend-text-${A}`,x:R+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let R=r-x+10;for(let N=0;N<I.length;N++){let A=I[N],k=N%2,w=Math.floor(N/2),$=k*(n/2)+10,E=R+w*22;F.push(o("circle",{key:`legend-dot-${N}`,cx:$+6,cy:E,r:6,fill:A.color})),F.push(o("text",{key:`legend-text-${N}`,x:$+18,y:E,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.percentage.toFixed(1)}%)`))}}M.push(...F)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...M)}function Yr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Vr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:b=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:f,onPointDoubleClick:g,onPointContextMenu:y,onPointHover:h}=e,[p,x]=G(r[1]),[v,T]=G(0),[D,C]=G(0),[P,L]=G(null),I=t/2+v,M=n/2+D,R=Math.min(t,n)/2-30,N=R/p,A=q(()=>{let V=Math.max(1,Math.ceil(p)),j=[],H=p/V;for(let Y=1;Y<=V;Y++)j.push(H*Y);return j},[p]),k=q(()=>{let V=[];for(let j=0;j<360;j+=30)V.push(j*Math.PI/180);return V},[]),w=q(()=>{if(!i||!l)return[];let V=a??2*Math.PI/s,j=it({start:0,end:2*Math.PI,step:V});return Ft(i,j)},[i,s,a,l]),[$,E]=G([]),W=te(null);re(()=>{if(!i||l){E([]);return}let V=a??2*Math.PI/s,j=it({start:0,end:2*Math.PI,step:V});return W.current&&W.current(),W.current=Nt(i,j,200,H=>{E([...H])}),()=>{W.current&&W.current()}},[i,s,a,l]);let z=l?w:$,B=q(()=>{if(z.length===0)return"";let V=[];for(let j=0;j<z.length;j++){let H=z[j],Y=H.output;if(Y<0||!isFinite(Y))continue;let{x:K,y:Q}=Yr(Y,H.input,I,M,N);V.push(`${V.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return V.join(" ")},[z,I,M,N]),O=S(V=>{L({x:V.clientX,y:V.clientY,px:v,py:D})},[v,D]),_=S(V=>{P&&(T(P.px+(V.clientX-P.x)),C(P.py+(V.clientY-P.y)))},[P]),U=S(()=>{L(null)},[]),X=S(V=>{V.preventDefault();let j=V.deltaY>0?1.15:1/1.15;x(Math.max(.1,p*j))},[p]),ee=S((V,j,H)=>{if(V)return Y=>V({r:j.r,theta:j.theta,index:H,event:Y})},[]),Z=[];if(Z.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let V=0;V<A.length;V++){let j=A[V]*N;Z.push(o("circle",{cx:I,cy:M,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${V}`})),Z.push(o("text",{x:I+j+2,y:M-4,"font-size":10,fill:"#9ca3af",key:`gl-${V}`},A[V].toFixed(1)))}for(let V=0;V<k.length;V++){let j=k[V],H=A[A.length-1]*N,Y=I+H*Math.cos(j),K=M-H*Math.sin(j);Z.push(o("line",{x1:I,y1:M,x2:Y,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${V}`}));let Q=Math.round(j*180/Math.PI),se=I+(H+14)*Math.cos(j),J=M-(H+14)*Math.sin(j);Z.push(o("text",{x:se,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${V}`},`${Q}\xB0`))}}Z.push(o("line",{x1:I-R,y1:M,x2:I+R,y2:M,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),Z.push(o("line",{x1:I,y1:M-R,x2:I,y2:M+R,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),B&&Z.push(o("path",{d:B,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let V=0;V<d.length;V++){let j=d[V],{x:H,y:Y}=Yr(j.r,j.theta,I,M,N);Z.push(o("circle",{cx:H,cy:Y,r:b,fill:m,key:`pt-${V}`,style:{cursor:"pointer"},onClick:ee(f,j,V),onDblClick:ee(g,j,V),onContextMenu:ee(y,j,V),onMouseEnter:ee(h,j,V)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:P?"grabbing":"grab"},onMouseDown:O,onMouseMove:_,onMouseUp:U,onMouseLeave:U,onWheel:X},...Z)}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 mn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function hn(e,t){let n=Ur(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=$l(n,Il(e,i,s,a))}r++}return n}function Ur(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function Il(e,t,n,r){let i=Ur(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function $l(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 bn(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 xn(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 mt(e,t=[],n=.3,r=1){let i=gn(e),s=mn(e),a=hn(e,t);return{vertices:i.map((d,u)=>{let b=bn(a,d),m=xn(b,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function ht(e){return e*(e-1)/2}function Wt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function jr(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,b=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=ht(t),f=1<<t,g=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Wt(f):e.vertexColors,[f,e.vertexColors]),[y,h]=G(()=>{let E=[];for(let W=0;W<c;W++)E.push(0);return E}),[p,x]=G(!1),v=te({x:0,y:0}),T=te([]),D=te(0);re(()=>{if(d===0)return;let E=!0,W=()=>{E&&(h(z=>{let B=z.slice();for(let O=0;O<B.length;O++)B[O]=(B[O]??0)+d*(1+O*.3);return B}),D.current=requestAnimationFrame(W))};return D.current=requestAnimationFrame(W),()=>{E=!1,cancelAnimationFrame(D.current)}},[d]);let C=q(()=>mt(t,y,l,m),[t,y,l,m]),P=n/2,L=r/2,I=q(()=>C.edges.map(E=>{let W=C.vertices[E.source],z=C.vertices[E.target],B=(W.depth+z.depth)/2;return{...E,avgDepth:B,sv:W,tv:z}}).sort((E,W)=>E.avgDepth-W.avgDepth),[C]),M=q(()=>C.vertices.slice().sort((E,W)=>E.depth-W.depth),[C]),F=S(E=>{let W=E;x(!0),v.current={x:W.clientX,y:W.clientY},T.current=y.slice()},[y]),R=S(E=>{if(!p)return;let W=E,z=(W.clientX-v.current.x)*.01,B=(W.clientY-v.current.y)*.01;h(()=>{let O=T.current.slice();return O.length>0&&(O[0]=(O[0]??0)+z),O.length>1&&(O[1]=(O[1]??0)+B),O})},[p]),N=S(()=>{x(!1)},[]),A=E=>{let W=(E+2)/4;return .3+.7*Math.max(0,Math.min(1,W))},k=E=>{let W=(E+2)/4;return .6+.4*Math.max(0,Math.min(1,W))},w=I.map((E,W)=>{let z=A(E.avgDepth);return o("line",{key:`e-${E.source}-${E.target}`,x1:String(P+E.sv.x),y1:String(L+E.sv.y),x2:String(P+E.tv.x),y2:String(L+E.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(z),"stroke-linecap":"round"})}),$=M.map(E=>{let W=i*k(E.depth),z=g[E.id%g.length]??"#3b82f6",B=[o("circle",{key:`v-${E.id}-circle`,cx:String(P+E.x),cy:String(L+E.y),r:String(W),fill:z,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&B.push(o("text",{key:`v-${E.id}-label`,x:String(P+E.x),y:String(L+E.y+W+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},E.id.toString(2).padStart(t,"0"))),B});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:b,cursor:p?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:R,onMouseUp:N,onMouseLeave:N},...w,...$.flat())}function Gr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=ht(t),[a,l]=G(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,b=0,m=()=>{u&&(l(c=>c.map((f,g)=>f+n*(1+g*.3))),b=requestAnimationFrame(m))};return b=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(b)}},[n]),{data:q(()=>mt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Xr(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:Dl(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?zl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,b=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=Tl(d,b,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function Dl(e,t){return"column"}function Tl(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 zl(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"}},Al(n),o("span",null,n.label))))}function Al(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 Ll(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 Fl(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function qr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;Ll(t),Fl();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function Kr(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:b,ariaLabel:m="Site footer"}=e;return o("footer",{className:b,role:"contentinfo","aria-label":m,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Qr=We({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Nl={width:600,height:400},Wl={x:30,y:30},Bl={top:0,left:0,width:1920,height:1080},yn=1e3;function Zr(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function Sn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function Jr(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function vn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function wn(e){let t=e.workspaceBounds??Bl,n=e.defaultWindowSize??Nl,r=e.cascadeOffset??Wl,[i,s]=G([]),a=S(((...F)=>{let R=F[0];s(N=>{if(N.find(B=>B.id===R.id)){let O=vn(N)+1,_=N.map(U=>U.id===R.id?{...U,focused:!0,zIndex:O,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return O>yn&&(_=Sn(_)),_}let k=R.size??n,w=R.position??Zr(N.length,r,t,k),E=vn(N)+1,W={id:R.id,title:R.title,icon:R.icon,position:w,size:k,windowState:"normal",zIndex:E,focused:!0,appProps:R.appProps},z=N.map(B=>({...B,focused:!1}));return z.push(W),E>yn&&(z=Sn(z)),e.onWindowOpen&&e.onWindowOpen(R.id),e.onFocusChange&&e.onFocusChange(R.id),z})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...F)=>{let R=F[0];v(N=>{if(N[R]){let A={...N};return delete A[R],A}return N}),D(N=>{if(N.has(R)){let A=new Map(N);return A.delete(R),A}return N}),s(N=>{let A=N.find(w=>w.id===R);if(!A)return N;let k=N.filter(w=>w.id!==R);if(A.focused&&k.length>0){let w=Jr(k,R);if(w){let $=k.map(E=>({...E,focused:E.id===w.id}));return e.onWindowClose&&e.onWindowClose(R),e.onFocusChange&&e.onFocusChange(w.id),$}}return e.onWindowClose&&e.onWindowClose(R),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...F)=>{let R=F[0];s(N=>{if(!N.find(E=>E.id===R))return N;let w=vn(N)+1,$=N.map(E=>E.id===R?{...E,focused:!0,zIndex:w}:{...E,focused:!1});return w>yn&&($=Sn($)),e.onFocusChange&&e.onFocusChange(R),$})}),[e.onFocusChange]),u=S(((...F)=>{let R=F[0];s(N=>{let A=N.find(w=>w.id===R);if(!A)return N;let k=N.map(w=>w.id===R?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=Jr(k,R);w?(k=k.map($=>({...$,focused:$.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),b=S(((...F)=>{let R=F[0];s(N=>N.map(A=>A.id===R?{...A,windowState:"maximized"}:A))}),[]),m=S(((...F)=>{let R=F[0];s(N=>N.map(A=>A.id===R?{...A,windowState:"normal"}:A))}),[]),c=S(((...F)=>{let R=F[0],N=F[1];s(A=>A.map(k=>k.id===R?{...k,position:N}:k))}),[]),f=S(((...F)=>{let R=F[0],N=F[1];s(A=>A.map(k=>k.id===R?{...k,size:N}:k))}),[]),g=S(((...F)=>{s(R=>{let N=R.filter(w=>w.windowState!=="minimized");if(N.length===0)return R;let A=N.length,k=new Map;if(A===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(A===2){let w=Math.floor(t.width/2);k.set(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(A===3){let w=Math.floor(t.width/2),$=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:$}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+$},size:{width:t.width-w,height:t.height-$}})}else{let w=Math.ceil(Math.sqrt(A)),$=Math.ceil(A/w),E=Math.floor(t.width/w),W=Math.floor(t.height/$);for(let z=0;z<N.length;z++){let B=Math.floor(z/w),O=z%w;k.set(N[z].id,{position:{x:t.left+O*E,y:t.top+B*W},size:{width:E,height:W}})}}return R.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,size:$.size,windowState:"normal"}:w})})}),[t]),y=S(((...F)=>{s(R=>{let N=R.filter(w=>w.windowState!=="minimized");if(N.length===0)return R;let A=[...N].sort((w,$)=>w.zIndex-$.zIndex),k=new Map;for(let w=0;w<A.length;w++){let $=Zr(w,r,t,A[w].size);k.set(A[w].id,{position:$,zIndex:w+1})}return R.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,zIndex:$.zIndex,windowState:"normal"}:w})})}),[r,t]),h=S(((...F)=>{s(R=>{let N=R.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),p=q(()=>{let F=i.find(R=>R.focused);return F?F.id:null},[i]),[x,v]=G({}),[T,D]=G(new Map),C=S(((...F)=>{let R=F[0],N=F[1];v(A=>({...A,[R]:N}))}),[]),P=S(((...F)=>{let R=F[0];v(N=>{let A={...N};return delete A[R],A})}),[]),L=q(()=>p&&x[p]?x[p]:null,[p,x]),I=S(((...F)=>{let R=F[0],N=F[1];D(A=>{let k=new Map(A),w=k.get(R);return k.set(R,{...w,...N}),k})}),[]),M=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:b,restoreWindow:m,moveWindow:c,resizeWindow:f,tileWindows:g,cascadeWindows:y,minimizeAll:h,focusedWindowId:p,setMenuBar:C,clearMenuBar:P,activeMenuBar:L,signalDock:I,dockSignals:T}),[i,a,l,d,u,b,m,c,f,g,y,h,p,C,P,L,I,T]);return o(Qr.Provider,{value:M},e.children)}function bt(){return Ae(Qr)}var ei=We({appId:""});function Xe(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(ei.Provider,{value:t},e.children)}function at(){return Ae(ei).appId}var ti=We({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function xt(e){let t=te([]),n=te([]),r=S(((...l)=>{let d=l[0],u=l[1],b=l[2],m=l[3]||"",c={channel:d,from:m,to:b||null,payload:u,timestamp:Date.now()},f=t.current;for(let y=0;y<f.length;y++){let h=f[y];h.channel===d&&(c.to&&h.appId!==c.to||!c.to&&h.appId===m||h.handler(c))}let g=n.current;for(let y=0;y<g.length;y++)g[y].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],b=l[2]||"",m={channel:d,handler:u,appId:b};return t.current=[...t.current,m],()=>{t.current=t.current.filter(c=>c!==m)}}),[]),s=S(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(b=>b!==u)}}),[]),a=q(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ti.Provider,{value:a},e.children)}function qe(){let e=Ae(ti),t=at(),n=S(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=S(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return q(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function yt(e,t){let n=qe(),r=te(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var ni=We({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function St(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=te(new Map),a=te(null),l=t!==null,d=S(((...f)=>{let g=f[0];n(g)}),[]),u=S(((...f)=>{if(a.current){let g=s.current.get(a.current);g&&g.onDragLeave&&g.onDragLeave(),a.current=null}n(null)}),[]),b=S(((...f)=>{let g=f[0],y=f[1];return s.current=new Map(s.current),s.current.set(g,y),()=>{s.current=new Map(s.current),s.current.delete(g),a.current===g&&(a.current=null)}}),[]);re(()=>{if(!l)return;let f=h=>{let p=h;i({x:p.clientX,y:p.clientY});let x=document.elementFromPoint(p.clientX,p.clientY);if(!x)return;let v=null,T=s.current;T.forEach((C,P)=>{let L=document.querySelector(`[data-dropzone-id="${P}"]`);L&&L.contains(x)&&(v=P)});let D=a.current;if(v!==D){if(D){let C=T.get(D);C&&C.onDragLeave&&C.onDragLeave()}if(v){let C=T.get(v);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=v}},g=h=>{let p=a.current;if(p&&t){let x=s.current.get(p);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=h=>{h.key==="Escape"&&u()};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",g),document.removeEventListener("keydown",y)}},[l,t,u]);let m=q(()=>({startDrag:d,cancelDrag:u,registerDropZone:b,currentDrag:t,isDragging:l}),[d,u,b,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(ni.Provider,{value:m},e.children,c)}function Qe(){return Ae(ni)}function vt(e,t){let n=Qe(),r=at(),i=te(t);i.current=t;let s=S(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return q(()=>({onMouseDown:s,isDragging:a}),[s,a])}function wt(e){let t=Qe(),[n,r]=G(!1),i=te(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=te(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 q(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var Ol=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Hl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(e){return e<10?"0"+String(e):String(e)}function _l(e,t,n){let r=e.getHours(),i=kn(e.getMinutes()),s=kn(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=kn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Yl(e){let t=Ol[e.getDay()],n=Hl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Vl(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce(),a=S(()=>{n()},[n]),l=S(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 Ul(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>_l(i,t,n),[i,t,n]),l=q(()=>Yl(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 jl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ce(),s=S(()=>{t.onClick&&t.onClick()},[t]),a=S(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 Gl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=S(()=>{t.onClick(),n()},[t,n]),l=S(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 Xl(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce(),[a,l]=G(!1),d=te(null),u=S(()=>{l(h=>!h)},[]),b=S(()=>{l(!1)},[]),m=S(h=>{let p=h;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l(x=>!x)),p.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let h=p=>{let x=d.current;x&&!x.contains(p.target)&&l(!1)};return document.addEventListener("click",h,!0),()=>{document.removeEventListener("click",h,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},f=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),g=o("span",{style:c,"aria-hidden":"true"},f),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((h,p)=>o(Gl,{key:String(p),item:h,onClose:b}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:m,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},g,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function ql(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ce(),[s,a]=G(!1),l=te(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),b=S(c=>{let f=c;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),a(g=>!g)),f.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=f=>{let g=l.current;g&&!g.contains(f.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,f)=>c.divider?o("div",{key:"div-"+String(f),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(f),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:b,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),m)}function Cn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:b=28,children:m}=e,c=String(b)+"px",f=[];if(n&&f.push(o(Vl,{key:"activities",label:n.label,onClick:n.onClick})),t&&f.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)f.push(o(ql,{key:"appmenu-"+String(v),menu:r.menus[v]}));let g=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...f),y=[];y.push(o(Ul,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let h=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),p=[];if(l&&l.length>0){let v=l.map(T=>o(jl,{key:T.id,indicator:T}));p.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&p.push(o(Xl,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...p);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},g,h,x)}function Kl(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var oi=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Zl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return oi[Math.abs(t)%oi.length]}function Jl(e){return e>99?"99+":String(e)}function Ql(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function ec(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 tc(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 nc(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,b=S(()=>{u||d(!0)},[u]),m=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),f=S(D=>{if(!u&&a){let C=D;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),g=`${n}px`,y=Kl(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:g,height:g,objectFit:"contain",display:"block"}}):o("span",{style:{width:g,height:g,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Zl(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),h=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Jl(t.badge)):null,p=t.active?o("span",{style:{...tc(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,v=l?o("div",{role:"tooltip",style:{position:"absolute",...ec(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,T={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:T,"aria-label":Ql(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:f,onMouseEnter:b,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,h,p,x,v)}function Mn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[b,m]=G(!s),c=te(null),f=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),g=S(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=S(T=>{let D=T,C=D.target,P=C.closest('[role="toolbar"]');if(!P)return;let L=Array.from(P.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(C);if(I<0)return;let M=n==="vertical",F=M?"ArrowDown":"ArrowRight",R=M?"ArrowUp":"ArrowLeft";if(D.key===F){D.preventDefault();let N=L[I+1];N&&N.focus()}else if(D.key===R){D.preventDefault();let N=L[I-1];N&&N.focus()}else D.key==="Home"?(D.preventDefault(),L[0]?.focus()):D.key==="End"?(D.preventDefault(),L[L.length-1]?.focus()):(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),C.click())},[n]),h=n==="vertical",p={display:"flex",flexDirection:h?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!b&&(r==="left"?(p.transform="translateX(-100%)",p.opacity="0"):r==="right"?(p.transform="translateX(100%)",p.opacity="0"):r==="top"?(p.transform="translateY(-100%)",p.opacity="0"):r==="bottom"&&(p.transform="translateY(100%)",p.opacity="0"));let x=[];for(let T=0;T<t.length;T++){if(a&&T===t.length-1&&t.length>1){let D=h?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};x.push(o("div",{key:`sep-${T}`,style:D,"aria-hidden":"true",role:"separator"}))}x.push(o(nc,{key:t[T].id,item:t[T],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!b?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:p,onMouseEnter:f,onMouseLeave:g,onKeyDown:y},v,...x,u??null)}var oc="#2c001e";function En(e){let{backgroundColor:t=oc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,b=S(p=>{let x=p;x.target===x.currentTarget&&a&&a()},[a]),m=S(p=>{let x=p;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{let p={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return p.backgroundColor=t,n&&(p.background=n),r&&i>=1&&(p.backgroundImage=`url(${r})`,p.backgroundSize="cover",p.backgroundPosition="center"),p},[t,n,r,i]),f=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),g={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];f&&y.push(o("div",{className:"desktop-background__image-overlay",style:f,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:g},u));let h=o("div",{className:"desktop-background",style:c,onClick:b,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Lt,{items:s},h):h}var rc={width:200,height:150},ic={x:50,y:50},sc={width:400,height:300},Me=8,Rn=20,ac={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=ic,defaultSize:s=sc,minSize:a=rc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:b="normal",focused:m=!0,zIndex:c,onClose:f,onMinimize:g,onMaximize:y,onFocus:h,onMove:p,onResize:x,children:v}=e,[T,D]=G(i.x),[C,P]=G(i.y),[L,I]=G(s.width),[M,F]=G(s.height),[R,N]=G(!1),[A,k]=G(!1),[w,$]=G(null),E=te(null),W=te(null),z=te(null),B=S((ne,fe)=>{let oe=Math.max(ne,a.width),ie=Math.max(fe,a.height);return l&&(oe=Math.min(oe,l.width),ie=Math.min(ie,l.height)),{width:oe,height:ie}},[a,l]),O=S(()=>{let ne=z.current;return ne&&ne.parentElement?{width:ne.parentElement.clientWidth,height:ne.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),_=S((ne,fe,oe,ie)=>{let ue=O(),he=Math.max(0,Math.min(ne,ue.width-oe)),be=Math.max(0,Math.min(fe,ue.height-ie));return{x:he,y:be}},[O]),U=S(ne=>{if(!u||b==="maximized")return;let fe=ne;fe.target.closest("button")||(fe.preventDefault(),E.current={startMouseX:fe.clientX,startMouseY:fe.clientY,startPosX:T,startPosY:C},N(!0))},[u,b,T,C]),X=S(ne=>{ne.target.closest("button")||y&&y()},[y]);re(()=>{if(!R)return;let ne=oe=>{let ie=oe,ue=E.current;if(!ue)return;let he=ie.clientX-ue.startMouseX,be=ie.clientY-ue.startMouseY,pe=ue.startPosX+he,ge=ue.startPosY+be,ye=O();pe=Math.max(0,Math.min(pe,ye.width-L)),ge=Math.max(0,Math.min(ge,ye.height-M)),D(pe),P(ge),ie.clientX<=Rn?$("left"):ie.clientX>=ye.width-Rn?$("right"):ie.clientY<=Rn?$("top"):$(null)},fe=oe=>{let ie=oe;N(!1);let ue=O();if(w==="left"){D(0),P(0),I(Math.floor(ue.width/2)),F(ue.height),$(null),p&&p({x:0,y:0}),x&&x({width:Math.floor(ue.width/2),height:ue.height});return}if(w==="right"){let be=Math.floor(ue.width/2);D(be),P(0),I(be),F(ue.height),$(null),p&&p({x:be,y:0}),x&&x({width:be,height:ue.height});return}if(w==="top"){$(null),y&&y();return}$(null);let he=E.current;if(he&&p){let be=ie.clientX-he.startMouseX,pe=ie.clientY-he.startMouseY,ge=he.startPosX+be,ye=he.startPosY+pe;ge=Math.max(0,Math.min(ge,ue.width-L)),ye=Math.max(0,Math.min(ye,ue.height-M)),p({x:ge,y:ye})}E.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",fe)}},[R,w,L,M,O,p,x,y]);let ee=S(ne=>fe=>{if(!d||b!=="normal")return;let oe=fe;oe.preventDefault(),oe.stopPropagation(),W.current={direction:ne,startMouseX:oe.clientX,startMouseY:oe.clientY,startPosX:T,startPosY:C,startWidth:L,startHeight:M},k(!0)},[d,b,T,C,L,M]);re(()=>{if(!A)return;let ne=oe=>{let ie=oe,ue=W.current;if(!ue)return;let he=ie.clientX-ue.startMouseX,be=ie.clientY-ue.startMouseY,pe=ue.direction,ge=ue.startWidth,ye=ue.startHeight,ve=ue.startPosX,De=ue.startPosY;pe.includes("e")&&(ge=ue.startWidth+he),pe.includes("w")&&(ge=ue.startWidth-he,ve=ue.startPosX+he),pe.includes("s")&&(ye=ue.startHeight+be),pe.includes("n")&&(ye=ue.startHeight-be,De=ue.startPosY+be);let ce=B(ge,ye);pe.includes("w")&&(ve=ue.startPosX+(ue.startWidth-ce.width)),pe.includes("n")&&(De=ue.startPosY+(ue.startHeight-ce.height)),I(ce.width),F(ce.height),D(ve),P(De)},fe=()=>{k(!1),x&&x({width:L,height:M}),W.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",fe)}},[A,L,M,B,x]),re(()=>{if(!m||!f)return;let ne=fe=>{fe.key==="Escape"&&f()};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[m,f]);let Z=S(ne=>{h&&h()},[h]);if(b==="minimized")return null;let V=b==="maximized",j=q(()=>{let ne={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:V?"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:V?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return V?(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"):(ne.top=`${C}px`,ne.left=`${T}px`,ne.width=`${L}px`,ne.height=`${M}px`),c!==void 0&&(ne.zIndex=String(c)),R&&(ne.cursor="grabbing",ne.userSelect="none"),ne},[V,T,C,L,M,c,m,R]),H=q(()=>{let ne={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&&!V?"grab":"default",opacity:m?"1":"0.6"};return R&&(ne.cursor="grabbing"),ne},[m,u,V,R]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},K={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let se=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:{...K,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:ne=>{ne.stopPropagation(),g&&g()}}),o("button",{type:"button","aria-label":V?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:ne=>{ne.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:ne=>{ne.stopPropagation(),f&&f()}}));Q.push(se);let J=[];if(d&&!V){let ne=["n","s","e","w","ne","nw","se","sw"];for(let fe=0;fe<ne.length;fe++){let oe=ne[fe],ie={position:"absolute",zIndex:"1"};oe==="n"?(ie.top="0",ie.left=`${Me}px`,ie.right=`${Me}px`,ie.height=`${Me}px`):oe==="s"?(ie.bottom="0",ie.left=`${Me}px`,ie.right=`${Me}px`,ie.height=`${Me}px`):oe==="e"?(ie.top=`${Me}px`,ie.right="0",ie.bottom=`${Me}px`,ie.width=`${Me}px`):oe==="w"?(ie.top=`${Me}px`,ie.left="0",ie.bottom=`${Me}px`,ie.width=`${Me}px`):oe==="ne"?(ie.top="0",ie.right="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="nw"?(ie.top="0",ie.left="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="se"?(ie.bottom="0",ie.right="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${Me}px`,ie.height=`${Me}px`),ie.cursor=ac[oe],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${oe}`,style:ie,onMouseDown:ee(oe)}))}}let ae=null;if(w){let ne={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"?(ne.top="0",ne.left="0",ne.width="50%",ne.height="100%"):w==="right"?(ne.top="0",ne.right="0",ne.width="50%",ne.height="100%"):w==="top"&&(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"),ae=o("div",{className:"draggable-window__snap-preview",style:ne})}let de=[];for(let ne=0;ne<J.length;ne++)de.push(J[ne]);de.push(o("div",{className:"draggable-window__title-bar",style:H,onMouseDown:U,onDblClick:X,role:"toolbar","aria-label":`${n} window controls`},...Q)),de.push(o("div",{className:"draggable-window__body",style:Y},v));let le=[o("div",{ref:z,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${b}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:Z},...de)];return ae&&le.push(ae),le.length===1?le[0]:o("div",{style:{display:"contents"}},...le)}var lc=["File","Edit","View","Insert","Format","Tools","Help"],ri={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},cc=[{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"}}],dc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],uc=["1","2","3","4","5","6","7"],pc={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 ii(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function Bt(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,b]=G(""),[m,c]=G(-1),[f,g]=G(0),[y,h]=G("3"),p=te(null),x=S(()=>{document.execCommand("bold",!1),n(Y=>!Y),p.current&&p.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(Y=>!Y),p.current&&p.current.focus()},[]),T=S(()=>{document.execCommand("underline",!1),a(Y=>!Y),p.current&&p.current.focus()},[]),D={bold:x,italic:v,underline:T},C={bold:t,italic:r,underline:s},P=S(Y=>{document.execCommand(Y,!1),p.current&&p.current.focus()},[]),L=S(Y=>{document.execCommand("fontSize",!1,Y),h(Y),p.current&&p.current.focus()},[]),I=S(Y=>{c(K=>K===Y?-1:Y)},[]),M=S(Y=>{switch(Y){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":p.current&&(p.current.innerHTML="",g(0));break;default:break}c(-1),p.current&&p.current.focus()},[]),F=S(()=>{if(p.current){let Y=p.current.textContent??"";g(ii(Y))}},[]),R=S(()=>{c(-1)},[]),N=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),A={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},k={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},$={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},E={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},W={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"},z=q(()=>fc(),[]),B=e.content??"Start typing...",O=ii(B),_=f>0?f:O;function U(Y){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===Y?"rgba(0,0,0,0.12)":l===Y?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let X={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},ee={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function Z(Y,K){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[Y]??!1?"rgba(0,0,0,0.12)":u===Y?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...K??{}}}let V={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"},H=lc.map((Y,K)=>{let Q=[Y];return m===K&&ri[Y]&&Q.push(o("div",{key:"dropdown",style:X,className:"word-processor__menu-dropdown"},...ri[Y].map((se,J)=>o("button",{key:String(J),style:ee,onClick:ae=>{ae.stopPropagation(),M(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(K),style:U(K),role:"menuitem","aria-label":Y,onClick:()=>I(K),onMouseEnter:()=>{d(K)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:A,role:"menubar"},...H),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:V,"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"}},...cc.map(Y=>o("button",{key:Y.id,style:Z(Y.id,Y.style),title:Y.shortcut?`${Y.label} (${Y.shortcut})`:Y.label,"aria-label":Y.label,"aria-pressed":String(C[Y.id]??!1),onClick:D[Y.id],onMouseEnter:()=>b(Y.id),onMouseLeave:()=>b("")},Y.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:j,"aria-label":"Font size",value:y,onChange:Y=>{let K=Y.target;L(K.value)}},...uc.map(Y=>o("option",{key:Y,value:Y},pc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...dc.map((Y,K)=>o("button",{key:String(K),style:Z(`align-${K}`),title:Y.label,"aria-label":Y.label,onClick:()=>P(Y.command),onMouseEnter:()=>b(`align-${K}`),onMouseLeave:()=>b("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...z),o("main",{className:"word-processor__document-area",style:$,onClick:R},o("div",{className:"word-processor__page",style:E,contentEditable:"true",ref:p,onInput:F,suppressContentEditableWarning:!0},B)),o("div",{className:"word-processor__status-bar",style:W},o("span",null,"Page 1 of 1"),o("span",null,`${_} words`),o("span",null,"100%")))}var gc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],si={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},ai=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],In={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},li=In["App.ts"],mc=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"]),hc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),ci="#569cd6",bc="#ce9178",xc="#4ec9b0",yc="#6a9955",Sc="#dcdcaa",Pn="#d4d4d4",vc="#d4d4d4",wc="#b5cea8";function kc(e){if(!e.trim())return[{text:"\xA0",color:Pn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:yc});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:bc}),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:wc}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=Pn;mc.has(i)?l=ci:hc.has(i)?l=xc:a?l=Sc:(i==="true"||i==="false")&&(l=ci),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:Pn}),n=r;continue}t.push({text:e[n],color:vc}),n++}return t}function Ot(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(li.length),u=te(null),b=S(H=>{n(H);let Y=In[H];Y&&d(Y.length)},[]),m=S(H=>{i(Y=>{let K={},Q=Object.keys(Y);for(let se=0;se<Q.length;se++)K[Q[se]]=Y[Q[se]];return K[H]=!Y[H],K})},[]),c=S(H=>{a(Y=>Y===H?-1:H)},[]),f=S(H=>{switch(H){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),g=S(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
8
- `);d(Math.max(Y.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),h={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},p={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...x,backgroundColor:"rgba(255,255,255,0.1)"},T={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"},D={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},C={flex:"1",display:"flex",overflow:"hidden"},P={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},M=(H,Y,K)=>({padding:"3px 8px",paddingLeft:`${12+H*16}px`,fontSize:"13px",cursor:"pointer",color:Y?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:K?"rgba(255,255,255,0.08)":"transparent"}),F={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},R={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},N={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},A={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},k={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},w={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},$={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},E={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},W={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},z=8,B=30,O=In[t]??li,_=O.map((H,Y)=>{let K=kc(H),Q=[],se=0;for(let J of K)Q.push(o("span",{key:String(se++),style:{color:J.color}},J.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,O.length),X=[];for(let H=0;H<U;H++)X.push(o("div",{key:String(H)},String(H+1)));let ee=H=>{if(!H.parent)return!0;if(!r[H.parent])return!1;let Y=ai.find(K=>K.name===H.parent&&K.isFolder);return Y?ee(Y):!0},Z=gc.map((H,Y)=>{let K=[H],Q=s===Y;return Q&&si[H]&&K.push(o("div",{key:"dropdown",style:T,className:"ide__menu-dropdown"},...si[H].map((se,J)=>o("button",{key:String(J),style:D,onClick:ae=>{ae.stopPropagation(),f(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":H,onClick:()=>c(Y)},...K)}),j=ai.map((H,Y)=>{if(!ee(H))return null;let K=!H.isFolder&&H.name===t,Q=H.isFolder?r[H.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:M(H.indent,H.isFolder,K),onClick:H.isFolder?()=>m(H.name):()=>b(H.name)},Q,H.name)}).filter(H=>H!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:h},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:p,role:"menubar"},...Z),o("div",{style:C},o("nav",{className:"ide__sidebar",style:P,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...j),o("div",{style:L}),o("div",{style:F},o("div",{style:R},o("button",{style:N,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...X),o("code",{style:w,contentEditable:"true",ref:u,onInput:g,suppressContentEditableWarning:!0},..._))),o("div",{className:"ide__minimap",style:$,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${z}px`,left:"0",right:"0",height:`${B}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...O.map((H,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:H.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,H.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:E},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:W},"\u2387 main"),o("span",{style:W},"0 errors"),o("span",{style:W},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:W},"Ln 1, Col 1"),o("span",{style:W},"UTF-8"),o("span",{style:W},"TypeScript"))))}var Cc=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],di=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],ui=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],pi=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],Mc=[{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}],Ec=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],fi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],gi=[{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}],mi=["09:30","10:00","10:30","11:00","11:30","12:00"];function Rc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Ct(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Oe(e){return e.toFixed(2)}var lt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},ct={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Ht={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Ie={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},$e={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},_t={cursor:"default",transition:"background-color 0.1s"};function Pc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,b)=>{let m=b/(e.length-1)*40,c=14-(u-i)/a*14;return`${m.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function Ic(e,t){let u=Math.min(...e),b=Math.max(...e),m=b-u||1,c=310/(e.length-1),f=e.map((C,P)=>{let L=40+P*c,I=15+(1-(C-u)/m)*120;return{x:L,y:I}}),g=f.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+f.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${f[f.length-1].x.toFixed(1)},135 Z`,h=[];for(let C=1;C<e.length;C++){let P=e[C]>=e[C-1]?"#00c853":"#ff1744";h.push(o("line",{key:String(C),x1:String(f[C-1].x.toFixed(1)),y1:String(f[C-1].y.toFixed(1)),x2:String(f[C].x.toFixed(1)),y2:String(f[C].y.toFixed(1)),stroke:P,strokeWidth:"2",strokeLinecap:"round"}))}let p=[];for(let C=0;C<5;C++){let P=15+C/4*120,L=b-C/4*m;p.push(o("line",{key:`g${C}`,x1:String(40),y1:String(P.toFixed(1)),x2:String(350),y2:String(P.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),p.push(o("text",{key:`yl${C}`,x:String(36),y:String((P+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Oe(L)))}let x=[],v=Math.min(mi.length,e.length),T=(e.length-1)/(v-1);for(let C=0;C<v;C++){let L=40+Math.round(C*T)*c;x.push(o("text",{key:`tl${C}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},mi[C]))}let D="chartGrad";return o("div",{style:lt},o("div",{style:ct},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Oe(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:D,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(#${D})`}),...p,...x,...h,o("line",{x1:String(40),y1:String((15+(1-(t-u)/m)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/m)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function $c(){let e=Math.max(...di.map(t=>t.qty),...ui.map(t=>t.qty));return o("div",{style:lt},o("div",{style:ct},"Order Book"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Bid Price"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Ask Price"),o("th",{style:Ie},"Qty"))),o("tbody",null,...di.map((t,n)=>{let r=ui[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:_t},o("td",{style:{...$e,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Oe(t.price)),o("td",{style:{...$e,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Ct(t.qty)),o("td",{style:{...$e,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Oe(r.price):""),o("td",{style:{...$e,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Ct(r.qty):""))}))))}function Dc(e){return o("div",{style:lt},o("div",{style:ct},"Watchlist"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Symbol"),o("th",{style:Ie},"Price"),o("th",{style:Ie},"Chg%"),o("th",{style:Ie},"Volume"))),o("tbody",null,...Cc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:_t},o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},t.symbol,Pc(t.spark,i)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(r)),o("td",{style:{...$e,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Oe(t.change)}%`),o("td",{style:{...$e,fontFamily:"monospace",color:"#8888aa"}},Rc(t.volume)))}))))}function Tc(){let e=pi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:lt},o("div",{style:ct},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Oe(e)}`)),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Symbol"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Avg"),o("th",{style:Ie},"P&L"))),o("tbody",null,...pi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{..._t,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...$e,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(n.avgPrice)),o("td",{style:{...$e,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Oe(n.pnl)}`))}))))}function zc(){return o("div",{style:lt},o("div",{style:ct},"Recent Trades"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Time"),o("th",{style:Ie},"Sym"),o("th",{style:Ie},"Side"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Price"))),o("tbody",null,...Mc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:_t},o("td",{style:{...$e,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...$e,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...$e,fontFamily:"monospace"}},Ct(e.qty)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(e.price)))}))))}function Ac(){let e=Math.max(...fi.map(n=>n.volume),...gi.map(n=>n.volume)),t="16px";return o("div",{style:lt},o("div",{style:ct},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...fi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Oe(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"}},Ct(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...gi.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"}},Oe(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"}},Ct(n.volume))))))}function Yt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);re(()=>{let f=setInterval(()=>{n(g=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(f)},[]),re(()=>{let f=()=>{let y=new Date,h=String(y.getHours()).padStart(2,"0"),p=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${h}:${p}:${x}`)};f();let g=setInterval(f,1e3);return()=>clearInterval(g)},[]),re(()=>{let f=setInterval(()=>{a(g=>!g)},800);return()=>clearInterval(f)},[]);let l=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},b={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},m=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:b},Ic(Ec,m),$c(),Dc(t),Tc(),zc(),Ac()))}var dt=["transparent","#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function $n(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:b,onGridToggle:m,onSearch:c}=e,[f,g]=G(""),y=S(P=>{let L=P.target.value;g(L),c(L)},[c]),h={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},p={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...p,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},T={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},D={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=dt.map(P=>{let L=P===r,I=P===i,M=()=>{L&&b?b(I?null:P):u(P)},F="1px solid rgba(0,0,0,0.15)";I?F="3px solid #ef4444":L&&(F="2px solid #3b82f6");let R=P==="transparent";return o("button",{key:P,title:R?"Transparent":P,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:R?"#ffffff":P,backgroundImage:R?"linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)":"none",backgroundSize:R?"6px 6px":"auto",backgroundPosition:R?"0 0, 3px 3px":"0 0",border:F,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:M,"aria-label":I?`Clear color filter ${P}`:`Select color ${P}`,"data-testid":`color-swatch-${P}`})});return o("div",{className:"board-toolbar",style:h,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:p,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:T}),o("button",{style:p,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:v,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:p,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:T}),...C,o("div",{style:T}),o("button",{style:n?x:p,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:T}),o("input",{type:"text",placeholder:"Search cards...",value:f,onInput:y,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var Dn={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},hi=dt,bi=[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Critical",value:"critical"}];function Tn(e){let{card:t,selected:n,onSelect:r,onMove:i,onResize:s,onDelete:a,onDoubleClick:l,onUpdate:d,onDragStart:u,onDuplicate:b,onChangeColor:m,onChangePriority:c,onAnchorDragStart:f,onCardContextMenu:g}=e,[y,h]=G(!1),[p,x]=G(!1),[v,T]=G(!1),[D,C]=G(t.title||""),[P,L]=G(t.description||""),I=te(null),M=te(null),F=te(null),R=te(null),N=te(null),A=t.priority?Dn[t.priority]||"#94a3b8":"transparent",{onMouseDown:k,isDragging:w}=vt("application/project-card",{id:t.id,title:t.title,description:t.description,color:t.color}),$=S(pe=>{let ge=pe;ge.preventDefault(),ge.stopPropagation(),g&&g(t.id,{x:ge.clientX,y:ge.clientY})},[t.id,g]);re(()=>{if(p&&R.current){let pe=R.current;pe.focus();let ge=pe.value.length;pe.setSelectionRange(ge,ge)}},[p]),re(()=>{if(v&&N.current){let pe=N.current;pe.focus();let ge=pe.value.length;pe.setSelectionRange(ge,ge)}},[v]);let E=S(pe=>{pe.preventDefault(),pe.stopPropagation(),C(t.title||""),x(!0)},[t.title]),W=S(pe=>{C(pe.target.value)},[]),z=S(()=>{let pe=D.trim();pe&&pe!==t.title&&d&&d(t.id,{title:pe}),x(!1)},[D,t.id,t.title,d]),B=S(pe=>{let ge=pe;ge.key==="Enter"?(ge.preventDefault(),z()):ge.key==="Escape"&&(ge.preventDefault(),x(!1))},[z]),O=S(()=>{z()},[z]),_=S(pe=>{pe.stopPropagation(),L(t.description||""),T(!0)},[t.description]),U=S(pe=>{L(pe.target.value)},[]),X=S(()=>{P!==t.description&&d&&d(t.id,{description:P}),T(!1)},[P,t.id,t.description,d]),ee=S(pe=>{let ge=pe;ge.key==="Escape"&&(ge.preventDefault(),X())},[X]),Z=S(()=>{X()},[X]),V=S((pe,ge)=>{let ye=ge;if(ye.preventDefault(),ye.stopPropagation(),f){let ve=t.position.x+t.size.width/2,De=t.position.y+t.size.height/2,ce=ve,me=De;pe==="top"?(ce=ve,me=t.position.y):pe==="bottom"?(ce=ve,me=t.position.y+t.size.height):pe==="left"?(ce=t.position.x,me=De):pe==="right"&&(ce=t.position.x+t.size.width,me=De),f(t.id,pe,ce,me)}},[t.id,t.position,t.size,f]),j=S(pe=>{let ge=pe,ye=ge.target;if(ye.dataset&&(ye.dataset.role==="delete"||ye.dataset.role==="resize"||ye.dataset.role==="anchor"||ye.dataset.role==="drag-handle"||ye.dataset.role==="inline-edit"))return;ge.preventDefault(),ge.stopPropagation(),r(t.id),I.current={x:ge.clientX,y:ge.clientY,cardX:t.position.x,cardY:t.position.y};let ve=ce=>{let me=ce;if(!I.current)return;let ke=me.clientX-I.current.x,Ee=me.clientY-I.current.y;i(t.id,{x:I.current.cardX+ke,y:I.current.cardY+Ee})},De=()=>{I.current=null,document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",De)};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",De),u&&u(t.id,pe)},[t.id,t.position.x,t.position.y,r,i,u]),H=S(pe=>{let ge=pe;ge.preventDefault(),ge.stopPropagation(),M.current={x:ge.clientX,y:ge.clientY,w:t.size.width,h:t.size.height};let ye=De=>{let ce=De;if(!M.current)return;let me=ce.clientX-M.current.x,ke=ce.clientY-M.current.y,Ee=Math.max(120,M.current.w+me),ze=Math.max(80,M.current.h+ke);s(t.id,{width:Ee,height:ze})},ve=()=>{M.current=null,document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",ve)};document.addEventListener("mousemove",ye),document.addEventListener("mouseup",ve)},[t.id,t.size.width,t.size.height,s]),Y=S(pe=>{pe.preventDefault(),pe.stopPropagation()},[]),K=S(pe=>{pe.preventDefault(),pe.stopPropagation(),a(t.id)},[t.id,a]),Q={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:"6px",borderLeft:`4px solid ${A}`,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"},se={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},J={fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},ae={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:y?"block":"none",border:"none",padding:"0"},de={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},le=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((pe,ge)=>o("span",{key:String(ge),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},pe))):null,ne=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.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,fe={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:w?"rgba(59,130,246,0.4)":"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:y?"block":"none",border:"none",padding:"0"},oe={position:"absolute",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #ffffff",cursor:"crosshair",display:y?"block":"none",zIndex:"10",boxSizing:"border-box"},ie={...oe,top:"-5px",left:"50%",transform:"translateX(-50%)"},ue={...oe,top:"50%",right:"-5px",transform:"translateY(-50%)"},he={...oe,bottom:"-5px",left:"50%",transform:"translateX(-50%)"},be={...oe,top:"50%",left:"-5px",transform:"translateY(-50%)"};return o("div",{ref:F,className:"board-card",style:Q,onMouseDown:j,onDblClick:Y,onContextMenu:$,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),"data-card-id":t.id,"data-testid":`card-${t.id}`,role:"button","aria-label":`Card: ${t.title}`,tabIndex:0},p?o("input",{ref:R,type:"text",value:D,onInput:W,style:{...se,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",padding:"0",margin:"0",fontFamily:"inherit",boxSizing:"border-box"},"data-role":"inline-edit","data-testid":`card-title-input-${t.id}`,onKeyDown:B,onBlur:O,onMouseDown:pe=>pe.stopPropagation()}):o("div",{style:se,onDblClick:E,"data-testid":`card-title-${t.id}`},t.title||"Untitled"),v?o("textarea",{ref:N,value:P,onInput:U,style:{...J,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",padding:"0",margin:"0",fontFamily:"inherit",resize:"none",boxSizing:"border-box"},"data-role":"inline-edit","data-testid":`card-desc-input-${t.id}`,onKeyDown:ee,onBlur:Z,onMouseDown:pe=>pe.stopPropagation()}):o("div",{style:J,onClick:_,"data-testid":`card-desc-${t.id}`},t.description||""),le,ne,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.id}`,onMouseDown:pe=>{pe.stopPropagation(),k(pe)},"aria-label":`Export drag handle for ${t.title}`,title:"Drag to export card"},"\u2630"),o("button",{style:ae,"data-role":"delete","data-testid":`card-delete-${t.id}`,onClick:K,"aria-label":`Delete ${t.title}`,tabIndex:-1},"\xD7"),o("div",{style:de,"data-role":"resize",onMouseDown:H,"aria-label":"Resize card"}),o("div",{style:ie,"data-role":"anchor","data-anchor":"top","data-testid":`anchor-top-${t.id}`,onMouseDown:pe=>V("top",pe),"aria-label":"Connection anchor top"}),o("div",{style:ue,"data-role":"anchor","data-anchor":"right","data-testid":`anchor-right-${t.id}`,onMouseDown:pe=>V("right",pe),"aria-label":"Connection anchor right"}),o("div",{style:he,"data-role":"anchor","data-anchor":"bottom","data-testid":`anchor-bottom-${t.id}`,onMouseDown:pe=>V("bottom",pe),"aria-label":"Connection anchor bottom"}),o("div",{style:be,"data-role":"anchor","data-anchor":"left","data-testid":`anchor-left-${t.id}`,onMouseDown:pe=>V("left",pe),"aria-label":"Connection anchor left"}))}function zn(e){let{card:t,onSave:n,onClose:r}=e,[i,s]=G(t.title),[a,l]=G(t.description),d=te(null),u=te(null);re(()=>{d.current&&(d.current.focus(),d.current.select())},[]);let b=S(()=>{n(t.id,{title:i,description:a}),r()},[t.id,i,a,n,r]),m=S(D=>{D.key==="Escape"&&b()},[b]),c=S(D=>{D.target===u.current&&b()},[b]),f=S(D=>{s(D.target.value)},[]),g=S(D=>{l(D.target.value)},[]),y=S(D=>{let C=D;if(C.key==="Tab"){C.preventDefault();let P=C.target.parentElement?.querySelector("textarea");P&&P.focus()}C.key==="Escape"&&b()},[b]),h={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"},p={backgroundColor:t.color||"#fef9c3",borderRadius:"8px",padding:"16px",width:`${Math.max(t.size.width,200)}px`,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",gap:"8px"},x={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"14px",fontWeight:"600",backgroundColor:"rgba(255,255,255,0.7)",color:"#1a1a1a",outline:"none",width:"100%",boxSizing:"border-box"},v={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"12px",backgroundColor:"rgba(255,255,255,0.7)",color:"#333",outline:"none",resize:"vertical",minHeight:"60px",width:"100%",boxSizing:"border-box",fontFamily:"inherit"},T={padding:"6px 14px",border:"none",borderRadius:"4px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"12px",fontWeight:"600",alignSelf:"flex-end"};return o("div",{ref:u,className:"card-editor-overlay",style:h,onClick:c,onKeyDown:m,"data-testid":"card-editor-overlay"},o("div",{style:p,"data-testid":"card-editor",role:"dialog","aria-label":`Edit card: ${t.title}`},o("input",{ref:d,type:"text",value:i,onInput:f,onKeyDown:y,style:x,placeholder:"Card title","data-testid":"card-editor-title","aria-label":"Card title"}),o("textarea",{value:a,onInput:g,onKeyDown:m,style:v,placeholder:"Description...","data-testid":"card-editor-description","aria-label":"Card description"}),o("button",{style:T,onClick:b,"data-testid":"card-editor-save"},"Done")))}function xi(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}function Lc(e){switch(e){case"dashed":return"8,4";case"dotted":return"2,4";default:return"none"}}function An(e){let{connections:t,cards:n,selectedConnectionId:r,onSelectConnection:i,canvasWidth:s,canvasHeight:a}=e,l=new Map;for(let m=0;m<n.length;m++)l.set(n[m].id,n[m]);let d=S(m=>{i(m)},[i]),u=[];for(let m=0;m<t.length;m++){let c=t[m],f=l.get(c.fromCardId),g=l.get(c.toCardId);if(!f||!g)continue;let y=xi(f),h=xi(g),p=c.id===r,x=p?"#3b82f6":"#94a3b8",v=Lc(c.style),T=h.x-y.x,D=h.y-y.y,C=Math.sqrt(T*T+D*D),P=Math.min(40,C*.15),L=C>0?-D/C:0,I=C>0?T/C:0,M=(y.x+h.x)/2,F=(y.y+h.y)/2,R=M+L*P,N=F+I*P,A=`M ${y.x} ${y.y} Q ${R} ${N} ${h.x} ${h.y}`;u.push(o("path",{key:`hit-${c.id}`,d:A,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(c.id),"data-testid":`connection-hit-${c.id}`})),u.push(o("path",{key:c.id,d:A,fill:"none",stroke:x,"stroke-width":p?"3":"2","stroke-dasharray":v,"pointer-events":"none","data-testid":`connection-${c.id}`})),c.label&&u.push(o("text",{key:`label-${c.id}`,x:String(R),y:String(N-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none"},c.label))}return o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(s),height:String(a),className:"connections-overlay","data-testid":"connections-overlay",role:"img","aria-label":"Card connections"},o("g",{style:{pointerEvents:"auto"}},...u))}var ut=20,pt=5e3;function Si(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Ln(e,t,n,r){let i=r??40;if(e.length===0)return{panX:0,panY:0,zoom:1};let s=1/0,a=1/0,l=-1/0,d=-1/0;for(let h=0;h<e.length;h++){let p=e[h];p.position.x<s&&(s=p.position.x),p.position.y<a&&(a=p.position.y);let x=p.position.x+p.size.width,v=p.position.y+p.size.height;x>l&&(l=x),v>d&&(d=v)}let u=l-s+i*2,b=d-a+i*2,m=t/u,c=n/b,f=Math.max(.25,Math.min(4,Math.min(m,c))),g=-s*f+(t-(l-s)*f)/2,y=-a*f+(n-(d-a)*f)/2;return{panX:g,panY:y,zoom:f}}var yi=0;function Fc(){return yi++,`conn-${Date.now()}-${yi}`}function Fn(e){let{state:t,dispatch:n,searchQuery:r,gridEnabled:i,selectedCardId:s,onSelectCard:a,colorFilter:l,showConnections:d}=e,u=d!==!1,{cards:b,connections:m,viewport:c}=t,[f,g]=G(null),[y,h]=G(null),[p,x]=G(null),[v,T]=G(!1),[D,C]=G(!1),P=te(null),L=te(!1),I=te(null),[M,F]=G(null),R=te(M);R.current=M;let N=S(ce=>{let me=ce;if(me.target.closest(".board-card"))return;let Ee=me.button===1,ze=me.button===0&&me.shiftKey;Ee||ze?(me.preventDefault(),L.current=!0,I.current={x:me.clientX,y:me.clientY,panX:c.panX,panY:c.panY}):me.button===0&&(a(null),h(null))},[c.panX,c.panY,a]);re(()=>{let ce=ke=>{if(!L.current||!I.current)return;let Ee=ke,ze=Ee.clientX-I.current.x,Fe=Ee.clientY-I.current.y;n({type:"PAN",panX:I.current.panX+ze,panY:I.current.panY+Fe})},me=()=>{L.current=!1,I.current=null};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me)}},[n]);let A=S(ce=>{let me=ce;if(!me.ctrlKey)return;me.preventDefault();let ke=me.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+ke})},[c.zoom,n]),k=te(null);re(()=>{let ce=P.current;if(!ce)return;let me=Ne=>{let Te=[];for(let Re=0;Re<Ne.touches.length;Re++)Te.push({x:Ne.touches[Re].clientX,y:Ne.touches[Re].clientY});return Te},ke=(Ne,Te)=>Math.sqrt((Ne.x-Te.x)**2+(Ne.y-Te.y)**2),Ee=Ne=>{let Te=Ne;if(Te.touches.length===2){Te.preventDefault();let Re=me(Te);k.current={touches:Re,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:ke(Re[0],Re[1])}}},ze=Ne=>{let Te=Ne;if(Te.touches.length!==2||!k.current)return;Te.preventDefault();let Re=me(Te),Ye=k.current,Ms=(Ye.touches[0].x+Ye.touches[1].x)/2,Es=(Ye.touches[0].y+Ye.touches[1].y)/2,Rs=(Re[0].x+Re[1].x)/2,Ps=(Re[0].y+Re[1].y)/2,Is=Rs-Ms,$s=Ps-Es;n({type:"PAN",panX:Ye.panX+Is,panY:Ye.panY+$s});let Ds=ke(Re[0],Re[1]);if(Ye.dist>0){let Ts=Ds/Ye.dist;n({type:"ZOOM",zoom:Ye.zoom*Ts})}},Fe=()=>{k.current=null};return ce.addEventListener("touchstart",Ee,{passive:!1}),ce.addEventListener("touchmove",ze,{passive:!1}),ce.addEventListener("touchend",Fe),()=>{ce.removeEventListener("touchstart",Ee),ce.removeEventListener("touchmove",ze),ce.removeEventListener("touchend",Fe)}},[c.panX,c.panY,c.zoom,n]),re(()=>{let ce=me=>{let ke=me;(ke.key==="Delete"||ke.key==="Backspace")&&(y?(n({type:"REMOVE_CONNECTION",connectionId:y}),h(null)):s&&(n({type:"REMOVE_CARD",cardId:s}),a(null)))};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[y,s,n,a]);let w=S(ce=>{a(ce),h(null)},[a]),$=S((ce,me)=>{let ke=me;i&&(ke={x:Math.round(me.x/ut)*ut,y:Math.round(me.y/ut)*ut}),n({type:"MOVE_CARD",cardId:ce,position:ke})},[n,i]),E=S((ce,me)=>{n({type:"RESIZE_CARD",cardId:ce,size:me})},[n]),W=S(ce=>{n({type:"REMOVE_CARD",cardId:ce}),s===ce&&a(null)},[n,s,a]),z=S(ce=>{},[]),B=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:me})},[n]),O=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:me})},[n]),_=S(()=>{g(null)},[]),U=S(ce=>{h(ce),a(null)},[a]),X=S(ce=>{n({type:"REMOVE_CONNECTION",connectionId:ce}),h(null)},[n]),ee=S(ce=>{let me=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:ce,newId:me})},[n]),Z=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:{color:me}})},[n]),V=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:{priority:me}})},[n]),j=S((ce,me)=>{x({cardId:ce,x:me.x,y:me.y}),T(!1),C(!1)},[]),H=S(()=>{x(null),T(!1),C(!1)},[]);re(()=>{if(!p)return;let ce=()=>{H()},me=setTimeout(()=>{document.addEventListener("click",ce),document.addEventListener("contextmenu",ce)},0);return()=>{clearTimeout(me),document.removeEventListener("click",ce),document.removeEventListener("contextmenu",ce)}},[p,H]);let Y=S(ce=>{if(ce.stopPropagation(),p){let me=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:p.cardId,newId:me})}H()},[p,n,H]),K=S(ce=>{ce.stopPropagation(),p&&(n({type:"REMOVE_CARD",cardId:p.cardId}),s===p.cardId&&a(null)),H()},[p,n,s,a,H]),Q=S(()=>{T(!0),C(!1)},[]),se=S(()=>{C(!0),T(!1)},[]),J=S(ce=>{p&&n({type:"UPDATE_CARD",cardId:p.cardId,updates:{color:ce}}),H()},[p,n,H]),ae=S(ce=>{p&&n({type:"UPDATE_CARD",cardId:p.cardId,updates:{priority:ce}}),H()},[p,n,H]),de=S((ce,me,ke,Ee)=>{F({fromCardId:ce,fromAnchor:me,fromX:ke,fromY:Ee,toX:ke,toY:Ee})},[]);re(()=>{if(!R.current)return;let ce=ke=>{let Ee=ke;if(!R.current)return;let ze=Si(Ee.clientX,Ee.clientY,c);F(Fe=>Fe?{...Fe,toX:ze.x,toY:ze.y}:null)},me=ke=>{let Ee=ke;if(!R.current)return;let ze=R.current,Fe=Ee.target,Ne=Fe.closest?Fe.closest("[data-anchor]"):null,Te=Fe.closest?Fe.closest("[data-card-id]"):null;if(Ne&&Te){let Re=Te.getAttribute("data-card-id");Re&&Re!==ze.fromCardId&&n({type:"ADD_CONNECTION",connection:{id:Fc(),fromCardId:ze.fromCardId,toCardId:Re}})}F(null)};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me)}},[M,c,n]);let le=r.toLowerCase(),ne=le?b.filter(ce=>ce.title.toLowerCase().includes(le)):b,fe=new Set;if(le)for(let ce=0;ce<b.length;ce++)b[ce].title.toLowerCase().includes(le)||fe.add(b[ce].id);if(l)for(let ce=0;ce<b.length;ce++)b[ce].color!==l&&fe.add(b[ce].id);let oe={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:L.current?"grabbing":"default",backgroundImage:"radial-gradient(circle, #d1d5db 1px, transparent 1px)",backgroundSize:`${ut}px ${ut}px`},ie={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${pt}px`,height:`${pt}px`},ue=b.map(ce=>{let me=fe.has(ce.id),ke=o(Tn,{key:ce.id,card:ce,selected:ce.id===s,onSelect:w,onMove:$,onResize:E,onDelete:W,onDoubleClick:z,onUpdate:B,onDuplicate:ee,onChangeColor:Z,onChangePriority:V,onAnchorDragStart:de,onCardContextMenu:j});return me?o("div",{key:`dim-${ce.id}`,style:{opacity:"0.3"}},ke):ke}),he=f?b.find(ce=>ce.id===f):null,be=he?o(zn,{card:he,onSave:O,onClose:_}):null,pe=M?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"5"},width:String(pt),height:String(pt),"data-testid":"connection-drag-line"},o("line",{x1:String(M.fromX),y1:String(M.fromY),x2:String(M.toX),y2:String(M.toY),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6,4","pointer-events":"none"})):null,ge={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"},ve=p?b.find(ce=>ce.id===p.cardId):null,De=p?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${p.x}px`,top:`${p.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":`context-menu-${p.cardId}`,role:"menu","aria-label":"Card context menu"},o("div",{style:ge,onClick:Y,role:"menuitem","data-testid":`context-menu-duplicate-${p.cardId}`},"Duplicate"),o("div",{style:ge,onClick:K,role:"menuitem","data-testid":`context-menu-delete-${p.cardId}`},"Delete"),o("div",{style:{...ge,position:"relative"},onMouseEnter:Q,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-color-${p.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),v?o("div",{style:ye,role:"menu","data-testid":`context-submenu-color-${p.cardId}`},...hi.map(ce=>o("div",{key:ce,style:{...ge,gap:"8px"},onClick:me=>{me.stopPropagation(),J(ce)},role:"menuitem","data-testid":`context-color-${ce}`},o("span",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:ce,border:"1px solid rgba(0,0,0,0.15)",display:"inline-block",flexShrink:"0"}}),ve&&ce===ve.color?"\u2713":""))):null),o("div",{style:{...ge,position:"relative"},onMouseEnter:se,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-priority-${p.cardId}`},"Set Priority",o("span",{style:{marginLeft:"8px"}},"\u25B6"),D?o("div",{style:ye,role:"menu","data-testid":`context-submenu-priority-${p.cardId}`},...bi.map(ce=>o("div",{key:ce.value,style:{...ge,gap:"8px"},onClick:me=>{me.stopPropagation(),ae(ce.value)},role:"menuitem","data-testid":`context-priority-${ce.value}`},o("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:Dn[ce.value]||"#94a3b8",display:"inline-block",flexShrink:"0"}}),ce.label,ve&&ce.value===ve.priority?" \u2713":""))):null)):null;return o("div",{ref:P,className:"board-canvas",style:oe,onMouseDown:N,onWheel:A,"data-testid":"board-canvas",role:"application","aria-label":"Project board canvas",tabIndex:0},o("div",{className:"board-canvas__inner",style:ie,"data-testid":"board-canvas-inner"},u?o(An,{connections:m,cards:b,selectedConnectionId:y,onSelectConnection:U,onDeleteConnection:X,canvasWidth:pt,canvasHeight:pt}):null,pe,...ue),be,De)}var vi=50,Vt={id:crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:"Untitled",cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}};function wi(e,t){switch(t.type){case"ADD_CARD":return{...e,cards:[...e.cards,t.card]};case"REMOVE_CARD":return{...e,cards:e.cards.filter(n=>n.id!==t.cardId),connections:e.connections.filter(n=>n.fromCardId!==t.cardId&&n.toCardId!==t.cardId)};case"MOVE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,position:t.position,updatedAt:Date.now()}:n)};case"RESIZE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,size:t.size,updatedAt:Date.now()}:n)};case"UPDATE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,...t.updates,updatedAt:Date.now()}:n)};case"DUPLICATE_CARD":{let n=e.cards.find(s=>s.id===t.cardId);if(!n)return e;let r=t.offset||{x:20,y:20},i={...n,id:t.newId,position:{x:n.position.x+r.x,y:n.position.y+r.y},createdAt:Date.now(),updatedAt:Date.now()};return{...e,cards:[...e.cards,i]}}case"ADD_CONNECTION":return{...e,connections:[...e.connections,t.connection]};case"REMOVE_CONNECTION":return{...e,connections:e.connections.filter(n=>n.id!==t.connectionId)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;default:return e}}function Nc(e){return e.type==="PAN"||e.type==="ZOOM"}function ki(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=wi(e.present,t.action);if(n===e.present)return e;if(Nc(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>vi&&r.splice(0,r.length-vi),{past:r,present:n,future:[]}}default:return e}}function Nn(e,t){let n={past:[],present:Vt,future:[]},[r,i]=en(ki,n),s=S(m=>{i({type:"BOARD_ACTION",action:m})},[i]),a=S(()=>{i({type:"UNDO"})},[i]),l=S(()=>{i({type:"REDO"})},[i]),d=te(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{s({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,s]);let u=te(null),b=te(r.present);return b.current=r.present,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,b.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,r.present]),{state:r.present,dispatch:s,undo:a,redo:l,canUndo:r.past.length>0,canRedo:r.future.length>0}}var Ci={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}},Mt=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):Ci}catch{return Ci}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Wn(e){let{cards:t,onCardDropped:n,children:r}=e,i=qe(),s=te([]);re(()=>{let u=s.current,b=new Set(u.map(c=>c.id)),m=new Set(t.map(c=>c.id));for(let c of t)b.has(c.id)||i.publish("project-board",{event:"card-created",card:c});for(let c of u)m.has(c.id)||i.publish("project-board",{event:"card-deleted",cardId:c.id});for(let c of t)if(b.has(c.id)){let f=u.find(g=>g.id===c.id);f&&f.updatedAt!==c.updatedAt&&i.publish("project-board",{event:"card-updated",card:c})}s.current=t},[t,i]);let a=S(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let b=u.data;n(String(b.title||"Dropped Item"),String(b.description||""))}},[n]),{isOver:l}=wt({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 Mi=0;function Ei(){return Mi++,`card-${Date.now()}-${Mi}`}var Wc=new Mt,Bc=[{id:"sample-1",title:"Auth API",description:"Design the auth flow",color:"#3b82f6",position:{x:50,y:50},size:{width:180,height:120},priority:"high",assignee:"Alice",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-2",title:"Dashboard",description:"Build the main dashboard",color:"#22c55e",position:{x:300,y:80},size:{width:180,height:120},priority:"medium",assignee:"Bob",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-3",title:"Deploy",description:"Set up CI pipeline",color:"#f59e0b",position:{x:150,y:250},size:{width:180,height:120},priority:"low",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-4",title:"Docs",description:"Write API reference",color:"#a855f7",position:{x:400,y:280},size:{width:180,height:120},priority:"medium",assignee:"Carol",createdAt:Date.now(),updatedAt:Date.now()}],Oc={id:"sample-board-001",name:"Sample Project",cards:Bc,connections:[{id:"sample-conn-1",fromCardId:"sample-1",toCardId:"sample-2"}],viewport:{panX:0,panY:0,zoom:1}};function Hc(e){return e.cards.length===0&&e.connections.length===0}function Ri(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Nn(Wc,t),[d,u]=G(dt[0]),[b,m]=G(!1),[c,f]=G(""),[g,y]=G(null),[h,p]=G(null),[x,v]=G(!0),[T,D]=G(n.name||"Untitled"),[C,P]=G(!1),[L,I]=G(""),M=te(!1);re(()=>{!M.current&&Hc(n)?(M.current=!0,r({type:"SET_BOARD",state:Oc})):n.cards.length>0&&(M.current=!0)},[n,r]);let F=S(()=>{let le=(-n.viewport.panX+300)/n.viewport.zoom,ne=(-n.viewport.panY+200)/n.viewport.zoom,fe=(Math.random()-.5)*300,oe=(Math.random()-.5)*200,ie={id:Ei(),title:"New Card",description:"",color:d,position:{x:Math.round(le+fe),y:Math.round(ne+oe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:ie})},[n.viewport,d,r]),R=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),N=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),A=S(()=>{r({type:"ZOOM",zoom:1})},[r]),k=S(()=>{m(le=>!le)},[]),w=S(le=>{f(le)},[]),$=S(le=>{y(le)},[]),E=S(le=>{p(le)},[]),W=S(()=>{r({type:"SET_BOARD",state:Vt}),y(null)},[r]),z=S(()=>{let le=JSON.stringify(n,null,2),ne=new Blob([le],{type:"application/json"}),fe=URL.createObjectURL(ne),oe=document.createElement("a");oe.href=fe,oe.download=`board-${t}.json`,oe.style.display="none",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(fe)},[n,t]),B=S(()=>{let le=document.createElement("input");le.type="file",le.accept=".json,application/json",le.style.display="none",le.addEventListener("change",()=>{let ne=le.files&&le.files[0];if(!ne)return;let fe=new FileReader;fe.onload=()=>{try{let oe=JSON.parse(fe.result);oe&&oe.cards&&oe.viewport&&r({type:"SET_BOARD",state:oe})}catch{}},fe.readAsText(ne)}),document.body.appendChild(le),le.click(),document.body.removeChild(le)},[r]),O=S(()=>{window.print()},[]),_=S(()=>{n.cards.length>0&&y(n.cards[0].id)},[n.cards]),U=S(()=>{v(le=>!le)},[]),X=S(()=>{g&&(r({type:"REMOVE_CARD",cardId:g}),y(null))},[g,r]),ee=S(()=>{if(n.cards.length===0)return;let fe=Ln(n.cards,800,600);r({type:"PAN",panX:fe.panX,panY:fe.panY}),r({type:"ZOOM",zoom:fe.zoom})},[n.cards,r]),Z=S(()=>{I(T),P(!0)},[T]),V=S(()=>{let le=L.trim();le&&D(le),P(!1)},[L]),j=S(()=>{P(!1)},[]),H=S(le=>{I(le.target.value)},[]),Y=S(le=>{let ne=le;ne.key==="Enter"&&(ne.preventDefault(),V()),ne.key==="Escape"&&(ne.preventDefault(),j())},[V,j]);re(()=>{let le={menus:[{label:"File",items:[{label:"New Board",onClick:W},{label:"Export JSON",onClick:z},{label:"Import JSON",onClick:B},{divider:!0},{label:"Print",onClick:O}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:_},{label:"Delete Selected",onClick:X}]},{label:"View",items:[{label:"Zoom In",onClick:R},{label:"Zoom Out",onClick:N},{label:"Fit All",onClick:ee},{divider:!0},{label:"Toggle Grid",onClick:k},{label:x?"Hide Connections":"Show Connections",onClick:U}]}]}},[W,z,B,O,i,s,a,l,_,X,R,N,ee,k,U,x]),re(()=>{let le=ne=>{let fe=ne;fe.ctrlKey&&fe.key==="z"?(fe.preventDefault(),i()):fe.ctrlKey&&fe.key==="y"&&(fe.preventDefault(),s())};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[i,s]);let K={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},Q=S((le,ne)=>{let fe=(-n.viewport.panX+300)/n.viewport.zoom,oe=(-n.viewport.panY+200)/n.viewport.zoom,ie=(Math.random()-.5)*300,ue=(Math.random()-.5)*200,he={id:Ei(),title:le,description:ne,color:d,position:{x:Math.round(fe+ie),y:Math.round(oe+ue)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:he})},[n.viewport,d,r]),se={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},J={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ae=o("div",{style:se,"data-testid":"app-menu-bar"},o("button",{style:J,onClick:Z,title:"Project menu"},"Project"),o("button",{style:J,title:"Settings"},"Settings"),o("button",{style:J,title:"Help"},"Help"),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${T}`)),de=C?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:j},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:le=>le.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:L,onInput:H,onKeyDown:Y,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:j,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:V,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null;return o("div",{className:"project-manager-app",style:K,"data-testid":"project-manager-app"},ae,o($n,{zoom:n.viewport.zoom,gridEnabled:b,selectedColor:d,colorFilter:h,onNewCard:F,onZoomIn:R,onZoomOut:N,onZoomReset:A,onColorSelect:u,onColorFilter:E,onGridToggle:k,onSearch:w}),o(Wn,{cards:n.cards,onCardDropped:Q},o(Fn,{state:n,dispatch:r,searchQuery:c,gridEnabled:b,selectedCardId:g,onSelectCard:$,colorFilter:h,showConnections:x})),de)}var _c=28,Yc=5e3;var Pi=0;function Ii(e){return Pi++,`${e}-${Pi}`}function $i(e){return e.replace(/\s*\(\d+\)$/,"")}function Vc(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 Uc(){let e=qe(),t=te(!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 jc(){let[e,t]=G([]),n=Qe();yt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=S(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 Gc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch($i(e)){case"Files":return o(Xe,{appId:"files"},o(jc,null));case"Terminal":return o(Xe,{appId:"terminal"},o(Uc,null));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(r=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},r)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(r=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},r)));case"Word Processor":return o(Bt,null);case"IDE":return o(Ot,null);case"Trading":return o(Yt,null);case"Project Board":return o(Ri,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Xc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=bt(),d=l.activeMenuBar,u=l.dockSignals,b=te(l);b.current=l;let[m,c]=G([]),[f,g]=G([]),[y,h]=G(!1),[p,x]=G(!1),[v,T]=G(null),[D,C]=G({x:0,y:0}),[P,L]=G(null),I=S(()=>{h(oe=>!oe)},[]),M=S(oe=>{g(ie=>ie.filter(ue=>ue.id!==oe))},[]);re(()=>{if(f.length===0)return;let oe=f[0],ie=Date.now()-oe.timestamp,ue=Math.max(0,Yc-ie),he=setTimeout(()=>{g(be=>be.filter(pe=>pe.id!==oe.id))},ue);return()=>clearTimeout(he)},[f]);let F=te(t);F.current=t;let R=te(r);R.current=r;let N=S(oe=>{let ue=F.current.find(he=>he.id===oe);ue&&(c(he=>{let pe=he.filter(ce=>ce.appId===oe).length+1,ge=pe===1?ue.label:`${ue.label} (${pe})`,ye=Ii(oe),ve=he.length>0?Math.max(...he.map(ce=>ce.zIndex))+1:1,De={id:ye,appId:ue.id,title:ge,icon:ue.icon,x:60+he.length*30,y:40+he.length*30,width:600,height:400,zIndex:ve,focused:!0,windowState:"normal"};return[...he.map(ce=>({...ce,focused:!1})),De]}),oe==="files"&&b.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:()=>{}}]}]}),oe==="terminal"&&b.current.signalDock("terminal",{badge:3}),R.current&&R.current(oe))},[]),A=S(oe=>{c(ie=>{if(!ie.find(be=>be.id===oe))return ie;let he=Math.max(...ie.map(be=>be.zIndex))+1;return ie.map(be=>be.id===oe?{...be,focused:!0,zIndex:he,windowState:be.windowState==="minimized"?"normal":be.windowState}:{...be,focused:!1})})},[]),k=S(oe=>{c(ie=>{let ue=ie.filter(ge=>ge.appId===oe);if(ue.length===0)return ie;let be=[...ue].sort((ge,ye)=>ye.zIndex-ge.zIndex)[0],pe=Math.max(...ie.map(ge=>ge.zIndex))+1;return ie.map(ge=>ge.id===be.id?{...ge,focused:!0,zIndex:pe,windowState:ge.windowState==="minimized"?"normal":ge.windowState}:{...ge,focused:!1})}),c(ie=>{if(ie.filter(he=>he.appId===oe).length===0){let be=F.current.find(ve=>ve.id===oe);if(!be)return ie;let pe=Ii(oe),ge=ie.length>0?Math.max(...ie.map(ve=>ve.zIndex))+1:1,ye={id:pe,appId:be.id,title:be.label,icon:be.icon,x:60+ie.length*30,y:40+ie.length*30,width:600,height:400,zIndex:ge,focused:!0,windowState:"normal"};return oe==="files"&&b.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:()=>{}}]}]}),oe==="terminal"&&b.current.signalDock("terminal",{badge:3}),R.current&&R.current(oe),[...ie.map(ve=>({...ve,focused:!1})),ye]}return ie})},[]),w=t.map(oe=>{let ie=m.some(be=>be.appId===oe.id),ue=u.get(oe.id),he={id:oe.id,icon:oe.icon,label:ue?.tooltip||oe.label,active:ie};return ue&&(ue.badge!=null&&(he.badge=ue.badge>0?ue.badge:void 0),ue.progress!=null&&(he.progress=ue.progress>0?ue.progress:void 0),ue.urgent&&(he.urgent=!0)),he}),$=m.find(oe=>oe.focused),E=$?$.title:void 0,W=S(()=>{x(!0)},[]),z=S(()=>{x(!1)},[]),B=S((oe,ie)=>{T(oe),C(ie)},[]),O=S(()=>{T(null)},[]),_=S(()=>{},[]),U=S(()=>{i&&i()},[i]),X=[];n&&(X.push({label:n.name,icon:void 0,onClick:_,divider:!1}),X.push({label:"",icon:void 0,onClick:_,divider:!0})),X.push({label:"Lock",icon:void 0,onClick:W,divider:!1}),X.push({label:"Logout",icon:void 0,onClick:U,divider:!1});let ee=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),Z={display:"flex",flex:"1",overflow:"hidden"},V={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},j={width:"100%",height:"100%",position:"relative"},H=o(Cn,{activeAppName:E,activitiesButton:{label:"Activities",onClick:I},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:X.length>0?X:void 0,height:_c}),Y=o(Mn,{items:w,orientation:"vertical",position:"left",iconSize:36,onItemClick:k,onItemContextMenu:B}),K=o(Vc,{toasts:f,onDismiss:M}),Q=m.filter(oe=>oe.windowState!=="minimized").map(oe=>o(kt,{key:oe.id,id:oe.id,title:oe.title,icon:oe.icon,defaultPosition:{x:oe.x,y:oe.y},defaultSize:{width:oe.width,height:oe.height},zIndex:oe.zIndex,focused:oe.focused,windowState:oe.windowState,onClose:()=>{c(ie=>ie.filter(ue=>ue.id!==oe.id))},onFocus:()=>{c(ie=>{let ue=Math.max(...ie.map(he=>he.zIndex))+1;return ie.map(he=>he.id===oe.id?{...he,focused:!0,zIndex:ue}:{...he,focused:!1})})},onMinimize:()=>{c(ie=>ie.map(ue=>ue.id===oe.id?{...ue,windowState:"minimized"}:ue))},onMaximize:()=>{c(ie=>ie.map(ue=>ue.id===oe.id?{...ue,windowState:ue.windowState==="maximized"?"normal":"maximized"}:ue))}},Gc(oe.title))),se=[];a&&se.push(a),se.push(...Q),se.push(K);let J=o(En,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:j},...se)),ae=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:I},...t.map(oe=>o("button",{key:oe.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:ie=>{ie.stopPropagation(),h(!1),k(oe.id)}},o("span",{style:{fontSize:"32px",display:"block"}},oe.icon),o("span",null,oe.label)))):null,de=p?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:z},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,le=(()=>{if(!v)return null;let oe=t.find(ge=>ge.id===v),ie=m.filter(ge=>ge.appId===v),ue={padding:"6px 14px",cursor:"pointer"},he={onMouseEnter:ge=>{ge.currentTarget.style.backgroundColor="#444"},onMouseLeave:ge=>{ge.currentTarget.style.backgroundColor="transparent"}},be={borderBottom:"1px solid #444",margin:"4px 0"},pe=[];return pe.push(o("div",{key:"new",style:ue,...he,onClick:()=>{N(v),T(null)},role:"menuitem"},"\u25CF New")),ie.length>0&&(pe.push(o("div",{key:"sep-1",style:be})),ie.forEach((ge,ye)=>{let ve=ie.length===1?oe?.label||ge.title:`${oe?.label||$i(ge.title)} (${ye+1})`;pe.push(o("div",{key:`inst-${ge.id}`,style:ue,...he,onClick:()=>{A(ge.id),T(null)},role:"menuitem"},ve))})),pe.push(o("div",{key:"sep-2",style:be})),pe.push(o("div",{key:"about",style:ue,...he,onClick:()=>{L(v),T(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:`${D.y}px`,left:`${D.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:ge=>ge.stopPropagation()},...pe))})(),ne=P?t.find(oe=>oe.id===P):null,fe=ne?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:oe=>oe.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ne.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:ee,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},H),o("div",{style:Z},o("div",{className:"unity-desktop__dock",style:V},Y),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},J,ae)),le,fe,de)}function Di(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(wn,{onWindowOpen:r},o(xt,null,o(St,null,o(Xc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function Ti(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:b,onDeactivate:m,children:c}=e,f=bt(),g=q(()=>f.windows.find(P=>P.id===t),[f.windows,t]);re(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=te(!1),h=g?g.focused:!1;re(()=>{let P=y.current;y.current=h,h&&!P?b&&b():!h&&P&&m&&m()},[h,b,m]);let p=S(()=>{f.closeWindow(t),d&&d()},[f,t,d]),x=S(()=>{f.focusWindow(t)},[f,t]),v=S(P=>{f.moveWindow(t,P)},[f,t]),T=S(P=>{f.resizeWindow(t,P)},[f,t]),D=S(()=>{f.minimizeWindow(t)},[f,t]),C=S(()=>{g&&g.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,g]);return g?o(Xe,{appId:t},o(kt,{id:t,title:n,icon:r,defaultPosition:g.position,defaultSize:g.size,minSize:a,resizable:l,windowState:g.windowState,focused:g.focused,zIndex:g.zIndex,onClose:p,onFocus:x,onMove:v,onResize:T,onMinimize:D,onMaximize:C,children:c})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var zi={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Ai={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 Li(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:b,active:m=!1}=e,c=q(()=>{let f=zi[i]??zi.md,g=Ai[r]??Ai.secondary,y={padding:f.padding,fontSize:f.fontSize,borderRadius:f.borderRadius,border:`1px solid ${g.border}`,backgroundColor:m?"#3b82f6":g.bg,color:m?"white":g.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,m,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":b,"aria-pressed":m?"true":void 0},t)}var qc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],ft=Math.PI/180;function Kc(e,t,n,r,i,s,a,l,d,u){let b=Math.cos(r*ft),m=Math.sin(r*ft),c=Math.cos(i*ft),f=Math.sin(i*ft),g=Math.cos(s*ft),y=Math.sin(s*ft),h=e*g-t*y,p=e*y+t*g,x=h*c-p*f,v=h*f+p*c,T=n,D=x,C=v*b-T*m,P=v*m+T*b,L=1+a*.001*P,I=l+D*u*L,M=d-C*u*L;return{sx:I,sy:M,depth:P}}function Fi(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 Ni(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 Wi(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:b=2,colorScale:m=qc,gridColor:c="#94a3b8",title:f}=e,g=q(()=>{let A=0,k=0,w=0;for(let $=0;$<t.length;$++){let E=t[$],W=E.data.length;W>A&&(A=W);for(let z=0;z<W;z++){let B=E.data[z].length;B>k&&(k=B);for(let O=0;O<B;O++){let _=Math.abs(E.data[z][O]??0);_>w&&(w=_)}}}return{maxRows:Math.max(A,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=q(()=>{let A=g.maxHeight+(t.length-1)*b+g.maxHeight,k=Math.sqrt(g.maxCols*g.maxCols+g.maxRows*g.maxRows+A*A),w=Math.min(n,r)*.75;return k>0?w/k:1},[g,t.length,b,n,r]),h=n/2,p=r/2,x=S((A,k,w)=>Kc(A,k,w,s,a,l,i,h,p,y),[s,a,l,i,h,p,y]),v=S(()=>{if(!u)return[];let A=[],k=Math.max(g.maxCols,g.maxRows),w=g.maxCols/2,$=g.maxRows/2,E=x(-w,-$,0),W=x(w,-$,0);A.push(o("line",{key:"axis-x",x1:String(E.sx),y1:String(E.sy),x2:String(W.sx),y2:String(W.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-x-label",x:String(W.sx+8),y:String(W.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let z=x(-w,$,0);A.push(o("line",{key:"axis-y",x1:String(E.sx),y1:String(E.sy),x2:String(z.sx),y2:String(z.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-y-label",x:String(z.sx-12),y:String(z.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let B=g.maxHeight+(t.length-1)*b,O=x(-w,-$,B);return A.push(o("line",{key:"axis-z",x1:String(E.sx),y1:String(E.sy),x2:String(O.sx),y2:String(O.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-z-label",x:String(O.sx-4),y:String(O.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),A},[u,g,t.length,b,x]),T=S(()=>{let A=[],k=g.maxCols/2,w=g.maxRows/2,$=[];for(let E=0;E<t.length;E++){let W=t[E],z=W.color??m[E%m.length],B=W.opacity??.7,O=E*b,_=W.data.length;for(let U=0;U<_-1;U++){let X=W.data[U],ee=W.data[U+1],Z=Math.min(X.length,ee.length);for(let V=0;V<Z-1;V++){let j=V-k,H=V+1-k,Y=U-w,K=U+1-w,Q=(X[V]??0)+O,se=(X[V+1]??0)+O,J=(ee[V]??0)+O,ae=(ee[V+1]??0)+O,de=x(j,Y,Q),le=x(H,Y,se),ne=x(j,K,J),fe=x(H,K,ae),oe=(de.depth+le.depth+ne.depth+fe.depth)/4,ie=`${de.sx},${de.sy} ${le.sx},${le.sy} ${fe.sx},${fe.sy} ${ne.sx},${ne.sy}`;$.push({points:ie,fill:Fi(z,B),stroke:Ni(z,.7),strokeWidth:"0.5",depth:oe,key:`quad-${E}-${U}-${V}`})}}if(_===1||_>0&&W.data[0].length===1)for(let U=0;U<_;U++){let X=W.data[U];for(let ee=0;ee<X.length;ee++){let Z=ee-k,V=U-w,j=(X[ee]??0)+O,H=x(Z,V,j),Y=3,K=`${H.sx},${H.sy-Y} ${H.sx+Y},${H.sy} ${H.sx},${H.sy+Y} ${H.sx-Y},${H.sy}`;$.push({points:K,fill:Fi(z,B),stroke:Ni(z,.7),strokeWidth:"0.5",depth:H.depth,key:`point-${E}-${U}-${ee}`})}}}$.sort((E,W)=>E.depth-W.depth);for(let E=0;E<$.length;E++){let W=$[E];A.push(o("polygon",{key:W.key,points:W.points,fill:W.fill,stroke:W.stroke,"stroke-width":W.strokeWidth,"stroke-linejoin":"round"}))}return A},[t,g,b,m,x]),D=S(()=>{let A=[],k=g.maxCols/2,w=g.maxRows/2;for(let $=0;$<=g.maxRows;$++){let E=$-w,W=x(-k,E,0),z=x(k,E,0);A.push(o("line",{key:`base-h-${$}`,x1:String(W.sx),y1:String(W.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let $=0;$<=g.maxCols;$++){let E=$-k,W=x(E,-w,0),z=x(E,w,0);A.push(o("line",{key:`base-v-${$}`,x1:String(W.sx),y1:String(W.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return A},[g,c,x]),C=S(()=>{if(!d)return[];let A=[],k=g.maxCols/2,w=g.maxRows/2;for(let $=0;$<t.length;$++){let E=t[$],W=$*b,z=0,B=0;for(let X=0;X<E.data.length;X++){let ee=E.data[X];for(let Z=0;Z<ee.length;Z++)z+=ee[Z]??0,B++}let O=B>0?z/B:0,_=x(k+1,0,O+W),U=E.color??m[$%m.length];A.push(o("text",{key:`layer-label-${$}`,x:String(_.sx+8),y:String(_.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},E.label))}return A},[d,t,g,b,m,x]),L=S(()=>f?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n])(),I=D(),M=v(),F=T(),R=C(),N=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...I,...M,...F,...R)}function Zc(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 Jc(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 Bi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:b="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:f="#ffffff"}=e,g=q(()=>Zc(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),h=l!=null&&l.length>1,p=n!=null&&n.length>0,x=y&&s>=0?m:c,v=20,T=p?u*.38:u*.45,D=Math.min(d*.15,48),C=D*.55,P=T+D*.4+8,L=p?P+22:T+D*.4+22,I=h?Math.min(u*.22,36):0,M=u-v-I,F=d-v*2,R=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:f,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,f]),N=S(()=>{let _=[],U=r+g+i;return _.push(o("text",{key:"value",x:String(d/2),y:String(T),"text-anchor":"middle","dominant-baseline":"central","font-size":String(D),"font-weight":"bold","font-family":"sans-serif",fill:b,"aria-label":`Value: ${U}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,g,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),_},[d,T,D,C,g,r,i,b]),A=S(()=>p?[o("text",{key:"label",x:String(d/2),y:String(P),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[p,d,P,n]),k=S(()=>{if(!y)return[];let _=[],U=s,X=U>=0,ee=8,Z=Jc(U),V=(X?"+":"-")+Z+(a?" "+a:""),j=d/2-40,H=L;if(X){let Y=`${j},${H} ${j-ee/2},${H+ee} ${j+ee/2},${H+ee}`;_.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${H+ee} ${j-ee/2},${H} ${j+ee/2},${H}`;_.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return _.push(o("text",{key:"trend-text",x:String(j+ee+4),y:String(H+ee*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${V}`},V)),_},[y,s,a,x,d,L]),w=S(()=>{if(!h)return[];let _=[],U=l,X=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&X.push(Q);if(X.length<2)return[];let ee=1/0,Z=-1/0;for(let Q of X)Q<ee&&(ee=Q),Q>Z&&(Z=Q);ee===Z&&(ee-=1,Z+=1);let V=Z-ee,j=F/(X.length-1),H="";for(let Q=0;Q<X.length;Q++){let se=v+Q*j,J=M+I-(X[Q]-ee)/V*I;Q===0?H+=`M ${se} ${J}`:H+=` L ${se} ${J}`}let Y=v+(X.length-1)*j,K=H+` L ${Y} ${M+I} L ${v} ${M+I} Z`;return _.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"})))),_.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),_.push(o("path",{key:"spark-line",d:H,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),_},[h,l,F,M,I,v]),$=R(),E=N(),W=A(),z=k(),B=w(),O=`${r}${g}${i}${p?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":O,style:{fontFamily:"sans-serif"}},...$,...B,...E,...W,...z)}var Ut=Math.PI/180;function Qc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Ut),u=Math.sin(r*Ut),b=Math.cos(i*Ut),m=Math.sin(i*Ut),c=e*b+n*m,f=-e*m+n*b,g=t*d-f*u,y=t*u+f*d;return{sx:s+c*l,sy:a-g*l,depth:y}}function gt(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 jt(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 Ke(e,t,n){let{x:r,y:i,z:s}=gt(e),a=Math.cos(n),l=Math.sin(n),d,u,b;return t==="x"?(d=r,u=i*a-s*l,b=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,b=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,b=s),jt(d,u,b)}function Bn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Ke(e,"x",Math.PI);case"Y":return Ke(e,"y",Math.PI);case"Z":return Ke(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=gt(e);return jt(s,-i,r)}case"S":return Ke(e,"z",Math.PI/2);case"T":return Ke(e,"z",Math.PI/4);case"Rx":return Ke(e,"x",n);case"Ry":return Ke(e,"y",n);case"Rz":return Ke(e,"z",n)}}function Oi(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:b=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:f=!0,trailMaxPoints:g=200,trailColor:y="#ef4444",wireframeColor:h="#cbd5e1",vectorColor:p="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:T,onStateChange:D}=e,[C,P]=G(t??{theta:0,phi:0}),[L,I]=G(s),[M,F]=G(a),[R,N]=G(l),A=te([]),k=te(!1),w=te(null),$=te(null);re(()=>{t&&P(t)},[t?.theta,t?.phi]);let E=te(0);re(()=>{if(!n||n.length===0)return;E.current=0;let j=0,H=()=>{E.current>=n.length||(P(Y=>{let K=Bn(Y,n[E.current]);return E.current++,D&&D(K),K}),j=requestAnimationFrame(H))};return j=requestAnimationFrame(H),()=>cancelAnimationFrame(j)},[n]),re(()=>{let j=gt(C);A.current.push(j),A.current.length>g&&A.current.splice(0,A.current.length-g)},[C.theta,C.phi]);let W=v*R,z=r/2,B=i/2,O=S((j,H,Y)=>Qc(j,H,Y,M,L,z,B,W),[M,L,z,B,W]),_=S(j=>{if(!d)return;let H=j;k.current=!0,w.current={mx:H.clientX,my:H.clientY,rx:M,ry:L}},[d,M,L]),U=S(j=>{if(!k.current||!w.current)return;let H=j,Y=w.current;I(Y.ry+(H.clientX-Y.mx)*.5),F(Y.rx-(H.clientY-Y.my)*.5)},[]),X=S(()=>{k.current=!1},[]),ee=S(j=>{if(!u)return;let H=j;H.preventDefault(),N(Y=>Math.max(.5,Math.min(3,Y*(H.deltaY>0?.95:1.05))))},[u]),Z=[];if(x&&Z.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),T&&Z.push(o("text",{key:"title",x:String(z),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},T)),c){let H=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(Math.cos(se),Math.sin(se),0);H.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"eq",d:H.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(Math.cos(se),0,Math.sin(se));Y.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(0,Math.cos(se),Math.sin(se));K.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}))}let V=[{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 V){let H=O(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=O(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),K=O(0,0,0);Z.push(o("line",{key:`axis-${j.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(H.sx),y2:String(H.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 H of j){let Y=O(H.pos[0],H.pos[1],H.pos[2]);Z.push(o("text",{key:`lbl-${H.text}`,x:String(Y.sx),y:String(Y.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},H.text))}}if(f&&A.current.length>1){let j=A.current,H=[];for(let Y=0;Y<j.length;Y++){let K=j[Y],Q=O(K.x,K.y,K.z);H.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}Z.push(o("path",{key:"trail",d:H.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(b){let j=gt(C),H=O(0,0,0),Y=O(j.x,j.y,j.z);Z.push(o("line",{key:"vec-line",x1:String(H.sx),y1:String(H.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:p,"stroke-width":"2.5","stroke-linecap":"round"})),Z.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:p,stroke:"#fff","stroke-width":"1.5"}));let K=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);Z.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=${K}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:$,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":T??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?_:void 0,onMouseMove:d?U:void 0,onMouseUp:d?X:void 0,onMouseLeave:d?X:void 0,onWheel:u?ee:void 0},...Z)}function ed(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 On(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 Hn(e){let t=ed(e);if(t.length===0)return null;let n=On(t,25),r=On(t,50),i=On(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let f of t)if(f>=a){d=f;break}let u=t[t.length-1];for(let f=t.length-1;f>=0;f--)if(t[f]<=l){u=t[f];break}let b=0;for(let f of t)b+=f;let m=b/t.length,c=[];for(let f of t)(f<a||f>l)&&c.push(f);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function td(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 Hi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:b,padding:m=60}=e,c=i==="vertical",f=n-m*2,g=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],h=q(()=>{let w=[];for(let $ of t)w.push(Hn($.values));return w},[t]),p=q(()=>{let w=1/0,$=-1/0;for(let z of h){if(z===null)continue;let B=s&&z.outliers.length>0?Math.min(z.whiskerLow,z.outliers[0]):z.whiskerLow,O=s&&z.outliers.length>0?Math.max(z.whiskerHigh,z.outliers[z.outliers.length-1]):z.whiskerHigh;B<w&&(w=B),O>$&&($=O)}isFinite(w)||(w=0,$=1);let E=$-w,W=E>0?E*.05:.5;return{min:w-W,max:$+W}},[h,s]),x=c?g:f,v=c?f:g,T=t.length>0?t.length:1,D=v/T,C=D*Math.min(Math.max(d,.1),.95),P=S(w=>{let $=p.max-p.min;return $===0?x/2:(w-p.min)/$*x},[p,x]),L=S(()=>{if(!u)return[];let w=[],$=p.max-p.min,E=td($),W=Math.ceil(p.min/E)*E;for(let z=W;z<=p.max;z+=E){let B=P(z),O=String(Math.round(z*1e3)/1e3);if(c){let _=m+g-B;w.push(o("line",{key:`grid-${z}`,x1:String(m),y1:String(_),x2:String(m+f),y2:String(_),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(m-6),y:String(_+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}else{let _=m+B;w.push(o("line",{key:`grid-${z}`,x1:String(_),y1:String(m),x2:String(_),y2:String(m+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(_),y:String(m+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}}return w},[u,p,P,c,m,f,g]),I=S(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(m),y1:String(c?m:m+g),x2:String(m),y2:String(m+g),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+g),x2:String(m+f),y2:String(m+g),stroke:"#374151","stroke-width":"1.5"})),w},[m,f,g,c]),M=S(()=>{let w=[];for(let $=0;$<t.length;$++){let E=h[$];if(E===null)continue;let W=t[$],z=W.color??y[$%y.length],B=D*$+D/2,O=C/2;if(c){let _=m+g-P(E.q1),U=m+g-P(E.q3),X=m+g-P(E.median),ee=m+g-P(E.whiskerLow),Z=m+g-P(E.whiskerHigh),V=m+B;w.push(o("line",{key:`wl-${$}`,x1:String(V),y1:String(_),x2:String(V),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(V-O*.4),y1:String(ee),x2:String(V+O*.4),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(V),y1:String(U),x2:String(V),y2:String(Z),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(V-O*.4),y1:String(Z),x2:String(V+O*.4),y2:String(Z),stroke:l,"stroke-width":"1.5"}));let j=Math.min(_,U),H=Math.abs(_-U);if(w.push(o("rect",{key:`box-${$}`,x:String(V-O),y:String(j),width:String(C),height:String(Math.max(H,1)),fill:z,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${W.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${$}`,x1:String(V-O),y1:String(X),x2:String(V+O),y2:String(X),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+g-P(E.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(V),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let K=m+g-P(E.outliers[Y]);w.push(o("circle",{key:`out-${$}-${Y}`,cx:String(V),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(V),y:String(m+g+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}else{let _=m+P(E.q1),U=m+P(E.q3),X=m+P(E.median),ee=m+P(E.whiskerLow),Z=m+P(E.whiskerHigh),V=m+B;w.push(o("line",{key:`wl-${$}`,x1:String(_),y1:String(V),x2:String(ee),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(ee),y1:String(V-O*.4),x2:String(ee),y2:String(V+O*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(U),y1:String(V),x2:String(Z),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(Z),y1:String(V-O*.4),x2:String(Z),y2:String(V+O*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(_,U),H=Math.abs(U-_);if(w.push(o("rect",{key:`box-${$}`,x:String(j),y:String(V-O),width:String(Math.max(H,1)),height:String(C),fill:z,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${W.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${$}`,x1:String(X),y1:String(V-O),x2:String(X),y2:String(V+O),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+P(E.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(Y),cy:String(V),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let K=m+P(E.outliers[Y]);w.push(o("circle",{key:`out-${$}-${Y}`,cx:String(K),cy:String(V),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}}return w},[t,h,P,c,m,f,g,D,C,l,s,a,y]),F=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n,m]),R=L(),N=I(),A=M(),k=F();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Box plot",style:{fontFamily:"sans-serif"}},...k,...R,...N,...A)}function _i(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function nd(e,t,n){return e<t?t:e>n?n:e}function _n(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Yi(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:b=4,defaultColor:m="#3b82f6",opacity:c=.7,title:f,padding:g=60}=e,y=q(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];_n(w.x)&&_n(w.y)&&_n(w.r)&&A.push(w)}return A},[t]),h=n-g*2,p=r-g*2,x=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let A=1/0,k=-1/0,w=1/0,$=-1/0,E=1/0,W=-1/0;for(let z of y)z.x<A&&(A=z.x),z.x>k&&(k=z.x),z.y<w&&(w=z.y),z.y>$&&($=z.y),z.r<E&&(E=z.r),z.r>W&&(W=z.r);return A===k&&(A-=1,k+=1),w===$&&(w-=1,$+=1),E===W&&(E=0,W=W>0?W:1),{xMin:A,xMax:k,yMin:w,yMax:$,rMin:E,rMax:W}},[y]),v=S(A=>{let k=x.xMax-x.xMin;return g+(A-x.xMin)/k*h},[x,g,h]),T=S(A=>{let k=x.yMax-x.yMin;return g+p-(A-x.yMin)/k*p},[x,g,p]),D=S(A=>{let k=x.rMax-x.rMin;if(k===0)return(b+u)/2;let w=(A-x.rMin)/k;return b+w*(u-b)},[x,b,u]),C=S(()=>{if(!a)return[];let A=[],k=_i(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let W=w;W<=x.xMax;W+=k){let z=v(W);A.push(o("line",{key:`grid-x-${W}`,x1:String(z),y1:String(g),x2:String(z),y2:String(g+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${W}`,x:String(z),y:String(g+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}let $=_i(x.yMax-x.yMin),E=Math.ceil(x.yMin/$)*$;for(let W=E;W<=x.yMax;W+=$){let z=T(W);A.push(o("line",{key:`grid-y-${W}`,x1:String(g),y1:String(z),x2:String(g+h),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-ylabel-${W}`,x:String(g-6),y:String(z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}return A},[a,x,v,T,g,h,p]),P=S(()=>{if(!l)return[];let A=[];return A.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+p),x2:String(g+h),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(g+h/2),y:String(g+p+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&A.push(o("text",{key:"y-label",x:String(g-40),y:String(g+p/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${g-40}, ${g+p/2})`},s)),A},[l,g,h,p,i,s]),L=S(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],$=v(w.x),E=T(w.y),W=nd(D(w.r),b,u),z=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String($),cy:String(E),r:String(W),fill:z,opacity:String(c),stroke:z,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&A.push(o("text",{key:`label-${k}`,x:String($),y:String(E-W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,v,T,D,m,c,d,b,u]),I=S(()=>f?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n,g]),M=C(),F=P(),R=L(),N=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":f??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...M,...F,...R)}var od=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function id(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 Vi(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 Ui(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function sd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function ad(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=Ui(t[i]),l=Ui(t[i+1]);return sd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var ld=["#9be9a8","#40c463","#30a14e","#216e39"];function ji(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=ld,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:b}=e,{dateMap:m,startDate:c,endDate:f,maxVal:g}=q(()=>{let R=new Map,N=0,A=null,k=null;for(let E of t){let W=id(E.date);if(isNaN(W.getTime()))continue;let z=Vi(W);R.set(z,(R.get(z)??0)+E.value);let B=R.get(z);B>N&&(N=B),(A===null||W<A)&&(A=W),(k===null||W>k)&&(k=W)}if(A===null||k===null){let E=new Date;A=new Date(E.getFullYear(),0,1),k=new Date(E.getFullYear(),11,31)}let w=new Date(A);w.setDate(w.getDate()-w.getDay());let $=new Date(k);return $.setDate($.getDate()+(6-$.getDay())),{dateMap:R,startDate:w,endDate:$,maxVal:N>0?N:1}},[t]),y=d?30:0,h=l?16:0,p=b?28:0,x=y+10,v=p+h+4,T=S(()=>{let R=[],N=new Date(c),A=0;for(;N<=f;){let k=N.getDay();k===0&&N>c&&A++;let w=Vi(N),$=m.get(w),E=$!==void 0&&$>0?ad($/g,i):u,W=x+A*(s+a),z=v+k*(s+a);R.push(o("rect",{key:`day-${w}`,x:String(W),y:String(z),width:String(s),height:String(s),rx:"2",ry:"2",fill:E,"aria-label":`${w}: ${$??0}`})),N.setDate(N.getDate()+1)}return R},[c,f,m,g,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let R=[],N=new Date(c),A=0,k=-1;for(;N<=f;){let w=N.getDay();w===0&&N>c&&A++;let $=N.getMonth();if($!==k&&w===0){k=$;let E=x+A*(s+a);R.push(o("text",{key:`month-${A}`,x:String(E),y:String(p+h-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},od[$]))}N.setDate(N.getDate()+1)}return R},[l,c,f,s,a,x,p,h]),C=S(()=>{if(!d)return[];let R=[],N=[1,3,5];for(let A of N){let k=v+A*(s+a)+s/2;R.push(o("text",{key:`day-label-${A}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},rd[A]))}return R},[d,s,a,v,y]),P=S(()=>b?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let L=P(),I=D(),M=C(),F=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":b??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...M,...F)}var cd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ue(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function dd(e,t,n,r,i,s){let a=Ue(e,t,n,i),l=Ue(e,t,n,s),d=Ue(e,t,r,i),u=Ue(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 ud(e,t,n,r,i,s,a){let l=Ue(e,t,n,r),d=Ue(e,t,n,i),u=Ue(e,t,n,s),b=Ue(e,t,n,a),m=i-r,c=a-s,f=m>Math.PI?1:0,g=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${f} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${g} 1 ${b.x} ${b.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function pd(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let f=0;for(let g=0;g<i;g++){let y=e[c]?.[g]??0;f+=Math.max(0,y)}s.push(f),a+=f}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),f=[],g=0;for(let y=0;y<i;y++)f.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:g,endAngle:g+c,value:0}),g+=c+r;return{groups:f,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let f=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+f,value:s[c]}),u+=f+r}let b=[];for(let c=0;c<i;c++)b.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let f=c;f<i;f++){let g=Math.max(0,e[c]?.[f]??0),y=c===f?0:Math.max(0,e[f]?.[c]??0);if(g===0&&y===0)continue;let h=g+y,p=s[c]>0?g/a*l:0,x=b[c],v=x+p;b[c]=v;let T=s[f]>0?g/a*l:0,D=b[f],C=D+T;if(b[f]=C,c===f){g>0&&m.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:C,value:g,color:d[c].color});continue}let P=s[f]>0?y/a*l:0,I=b[f]+P;b[f]=I;let M=s[c]>0?y/a*l:0,R=b[c]+M;b[c]=R,(g>0||y>0)&&m.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(C,D+.001),value:h,color:d[c].color})}return{groups:d,chords:m}}function Gi(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=cd,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:b=.9,title:m}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,f=i/2,g=Math.min(r,i)/2-40,y=g*Math.max(.5,Math.min(.99,b)),h=g+16,p=q(()=>pd(t,n,s,a),[t,n,s,a]),x=S(()=>{let L=[];for(let I=0;I<p.groups.length;I++){let M=p.groups[I];if(M.endAngle-M.startAngle<.001)continue;let R=dd(c,f,g,y,M.startAngle,M.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:R,fill:M.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${M.label}: ${M.value}`})),l){let N=(M.startAngle+M.endAngle)/2,A=Ue(c,f,h,N),$=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,E=$?"start":"end",W=N*180/Math.PI-90;$||(W+=180);let z=d?`${M.label} (${M.value})`:M.label;L.push(o("text",{key:`label-${I}`,x:String(A.x),y:String(A.y),"text-anchor":E,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${W}, ${A.x}, ${A.y})`,"dominant-baseline":"central","pointer-events":"none"},z))}}return L},[p,c,f,g,y,h,l,d]),v=S(()=>{let L=[];for(let I=0;I<p.chords.length;I++){let M=p.chords[I],F=ud(c,f,y,M.sourceStartAngle,M.sourceEndAngle,M.targetStartAngle,M.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:F,fill:M.color,"fill-opacity":String(u),stroke:M.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[p,c,f,y,u]),T=S(()=>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]),D=v(),C=x(),P=T();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"}},...P,...D,...C)}var fd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function gd(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],b=[];for(let m=0;m<u.length;m++)b.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:b});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function md(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 hd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=gd(e);if(d.length===0)return[];let b=md(d),m=t-s*2,c=n-s*2,f=a==="horizontal",g=u+1,y=f?g>1?(m-r)/u:0:g>1?(c-i)/u:0,h=new Array(d.length),p=b[0],x=f?c:m,v=p>0?x/p:x,T=new Array(d.length);T[0]=[0,p];let D=[0],C=0;for(;C<D.length;){let P=D[C];C++;let L=d[P],[I,M]=T[P],F=(I+M)/2,R=s+L.depth*y,N=s+(F-.5)*v,A=f?R:N,k=f?N:R,w=L.node.color??l[L.depth%l.length];h[P]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:A,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:b[P]};let $=I;for(let E of L.childIndices)if(E<d.length){let W=b[E],z=$+W;T[E]=[$,z],$=z,D.push(E)}}return h}function Xi(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:b=fd,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 f=i==="horizontal",g=q(()=>hd(t,n,r,s,a,c,i,b),[t,n,r,s,a,c,i,b]),y=q(()=>{let C=new Map;for(let P=0;P<g.length;P++){let L=g[P];C.set(L.id,L)}return C},[g]),h=S(()=>{if(!d)return[];let C=[];for(let P=0;P<g.length;P++){let L=g[P];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let M,F,R,N;f?(M=I.x+s,F=I.y+a/2,R=L.x,N=L.y+a/2):(M=I.x+s/2,F=I.y+a,R=L.x+s/2,N=L.y);let A=(M+R)/2,k=(F+N)/2,w;f?w=`M ${M} ${F} C ${A} ${F}, ${A} ${N}, ${R} ${N}`:w=`M ${M} ${F} C ${M} ${k}, ${R} ${k}, ${R} ${N}`,C.push(o("path",{key:`conn-${P}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[g,y,f,s,a,d,u]),p=S(()=>{let C=[];for(let P=0;P<g.length;P++){let L=g[P];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 I=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(I),"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},[g,s,a,l]),x=S(()=>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]),v=h(),T=p(),D=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...D,...v,...T)}var qi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function bd(e){return qi[e%qi.length]}function Ki(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],b=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??bd(d),x:u.x??r+s*Math.cos(b),y:u.y??i+s*Math.sin(b),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Zi(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let b=Math.sqrt(u),m=l/b,c=d/b,f=n-b;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*f,a.y+=c*f):a.fixed?(i.x-=m*f,i.y-=c*f):(i.x-=m*f*.5,i.y-=c*f*.5,a.x+=m*f*.5,a.y+=c*f*.5);let g=i.vx-a.vx,y=i.vy-a.vy,h=g*m+y*c;h<=0||(i.fixed?(a.vx+=h*m,a.vy+=h*c):a.fixed?(i.vx-=h*m,i.vy-=h*c):(i.vx-=h*m,i.vy-=h*c,a.vx+=h*m,a.vy+=h*c))}}}function xd(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let b=new Map;for(let x=0;x<u;x++)b.set(e[x].id,x);let m=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let T=x+1;T<u;T++){let D=e[T],C=v.x-D.x,P=v.y-D.y,L=C*C+P*P;L<1&&(L=1);let I=Math.sqrt(L),M=i/L,F=C/I*M,R=P/I*M;m[x]+=F,c[x]+=R,m[T]-=F,c[T]-=R}}for(let x=0;x<t.length;x++){let v=t[x],T=b.get(v.source),D=b.get(v.target);if(T===void 0||D===void 0)continue;let C=e[T],P=e[D],L=P.x-C.x,I=P.y-C.y,M=Math.sqrt(L*L+I*I);if(M<.1)continue;let F=v.weight??1,R=M-l,N=s*R*F,A=L/M*N,k=I/M*N;m[T]+=A,c[T]+=k,m[D]-=A,c[D]-=k}let f=n/2,g=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];m[x]+=(f-v.x)*y,c[x]+=(g-v.y)*y}let h=20,p=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){p.push({...v,vx:0,vy:0});continue}let T=(v.vx+m[x])*a,D=(v.vy+c[x])*a,C=Math.sqrt(T*T+D*D),P=10;C>P&&(T=T/C*P,D=D/C*P);let L=v.x+T,I=v.y+D;L=Math.max(h,Math.min(n-h,L)),I=Math.max(h,Math.min(r-h,I)),p.push({...v,x:L,y:I,vx:T,vy:D})}return Zi(p,d),p}function yd(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 Ji(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:b=300,attractionForce:m=.01,damping:c=.9,edgeLength:f=100,edgeColor:g="#94a3b8",edgeWidth:y=1.5,title:h,customForce:p,trails:x}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty force-directed graph"},h?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let v=te(Ki(t,r,i)),[T,D]=G(0),C=te(!0),P=te(!1),L=te(n);L.current=n;let I=te(p);I.current=p;let M=te(null),F=te({repulsionForce:b,attractionForce:m,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l});F.current={repulsionForce:b,attractionForce:m,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l};let R=te(new Map);re(()=>{v.current=Ki(t,r,i),P.current=!1,C.current=!0,R.current=new Map,D(se=>se+1)},[t.length]),re(()=>{let se=0,J=()=>{if(!C.current)return;let ae=F.current,de=I.current,le;if(de?(le=de(v.current,L.current,ae.width,ae.height,M.current),ae.solidNodes&&Zi(le,ae.nodeRadius)):le=xd(v.current,L.current,ae.width,ae.height,ae.repulsionForce,ae.attractionForce,ae.damping,ae.edgeLength,ae.nodeRadius),v.current=le,x)for(let ne=0;ne<x.length;ne++){let fe=x[ne],oe=le.find(he=>he.id===fe.nodeId);if(!oe)continue;let ie=R.current.get(fe.nodeId);ie||(ie=[],R.current.set(fe.nodeId,ie)),ie.push({x:oe.x,y:oe.y});let ue=fe.maxPoints??200;ie.length>ue&&ie.splice(0,ie.length-ue)}if(!de&&yd(le)<.01){P.current=!0,D(ne=>ne+1);return}D(ne=>ne+1),se=requestAnimationFrame(J)};return se=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(se)}},[]);let N=v.current,A=S(se=>{v.current=v.current.map(J=>J.id===se?{...J,fixed:!J.fixed,vx:0,vy:0}:J),P.current&&(P.current=!1,C.current=!0,D(J=>J+1))},[]),k=te(null),w=te(null),$=S(se=>{let J=se,ae=w.current;if(!ae)return{x:J.clientX,y:J.clientY};let de=ae.getBoundingClientRect(),le=r/de.width,ne=i/de.height;return{x:(J.clientX-de.left)*le,y:(J.clientY-de.top)*ne}},[r,i]),E=te(!1),W=S((se,J)=>{J.stopPropagation(),k.current=se;let ae=v.current.find(de=>de.id===se);E.current=ae?.fixed??!1,v.current=v.current.map(de=>de.id===se?{...de,fixed:!0,vx:0,vy:0}:de)},[]),z=S(se=>{let J=$(se);if(M.current={x:J.x,y:J.y},!k.current)return;let ae=k.current,de=20;v.current=v.current.map(le=>le.id===ae?{...le,x:Math.max(de,Math.min(r-de,J.x)),y:Math.max(de,Math.min(i-de,J.y))}:le),P.current&&(P.current=!1,C.current=!0),D(le=>le+1)},[r,i,$]),B=S(()=>{let se=k.current;se&&(v.current=v.current.map(J=>J.id===se?{...J,fixed:E.current}:J)),k.current=null},[]),O=S(()=>{k.current=null,M.current=null},[]),_=q(()=>{let se=new Map;for(let J=0;J<N.length;J++)se.set(N[J].id,N[J]);return se},[T]),U=S(()=>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:g})))]:[],[u,s,g]),X=S(()=>{let se=[];for(let J=0;J<n.length;J++){let ae=n[J],de=_.get(ae.source),le=_.get(ae.target);if(!de||!le||ae.weight!==void 0&&ae.weight<=0)continue;let ne=ae.weight?Math.max(.5,Math.min(6,y*ae.weight)):y,fe={key:`edge-${J}`,x1:String(de.x),y1:String(de.y),x2:String(le.x),y2:String(le.y),stroke:ae.color??g,"stroke-width":String(ne),"stroke-opacity":"0.6"};u&&(fe["marker-end"]="url(#arrowhead)"),se.push(o("line",fe))}return se},[T,g,y,u]),ee=S(()=>{let se=[];for(let J=0;J<N.length;J++){let ae=N[J];se.push(o("circle",{key:`node-${ae.id}`,cx:String(ae.x),cy:String(ae.y),r:String(s),fill:ae.color,stroke:ae.fixed?"#0f172a":"#fff","stroke-width":ae.fixed?"3":String(a),style:{cursor:k.current===ae.id?"grabbing":"grab"},onMouseDown:de=>W(ae.id,de),onDblClick:()=>A(ae.id),role:"button",tabIndex:0,"aria-label":`Node: ${ae.label}${ae.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&se.push(o("text",{key:`label-${ae.id}`,x:String(ae.x),y:String(ae.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},ae.label))}return se},[T,s,d,A]),Z=S(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r]),V=S(()=>{if(!x||x.length===0)return[];let se=[];for(let J=0;J<x.length;J++){let ae=x[J],de=R.current.get(ae.nodeId);if(!de||de.length<2)continue;let le=[];for(let ne=0;ne<de.length;ne++){let fe=de[ne];le.push(`${ne===0?"M":"L"}${fe.x.toFixed(1)},${fe.y.toFixed(1)}`)}se.push(o("path",{key:`trail-${ae.nodeId}`,d:le.join(" "),fill:"none",stroke:ae.color??"#3b82f6","stroke-width":String(ae.width??1),opacity:String(ae.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return se},[T,x]),j=U(),H=V(),Y=X(),K=ee(),Q=Z();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:z,onMouseUp:B,onMouseLeave:O},...j,...Q,...H,...Y,...K)}var Qi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function es(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=Qi,title:b}=e,m=i==="vertical",c=b?30:0,f=120,g=q(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=S(L=>g===0?0:Math.max(.05,L/g),[g]),h=S((L,I)=>I||(u[L%u.length]??Qi[0]),[u]),p=S(()=>{if(t.length===0)return[];let L=[],I=40,M=n-I*2-f,F=r-c-I*2,R=d*(t.length-1),N=Math.max(1,(F-R)/t.length),A=I+M/2;for(let k=0;k<t.length;k++){let w=t[k],$=k<t.length-1?t[k+1]:null,E=h(k,w.color),W=y(w.value),z=$!==null?y($.value):W*.6,B=M/2*W,O=M/2*z,_=c+I+k*(N+d),U=A-B,X=A+B,ee=A+O,Z=A-O,V=`${U},${_} ${X},${_} ${ee},${_+N} ${Z},${_+N}`;L.push(o("polygon",{key:`section-${k}`,points:V,fill:E,stroke:"#fff","stroke-width":"1"}));let j=I+M+12,H=_+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),y:String(H-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let Y="";if(a&&(Y=String(w.value)),l&&t.length>0){let K=t[0].value,Q=K>0?Math.round(w.value/K*100):0;Y+=a?` (${Q}%)`:`${Q}%`}L.push(o("text",{key:`value-${k}`,x:String(j),y:String(H+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return L},[t,n,r,c,d,s,a,l,h,y,f]),x=S(()=>{if(t.length===0)return[];let L=[],I=40,M=n-I*2,R=r-c-I*2-40,N=d*(t.length-1),A=Math.max(1,(M-N)/t.length),k=c+I+R/2;for(let w=0;w<t.length;w++){let $=t[w],E=w<t.length-1?t[w+1]:null,W=h(w,$.color),z=y($.value),B=E!==null?y(E.value):z*.6,O=R/2*z,_=R/2*B,U=I+w*(A+d),X=k-O,ee=k-_,Z=k+_,V=k+O,j=`${U},${X} ${U+A},${ee} ${U+A},${Z} ${U},${V}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:W,stroke:"#fff","stroke-width":"1"}));let H=U+A/2,Y=c+I+R+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(H),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},$.label)),a||l){let K="";if(a&&(K=String($.value)),l&&t.length>0){let Q=t[0].value,se=Q>0?Math.round($.value/Q*100):0;K+=a?` (${se}%)`:`${se}%`}L.push(o("text",{key:`value-${w}`,x:String(H),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},K))}}return L},[t,n,r,c,d,s,a,l,h,y]),v=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n]),T=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),D=v(),C=m?p():x(),P=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":b??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...C,...P)}var ts=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ns(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 Sd(e,t){return t||ts[e%ts.length]}function os(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:b,padding:m=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,f=q(()=>{let F=1/0,R=-1/0;for(let N of t){N.start<F&&(F=N.start);let A=N.start+N.duration;A>R&&(R=A)}return F===1/0&&(F=0,R=1),{min:F,max:R,range:R-F}},[t]),g=q(()=>{let F=t.slice();return F.sort((R,N)=>R.group!==N.group?(R.group??"").localeCompare(N.group??""):R.start-N.start),F},[t]),y=r??m*2+g.length*(i+s)+s+20,h=n-m-c-m,p=m+(b?20:0),x=S(F=>f.range===0?c+m:c+m+(F-f.min)/f.range*h,[f,h,c,m]),v=S(()=>{if(!a)return[];let F=[],R=ns(f.range),N=Math.ceil(f.min/R)*R,A=p+g.length*(i+s)+s;for(let k=N;k<=f.max;k+=R){let w=x(k);F.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(p),x2:String(w),y2:String(A),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return F},[a,f,p,g.length,i,s,x]),T=S(()=>{let F=[],R=ns(f.range),N=Math.ceil(f.min/R)*R,A=p-8;for(let k=N;k<=f.max;k+=R){let w=x(k);F.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(A),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return F.push(o("text",{key:"time-unit",x:String(n-m),y:String(A),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),F},[f,p,x,u,n,m]),D=S(()=>{let F=[],R="";for(let N=0;N<g.length;N++){let A=g[N],k=p+N*(i+s)+s,w=x(A.start),$=Math.max(2,x(A.start+A.duration)-w),E=Sd(N,A.color);A.group&&A.group!==R&&(R=A.group,l&&F.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"},A.group))),F.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String($),height:String(i),rx:"4",ry:"4",fill:E,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&F.push(o("text",{key:`label-${A.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},A.label.length>16?A.label.substring(0,14)+"..":A.label)),d&&$>30&&F.push(o("text",{key:`prog-${A.id}`,x:String(w+$/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${A.start}-${A.start+A.duration}`))}return F},[g,p,i,s,x,l,d,c,m]),C=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n,m]),P=v(),L=T(),I=D(),M=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Gantt chart",style:{fontFamily:"sans-serif"}},...M,...P,...L,...I)}var vd=Math.PI/180;function wd(e){return e*vd}function _e(e,t,n,r){let i=wd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function rs(e,t,n,r,i){let s=_e(e,t,n,i),a=_e(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 kd(e,t,n){return e<t?t:e>n?n:e}function et(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function is(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:b=!0,showTicks:m=!0,tickCount:c=10,label:f,unit:g,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:h="#374151",backgroundColor:p="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,T=isFinite(t)&&!isNaN(t)?kd(t,x,v):x,D=(u?24:0)+(f?18:0),C=i/2,P=(s-D)*.6,L=Math.min(i/2,(s-D)*.55)-d/2-10,I=L-d,M=L-d/2,F=l-a,R=S(V=>{let j=v-x;if(j===0)return a;let H=(V-x)/j;return a+H*F},[x,v,a,F]),N=S(()=>{let V=rs(C,P,M,a,l);return[o("path",{key:"bg-arc",d:V,fill:"none",stroke:p,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,P,M,a,l,p,d]),A=S(()=>{if(y.length===0)return[];let V=[],j=F/y.length;for(let H=0;H<y.length;H++){let Y=a+H*j,K=Y+j,Q=rs(C,P,M,Y,K);V.push(o("path",{key:`seg-${H}`,d:Q,fill:"none",stroke:y[H],"stroke-width":String(d),"stroke-linecap":H===0||H===y.length-1?"round":"butt",opacity:"0.85"}))}return V},[y,F,a,C,P,M,d]),k=S(()=>{if(!m||c<=0)return[];let V=[],j=Math.max(1,Math.min(c,100));for(let H=0;H<=j;H++){let Y=H/j,K=a+Y*F,Q=H%2===0,se=Q?10:6,J=_e(C,P,L+4,K),ae=_e(C,P,L+4+se,K);if(V.push(o("line",{key:`tick-${H}`,x1:String(J.x),y1:String(J.y),x2:String(ae.x),y2:String(ae.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let de=x+Y*(v-x),le=_e(C,P,L+4+se+12,K);V.push(o("text",{key:`tick-label-${H}`,x:String(le.x),y:String(le.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(de)))}}return V},[m,c,a,F,C,P,L,x,v]),w=S(()=>{let V=[],j=R(T),H=I-8,Y=_e(C,P,H,j),K=6,Q=j+90,se=j-90,J=_e(C,P,K,Q),ae=_e(C,P,K,se);return V.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${J.x},${J.y} ${ae.x},${ae.y}`,fill:h,stroke:"none"})),V.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(P),r:"8",fill:h,stroke:"#fff","stroke-width":"2"})),V},[T,R,C,P,I,h]),$=S(()=>{if(!u)return[];let V=[],j=et(T),H=j+(g?" "+g:""),Y=P+M+20;return V.push(o("text",{key:"value-text",x:String(C),y:String(Y),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${H}`},j,g?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+g):null)),V},[u,T,g,C,P,M]),E=S(()=>{if(!f)return[];let V=P+M+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(V),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},f)]},[f,C,P,M,u]),W=S(()=>{if(!b)return[];let V=[],j=_e(C,P,M,a),H=_e(C,P,M,l);return V.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"},et(x))),V.push(o("text",{key:"max-label",x:String(H.x+4),y:String(H.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(v))),V},[b,C,P,M,a,l,x,v]),z=N(),B=A(),O=k(),_=w(),U=$(),X=E(),ee=W(),Z=`Gauge: ${et(T)}${g?" "+g:""}, range ${et(x)} to ${et(v)}${f?", "+f:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(T),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":Z,style:{fontFamily:"sans-serif"}},...z,...B,...O,..._,...U,...X,...ee)}var Et={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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1.6 .5,-5.4 1,-1.8 -.3,-2.7 -1.2,-1.3 -1.8,-.3 v -1.7 l 2.8,-5.8 5.9,-3.9 -.4,-13 .9,.4 .6,-.5 .1,-1.1 .9,-.6 1.4,1.2 .7,-.1 h 2.6 l 6.8,-2.6 .3,-1 h 1.2 l .7,-1.2 .4,.8 1.8,-.9 1.8,-1.7 .3,.5 1,-1 2.2,1.6 -.8,1.6 -1.2,1.4 .5,1.5 -1.4,1.6 .4,.9 2.3,-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function ss(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:b="Map of the United States"}=e,m=q(()=>Object.keys(Et),[]),c=S(p=>{l&&l(p)},[l]),f=S((p,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(p)},[d,u]),g=S((p,x)=>{let v=x.currentTarget;if(v){let T=r[p]??i;v.setAttribute("fill",T)}d&&d(null)},[d,r,i]),y=q(()=>{let p=[];for(let x=0;x<m.length;x++){let v=m[x],T=Et[v],D=r[v]??i,C={key:`state-${v}`,d:T.path,fill:D,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":T.name,style:{cursor:l?"pointer":"default"}};if(l){let L=v;C.onClick=()=>c(L),C.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(L)},C.tabindex=0,C.role="button",C["aria-label"]=T.name}let P=v;C.onMouseOver=L=>f(P,L),C.onMouseOut=L=>g(P,L),p.push(o("path",C))}return p},[m,r,i,s,a,l,c,f,g]),h=o("title",{key:"map-title"},b);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b,style:{fontFamily:"sans-serif"}},h,...y)}function Yn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Cd(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 Md(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Yn(t[i]),l=Yn(t[i+1]);return Cd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Ed(e){let{r:t,g:n,b:r}=Yn(e);return(.299*t+.587*n+.114*r)/255}var Rd=["#3b82f6","#fbbf24","#ef4444"];function as(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Rd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:b="#fff",cellBorderWidth:m=1,title:c,padding:f=60}=e,g=t.length,y=q(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:h,maxVal:p}=q(()=>{let k=l??1/0,w=d??-1/0;for(let $ of t)for(let E of $)l===void 0&&E<k&&(k=E),d===void 0&&E>w&&(w=E);return k===1/0&&(k=0),w===-1/0&&(w=1),k===w&&(w=k+1),{minVal:k,maxVal:w}},[t,l,d]),x=c?30:0,v=n?f:20,T=r?f:20,D=i-v-20,C=s-x-T-20,P=y>0?D/y:0,L=g>0?C/g:0,I=S(()=>{let k=[];for(let w=0;w<g;w++){let $=t[w];for(let E=0;E<y;E++){let W=E<$.length?$[E]:0,z=(W-h)/(p-h),B=Md(z,a),O=v+E*P,_=x+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${E}`,x:String(O),y:String(_),width:String(P),height:String(L),fill:B,stroke:b,"stroke-width":String(m)})),u){let U=Ed(B)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${E}`,x:String(O+P/2),y:String(_+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,P*.3,L*.4)),"font-family":"sans-serif",fill:U},String(Math.round(W*100)/100)))}}}return k},[t,g,y,h,p,a,P,L,v,x,u,b,m]),M=S(()=>{let k=[];if(n)for(let w=0;w<g;w++){let $=w<n.length?n[w]:"",E=x+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(v-8),y:String(E),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}if(r)for(let w=0;w<y;w++){let $=w<r.length?r[w]:"",E=v+w*P+P/2,W=x+20+g*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(E),y:String(W),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}return k},[n,r,g,y,P,L,v,x]),F=S(()=>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(g===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 R=F(),N=I(),A=M();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"}},...R,...N,...A)}function Pd(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 Id(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Vn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ls(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:b,yLabel:m,padding:c=60}=e,f=Math.max(1,Math.round(n)),g=q(()=>Pd(t,f),[t,f]),y=q(()=>{let R=0;for(let N=0;N<g.length;N++)g[N].count>R&&(R=g[N].count);return R>0?R:1},[g]),h=r-c*2,p=i-c*2,x=S(()=>{if(!l)return[];let R=Id(y),N=[];for(let A=R;A<=y;A+=R){let k=c+p-A/y*p;N.push(o("line",{key:`grid-${A}`,x1:String(c),y1:String(k),x2:String(c+h),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${A}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(A)))}return N},[l,y,c,h,p]),v=S(()=>{let R=[];return R.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),R.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+p),x2:String(c+h),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),R},[c,h,p]),T=S(()=>{if(g.length===0)return[];let R=[],N=a*(g.length-1),A=Math.max(1,(h-N)/g.length);for(let k=0;k<g.length;k++){let w=g[k],$=w.count/y*p,E=c+k*(A+a),W=c+p-$;if(R.push(o("rect",{key:`bar-${k}`,x:String(E),y:String(W),width:String(A),height:String($),fill:s})),d&&w.count>0&&R.push(o("text",{key:`val-${k}`,x:String(E+A/2),y:String(W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),g.length<=15||k%2===0||k===g.length-1){let B=(g.length===1,Vn(w.min));R.push(o("text",{key:`xlabel-${k}`,x:String(E+A/2),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},B))}}if(g.length>0){let k=g[g.length-1],w=c+h;R.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Vn(k.max)))}return R},[g,y,a,s,d,c,h,p]),D=S(()=>{let R=[];return u&&R.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),b&&R.push(o("text",{key:"x-label",x:String(c+h/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},b)),m&&R.push(o("text",{key:"y-label",x:String(14),y:String(c+p/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+p/2})`},m)),R},[u,b,m,r,i,c,h,p]),C=S(()=>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]),P=x(),L=v(),I=T(),M=D(),F=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"}},...M,...P,...L,...I,...F)}function $d(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 cs(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:b=!0,title:m,padding:c=60}=e,f=i==="vertical",g=f?30:0,y=n-c*2,h=r-c*2-g,p=f?h:y,x=f?y:h,v=q(()=>{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]),T=q(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=$d(v),w=[];for(let $=k;$<=v;$+=k){let E=$/v*p;if(f){let W=c+h-E;w.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(W),x2:String(c+y),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}else{let W=c+E;w.push(o("line",{key:`grid-${$}`,x1:String(W),y1:String(c),x2:String(W),y2:String(c+h),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(W),y:String(c+h+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}}return w},[u,v,f,c,y,h,p]),C=S(()=>{let k=[];return f?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+h),x2:String(c+y),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k},[f,c,y,h]),P=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let $=t[w],E=$.value/v*p,W=T*w+T/2,z=$.color??d;if(f){let B=c+W,O=c+h,_=c+h-E;k.push(o("line",{key:`stem-${w}`,x1:String(B),y1:String(O),x2:String(B),y2:String(_),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(B),cy:String(_),r:String(l),fill:z})),b&&k.push(o("text",{key:`val-${w}`,x:String(B),y:String(_-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value)));let U=B,X=c+h+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(X),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${X})`},$.label))}else{let B=c+W,O=c,_=c+E;k.push(o("line",{key:`stem-${w}`,x1:String(O),y1:String(B),x2:String(_),y2:String(B),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(_),cy:String(B),r:String(l),fill:z})),b&&k.push(o("text",{key:`val-${w}`,x:String(_+l+4),y:String(B+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},$.label))}}return k},[t,v,T,d,l,s,a,b,f,c,y,h,p]),L=S(()=>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]),I=S(()=>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]),M=D(),F=C(),R=P(),N=L(),A=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":m??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...M,...F,...R,...A)}function Un(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Dd(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 Td(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Un(t[i]),l=Un(t[i+1]);return Dd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function zd(e){let{r:t,g:n,b:r}=Un(e);return(.299*t+.587*n+.114*r)/255}var Ad=["#f0f9ff","#3b82f6","#1e3a8a"];function ds(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Ad,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:b="#e5e7eb",title:m,padding:c=70,symmetric:f=!1}=e,g=r??n,y=i??n,h=t.length,p=q(()=>{let z=0;for(let B of t)B.length>z&&(z=B.length);return z},[t]),x=q(()=>{if(!f||h===0)return t;let z=[],B=Math.max(h,p);for(let O=0;O<B;O++){let _=[];for(let U=0;U<B;U++){let X=t[O],ee=X&&U<X.length?X[U]:0,Z=t[U],V=Z&&O<Z.length?Z[O]:0;ee!==0?_.push(ee):_.push(V)}z.push(_)}return z},[t,f,h,p]),v=x.length,T=q(()=>{let z=0;for(let B of x)B.length>z&&(z=B.length);return z},[x]),{minVal:D,maxVal:C}=q(()=>{let z=1/0,B=-1/0;for(let O of x)for(let _ of O)_<z&&(z=_),_>B&&(B=_);return z===1/0&&(z=0),B===-1/0&&(B=1),z===B&&(B=z+1),{minVal:z,maxVal:B}},[x]),P=m?30:0,L=g?c:20,I=y?c:20,M=s-L-20,F=a-P-I-20,R=T>0?M/T:0,N=v>0?F/v:0,A=S(()=>{let z=[];for(let B=0;B<v;B++){let O=x[B];for(let _=0;_<T;_++){let U=_<O.length?O[_]:0,X=(U-D)/(C-D),ee=Td(X,l),Z=L+_*R,V=P+20+B*N,j=B===_,H=j&&u?"currentColor":b,Y=j&&u?"2":"1";if(z.push(o("rect",{key:`cell-${B}-${_}`,x:String(Z),y:String(V),width:String(R),height:String(N),fill:ee,stroke:H,"stroke-width":Y})),d){let K=zd(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,R*.3,N*.35);z.push(o("text",{key:`val-${B}-${_}`,x:String(Z+R/2),y:String(V+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:K},String(Math.round(U*100)/100)))}}}return z},[x,v,T,D,C,l,R,N,L,P,d,u,b]),k=S(()=>{let z=[];if(g)for(let B=0;B<v;B++){let O=B<g.length?g[B]:"",_=P+20+B*N+N/2;z.push(o("text",{key:`row-label-${B}`,x:String(L-8),y:String(_),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O))}if(y)for(let B=0;B<T;B++){let O=B<y.length?y[B]:"",_=L+B*R+R/2,U=P+20+v*N+12;z.push(o("text",{key:`col-label-${B}`,x:String(_),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O))}return z},[g,y,v,T,R,N,L,P]),w=S(()=>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(v===0||T===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 $=w(),E=A(),W=k();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix visualization",style:{fontFamily:"sans-serif"}},...$,...E,...W)}var Ld=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Gt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Fd(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 Nd(e,t,n,r,i,s,a){let l=[];if(Gt(e)<=0)return l;let b=Fd(e)+1,m=s==="horizontal",c=m?i/b:r/b,f=[];for(f.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});f.length>0;){let g=f.shift(),{node:y,depth:h,spanStart:p,spanEnd:x,colorIndex:v}=g,T=Gt(y);if(T<=0)continue;let D=x-p,C,P,L,I;if(m?(C=p,P=n+h*c,L=D,I=c):(C=t+h*c,P=p,L=c,I=D),l.push({x:C,y:P,w:L,h:I,label:y.label,value:T,color:y.color??a[v%a.length],depth:h}),y.children&&y.children.length>0){let M=p;for(let F=0;F<y.children.length;F++){let R=y.children[F],N=Gt(R);if(N<=0)continue;let A=N/T*D;f.push({node:R,depth:h+1,spanStart:M,spanEnd:M+A,colorIndex:h===0?F:v}),M+=A}}}return l}function us(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Ld,borderColor:d="#ffffff",borderWidth:u=1,title:b,padding:m=10}=e,c=b?30:0,f=m,g=m+c,y=n-m*2,h=r-m*2-c;if(q(()=>Gt(t),[t])<=0||y<=0||h<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=q(()=>Nd(t,f,g,y,h,i,l),[t,f,g,y,h,i,l]),v=[];b&&v.push(o("text",{key:"title",x:String(n/2),y:String(m+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let T=0;T<x.length;T++){let D=x[T];if(v.push(o("rect",{key:`cell-${T}`,x:String(D.x),y:String(D.y),width:String(Math.max(0,D.w)),height:String(Math.max(0,D.h)),fill:D.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),s&&D.w>20&&D.h>14){let C=Math.floor(D.w/7),P=D.label.length>C?D.label.substring(0,Math.max(1,C-2))+"..":D.label;v.push(o("text",{key:`label-${T}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},P))}a&&D.w>30&&D.h>28&&v.push(o("text",{key:`value-${T}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(D.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function jn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function ps(e,t){let n=new Set;for(let i of e)n.add(jn(i,t));let r=Array.from(n);return r.sort(),r}function Xt(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 qt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Wd(e,t,n,r,i){let s=ps(e,t),a=ps(e,n),l=new Map;for(let f of e){let g=jn(f,t),y=jn(f,n),h=`${g}::${y}`;l.has(h)||l.set(h,[]);let p=l.get(h),x=0;for(let v of r){let T=f[v];if(typeof T=="number")x+=T;else if(typeof T=="string"){let D=parseFloat(T);isNaN(D)||(x+=D)}}p.push(x)}let d=new Map;for(let[f,g]of l)d.set(f,Xt(g,i));let u=new Map;for(let f of s){let g=[];for(let y of a){let h=d.get(`${f}::${y}`);h!==void 0&&g.push(h)}u.set(f,Xt(g,i==="count"?"sum":i))}let b=new Map;for(let f of a){let g=[];for(let y of s){let h=d.get(`${y}::${f}`);h!==void 0&&g.push(h)}b.set(f,Xt(g,i==="count"?"sum":i))}let m=[];for(let f of u.values())m.push(f);let c=Xt(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:b,grandTotal:c}}function fs(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:b="#3b82f6",cellPadding:m=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>Wd(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:f,colKeys:g,cells:y,rowTotals:h,colTotals:p,grandTotal:x}=c,v=u?30:0,T=g.length+(d?1:0),D=f.length+(d?1:0),C=1+T,P=1+D,L=Math.max(40,(a-m*2)/C),I=Math.max(20,Math.min(36,(l-v-m*2)/P)),M=L*C,F=I*P,R=Math.max(0,(a-M)/2),N=v+Math.max(0,(l-v-F)/2),A=[];u&&A.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),A.push(o("rect",{key:"header-row-bg",x:String(R),y:String(N),width:String(M),height:String(I),fill:b})),A.push(o("rect",{key:"header-col-bg",x:String(R),y:String(N+I),width:String(L),height:String(I*D),fill:b,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(R+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<g.length;k++){let w=R+(k+1)*L,$=Math.floor(L/7),E=g[k],W=E.length>$?E.substring(0,Math.max(1,$-2))+"..":E;A.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W))}d&&A.push(o("text",{key:"ch-total",x:String(R+(g.length+1)*L+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<f.length;k++){let w=f[k],$=N+(k+1)*I;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(R+L),y:String($),width:String(L*T),height:String(I),fill:"#f9fafb"}));let E=Math.floor(L/7),W=w.length>E?w.substring(0,Math.max(1,E-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(R+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W));for(let z=0;z<g.length;z++){let B=g[z],O=`${w}::${B}`,_=y.get(O),U=R+(z+1)*L;A.push(o("rect",{key:`border-${k}-${z}`,x:String(U),y:String($),width:String(L),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),A.push(o("text",{key:`cell-${k}-${z}`,x:String(U+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_!==void 0?qt(_):"-"))}if(d){let z=R+(g.length+1)*L,B=h.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String(z),y:String($),width:String(L),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String(z+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},qt(B)))}}if(d){let k=N+(f.length+1)*I;A.push(o("rect",{key:"total-row-bg",x:String(R),y:String(k),width:String(M),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(R+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let $=0;$<g.length;$++){let E=g[$],W=p.get(E)??0,z=R+($+1)*L;A.push(o("text",{key:`ct-${$}`,x:String(z+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},qt(W)))}let w=R+(g.length+1)*L;A.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},qt(x)))}return A.push(o("rect",{key:"outer-border",x:String(R),y:String(N),width:String(M),height:String(F),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...A)}function Kt(e,t){return Math.PI*2*e/t-Math.PI/2}function Zt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function gs(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:b="#d1d5db",title:m}=e,c=t.length,f=m?30:0,g=d&&n.length>0?30:0,y=60,h=Math.min((r-y*2)/2,(i-y*2-f-g)/2),p=r/2,x=y+f+h,v=q(()=>{let A=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){A.push(w);continue}let $=0;for(let E of n){let W=E.values[k];W!==void 0&&W>$&&($=W)}A.push($>0?$:1)}return A},[t,n,c]),T=S(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=h*k/s,$=[];for(let E=0;E<c;E++){let W=Kt(E,c),z=Zt(p,x,w,W);$.push(`${z.x},${z.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:$.join(" "),fill:"none",stroke:b,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Kt(k,c),$=Zt(p,x,h,w);A.push(o("line",{key:`spoke-${k}`,x1:String(p),y1:String(x),x2:String($.x),y2:String($.y),stroke:b,"stroke-width":"0.75"}))}return A},[c,s,h,p,x,b]),D=S(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let $=Kt(w,c),E=Zt(p,x,h+k,$),W="middle";E.x<p-5?W="end":E.x>p+5&&(W="start");let z=Math.abs(E.y-x)<5?"0.35em":E.y<x?"0em":"0.7em";A.push(o("text",{key:`label-${w}`,x:String(E.x),y:String(E.y),"text-anchor":W,dy:z,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,h,p,x]),C=S(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],$=[],E=[],W=[];for(let z=0;z<c;z++){let B=w.values[z]??0,O=v[z],_=Math.min(B/O,1),U=h*_,X=Kt(z,c),ee=Zt(p,x,U,X);$.push(`${ee.x},${ee.y}`),u&&E.push(o("circle",{key:`dot-${k}-${z}`,cx:String(ee.x),cy:String(ee.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&W.push(o("text",{key:`val-${k}-${z}`,x:String(ee.x),y:String(ee.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(B*100)/100)))}A.push(o("polygon",{key:`series-fill-${k}`,points:$.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:$.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let z of E)A.push(z);for(let z of W)A.push(z)}return A},[c,n,v,h,p,x,u,l]),P=S(()=>{if(!d||n.length===0)return[];let A=[],k=x+h+40,w=100,$=n.length*w,E=p-$/2;for(let W=0;W<n.length;W++){let z=n[W],B=E+W*w;A.push(o("rect",{key:`legend-swatch-${W}`,x:String(B),y:String(k),width:"12",height:"12",rx:"2",fill:z.color})),A.push(o("text",{key:`legend-text-${W}`,x:String(B+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},z.label))}return A},[d,n,p,x,h]),L=S(()=>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 I=T(),M=D(),F=C(),R=P(),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,...I,...M,...F,...R)}var Bd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Od(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let b of u){let m=n.get(b),c=d+1;(m===void 0||c>m)&&n.set(b,c),s.includes(b)||s.push(b)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Hd(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,b=t.filter(M=>M.value>0),m=e.map(M=>M.id),c=Od(m,b),f=new Map,g=new Map;for(let M of m)f.set(M,0),g.set(M,0);for(let M of b)g.set(M.source,(g.get(M.source)??0)+M.value),f.set(M.target,(f.get(M.target)??0)+M.value);let y=0;for(let M of c.values())M>y&&(y=M);let h=new Map;for(let M=0;M<=y;M++)h.set(M,[]);for(let[M,F]of c)h.get(F).push(M);let p=new Map,x=y>0?(d-i)/y:0;for(let M=0;M<=y;M++)p.set(M,a+M*x);let v=new Map;for(let M=0;M<e.length;M++)v.set(e[M].id,e[M]);let T=[],D=new Map;for(let M=0;M<=y;M++){let F=h.get(M);if(F.length===0)continue;let R=0;for(let w of F){let $=f.get(w)??0,E=g.get(w)??0;R+=Math.max($,E,1)}let N=u-s*(F.length-1),A=R>0?N/R:1,k=a;for(let w=0;w<F.length;w++){let $=F[w],E=v.get($),W=f.get($)??0,z=g.get($)??0,B=Math.max(W,z,1),O=Math.max(4,B*A),_=e.findIndex(X=>X.id===$),U={id:$,label:E.label,color:E.color??l[_%l.length],column:M,x:p.get(M),y:k,height:O,totalIn:W,totalOut:z,totalValue:B};T.push(U),D.set($,U),k+=O+s}}let C=new Map,P=new Map;for(let M of m)C.set(M,0),P.set(M,0);let L=[...b].sort((M,F)=>F.value-M.value),I=[];for(let M of L){let F=D.get(M.source),R=D.get(M.target);if(!F||!R)continue;let N=F.totalOut||1,A=R.totalIn||1,k=M.value/N*F.height,w=M.value/A*R.height,$=Math.max(1,(k+w)/2),E=C.get(M.source),W=P.get(M.target),z=F.y+E+k/2,B=R.y+W+w/2;C.set(M.source,E+k),P.set(M.target,W+w);let O=v.get(M.source);I.push({source:M.source,target:M.target,value:M.value,color:M.color??O?.color??F.color,sourceY:z,targetY:B,width:$})}return{layoutNodes:T,layoutLinks:I}}function ms(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:b=Bd,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 f=q(()=>Hd(t,n,r,i,s,a,c,b),[t,n,r,i,s,a,c,b]),g=S(()=>{let T=[];for(let D=0;D<f.layoutLinks.length;D++){let C=f.layoutLinks[D],P=f.layoutNodes.find(N=>N.id===C.source),L=f.layoutNodes.find(N=>N.id===C.target);if(!P||!L)continue;let I=P.x+s,M=L.x,F=(I+M)/2,R=`M ${I} ${C.sourceY} C ${F} ${C.sourceY}, ${F} ${C.targetY}, ${M} ${C.targetY}`;T.push(o("path",{key:`link-${D}`,d:R,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&T.push(o("text",{key:`link-val-${D}`,x:String(F),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 T},[f,s,u,d]),y=S(()=>{let T=[];for(let D=0;D<f.layoutNodes.length;D++){let C=f.layoutNodes[D];if(T.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 P=f.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),L=C.column===P,I=L?C.x+s+6:C.x-6,M=L?"start":"end",F=C.column===0,R=F?C.x-6:I,N=F?"end":M;T.push(o("text",{key:`label-${C.id}`,x:String(R),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 T},[f,s,l]),h=S(()=>m?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r,c]),p=g(),x=y(),v=h();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...p,...x)}var _d=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gn=2*Math.PI;function Rt(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 Yd(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 Vd(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,b=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),f=t+r*Math.sin(u),g=e+n*Math.cos(u),y=t+n*Math.sin(u),h=e+n*Math.cos(d),p=t+n*Math.sin(d);if(a>=Gn-.001){let x=d+Math.PI,v=e+r*Math.cos(x),T=t+r*Math.sin(x),D=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${b} ${m}`,`A ${r} ${r} 0 1 1 ${v} ${T}`,`A ${r} ${r} 0 1 1 ${b} ${m}`,`L ${h} ${p}`,`A ${n} ${n} 0 1 0 ${D} ${C}`,`A ${n} ${n} 0 1 0 ${h} ${p}`,"Z"].join(" ")}return[`M ${b} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${f}`,`L ${g} ${y}`,`A ${n} ${n} 0 ${l} 0 ${h} ${p}`,"Z"].join(" ")}function Ud(e,t,n,r){let i=[],s=Rt(e);if(s<=0)return i;let a=Yd(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let b=0;b<e.children.length;b++){let m=e.children[b],c=Rt(m);if(c<=0)continue;let f=c/s*Gn;d.push({node:m,startAngle:u,endAngle:u+f,depth:0,colorIndex:b}),u+=f}}else return i.push({startAngle:0,endAngle:Gn,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:b,startAngle:m,endAngle:c,depth:f,colorIndex:g}=u,y=Rt(b);if(y<=0)continue;let h=t+f*l,p=h+l;if(i.push({startAngle:m,endAngle:c,innerR:h,outerR:p,label:b.label,value:y,color:b.color??r[g%r.length],depth:f}),b.children&&b.children.length>0){let x=m,v=c-m;for(let T=0;T<b.children.length;T++){let D=b.children[T],C=Rt(D);if(C<=0)continue;let P=C/y*v;d.push({node:D,startAngle:x,endAngle:x+P,depth:f+1,colorIndex:g}),x+=P}}}return i}function hs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=_d,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,b=n/2,m=r/2,c=u?20:0,f=Math.min(b,m-c)-10;if(q(()=>Rt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(b),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>Ud(t,i,f,a),[t,i,f,a]),h=[];u&&h.push(o("text",{key:"title",x:String(b),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let p=m+c/2;for(let x=0;x<y.length;x++){let v=y[x],T=Vd(b,p,v.innerR,v.outerR,v.startAngle,v.endAngle);if(h.push(o("path",{key:`arc-${x}`,d:T,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let D=v.endAngle-v.startAngle,C=v.startAngle+D/2-Math.PI/2,P=(v.innerR+v.outerR)/2,L=v.outerR-v.innerR,I=D*P;if(I>20&&L>14){let M=b+P*Math.cos(C),F=p+P*Math.sin(C),R=Math.floor(Math.min(I,L)/7),N=v.label.length>R?v.label.substring(0,Math.max(1,R-1))+"..":v.label;h.push(o("text",{key:`label-${x}`,x:String(M),y:String(F+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"}},...h)}var jd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Jt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);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 bs(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 Gd(e,t,n,r,i,s){let a=[],l=[],d=Jt(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],b=r*i,m=[];for(let c=0;c<u.length;c++){let f=u[c],g=Jt(f);g<=0||m.push({label:f.label,value:g,area:g/d*b,color:f.color??s[c%s.length],node:f})}for(m.sort((c,f)=>f.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:f,rect:g,depth:y}=c;if(f.length===0)continue;let h={...g},p=0;for(;p<f.length&&h.w>0&&h.h>0;){let x=h.w>=h.h,v=x?h.h:h.w,T=[],D=[];T.push(f[p]),D.push(f[p].area),p++;let C=bs(D,v);for(;p<f.length;){let M=[...D,f[p].area],F=bs(M,v);if(F>C)break;T.push(f[p]),D.push(f[p].area),C=F,p++}let P=0;for(let M of D)P+=M;let L=v>0?P/v:0,I=0;for(let M=0;M<T.length;M++){let F=T[M],R=L>0?F.area/L:0,N,A,k,w;if(x?(N=h.x,A=h.y+I,k=L,w=R):(N=h.x+I,A=h.y,k=R,w=L),a.push({x:N,y:A,w:k,h:w,label:F.label,value:F.value,color:F.color,depth:y}),F.node.children&&F.node.children.length>0){let E=N+2,W=A+2+14,z=k-4,B=w-4-14;if(z>4&&B>4){let O=[],_=F.value,U=z*B;for(let X=0;X<F.node.children.length;X++){let ee=F.node.children[X],Z=Jt(ee);Z<=0||O.push({label:ee.label,value:Z,area:Z/_*U,color:ee.color??s[(X+y+1)%s.length],node:ee})}O.sort((X,ee)=>ee.area-X.area),l.push({nodes:O,rect:{x:E,y:W,w:z,h:B},depth:y+1})}}I+=R}x?h={x:h.x+L,y:h.y,w:h.w-L,h:h.h}:h={x:h.x,y:h.y+L,w:h.w,h:h.h-L}}}return a}function xs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=jd,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:b}=e,m=b?30:0,c=u,f=u+m,g=n-u*2,y=r-u*2-m;if(q(()=>Jt(t),[t])<=0||g<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let p=q(()=>Gd(t,c,f,g,y,a),[t,c,f,g,y,a]),x=[];b&&x.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let v=0;v<p.length;v++){let T=p[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(T.x),y:String(T.y),width:String(Math.max(0,T.w)),height:String(Math.max(0,T.h)),fill:T.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${T.label}: ${T.value}`})),i&&T.w>20&&T.h>14){let D=Math.floor(T.w/7),C=T.label.length>D?T.label.substring(0,Math.max(1,D-2))+"..":T.label;x.push(o("text",{key:`label-${v}`,x:String(T.x+4),y:String(T.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&T.w>30&&T.h>28&&x.push(o("text",{key:`value-${v}`,x:String(T.x+4),y:String(T.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(T.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function ys(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 Xd(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function Ss(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=ys(t[s]),u=ys(t[a]);return Xd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Qt(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 qd(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let b=Math.max(2,Math.min(50,r)),m=d/(b-1),c=u/(b-1);if(n){let g=[];for(let x=0;x<b;x++)for(let v=0;v<b;v++)g.push({x:i+v*m,y:a+x*c});let h=n(g,{gridSize:b,xMin:i,xMax:s,yMin:a,yMax:l}),p=[];for(let x=0;x<g.length;x++){let v=g[x],T=h[x]??{dx:0,dy:0},D=Math.sqrt(T.dx*T.dx+T.dy*T.dy);p.push({x:v.x,y:v.y,dx:T.dx,dy:T.dy,magnitude:D})}return p}if(!t)return[];let f=[];for(let g=0;g<b;g++)for(let y=0;y<b;y++){let h=i+y*m,p=a+g*c,x=t(h,p),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);f.push({x:h,y:p,dx:x.dx,dy:x.dy,magnitude:v})}return f}function Kd(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:b,yMax:m,xSpan:c,ySpan:f,showGrid:g,showAxes:y,colorByMagnitude:h,colorScale:p,arrowColor:x,arrowWidth:v,effectiveArrowScale:T,maxMagnitude:D,title:C,tickFontSize:P}=i,L=F=>s+(F-d)/c*a,I=F=>s+(m-F)/f*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),g){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${P}px sans-serif`,e.fillStyle="#6b7280";let F=Qt(c,10),R=Math.ceil(d/F)*F;for(let k=R;k<=u;k+=F){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=Qt(f,10),A=Math.ceil(b/N)*N;for(let k=A;k<=m;k+=N){let w=I(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=v,b<=0&&m>=0){let F=I(0);e.beginPath(),e.moveTo(s,F),e.lineTo(s+a,F),e.stroke()}if(d<=0&&u>=0){let F=L(0);e.beginPath(),e.moveTo(F,s),e.lineTo(F,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let M=4;for(let F=0;F<r.length;F++){let R=r[F],N=R.magnitude??Math.sqrt(R.dx*R.dx+R.dy*R.dy);if(N<1e-10)continue;let A=L(R.x),k=I(R.y),w=R.dx*T,$=-R.dy*T,E=A+w,W=k+$,z;if(h){let O=N/D;z=Ss(O,p)}else z=x;e.save(),e.strokeStyle=z,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(E,W),e.stroke();let B=Math.sqrt(w*w+$*$);if(B>2){let O=w/B,_=$/B,U=-_,X=O,ee=Math.min(M,B*.4),Z=E-O*ee+U*ee*.5,V=W-_*ee+X*ee*.5,j=E-O*ee-U*ee*.5,H=W-_*ee-X*ee*.5;e.fillStyle=z,e.beginPath(),e.moveTo(E,W),e.lineTo(Z,V),e.lineTo(j,H),e.closePath(),e.fill()}e.restore()}}function vs(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:b=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:f=["#3b82f6","#8b5cf6","#ef4444"],title:g,padding:y=50,tickFontSize:h=10,arrowWidth:p=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:T}=e,D=Math.max(2,Math.min(50,s)),C=r-y*2,P=i-y*2,L=a[0],I=a[1],M=l[0],F=l[1],R=I-L,N=F-M,A=q(()=>Z=>y+(Z-L)/R*C,[y,L,R,C]),k=q(()=>Z=>y+(F-Z)/N*P,[y,F,N,P]),w=q(()=>qd(t,n,T,D,L,I,M,F,R,N),[t,n,T,D,L,I,M,F,R,N]),$=q(()=>{let Z=0;for(let V=0;V<w.length;V++){let j=w[V],H=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);H>Z&&(Z=H)}return Z>0?Z:1},[w]),E=q(()=>Math.min(C,P)/Math.max(D,2)/(2*$)*d,[C,P,D,$,d]);if(x==="canvas"){let Z=te(null),V=te(0);return re(()=>{let j=Z.current;if(!j)return;let H=j.getContext("2d");if(H)return V.current&&cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{Kd(H,r,i,w,{padding:y,chartWidth:C,chartHeight:P,xMin:L,xMax:I,yMin:M,yMax:F,xSpan:R,ySpan:N,showGrid:b,showAxes:m,colorByMagnitude:c,colorScale:f,arrowColor:u,arrowWidth:p,effectiveArrowScale:E,maxMagnitude:$,title:g,tickFontSize:h})}),()=>{V.current&&cancelAnimationFrame(V.current)}},[w,r,i,y,C,P,L,I,M,F,R,N,b,m,c,f,u,p,E,$,g,h]),o("canvas",{ref:Z,width:r,height:i,role:"img","aria-label":g??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let W=S(()=>{if(!b)return[];let Z=[],V=Qt(R,10),j=Math.ceil(L/V)*V;for(let K=j;K<=I;K+=V){let Q=A(K);Z.push(o("line",{key:`gridv-${K}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+P),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+P+16),"text-anchor":"middle","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let H=Qt(N,10),Y=Math.ceil(M/H)*H;for(let K=Y;K<=F;K+=H){let Q=k(K);Z.push(o("line",{key:`gridh-${K}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`ytick-${K}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return Z},[b,L,I,M,F,R,N,A,k,y,C,P]),z=S(()=>{if(!m)return[];let Z=[];if(M<=0&&F>=0){let V=k(0);Z.push(o("line",{key:"axis-x",x1:String(y),y1:String(V),x2:String(y+C),y2:String(V),stroke:"#374151","stroke-width":String(p)}))}if(L<=0&&I>=0){let V=A(0);Z.push(o("line",{key:"axis-y",x1:String(V),y1:String(y),x2:String(V),y2:String(y+P),stroke:"#374151","stroke-width":String(p)}))}return Z.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(P),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),Z},[m,L,I,M,F,A,k,y,C,P]),B=S(()=>{let Z=[];for(let j=0;j<w.length;j++){let H=w[j],Y=H.magnitude??Math.sqrt(H.dx*H.dx+H.dy*H.dy);if(Y<1e-10)continue;let K=A(H.x),Q=k(H.y),se=H.dx*E,J=-H.dy*E,ae=K+se,de=Q+J,le;if(c){let fe=Y/$;le=Ss(fe,f)}else le=u;Z.push(o("line",{key:`arrow-line-${j}`,x1:String(K),y1:String(Q),x2:String(ae),y2:String(de),stroke:le,"stroke-width":String(p),"stroke-linecap":"round"}));let ne=Math.sqrt(se*se+J*J);if(ne>2){let fe=se/ne,oe=J/ne,ie=-oe,ue=fe,he=Math.min(4,ne*.4),be=ae-fe*he+ie*he*.5,pe=de-oe*he+ue*he*.5,ge=ae-fe*he-ie*he*.5,ye=de-oe*he-ue*he*.5;Z.push(o("polygon",{key:`arrow-head-${j}`,points:`${ae},${de} ${be},${pe} ${ge},${ye}`,fill:le}))}}return Z},[w,A,k,E,c,$,f,u]),O=S(()=>g?[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"},g)]:[],[g,r,y]),_=W(),U=z(),X=B(),ee=O();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Vector field plot",style:{fontFamily:"sans-serif"}},...ee,..._,...U,...X)}function Zd(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 Jd(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 ws(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:b=!0,title:m,padding:c=60}=e,f=n-c*2,g=r-c*2,y=q(()=>Zd(t),[t]),{minVal:h,maxVal:p}=q(()=>{let $=0,E=0;for(let W=0;W<y.length;W++){let z=y[W];z.start<$&&($=z.start),z.end<$&&($=z.end),z.start>E&&(E=z.start),z.end>E&&(E=z.end)}return $===E&&(E=$+1),{minVal:$,maxVal:E}},[y]),x=p-h,v=S($=>c+g-($-h)/x*g,[c,g,h,x]),T=q(()=>y.length===0?0:f/y.length,[y.length,f]),D=6,C=Math.max(1,T-D),P=S(()=>{if(!u)return[];let $=Jd(x),E=[],W=Math.ceil(h/$)*$;for(let z=W;z<=p;z+=$){let B=v(z);E.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(B),x2:String(c+f),y2:String(B),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),E.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return E},[u,x,h,p,v,c,f]),L=S(()=>{let $=[];$.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"}));let E=h<=0&&p>=0?v(0):c+g;return $.push(o("line",{key:"axis-x",x1:String(c),y1:String(E),x2:String(c+f),y2:String(E),stroke:"#374151","stroke-width":"1.5"})),$},[c,f,g,h,p,v]),I=S(()=>{if(y.length===0)return[];let $=[];for(let E=0;E<y.length;E++){let W=y[E],z=c+E*T+D/2,B=Math.max(W.start,W.end),O=Math.min(W.start,W.end),_=v(B),U=v(O),X=Math.max(0,U-_),ee;if(W.type==="total"?ee=a:W.type==="decrease"?ee=s:ee=i,$.push(o("rect",{key:`bar-${E}`,x:String(z),y:String(_),width:String(C),height:String(X),fill:ee,rx:"2",ry:"2"})),d){let Z=W.type==="decrease"||W.value<0?U+14:_-4,V=W.type==="total"?String(W.value):(W.value>=0?"+":"")+String(W.value);$.push(o("text",{key:`val-${E}`,x:String(z+C/2),y:String(Z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},V))}if($.push(o("text",{key:`cat-${E}`,x:String(z+C/2),y:String(c+g+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},W.label)),b&&E<y.length-1){let Z=y[E+1],V=v(W.end),j=c+(E+1)*T+D/2;Z.type!=="total"&&$.push(o("line",{key:`conn-${E}`,x1:String(z+C),y1:String(V),x2:String(j),y2:String(V),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return $},[y,T,C,v,i,s,a,l,d,b,c,g]),M=S(()=>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]),F=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),R=P(),N=L(),A=I(),k=M(),w=F();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,...R,...N,...A,...w)}var Qd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],eu=[0,-45,45,90];function tu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),b=Math.abs(Math.sin(d)),m=a*u+l*b,c=a*b+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function nu(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 ou(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function ru(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 ks(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=Qd,rotations:d=eu,padding:u=4,spiral:b="archimedean",title:m}=e,c=q(()=>{if(t.length===0)return[];let g=t.map((C,P)=>({...C,originalIndex:P})).filter(C=>C.text.length>0&&C.weight>0).sort((C,P)=>P.weight-C.weight);if(g.length===0)return[];let y=g[g.length-1].weight,p=g[0].weight-y;function x(C){if(p===0)return(i+s)/2;let P=(C-y)/p;return i+P*(s-i)}let v=[],T=n/2,D=r/2;for(let C=0;C<g.length;C++){let P=g[C],L=x(P.weight),I=d[ru(P.text)%d.length],M=P.color??l[C%l.length],F=!1,R=500,N=b==="archimedean"?4:5;for(let A=0;A<R;A++){let k,w;if(b==="archimedean"){let O=A*.1,_=N*O;k=_*Math.cos(O),w=_*Math.sin(O)}else{let O=Math.floor(A/4)+1,_=A%4,U=(A%4===0?0:A)*N;switch(_){case 0:k=O*N*4,w=U;break;case 1:k=-U,w=O*N*4;break;case 2:k=-O*N*4,w=-U;break;default:k=U,w=-O*N*4;break}}let $=T+k,E=D+w,W=tu(P.text,L,I,$,E),z={x:W.x-u,y:W.y-u,w:W.w+u*2,h:W.h+u*2};if(!ou(z,n,r))continue;let B=!1;for(let O of v)if(nu(z,O.bbox)){B=!0;break}if(!B){v.push({text:P.text,x:$,y:E,fontSize:L,rotation:I,color:M,bbox:z}),F=!0;break}}}return v},[t,n,r,i,s,l,d,u,b]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let f=[];m&&f.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},m));for(let g=0;g<c.length;g++){let y=c[g],h=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;f.push(o("text",{key:`word-${g}`,transform:h,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud",style:{fontFamily:a}},...f)}var iu={0:"#1e293b",1:"#3b82f6"},su="#666";function Cs(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:b="#0f172a",padding:m=10,onCellClick:c,onCellHover:f,title:g}=e,y=n??iu,h=t.length,p=q(()=>{let $=0;for(let E=0;E<t.length;E++){let W=t[E];W!==void 0&&W.length>$&&($=W.length)}return $},[t]),x=u?20:0,v=g?24:0,T=q(()=>{let $=r-m*2-x,E=i-m*2-x-v;if(h===0||p===0)return{cellWidth:0,cellHeight:0};let W=Math.max(0,($-s*(p-1))/p),z=Math.max(0,(E-s*(h-1))/h);return{cellWidth:W,cellHeight:z}},[r,i,m,h,p,s,x,v]),D=S($=>{let E=y[$];return E!==void 0?E:su},[y]),C=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b}),[r,i,b]),P=S(()=>g?[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"},g)]:[],[g,r,m]),L=S(()=>{if(!l||h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=p*$+(p-1)*s,O=h*E+(h-1)*s,_=[];for(let U=0;U<=p;U++){let X=W+U*($+s)-s/2;_.push(o("line",{key:`vgrid-${U}`,x1:String(X),y1:String(z-s/2),x2:String(X),y2:String(z+O+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=h;U++){let X=z+U*(E+s)-s/2;_.push(o("line",{key:`hgrid-${U}`,x1:String(W-s/2),y1:String(X),x2:String(W+B+s/2),y2:String(X),stroke:d,"stroke-width":"0.5"}))}return _},[l,h,p,T,m,x,v,s,d]),I=S(()=>{if(!u||h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=[];for(let O=0;O<p;O++){let _=W+O*($+s)+$/2,U=z-6;B.push(o("text",{key:`col-idx-${O}`,x:String(_),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(O)))}for(let O=0;O<h;O++){let _=W-6,U=z+O*(E+s)+E/2+3;B.push(o("text",{key:`row-idx-${O}`,x:String(_),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(O)))}return B},[u,h,p,T,m,x,v,s]),M=S(()=>{if(h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=[];for(let O=0;O<h;O++){let _=t[O];if(_!==void 0)for(let U=0;U<p;U++){let X=U<_.length?_[U]:0,ee=W+U*($+s),Z=z+O*(E+s),V=D(X),j={key:`cell-${O}-${U}`,x:String(ee),y:String(Z),width:String($),height:String(E),fill:V,rx:String(a),ry:String(a)};if(c){let H=O,Y=U,K=X;j.onClick=()=>c(H,Y,K),j.role="button",j.tabIndex=0}if(f){let H=O,Y=U,K=X;j.onMouseEnter=()=>f(H,Y,K)}B.push(o("rect",j))}}return B},[h,p,t,T,m,x,v,s,a,D,c,f]),F=C(),R=P(),N=L(),A=I(),k=M(),w=g?`${g} \u2014 ${h}x${p} discrete grid`:`${h}x${p} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},F,...R,...N,...A,...k)}
7
+ `,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=w(l=>t.dismiss(l),[t]),a=r.map(l=>o(al,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function wr(e={}){let t=ne(null);t.current||(t.current=an(e));let n=t.current,r=w(()=>o(ln,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var ll=6,cl=8;function dl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=cl;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function ul(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${ll}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function kr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),g=ne(null),h=ne(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,f=w(()=>{h.current=setTimeout(()=>{if(g.current){let x=g.current.getBoundingClientRect();u(dl(x,n))}l(!0)},r)},[r,n]),p=w(()=>{h.current&&(clearTimeout(h.current),h.current=null),l(!1)},[]);se(()=>()=>{h.current&&clearTimeout(h.current)},[]);let y={display:"inline-block"},b={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},m=[o("div",{ref:g,style:y,onMouseEnter:f,onMouseLeave:p,onFocus:f,onBlur:p,"aria-describedby":a?c:void 0},s)];return a&&d&&m.push(o("div",{id:c,style:b,role:"tooltip"},t,o("div",{style:ul(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...m)}function cn(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function pl(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function fl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ml(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var Cr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Mr(e,t){return t||Cr[e%Cr.length]}function Er(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:g="#e5e7eb",title:h,padding:c=50,animate:f=!1,stacked:p,grouped:y=!1}=e,b=i==="vertical",m=n-c*2,x=r-c*2,v=b?x:m,D=b?m:x,T=p!==void 0&&p.length>0,C=q(()=>T?ml(p):[],[T,p]),$=T?p.length:t.length,A=q(()=>pl(t,p,y),[t,p,y]),z=A>0?A:1,P=cn($,z,v,D,a),B=w(()=>{if(!u)return[];let O=fl(z),H=[];for(let X=O;X<=z;X+=O){let J=P.valueScale(X);if(b){let K=c+x-J;H.push(o("line",{key:`grid-${X}`,x1:String(c),y1:String(K),x2:String(c+m),y2:String(K),stroke:g,"stroke-width":"1","stroke-dasharray":"4 2"})),H.push(o("text",{key:`grid-label-${X}`,x:String(c-6),y:String(K+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}else{let K=c+J;H.push(o("line",{key:`grid-${X}`,x1:String(K),y1:String(c),x2:String(K),y2:String(c+x),stroke:g,"stroke-width":"1","stroke-dasharray":"4 2"})),H.push(o("text",{key:`grid-label-${X}`,x:String(K),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}}return H},[u,z,P,b,c,m,x,g]),I=w(()=>{let O=[];return b?(O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+m),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+m),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),O},[b,c,m,x]),N=w(()=>{let O=[];for(let H=0;H<t.length;H++){let X=t[H],J=P.valueScale(X.value),K=P.categoryScale(H),U=X.color??s,j,V,Y=String(X.value);if(b){let Z=c+K,Q=c+x-J;j={x:String(Z),y:String(Q),width:String(P.barThickness),height:String(J),rx:String(l),ry:String(l),fill:U},V={x:String(Z+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+K,Q=c;j={x:String(Q),y:String(Z),width:String(J),height:String(P.barThickness),rx:String(l),ry:String(l),fill:U},V={x:String(Q+J+6),y:String(Z+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(f&&(j.style=b?`animation: barGrow 0.6s ease-out ${H*.05}s both`:`animation: barGrow 0.6s ease-out ${H*.05}s both`),O.push(o("rect",{key:`bar-${H}`,...j})),d&&O.push(o("text",{key:`val-${H}`,...V},Y)),b){let Z=c+K+P.barThickness/2,Q=c+x+16;O.push(o("text",{key:`cat-${H}`,x:String(Z),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${Q})`},X.label))}else O.push(o("text",{key:`cat-${H}`,x:String(c-6),y:String(c+K+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return O},[t,P,s,l,d,f,b,c,x]),L=w(()=>{if(!p)return[];let O=[];for(let H=0;H<p.length;H++){let X=p[H],J=P.categoryScale(H),K=0;for(let U=0;U<X.values.length;U++){let j=X.values[U],V=P.valueScale(j.value),Y=P.valueScale(K),Z=Mr(U,j.color);if(b){let Q=c+J,ae=c+x-Y-V;O.push(o("rect",{key:`sbar-${H}-${U}`,x:String(Q),y:String(ae),width:String(P.barThickness),height:String(V),rx:U===X.values.length-1?String(l):"0",ry:U===X.values.length-1?String(l):"0",fill:Z,...f?{style:`animation: barGrow 0.6s ease-out ${(H*X.values.length+U)*.03}s both`}:{}})),d&&V>14&&O.push(o("text",{key:`sval-${H}-${U}`,x:String(Q+P.barThickness/2),y:String(ae+V/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,ae=c+J;O.push(o("rect",{key:`sbar-${H}-${U}`,x:String(Q),y:String(ae),width:String(V),height:String(P.barThickness),rx:U===X.values.length-1?String(l):"0",ry:U===X.values.length-1?String(l):"0",fill:Z,...f?{style:`animation: barGrow 0.6s ease-out ${(H*X.values.length+U)*.03}s both`}:{}})),d&&V>20&&O.push(o("text",{key:`sval-${H}-${U}`,x:String(Q+V/2),y:String(ae+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}K+=j.value}if(d){let U=P.valueScale(K);b?O.push(o("text",{key:`stotal-${H}`,x:String(c+J+P.barThickness/2),y:String(c+x-U-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(K))):O.push(o("text",{key:`stotal-${H}`,x:String(c+U+6),y:String(c+J+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(K)))}if(b){let U=c+J+P.barThickness/2,j=c+x+16;O.push(o("text",{key:`scat-${H}`,x:String(U),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${j})`},X.label))}else O.push(o("text",{key:`scat-${H}`,x:String(c-6),y:String(c+J+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return O},[p,P,l,d,f,b,c,x]),M=w(()=>{if(!p)return[];let O=C.length,H=[];for(let X=0;X<p.length;X++){let J=p[X],K=P.categoryScale(X),U=2,j=Math.max(1,(P.barThickness-U*(O-1))/O);for(let V=0;V<J.values.length;V++){let Y=J.values[V],Z=C.indexOf(Y.category),Q=Z*(j+U),ae=P.valueScale(Y.value),ee=Mr(Z>=0?Z:V,Y.color);if(b){let te=c+K+Q,le=c+x-ae;H.push(o("rect",{key:`gbar-${X}-${V}`,x:String(te),y:String(le),width:String(j),height:String(ae),rx:String(l),ry:String(l),fill:ee,...f?{style:`animation: barGrow 0.6s ease-out ${(X*O+V)*.04}s both`}:{}})),d&&H.push(o("text",{key:`gval-${X}-${V}`,x:String(te+j/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let te=c,le=c+K+Q;H.push(o("rect",{key:`gbar-${X}-${V}`,x:String(te),y:String(le),width:String(ae),height:String(j),rx:String(l),ry:String(l),fill:ee,...f?{style:`animation: barGrow 0.6s ease-out ${(X*O+V)*.04}s both`}:{}})),d&&H.push(o("text",{key:`gval-${X}-${V}`,x:String(te+ae+4),y:String(le+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(b){let V=c+K+P.barThickness/2,Y=c+x+16;H.push(o("text",{key:`gcat-${X}`,x:String(V),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${Y})`},J.label))}else H.push(o("text",{key:`gcat-${X}`,x:String(c-6),y:String(c+K+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},J.label))}return H},[p,C,P,l,d,f,b,c,x]),S=w(()=>h?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,c]),k=w(()=>f?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[f,b]),E=B(),F=I(),R=S(),W=k(),_;return T&&y?_=M():T?_=L():_=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...R,...E,...F,..._)}function tt(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function Tt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function zt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let g=t[u],h=e(g);isFinite(h)&&a.push({input:g,output:h})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Rr(l)};return Rr(l),()=>{i=!0}}function Rr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function gl(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function Pr(e,t){let n=t-e;if(n<=0)return[e];let r=gl(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function Ir(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var be=40,$r=1.1,Tr=.01,zr=1e6;function Dr(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:g=!0,showAxes:h=!0,pointRadius:c=3,pointColor:f="#3b82f6",curveColor:p="#3b82f6",gridColor:y="#e2e8f0",axisColor:b="#94a3b8",onPointClick:m,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:D}=e,[T,C]=G(d[0]),[$,A]=G(d[1]),[z,P]=G(u[0]),[B,I]=G(u[1]),N=ne(!1),L=ne(null),M=w(Y=>be+(Y-T)/($-T)*(t-2*be),[T,$,t]),S=w(Y=>n-be-(Y-z)/(B-z)*(n-2*be),[z,B,n]),k=w(Y=>T+(Y-be)/(t-2*be)*($-T),[T,$,t]),E=w(Y=>z+(n-be-Y)/(n-2*be)*(B-z),[z,B,n]),F=w(Y=>{let Z=Y;N.current=!0,L.current={mx:Z.clientX,my:Z.clientY,x0:T,x1:$,y0:z,y1:B}},[T,$,z,B]),R=w(Y=>{if(!N.current||!L.current)return;let Z=Y,Q=L.current,ae=Z.clientX-Q.mx,ee=Z.clientY-Q.my,te=ae/(t-2*be)*(Q.x1-Q.x0),le=ee/(n-2*be)*(Q.y1-Q.y0);C(Q.x0-te),A(Q.x1-te),P(Q.y0+le),I(Q.y1+le)},[t,n]),W=w(()=>{N.current=!1,L.current=null},[]),_=w(Y=>{let Z=Y;Z.preventDefault();let Q=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-Q.left,ee=Z.clientY-Q.top,te=k(ae),le=E(ee),ce=Z.deltaY>0?$r:1/$r,oe=($-T)*ce,ue=(B-z)*ce;if(oe<Tr||ue<Tr||oe>zr||ue>zr)return;let re=(te-T)/($-T),ie=(le-z)/(B-z);C(te-re*oe),A(te+(1-re)*oe),P(le-ie*ue),I(le+(1-ie)*ue)},[T,$,z,B,k,E]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),g){let Y=Pr(T,$),Z=Pr(z,B);for(let Q=0;Q<Y.length;Q++){let ae=M(Y[Q]);O.push(o("line",{x1:ae,y1:be,x2:ae,y2:n-be,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),O.push(o("text",{x:ae,y:n-be+14,"text-anchor":"end","font-size":10,fill:b,transform:`rotate(-45, ${ae}, ${n-be+14})`,key:`lx-${Q}`},Ir(Y[Q])))}for(let Q=0;Q<Z.length;Q++){let ae=S(Z[Q]);O.push(o("line",{x1:be,y1:ae,x2:t-be,y2:ae,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),O.push(o("text",{x:be-6,y:ae+3,"text-anchor":"end","font-size":10,fill:b,key:`ly-${Q}`},Ir(Z[Q])))}}if(h){let Y=Math.max(be,Math.min(t-be,M(0))),Z=Math.max(be,Math.min(n-be,S(0)));O.push(o("line",{x1:be,y1:Z,x2:t-be,y2:Z,stroke:b,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:Y,y1:be,x2:Y,y2:n-be,stroke:b,"stroke-width":1,key:"y-axis"}))}let H=q(()=>{if(!i||!l)return[];let Y=a??($-T)/s,Z=tt({start:T,end:$,step:Y});return Tt(i,Z)},[i,T,$,a,s,l]),[X,J]=G([]),K=ne(null);se(()=>{if(!i||l){J([]);return}let Y=a??($-T)/s,Z=tt({start:T,end:$,step:Y});return K.current&&K.current(),K.current=zt(i,Z,200,Q=>{J([...Q])}),()=>{K.current&&K.current()}},[i,T,$,a,s,l]);let U=l?H:X;if(U.length>0){let Y=[];for(let Z=0;Z<U.length;Z++){let Q=U[Z],ae=M(Q.input),ee=S(Q.output);Y.push(`${Y.length===0?"M":"L"}${ae},${ee}`)}O.push(o("path",{d:Y.join(" "),fill:"none",stroke:p,"stroke-width":1.5,key:"curve"}))}let j=(Y,Z,Q,ae)=>{if(Z)return ee=>Z({x:ae.x,y:ae.y,index:Q,event:ee})};for(let Y=0;Y<r.length;Y++){let Z=r[Y],Q=M(Z.x),ae=S(Z.y),ee={cx:Q,cy:ae,r:c,fill:f,cursor:"pointer",key:`pt-${Y}`};m&&(ee.onClick=j("click",m,Y,Z)),x&&(ee.onDblClick=j("dblclick",x,Y,Z)),v&&(ee.onContextMenu=j("contextmenu",v,Y,Z)),D&&(ee.onMouseOver=j("mouseover",D,Y,Z)),O.push(o("circle",ee))}let V=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:be,y:be,width:t-2*be,height:n-2*be})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:F,onMouseMove:R,onMouseUp:W,onMouseLeave:W,onWheel:_},V,...O)}function Lr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function Ar(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,g=0,h=0,c=0;return i<60?(g=l,h=d):i<120?(g=d,h=l):i<180?(h=l,c=d):i<240?(h=d,c=l):i<300?(g=d,c=l):(g=l,c=d),[Math.floor((g+u)*255),Math.floor((h+u)*255),Math.floor((c+u)*255)]}function Br(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Lr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let g=0;g<e;g++){let h=n[0]+g/e*(n[1]-n[0]);d.push(s(h,u,i))}a.push(d)}return a}function Fr(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Lr,data:d,resolution:u=2,onPointClick:g,onPointHover:h,onPointDoubleClick:c,onPointContextMenu:f}=e;if(d){let E=d.length,F=E>0?d[0].length:0,R=F>0?t/F:1,W=E>0?n/E:1,_=[];for(let O=0;O<E;O++){let H=d[O];for(let X=0;X<F;X++){let J=H[X]??0,[K,U,j]=Ar(J,s,a);_.push(o("rect",{key:`${O}-${X}`,x:String(X*R),y:String(O*W),width:String(Math.ceil(R)),height:String(Math.ceil(W)),fill:`rgb(${K},${U},${j})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},..._)}let[p,y]=G(r[0]),[b,m]=G(r[1]),[x,v]=G(i[0]),[D,T]=G(i[1]),C=ne(null),$=ne(!1),A=ne(null),z=w((E,F)=>{let R=p+E/t*(b-p),W=D-F/n*(D-x);return{re:R,im:W}},[p,b,x,D,t,n]);se(()=>{let E=C.current;if(!E)return;let F=E.getContext("2d");if(!F)return;let R=F.createImageData(t,n),W=R.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:H,im:X}=z(O,_),J=l(H,X,s),[K,U,j]=Ar(J,s,a),V=(_*t+O)*4;W[V]=K,W[V+1]=U,W[V+2]=j,W[V+3]=255}F.putImageData(R,0,0)},[p,b,x,D,t,n,s,a,l,z]);let P=w(E=>{let F=E.target.getBoundingClientRect(),R=E.clientX-F.left,W=E.clientY-F.top,{re:_,im:O}=z(R,W),H=l(_,O,s);return{re:_,im:O,iterations:H,event:E}},[z,l,s]),B=w(E=>{$.current=!0,A.current={x:E.clientX,y:E.clientY,rMin:p,rMax:b,iMin:x,iMax:D}},[p,b,x,D]),I=w(E=>{if(h&&h(P(E)),!$.current||!A.current)return;let F=A.current,R=E.clientX-F.x,W=E.clientY-F.y,_=(F.rMax-F.rMin)/t,O=(F.iMax-F.iMin)/n;y(F.rMin-R*_),m(F.rMax-R*_),v(F.iMin+W*O),T(F.iMax+W*O)},[t,n,h,P]),N=w(()=>{$.current=!1},[]),L=w(E=>{E.preventDefault();let F=E.deltaY>0?1.15:1/1.15,R=E.target.getBoundingClientRect(),W=E.clientX-R.left,_=E.clientY-R.top,{re:O,im:H}=z(W,_);y(O+(p-O)*F),m(O+(b-O)*F),v(H+(x-H)*F),T(H+(D-H)*F)},[z,p,b,x,D]),M=w(E=>{g&&g(P(E))},[g,P]),S=w(E=>{c&&c(P(E))},[c,P]),k=w(E=>{E.preventDefault(),f&&f(P(E))},[f,P]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:I,onMouseUp:N,onMouseLeave:N,onWheel:L,onClick:M,onDblClick:S,onContextMenu:k})}function Nr(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function hl(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,g=y=>r+(y-i)/(s-i)*d,h=y=>n-r-(y-a)/(l-a)*u,c=6,f=Nr(i,s,c),p=Nr(a,l,c);return{xScale:g,yScale:h,xTicks:f,yTicks:p,xMin:i,xMax:s,yMin:a,yMax:l}}function dn(e,t,n,r){return q(()=>hl(e,t,n,r),[e,t,n,r])}function Wr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function _r(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function Or(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:g=!0,showArea:h=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:f,yLabel:p,title:y,padding:b=50,animate:m=!1,multiLine:x}=e,v=q(()=>{let B=[...t];if(x)for(let I of x)B.push(...I.data);return B},[t,x]),D=dn(v,n,r,b),{xScale:T,yScale:C,xTicks:$,yTicks:A}=D,z=[];if(z.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),g){for(let B=0;B<$.length;B++){let I=T($[B]);z.push(o("line",{x1:I,y1:b,x2:I,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<A.length;B++){let I=C(A[B]);z.push(o("line",{x1:b,y1:I,x2:n-b,y2:I,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}z.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),z.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<$.length;B++){let I=T($[B]);z.push(o("line",{x1:I,y1:r-b,x2:I,y2:r-b+5,stroke:"#374151",key:`xtick-${B}`})),z.push(o("text",{x:I,y:r-b+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${I}, ${r-b+18})`,key:`xlabel-${B}`},Wr($[B])))}for(let B=0;B<A.length;B++){let I=C(A[B]);z.push(o("line",{x1:b-5,y1:I,x2:b,y2:I,stroke:"#374151",key:`ytick-${B}`})),z.push(o("text",{x:b-10,y:I+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},Wr(A[B])))}function P(B,I,N,L,M,S,k,E,F,R){if(B.length===0)return;let W=[...B].sort((H,X)=>H.x-X.x);if(L){let H=C(D.yMin),X=W.map(j=>`${T(j.x)},${C(j.y)}`).join(" "),J=T(W[0].x),K=T(W[W.length-1].x),U=`${J},${H} ${X} ${K},${H}`;z.push(o("polygon",{points:U,fill:M,key:`${R}-area`}))}let O={points:W.map(H=>`${T(H.x)},${C(H.y)}`).join(" "),fill:"none",stroke:I,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${R}-line`};if(m?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",z.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):z.push(o("polyline",O)),S)for(let H=0;H<W.length;H++){let X=T(W[H].x),J=C(W[H].y),K=W[H].shape??F,U=W[H].radius??E,j=`${R}-pt-${H}`;if(m){let V=_r(K,X,J,U,k,j,{opacity:0});z.push(o("g",{key:`${j}-g`},V,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else z.push(_r(K,X,J,U,k,j))}}if(P(t,i,s,h,c,u,l,a,d,"primary"),x)for(let B=0;B<x.length;B++){let I=x[B];P(I.data,I.color,s,!1,"transparent",u,I.color,I.pointRadius??a,I.pointShape??d,`series-${B}`)}if(x&&x.length>0){let B=[],I=[{color:i,label:"Primary"},...x.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],N=b+10,L=16,M=22,S=7.2,k=14,E=6,F=n-b*2-20,R=0,W=0;for(let _=0;_<I.length;_++){let O=I[_].label.length*S,H=k+E+O;R>0&&R+H>F&&(R=0,W+=M);let X=N+R,J=b-30-W;B.push(o("rect",{x:X,y:J,width:k,height:14,fill:I[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:X+k+E,y:J+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},I[_].label)),R+=H+L}z.push(o("g",{key:"legend"},...B))}return f&&z.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},f)),p&&z.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},p)),y&&z.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)}function bl(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function xl(e,t){let n=t??bl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function nt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function un(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=nt(e,t,r,a),u=nt(e,t,r,l),g=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${g} 1 ${u.x} ${u.y}`,"Z"].join(" ");let h=nt(e,t,n,l),c=nt(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${g} 1 ${u.x} ${u.y}`,`L ${h.x} ${h.y}`,`A ${n} ${n} 0 ${g} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function pn(e,t){let n=t?.padAngle??0,r=xl(e,t?.colors),i=e.reduce((u,g)=>u+g.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let g=e[u],h=g.value/i*a,c=d+n/2,f=c+h;l.push({label:g.label,value:g.value,startAngle:c,endAngle:f,percentage:g.value/i*100,color:r[u]}),d=f+n/2}return l}function Hr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:g,centerLabel:h,colors:c,strokeColor:f="#fff",strokeWidth:p=2,textColor:y="currentColor"}=e,b=d&&u==="right"?140:0,m=g?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-b,D=r-m-x,T=v/2,C=m+D/2,$=Math.min(v,D)/2-10,A=e.outerRadius??$,z=q(()=>pn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];g&&P.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},g));for(let B=0;B<z.length;B++){let I=z[B],N=un(T,C,i,A,I.startAngle,I.endAngle);if(P.push(o("path",{key:`slice-${B}`,d:N,fill:I.color,stroke:f,strokeWidth:p})),a||l){let L=(I.startAngle+I.endAngle)/2,M=I.percentage<5,S=M?A+14:i+(A-i)*.65,k=nt(T,C,S,L-Math.PI/2),E=M?y:"#fff",F=M?11:12,R=[];if(a&&R.push(I.label),l&&R.push(`${I.percentage.toFixed(1)}%`),M){let W=nt(T,C,A+2,L-Math.PI/2);P.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:k.x,y2:k.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${B}`,x:k.x,y:k.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:E,pointerEvents:"none"},I.label)),l&&P.push(o("text",{key:`value-${B}`,x:k.x,y:k.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:E,pointerEvents:"none"},`${I.percentage.toFixed(1)}%`))}}if(h&&i>0&&P.push(o("text",{key:"center-label",x:T,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},h)),d){let B=[];if(u==="right"){let I=v+10,N=m+20;for(let L=0;L<z.length;L++){let M=z[L],S=N+L*22;B.push(o("circle",{key:`legend-dot-${L}`,cx:I+6,cy:S,r:6,fill:M.color})),B.push(o("text",{key:`legend-text-${L}`,x:I+18,y:S,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${M.label} (${M.percentage.toFixed(1)}%)`))}}else{let I=r-x+10;for(let N=0;N<z.length;N++){let L=z[N],M=N%2,S=Math.floor(N/2),k=M*(n/2)+10,E=I+S*22;B.push(o("circle",{key:`legend-dot-${N}`,cx:k+6,cy:E,r:6,fill:L.color})),B.push(o("text",{key:`legend-text-${N}`,x:k+18,y:E,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${L.label} (${L.percentage.toFixed(1)}%)`))}}P.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Yr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Vr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:g=3,pointColor:h="#3b82f6",curveColor:c="#3b82f6",onPointClick:f,onPointDoubleClick:p,onPointContextMenu:y,onPointHover:b}=e,[m,x]=G(r[1]),[v,D]=G(0),[T,C]=G(0),[$,A]=G(null),z=t/2+v,P=n/2+T,I=Math.min(t,n)/2-30,N=I/m,L=q(()=>{let U=Math.max(1,Math.ceil(m)),j=[],V=m/U;for(let Y=1;Y<=U;Y++)j.push(V*Y);return j},[m]),M=q(()=>{let U=[];for(let j=0;j<360;j+=30)U.push(j*Math.PI/180);return U},[]),S=q(()=>{if(!i||!l)return[];let U=a??2*Math.PI/s,j=tt({start:0,end:2*Math.PI,step:U});return Tt(i,j)},[i,s,a,l]),[k,E]=G([]),F=ne(null);se(()=>{if(!i||l){E([]);return}let U=a??2*Math.PI/s,j=tt({start:0,end:2*Math.PI,step:U});return F.current&&F.current(),F.current=zt(i,j,200,V=>{E([...V])}),()=>{F.current&&F.current()}},[i,s,a,l]);let R=l?S:k,W=q(()=>{if(R.length===0)return"";let U=[];for(let j=0;j<R.length;j++){let V=R[j],Y=V.output;if(Y<0||!isFinite(Y))continue;let{x:Z,y:Q}=Yr(Y,V.input,z,P,N);U.push(`${U.length===0?"M":"L"}${Z.toFixed(2)},${Q.toFixed(2)}`)}return U.join(" ")},[R,z,P,N]),_=w(U=>{A({x:U.clientX,y:U.clientY,px:v,py:T})},[v,T]),O=w(U=>{$&&(D($.px+(U.clientX-$.x)),C($.py+(U.clientY-$.y)))},[$]),H=w(()=>{A(null)},[]),X=w(U=>{U.preventDefault();let j=U.deltaY>0?1.15:1/1.15;x(Math.max(.1,m*j))},[m]),J=w((U,j,V)=>{if(U)return Y=>U({r:j.r,theta:j.theta,index:V,event:Y})},[]),K=[];if(K.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let U=0;U<L.length;U++){let j=L[U]*N;K.push(o("circle",{cx:z,cy:P,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${U}`})),K.push(o("text",{x:z+j+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${U}`},L[U].toFixed(1)))}for(let U=0;U<M.length;U++){let j=M[U],V=L[L.length-1]*N,Y=z+V*Math.cos(j),Z=P-V*Math.sin(j);K.push(o("line",{x1:z,y1:P,x2:Y,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${U}`}));let Q=Math.round(j*180/Math.PI),ae=z+(V+14)*Math.cos(j),ee=P-(V+14)*Math.sin(j);K.push(o("text",{x:ae,y:ee+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${U}`},`${Q}\xB0`))}}K.push(o("line",{x1:z-I,y1:P,x2:z+I,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),K.push(o("line",{x1:z,y1:P-I,x2:z,y2:P+I,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&K.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let U=0;U<d.length;U++){let j=d[U],{x:V,y:Y}=Yr(j.r,j.theta,z,P,N);K.push(o("circle",{cx:V,cy:Y,r:g,fill:h,key:`pt-${U}`,style:{cursor:"pointer"},onClick:J(f,j,U),onDblClick:J(p,j,U),onContextMenu:J(y,j,U),onMouseEnter:J(b,j,U)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:$?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:H,onMouseLeave:H,onWheel:X},...K)}function fn(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function mn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function gn(e,t){let n=Ur(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=Sl(n,yl(e,i,s,a))}r++}return n}function Ur(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function yl(e,t,n,r){let i=Ur(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function Sl(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function hn(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function bn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function dt(e,t=[],n=.3,r=1){let i=fn(e),s=mn(e),a=gn(e,t);return{vertices:i.map((d,u)=>{let g=hn(a,d),h=bn(g,n);return{id:u,position:d,x:h.x*r,y:h.y*r,depth:h.depth}}),edges:s,dimension:e}}function ut(e){return e*(e-1)/2}function Dt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function jr(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,g=e.backgroundColor??"transparent",h=e.scale??Math.min(n,r)*.3,c=ut(t),f=1<<t,p=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Dt(f):e.vertexColors,[f,e.vertexColors]),[y,b]=G(()=>{let E=[];for(let F=0;F<c;F++)E.push(0);return E}),[m,x]=G(!1),v=ne({x:0,y:0}),D=ne([]),T=ne(0);se(()=>{if(d===0)return;let E=!0,F=()=>{E&&(b(R=>{let W=R.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),T.current=requestAnimationFrame(F))};return T.current=requestAnimationFrame(F),()=>{E=!1,cancelAnimationFrame(T.current)}},[d]);let C=q(()=>dt(t,y,l,h),[t,y,l,h]),$=n/2,A=r/2,z=q(()=>C.edges.map(E=>{let F=C.vertices[E.source],R=C.vertices[E.target],W=(F.depth+R.depth)/2;return{...E,avgDepth:W,sv:F,tv:R}}).sort((E,F)=>E.avgDepth-F.avgDepth),[C]),P=q(()=>C.vertices.slice().sort((E,F)=>E.depth-F.depth),[C]),B=w(E=>{let F=E;x(!0),v.current={x:F.clientX,y:F.clientY},D.current=y.slice()},[y]),I=w(E=>{if(!m)return;let F=E,R=(F.clientX-v.current.x)*.01,W=(F.clientY-v.current.y)*.01;b(()=>{let _=D.current.slice();return _.length>0&&(_[0]=(_[0]??0)+R),_.length>1&&(_[1]=(_[1]??0)+W),_})},[m]),N=w(()=>{x(!1)},[]),L=E=>{let F=(E+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},M=E=>{let F=(E+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},S=z.map((E,F)=>{let R=L(E.avgDepth);return o("line",{key:`e-${E.source}-${E.target}`,x1:String($+E.sv.x),y1:String(A+E.sv.y),x2:String($+E.tv.x),y2:String(A+E.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(R),"stroke-linecap":"round"})}),k=P.map(E=>{let F=i*M(E.depth),R=p[E.id%p.length]??"#3b82f6",W=[o("circle",{key:`v-${E.id}-circle`,cx:String($+E.x),cy:String(A+E.y),r:String(F),fill:R,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&W.push(o("text",{key:`v-${E.id}-label`,x:String($+E.x),y:String(A+E.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},E.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:g,cursor:m?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:I,onMouseUp:N,onMouseLeave:N},...S,...k.flat())}function Gr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=ut(t),[a,l]=G(()=>new Array(s).fill(0));return se(()=>{if(n===0)return;let u=!0,g=0,h=()=>{u&&(l(c=>c.map((f,p)=>f+n*(1+p*.3))),g=requestAnimationFrame(h))};return g=requestAnimationFrame(h),()=>{u=!1,cancelAnimationFrame(g)}},[n]),{data:q(()=>dt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Xr(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:vl(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?kl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,g=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),h=wl(d,g,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...h)}function vl(e,t){return"column"}function wl(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function kl(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},Cl(n),o("span",null,n.label))))}function Cl(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function Ml(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function El(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function qr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return se(()=>{if(n||typeof window>"u")return;Ml(t),El();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function Kr(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:g,ariaLabel:h="Site footer"}=e;return o("footer",{className:g,role:"contentinfo","aria-label":h,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Qr=$e({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Rl={width:600,height:400},Pl={x:30,y:30},Il={top:0,left:0,width:1920,height:1080},xn=1e3;function Zr(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function yn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function Jr(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function Sn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function vn(e){let t=e.workspaceBounds??Il,n=e.defaultWindowSize??Rl,r=e.cascadeOffset??Pl,[i,s]=G([]),a=w(((...B)=>{let I=B[0];s(N=>{if(N.find(W=>W.id===I.id)){let _=Sn(N)+1,O=N.map(H=>H.id===I.id?{...H,focused:!0,zIndex:_,windowState:H.windowState==="minimized"?"normal":H.windowState}:{...H,focused:!1});return _>xn&&(O=yn(O)),O}let M=I.size??n,S=I.position??Zr(N.length,r,t,M),E=Sn(N)+1,F={id:I.id,title:I.title,icon:I.icon,position:S,size:M,windowState:"normal",zIndex:E,focused:!0,appProps:I.appProps},R=N.map(W=>({...W,focused:!1}));return R.push(F),E>xn&&(R=yn(R)),e.onWindowOpen&&e.onWindowOpen(I.id),e.onFocusChange&&e.onFocusChange(I.id),R})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=w(((...B)=>{let I=B[0];v(N=>{if(N[I]){let L={...N};return delete L[I],L}return N}),T(N=>{if(N.has(I)){let L=new Map(N);return L.delete(I),L}return N}),s(N=>{let L=N.find(S=>S.id===I);if(!L)return N;let M=N.filter(S=>S.id!==I);if(L.focused&&M.length>0){let S=Jr(M,I);if(S){let k=M.map(E=>({...E,focused:E.id===S.id}));return e.onWindowClose&&e.onWindowClose(I),e.onFocusChange&&e.onFocusChange(S.id),k}}return e.onWindowClose&&e.onWindowClose(I),M.length===0&&e.onFocusChange&&e.onFocusChange(null),M})}),[e.onWindowClose,e.onFocusChange]),d=w(((...B)=>{let I=B[0];s(N=>{if(!N.find(E=>E.id===I))return N;let S=Sn(N)+1,k=N.map(E=>E.id===I?{...E,focused:!0,zIndex:S}:{...E,focused:!1});return S>xn&&(k=yn(k)),e.onFocusChange&&e.onFocusChange(I),k})}),[e.onFocusChange]),u=w(((...B)=>{let I=B[0];s(N=>{let L=N.find(S=>S.id===I);if(!L)return N;let M=N.map(S=>S.id===I?{...S,windowState:"minimized",focused:!1}:S);if(L.focused){let S=Jr(M,I);S?(M=M.map(k=>({...k,focused:k.id===S.id})),e.onFocusChange&&e.onFocusChange(S.id)):e.onFocusChange&&e.onFocusChange(null)}return M})}),[e.onFocusChange]),g=w(((...B)=>{let I=B[0];s(N=>N.map(L=>L.id===I?{...L,windowState:"maximized"}:L))}),[]),h=w(((...B)=>{let I=B[0];s(N=>N.map(L=>L.id===I?{...L,windowState:"normal"}:L))}),[]),c=w(((...B)=>{let I=B[0],N=B[1];s(L=>L.map(M=>M.id===I?{...M,position:N}:M))}),[]),f=w(((...B)=>{let I=B[0],N=B[1];s(L=>L.map(M=>M.id===I?{...M,size:N}:M))}),[]),p=w(((...B)=>{s(I=>{let N=I.filter(S=>S.windowState!=="minimized");if(N.length===0)return I;let L=N.length,M=new Map;if(L===1)M.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(L===2){let S=Math.floor(t.width/2);M.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:S,height:t.height}}),M.set(N[1].id,{position:{x:t.left+S,y:t.top},size:{width:t.width-S,height:t.height}})}else if(L===3){let S=Math.floor(t.width/2),k=Math.floor(t.height/2);M.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:S,height:t.height}}),M.set(N[1].id,{position:{x:t.left+S,y:t.top},size:{width:t.width-S,height:k}}),M.set(N[2].id,{position:{x:t.left+S,y:t.top+k},size:{width:t.width-S,height:t.height-k}})}else{let S=Math.ceil(Math.sqrt(L)),k=Math.ceil(L/S),E=Math.floor(t.width/S),F=Math.floor(t.height/k);for(let R=0;R<N.length;R++){let W=Math.floor(R/S),_=R%S;M.set(N[R].id,{position:{x:t.left+_*E,y:t.top+W*F},size:{width:E,height:F}})}}return I.map(S=>{let k=M.get(S.id);return k?{...S,position:k.position,size:k.size,windowState:"normal"}:S})})}),[t]),y=w(((...B)=>{s(I=>{let N=I.filter(S=>S.windowState!=="minimized");if(N.length===0)return I;let L=[...N].sort((S,k)=>S.zIndex-k.zIndex),M=new Map;for(let S=0;S<L.length;S++){let k=Zr(S,r,t,L[S].size);M.set(L[S].id,{position:k,zIndex:S+1})}return I.map(S=>{let k=M.get(S.id);return k?{...S,position:k.position,zIndex:k.zIndex,windowState:"normal"}:S})})}),[r,t]),b=w(((...B)=>{s(I=>{let N=I.map(L=>({...L,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),m=q(()=>{let B=i.find(I=>I.focused);return B?B.id:null},[i]),[x,v]=G({}),[D,T]=G(new Map),C=w(((...B)=>{let I=B[0],N=B[1];v(L=>({...L,[I]:N}))}),[]),$=w(((...B)=>{let I=B[0];v(N=>{let L={...N};return delete L[I],L})}),[]),A=q(()=>m&&x[m]?x[m]:null,[m,x]),z=w(((...B)=>{let I=B[0],N=B[1];T(L=>{let M=new Map(L),S=M.get(I);return M.set(I,{...S,...N}),M})}),[]),P=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:g,restoreWindow:h,moveWindow:c,resizeWindow:f,tileWindows:p,cascadeWindows:y,minimizeAll:b,focusedWindowId:m,setMenuBar:C,clearMenuBar:$,activeMenuBar:A,signalDock:z,dockSignals:D}),[i,a,l,d,u,g,h,c,f,p,y,b,m,C,$,A,z,D]);return o(Qr.Provider,{value:P},e.children)}function pt(){return Re(Qr)}var ei=$e({appId:""});function _e(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(ei.Provider,{value:t},e.children)}function ot(){return Re(ei).appId}var ti=$e({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function ft(e){let t=ne([]),n=ne([]),r=w(((...l)=>{let d=l[0],u=l[1],g=l[2],h=l[3]||"",c={channel:d,from:h,to:g||null,payload:u,timestamp:Date.now()},f=t.current;for(let y=0;y<f.length;y++){let b=f[y];b.channel===d&&(c.to&&b.appId!==c.to||!c.to&&b.appId===h||b.handler(c))}let p=n.current;for(let y=0;y<p.length;y++)p[y].handler(c)}),[]),i=w(((...l)=>{let d=l[0],u=l[1],g=l[2]||"",h={channel:d,handler:u,appId:g};return t.current=[...t.current,h],()=>{t.current=t.current.filter(c=>c!==h)}}),[]),s=w(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(g=>g!==u)}}),[]),a=q(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ti.Provider,{value:a},e.children)}function Oe(){let e=Re(ti),t=ot(),n=w(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=w(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return q(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function mt(e,t){let n=Oe(),r=ne(t);r.current=t,se(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var ni=$e({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function gt(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=ne(new Map),a=ne(null),l=t!==null,d=w(((...f)=>{let p=f[0];n(p)}),[]),u=w(((...f)=>{if(a.current){let p=s.current.get(a.current);p&&p.onDragLeave&&p.onDragLeave(),a.current=null}n(null)}),[]),g=w(((...f)=>{let p=f[0],y=f[1];return s.current=new Map(s.current),s.current.set(p,y),()=>{s.current=new Map(s.current),s.current.delete(p),a.current===p&&(a.current=null)}}),[]);se(()=>{if(!l)return;let f=b=>{let m=b;i({x:m.clientX,y:m.clientY});let x=document.elementFromPoint(m.clientX,m.clientY);if(!x)return;let v=null,D=s.current;D.forEach((C,$)=>{let A=document.querySelector(`[data-dropzone-id="${$}"]`);A&&A.contains(x)&&(v=$)});let T=a.current;if(v!==T){if(T){let C=D.get(T);C&&C.onDragLeave&&C.onDragLeave()}if(v){let C=D.get(v);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=v}},p=b=>{let m=a.current;if(m&&t){let x=s.current.get(m);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=b=>{b.key==="Escape"&&u()};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",p),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p),document.removeEventListener("keydown",y)}},[l,t,u]);let h=q(()=>({startDrag:d,cancelDrag:u,registerDropZone:g,currentDrag:t,isDragging:l}),[d,u,g,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(ni.Provider,{value:h},e.children,c)}function Xe(){return Re(ni)}function wn(e,t){let n=Xe(),r=ot(),i=ne(t);i.current=t;let s=w(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return q(()=>({onMouseDown:s,isDragging:a}),[s,a])}function ht(e){let t=Xe(),[n,r]=G(!1),i=ne(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=ne(e);s.current=e,se(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return q(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var $l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Tl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(e){return e<10?"0"+String(e):String(e)}function zl(e,t,n){let r=e.getHours(),i=kn(e.getMinutes()),s=kn(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=kn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Dl(e){let t=$l[e.getDay()],n=Tl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Al(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Se(),a=w(()=>{n()},[n]),l=w(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function Ll(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);se(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>zl(i,t,n),[i,t,n]),l=q(()=>Dl(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function Bl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Se(),s=w(()=>{t.onClick&&t.onClick()},[t]),a=w(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Fl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Se();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=w(()=>{t.onClick(),n()},[t,n]),l=w(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function Nl(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Se(),[a,l]=G(!1),d=ne(null),u=w(()=>{l(b=>!b)},[]),g=w(()=>{l(!1)},[]),h=w(b=>{let m=b;(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(x=>!x)),m.key==="Escape"&&l(!1)},[]);se(()=>{if(!a)return;let b=m=>{let x=d.current;x&&!x.contains(m.target)&&l(!1)};return document.addEventListener("click",b,!0),()=>{document.removeEventListener("click",b,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},f=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),p=o("span",{style:c,"aria-hidden":"true"},f),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((b,m)=>o(Fl,{key:String(m),item:b,onClose:g}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:h,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},p,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function Wl(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Se(),[s,a]=G(!1),l=ne(null),d=w(()=>{a(c=>!c)},[]),u=w(()=>{a(!1)},[]),g=w(c=>{let f=c;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),a(p=>!p)),f.key==="Escape"&&a(!1)},[]);se(()=>{if(!s)return;let c=f=>{let p=l.current;p&&!p.contains(f.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let h=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,f)=>c.divider?o("div",{key:"div-"+String(f),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(f),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:g,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),h)}function Cn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:g=28,children:h}=e,c=String(g)+"px",f=[];if(n&&f.push(o(Al,{key:"activities",label:n.label,onClick:n.onClick})),t&&f.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)f.push(o(Wl,{key:"appmenu-"+String(v),menu:r.menus[v]}));let p=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...f),y=[];y.push(o(Ll,{key:"clock",format:i,showSeconds:s,showDate:a})),h&&y.push(h);let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),m=[];if(l&&l.length>0){let v=l.map(D=>o(Bl,{key:D.id,indicator:D}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&m.push(o(Nl,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},p,b,x)}function _l(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var oi=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Ol(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return oi[Math.abs(t)%oi.length]}function Hl(e){return e>99?"99+":String(e)}function Yl(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Vl(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function Ul(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function jl(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,g=w(()=>{u||d(!0)},[u]),h=w(()=>{d(!1)},[]),c=w(()=>{!u&&s&&s(t.id)},[u,s,t.id]),f=w(T=>{if(!u&&a){let C=T;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),p=`${n}px`,y=_l(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:p,height:p,objectFit:"contain",display:"block"}}):o("span",{style:{width:p,height:p,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Ol(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),b=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Hl(t.badge)):null,m=t.active?o("span",{style:{...Ul(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,v=l?o("div",{role:"tooltip",style:{position:"absolute",...Vl(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,D={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:D,"aria-label":Yl(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:f,onMouseEnter:g,onMouseLeave:h,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,b,m,x,v)}function Mn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[g,h]=G(!s),c=ne(null),f=w(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),h(!0))},[s]),p=w(()=>{s&&(c.current=setTimeout(()=>{h(!1)},300))},[s]),y=w(D=>{let T=D,C=T.target,$=C.closest('[role="toolbar"]');if(!$)return;let A=Array.from($.querySelectorAll("button[data-dock-item-id]")),z=A.indexOf(C);if(z<0)return;let P=n==="vertical",B=P?"ArrowDown":"ArrowRight",I=P?"ArrowUp":"ArrowLeft";if(T.key===B){T.preventDefault();let N=A[z+1];N&&N.focus()}else if(T.key===I){T.preventDefault();let N=A[z-1];N&&N.focus()}else T.key==="Home"?(T.preventDefault(),A[0]?.focus()):T.key==="End"?(T.preventDefault(),A[A.length-1]?.focus()):(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),C.click())},[n]),b=n==="vertical",m={display:"flex",flexDirection:b?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!g&&(r==="left"?(m.transform="translateX(-100%)",m.opacity="0"):r==="right"?(m.transform="translateX(100%)",m.opacity="0"):r==="top"?(m.transform="translateY(-100%)",m.opacity="0"):r==="bottom"&&(m.transform="translateY(100%)",m.opacity="0"));let x=[];for(let D=0;D<t.length;D++){if(a&&D===t.length-1&&t.length>1){let T=b?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};x.push(o("div",{key:`sep-${D}`,style:T,"aria-hidden":"true",role:"separator"}))}x.push(o(jl,{key:t[D].id,item:t[D],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!g?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:m,onMouseEnter:f,onMouseLeave:p,onKeyDown:y},v,...x,u??null)}var Gl="#2c001e";function En(e){let{backgroundColor:t=Gl,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,g=w(m=>{let x=m;x.target===x.currentTarget&&a&&a()},[a]),h=w(m=>{let x=m;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{let m={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return m.backgroundColor=t,n&&(m.background=n),r&&i>=1&&(m.backgroundImage=`url(${r})`,m.backgroundSize="cover",m.backgroundPosition="center"),m},[t,n,r,i]),f=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),p={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];f&&y.push(o("div",{className:"desktop-background__image-overlay",style:f,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:p},u));let b=o("div",{className:"desktop-background",style:c,onClick:g,onDblClick:h,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o($t,{items:s},b):b}var Xl={width:200,height:150},ql={x:50,y:50},Kl={width:400,height:300},ve=8,Rn=20,Zl={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function bt(e){let{id:t,title:n,icon:r,defaultPosition:i=ql,defaultSize:s=Kl,minSize:a=Xl,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:g="normal",focused:h=!0,zIndex:c,onClose:f,onMinimize:p,onMaximize:y,onFocus:b,onMove:m,onResize:x,children:v}=e,[D,T]=G(i.x),[C,$]=G(i.y),[A,z]=G(s.width),[P,B]=G(s.height),[I,N]=G(!1),[L,M]=G(!1),[S,k]=G(null),E=ne(null),F=ne(null),R=ne(null),W=w((oe,ue)=>{let re=Math.max(oe,a.width),ie=Math.max(ue,a.height);return l&&(re=Math.min(re,l.width),ie=Math.min(ie,l.height)),{width:re,height:ie}},[a,l]),_=w(()=>{let oe=R.current;return oe&&oe.parentElement?{width:oe.parentElement.clientWidth,height:oe.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=w((oe,ue,re,ie)=>{let de=_(),pe=Math.max(0,Math.min(oe,de.width-re)),me=Math.max(0,Math.min(ue,de.height-ie));return{x:pe,y:me}},[_]),H=w(oe=>{if(!u||g==="maximized")return;let ue=oe;ue.target.closest("button")||(ue.preventDefault(),E.current={startMouseX:ue.clientX,startMouseY:ue.clientY,startPosX:D,startPosY:C},N(!0))},[u,g,D,C]),X=w(oe=>{oe.target.closest("button")||y&&y()},[y]);se(()=>{if(!I)return;let oe=re=>{let ie=re,de=E.current;if(!de)return;let pe=ie.clientX-de.startMouseX,me=ie.clientY-de.startMouseY,he=de.startPosX+pe,fe=de.startPosY+me,ye=_();he=Math.max(0,Math.min(he,ye.width-A)),fe=Math.max(0,Math.min(fe,ye.height-P)),T(he),$(fe),ie.clientX<=Rn?k("left"):ie.clientX>=ye.width-Rn?k("right"):ie.clientY<=Rn?k("top"):k(null)},ue=re=>{let ie=re;N(!1);let de=_();if(S==="left"){T(0),$(0),z(Math.floor(de.width/2)),B(de.height),k(null),m&&m({x:0,y:0}),x&&x({width:Math.floor(de.width/2),height:de.height});return}if(S==="right"){let me=Math.floor(de.width/2);T(me),$(0),z(me),B(de.height),k(null),m&&m({x:me,y:0}),x&&x({width:me,height:de.height});return}if(S==="top"){k(null),y&&y();return}k(null);let pe=E.current;if(pe&&m){let me=ie.clientX-pe.startMouseX,he=ie.clientY-pe.startMouseY,fe=pe.startPosX+me,ye=pe.startPosY+he;fe=Math.max(0,Math.min(fe,de.width-A)),ye=Math.max(0,Math.min(ye,de.height-P)),m({x:fe,y:ye})}E.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ue),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ue)}},[I,S,A,P,_,m,x,y]);let J=w(oe=>ue=>{if(!d||g!=="normal")return;let re=ue;re.preventDefault(),re.stopPropagation(),F.current={direction:oe,startMouseX:re.clientX,startMouseY:re.clientY,startPosX:D,startPosY:C,startWidth:A,startHeight:P},M(!0)},[d,g,D,C,A,P]);se(()=>{if(!L)return;let oe=re=>{let ie=re,de=F.current;if(!de)return;let pe=ie.clientX-de.startMouseX,me=ie.clientY-de.startMouseY,he=de.direction,fe=de.startWidth,ye=de.startHeight,Pe=de.startPosX,ct=de.startPosY;he.includes("e")&&(fe=de.startWidth+pe),he.includes("w")&&(fe=de.startWidth-pe,Pe=de.startPosX+pe),he.includes("s")&&(ye=de.startHeight+me),he.includes("n")&&(ye=de.startHeight-me,ct=de.startPosY+me);let De=W(fe,ye);he.includes("w")&&(Pe=de.startPosX+(de.startWidth-De.width)),he.includes("n")&&(ct=de.startPosY+(de.startHeight-De.height)),z(De.width),B(De.height),T(Pe),$(ct)},ue=()=>{M(!1),x&&x({width:A,height:P}),F.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ue),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ue)}},[L,A,P,W,x]),se(()=>{if(!h||!f)return;let oe=ue=>{ue.key==="Escape"&&f()};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[h,f]);let K=w(oe=>{b&&b()},[b]);if(g==="minimized")return null;let U=g==="maximized",j=q(()=>{let oe={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:U?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:U?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return U?(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"):(oe.top=`${C}px`,oe.left=`${D}px`,oe.width=`${A}px`,oe.height=`${P}px`),c!==void 0&&(oe.zIndex=String(c)),I&&(oe.cursor="grabbing",oe.userSelect="none"),oe},[U,D,C,A,P,c,h,I]),V=q(()=>{let oe={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!U?"grab":"default",opacity:h?"1":"0.6"};return I&&(oe.cursor="grabbing"),oe},[h,u,U,I]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},Z={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let ae=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...Z,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:oe=>{oe.stopPropagation(),p&&p()}}),o("button",{type:"button","aria-label":U?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...Z,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:oe=>{oe.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...Z,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:oe=>{oe.stopPropagation(),f&&f()}}));Q.push(ae);let ee=[];if(d&&!U){let oe=["n","s","e","w","ne","nw","se","sw"];for(let ue=0;ue<oe.length;ue++){let re=oe[ue],ie={position:"absolute",zIndex:"1"};re==="n"?(ie.top="0",ie.left=`${ve}px`,ie.right=`${ve}px`,ie.height=`${ve}px`):re==="s"?(ie.bottom="0",ie.left=`${ve}px`,ie.right=`${ve}px`,ie.height=`${ve}px`):re==="e"?(ie.top=`${ve}px`,ie.right="0",ie.bottom=`${ve}px`,ie.width=`${ve}px`):re==="w"?(ie.top=`${ve}px`,ie.left="0",ie.bottom=`${ve}px`,ie.width=`${ve}px`):re==="ne"?(ie.top="0",ie.right="0",ie.width=`${ve}px`,ie.height=`${ve}px`):re==="nw"?(ie.top="0",ie.left="0",ie.width=`${ve}px`,ie.height=`${ve}px`):re==="se"?(ie.bottom="0",ie.right="0",ie.width=`${ve}px`,ie.height=`${ve}px`):re==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${ve}px`,ie.height=`${ve}px`),ie.cursor=Zl[re],ee.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${re}`,style:ie,onMouseDown:J(re)}))}}let te=null;if(S){let oe={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};S==="left"?(oe.top="0",oe.left="0",oe.width="50%",oe.height="100%"):S==="right"?(oe.top="0",oe.right="0",oe.width="50%",oe.height="100%"):S==="top"&&(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"),te=o("div",{className:"draggable-window__snap-preview",style:oe})}let le=[];for(let oe=0;oe<ee.length;oe++)le.push(ee[oe]);le.push(o("div",{className:"draggable-window__title-bar",style:V,onMouseDown:H,onDblClick:X,role:"toolbar","aria-label":`${n} window controls`},...Q)),le.push(o("div",{className:"draggable-window__body",style:Y},v));let ce=[o("div",{ref:R,id:`draggable-window-${t}`,className:`draggable-window ${h?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${g}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:K},...le)];return te&&ce.push(te),ce.length===1?ce[0]:o("div",{style:{display:"contents"}},...ce)}var Jl=["File","Edit","View","Insert","Format","Tools","Help"],ri={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},Ql=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],ec=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],tc=["1","2","3","4","5","6","7"],nc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function oc(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function ii(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function At(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,g]=G(""),[h,c]=G(-1),[f,p]=G(0),[y,b]=G("3"),m=ne(null),x=w(()=>{document.execCommand("bold",!1),n(Y=>!Y),m.current&&m.current.focus()},[]),v=w(()=>{document.execCommand("italic",!1),i(Y=>!Y),m.current&&m.current.focus()},[]),D=w(()=>{document.execCommand("underline",!1),a(Y=>!Y),m.current&&m.current.focus()},[]),T={bold:x,italic:v,underline:D},C={bold:t,italic:r,underline:s},$=w(Y=>{document.execCommand(Y,!1),m.current&&m.current.focus()},[]),A=w(Y=>{document.execCommand("fontSize",!1,Y),b(Y),m.current&&m.current.focus()},[]),z=w(Y=>{c(Z=>Z===Y?-1:Y)},[]),P=w(Y=>{switch(Y){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":m.current&&(m.current.innerHTML="",p(0));break;default:break}c(-1),m.current&&m.current.focus()},[]),B=w(()=>{if(m.current){let Y=m.current.textContent??"";p(ii(Y))}},[]),I=w(()=>{c(-1)},[]),N=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),L={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},M={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},S={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},k={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},E={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},F={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},R=q(()=>oc(),[]),W=e.content??"Start typing...",_=ii(W),O=f>0?f:_;function H(Y){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:h===Y?"rgba(0,0,0,0.12)":l===Y?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let X={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},J={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function K(Y,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[Y]??!1?"rgba(0,0,0,0.12)":u===Y?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let U={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},j={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},V=Jl.map((Y,Z)=>{let Q=[Y];return h===Z&&ri[Y]&&Q.push(o("div",{key:"dropdown",style:X,className:"word-processor__menu-dropdown"},...ri[Y].map((ae,ee)=>o("button",{key:String(ee),style:J,onClick:te=>{te.stopPropagation(),P(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:H(Z),role:"menuitem","aria-label":Y,onClick:()=>z(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:L,role:"menubar"},...V),o("div",{className:"word-processor__toolbar",style:M,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:U,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ql.map(Y=>o("button",{key:Y.id,style:K(Y.id,Y.style),title:Y.shortcut?`${Y.label} (${Y.shortcut})`:Y.label,"aria-label":Y.label,"aria-pressed":String(C[Y.id]??!1),onClick:T[Y.id],onMouseEnter:()=>g(Y.id),onMouseLeave:()=>g("")},Y.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:j,"aria-label":"Font size",value:y,onChange:Y=>{let Z=Y.target;A(Z.value)}},...tc.map(Y=>o("option",{key:Y,value:Y},nc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...ec.map((Y,Z)=>o("button",{key:String(Z),style:K(`align-${Z}`),title:Y.label,"aria-label":Y.label,onClick:()=>$(Y.command),onMouseEnter:()=>g(`align-${Z}`),onMouseLeave:()=>g("")},Y.text)))),o("div",{className:"word-processor__ruler",style:S,"aria-hidden":"true"},...R),o("main",{className:"word-processor__document-area",style:k,onClick:I},o("div",{className:"word-processor__page",style:E,contentEditable:"true",ref:m,onInput:B,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:F},o("span",null,"Page 1 of 1"),o("span",null,`${O} words`),o("span",null,"100%")))}var rc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],si={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},ai=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],In={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},li=In["App.ts"],ic=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),sc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),ci="#569cd6",ac="#ce9178",lc="#4ec9b0",cc="#6a9955",dc="#dcdcaa",Pn="#d4d4d4",uc="#d4d4d4",pc="#b5cea8";function fc(e){if(!e.trim())return[{text:"\xA0",color:Pn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:cc});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:ac}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:pc}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=Pn;ic.has(i)?l=ci:sc.has(i)?l=lc:a?l=dc:(i==="true"||i==="false")&&(l=ci),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:Pn}),n=r;continue}t.push({text:e[n],color:uc}),n++}return t}function Lt(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(li.length),u=ne(null),g=w(V=>{n(V);let Y=In[V];Y&&d(Y.length)},[]),h=w(V=>{i(Y=>{let Z={},Q=Object.keys(Y);for(let ae=0;ae<Q.length;ae++)Z[Q[ae]]=Y[Q[ae]];return Z[V]=!Y[V],Z})},[]),c=w(V=>{a(Y=>Y===V?-1:V)},[]),f=w(V=>{switch(V){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),p=w(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
8
+ `);d(Math.max(Y.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),b={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},m={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...x,backgroundColor:"rgba(255,255,255,0.1)"},D={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},T={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},C={flex:"1",display:"flex",overflow:"hidden"},$={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},A={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},z={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(V,Y,Z)=>({padding:"3px 8px",paddingLeft:`${12+V*16}px`,fontSize:"13px",cursor:"pointer",color:Y?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:Z?"rgba(255,255,255,0.08)":"transparent"}),B={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},I={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},N={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},L={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},M={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},S={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},k={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},E={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},F={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},R=8,W=30,_=In[t]??li,O=_.map((V,Y)=>{let Z=fc(V),Q=[],ae=0;for(let ee of Z)Q.push(o("span",{key:String(ae++),style:{color:ee.color}},ee.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),H=Math.max(l,_.length),X=[];for(let V=0;V<H;V++)X.push(o("div",{key:String(V)},String(V+1)));let J=V=>{if(!V.parent)return!0;if(!r[V.parent])return!1;let Y=ai.find(Z=>Z.name===V.parent&&Z.isFolder);return Y?J(Y):!0},K=rc.map((V,Y)=>{let Z=[V],Q=s===Y;return Q&&si[V]&&Z.push(o("div",{key:"dropdown",style:D,className:"ide__menu-dropdown"},...si[V].map((ae,ee)=>o("button",{key:String(ee),style:T,onClick:te=>{te.stopPropagation(),f(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":V,onClick:()=>c(Y)},...Z)}),j=ai.map((V,Y)=>{if(!J(V))return null;let Z=!V.isFolder&&V.name===t,Q=V.isFolder?r[V.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:P(V.indent,V.isFolder,Z),onClick:V.isFolder?()=>h(V.name):()=>g(V.name)},Q,V.name)}).filter(V=>V!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:b},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:m,role:"menubar"},...K),o("div",{style:C},o("nav",{className:"ide__sidebar",style:$,"aria-label":"File explorer"},o("div",{style:z},"Explorer"),...j),o("div",{style:A}),o("div",{style:B},o("div",{style:I},o("button",{style:N,"aria-label":t},t)),o("div",{style:L},o("div",{style:M,"aria-hidden":"true"},...X),o("code",{style:S,contentEditable:"true",ref:u,onInput:p,suppressContentEditableWarning:!0},...O))),o("div",{className:"ide__minimap",style:k,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${R}px`,left:"0",right:"0",height:`${W}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),..._.map((V,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:V.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,V.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:E},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"\u2387 main"),o("span",{style:F},"0 errors"),o("span",{style:F},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"Ln 1, Col 1"),o("span",{style:F},"UTF-8"),o("span",{style:F},"TypeScript"))))}var mc=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],di=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],ui=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],pi=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],gc=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],hc=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],fi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],mi=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],gi=["09:30","10:00","10:30","11:00","11:30","12:00"];function bc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function xt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function ze(e){return e.toFixed(2)}var rt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},it={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Bt={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Ce={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},Me={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Ft={cursor:"default",transition:"background-color 0.1s"};function xc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,g)=>{let h=g/(e.length-1)*40,c=14-(u-i)/a*14;return`${h.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function yc(e,t){let u=Math.min(...e),g=Math.max(...e),h=g-u||1,c=310/(e.length-1),f=e.map((C,$)=>{let A=40+$*c,z=15+(1-(C-u)/h)*120;return{x:A,y:z}}),p=f.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+f.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${f[f.length-1].x.toFixed(1)},135 Z`,b=[];for(let C=1;C<e.length;C++){let $=e[C]>=e[C-1]?"#00c853":"#ff1744";b.push(o("line",{key:String(C),x1:String(f[C-1].x.toFixed(1)),y1:String(f[C-1].y.toFixed(1)),x2:String(f[C].x.toFixed(1)),y2:String(f[C].y.toFixed(1)),stroke:$,strokeWidth:"2",strokeLinecap:"round"}))}let m=[];for(let C=0;C<5;C++){let $=15+C/4*120,A=g-C/4*h;m.push(o("line",{key:`g${C}`,x1:String(40),y1:String($.toFixed(1)),x2:String(350),y2:String($.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),m.push(o("text",{key:`yl${C}`,x:String(36),y:String(($+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},ze(A)))}let x=[],v=Math.min(gi.length,e.length),D=(e.length-1)/(v-1);for(let C=0;C<v;C++){let A=40+Math.round(C*D)*c;x.push(o("text",{key:`tl${C}`,x:String(A.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},gi[C]))}let T="chartGrad";return o("div",{style:rt},o("div",{style:it},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${ze(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:T,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${T})`}),...m,...x,...b,o("line",{x1:String(40),y1:String((15+(1-(t-u)/h)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/h)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function Sc(){let e=Math.max(...di.map(t=>t.qty),...ui.map(t=>t.qty));return o("div",{style:rt},o("div",{style:it},"Order Book"),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Bid Price"),o("th",{style:Ce},"Qty"),o("th",{style:Ce},"Ask Price"),o("th",{style:Ce},"Qty"))),o("tbody",null,...di.map((t,n)=>{let r=ui[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Ft},o("td",{style:{...Me,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},ze(t.price)),o("td",{style:{...Me,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},xt(t.qty)),o("td",{style:{...Me,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?ze(r.price):""),o("td",{style:{...Me,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?xt(r.qty):""))}))))}function vc(e){return o("div",{style:rt},o("div",{style:it},"Watchlist"),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Symbol"),o("th",{style:Ce},"Price"),o("th",{style:Ce},"Chg%"),o("th",{style:Ce},"Volume"))),o("tbody",null,...mc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Ft},o("td",{style:{...Me,fontWeight:"600",color:"#ffffff"}},t.symbol,xc(t.spark,i)),o("td",{style:{...Me,fontFamily:"monospace"}},ze(r)),o("td",{style:{...Me,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${ze(t.change)}%`),o("td",{style:{...Me,fontFamily:"monospace",color:"#8888aa"}},bc(t.volume)))}))))}function wc(){let e=pi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:rt},o("div",{style:it},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${ze(e)}`)),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Symbol"),o("th",{style:Ce},"Qty"),o("th",{style:Ce},"Avg"),o("th",{style:Ce},"P&L"))),o("tbody",null,...pi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...Ft,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...Me,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...Me,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...Me,fontFamily:"monospace"}},ze(n.avgPrice)),o("td",{style:{...Me,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${ze(n.pnl)}`))}))))}function kc(){return o("div",{style:rt},o("div",{style:it},"Recent Trades"),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Time"),o("th",{style:Ce},"Sym"),o("th",{style:Ce},"Side"),o("th",{style:Ce},"Qty"),o("th",{style:Ce},"Price"))),o("tbody",null,...gc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:Ft},o("td",{style:{...Me,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...Me,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Me,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...Me,fontFamily:"monospace"}},xt(e.qty)),o("td",{style:{...Me,fontFamily:"monospace"}},ze(e.price)))}))))}function Cc(){let e=Math.max(...fi.map(n=>n.volume),...mi.map(n=>n.volume)),t="16px";return o("div",{style:rt},o("div",{style:it},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...fi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},ze(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},xt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...mi.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},ze(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},xt(n.volume))))))}function Nt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);se(()=>{let f=setInterval(()=>{n(p=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(f)},[]),se(()=>{let f=()=>{let y=new Date,b=String(y.getHours()).padStart(2,"0"),m=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${b}:${m}:${x}`)};f();let p=setInterval(f,1e3);return()=>clearInterval(p)},[]),se(()=>{let f=setInterval(()=>{a(p=>!p)},800);return()=>clearInterval(f)},[]);let l=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},g={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},h=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:g},yc(hc,h),Sc(),vc(t),wc(),kc(),Cc()))}function we(e){return e.type==="card"}function Ee(e){return e.type==="container"}function st(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function He(e){return we(e)?e.card_id:e.container_id}var bi={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},xi=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function hi(e){let t=e.content;return o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},"data-testid":`card-text-content-${e.card_id}`},t.text||"")}function Mc(e){let t=e.content,r=Object.entries(t).map(([i,s],a)=>o("div",{key:String(a),style:{display:"flex",gap:"4px",fontSize:"11px",lineHeight:"1.6",borderBottom:"1px solid rgba(0,0,0,0.05)",padding:"2px 0"}},o("span",{style:{fontWeight:"600",color:"#374151",minWidth:"60px"}},`${i}:`),o("span",{style:{color:"#555555"}},String(s??""))));return o("div",{style:{flex:"1",overflow:"auto"},"data-testid":`card-json-content-${e.card_id}`},...r)}function Ec(e){return o("div",{style:{fontSize:"12px",color:"#9ca3af",fontStyle:"italic",flex:"1",display:"flex",alignItems:"center",justifyContent:"center"},"data-testid":`card-task-content-${e.card_id}`},"Task card (coming soon)")}function Rc(e,t){let n=e.content;return o("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"4px 16px",borderRadius:"999px",backgroundColor:e.color||"#e0e7ff",fontSize:"13px",fontWeight:"600",color:"#1e3a5f",cursor:"pointer",flex:"1"},onDblClick:r=>{r.preventDefault(),r.stopPropagation(),t&&n.project_id&&t(n.project_id)},"data-testid":`card-project-content-${e.card_id}`},n.project_name||"Untitled Project")}function Wt(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d}=e,[u,g]=G(!1),[h,c]=G(null),[f,p]=G(!1),y=ne(null),b=ne(null),m=t.priority?bi[t.priority]||"#94a3b8":"transparent",x=w(R=>{let W=R;W.preventDefault(),W.stopPropagation(),c({x:W.clientX,y:W.clientY}),p(!1)},[]),v=w(()=>{c(null),p(!1)},[]),D=w(R=>{let W=R,_=W.target;if(_.dataset&&(_.dataset.role==="delete"||_.dataset.role==="resize"||_.dataset.role==="drag-handle"))return;W.preventDefault(),W.stopPropagation(),r&&r(t.card_id),y.current={x:W.clientX,y:W.clientY,cardX:t.position.x,cardY:t.position.y};let O=X=>{let J=X;if(!y.current)return;let K=J.clientX-y.current.x,U=J.clientY-y.current.y;i&&i(t.card_id,{x:y.current.cardX+K,y:y.current.cardY+U})},H=()=>{y.current=null,document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",H)};document.addEventListener("mousemove",O),document.addEventListener("mouseup",H)},[t.card_id,t.position.x,t.position.y,r,i]),T=w(R=>{let W=R;W.preventDefault(),W.stopPropagation(),b.current={x:W.clientX,y:W.clientY,w:t.size.width,h:t.size.height};let _=H=>{let X=H;if(!b.current)return;let J=X.clientX-b.current.x,K=X.clientY-b.current.y,U=Math.max(120,b.current.w+J),j=Math.max(80,b.current.h+K);s&&s(t.card_id,{width:U,height:j})},O=()=>{b.current=null,document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",_),document.addEventListener("mouseup",O)},[t.card_id,t.size.width,t.size.height,s]),C=w(R=>{R.preventDefault(),R.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),$=w(R=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:R}),v()},[t.card_id,l,v]),A;switch(t.card_type){case"text":A=hi(t);break;case"json":A=Mc(t);break;case"task":A=Ec(t);break;case"project":A=Rc(t,d);break;default:A=hi(t)}let z=t.card_type==="project",P={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:z?"999px":"6px",borderLeft:`4px solid ${m}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease",zIndex:"1"},B={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},I={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:u?"block":"none",border:"none",padding:"0"},N={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},L={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:u?"block":"none",border:"none",padding:"0"},M=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.card_id}`},o("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"#3b82f6",color:"#fff",fontSize:"9px",fontWeight:"700",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},t.assignee.charAt(0).toUpperCase()),o("span",{},t.assignee)):null,S=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((R,W)=>o("span",{key:String(W),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},R))):null,k={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},E={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},F=h?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${h.x}px`,top:`${h.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`card-context-menu-${t.card_id}`,role:"menu","aria-label":"Card context menu",onClick:R=>R.stopPropagation()},o("div",{style:k,onClick:R=>{R.stopPropagation(),a&&a(t.card_id),v()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...k,position:"relative"},onMouseEnter:()=>p(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),f?o("div",{style:E,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...xi.map(R=>o("div",{key:R.value,style:{...k,fontWeight:t.card_type===R.value?"700":"400"},onClick:W=>{W.stopPropagation(),$(R.value)},role:"menuitem","data-testid":`ctx-type-${R.value}-${t.card_id}`},R.label,t.card_type===R.value?" \u2713":""))):null)):null;return z?o("div",{className:"board-card board-card--project",style:P,onMouseDown:D,onContextMenu:x,onMouseEnter:()=>g(!0),onMouseLeave:()=>{g(!1),v()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},A,o("div",{style:L,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),F):o("div",{className:"board-card",style:P,onMouseDown:D,onContextMenu:x,onMouseEnter:()=>g(!0),onMouseLeave:()=>{g(!1),v()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},o("div",{style:B,"data-testid":`card-title-${t.card_id}`},t.card_title||"Untitled"),A,S,M,o("div",{style:L,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":`Export drag handle for ${t.card_title}`,title:"Drag to export card"},"\u2630"),o("button",{style:I,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:C,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:N,"data-role":"resize",onMouseDown:T,"aria-label":"Resize card"}),F)}function yi(e){let{container:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDrop:a,children:l}=e,[d,u]=G(!1),g=ne(null),h=ne(null),c=w(T=>{let C=T;C.preventDefault(),C.stopPropagation(),r&&r(t.container_id),g.current={x:C.clientX,y:C.clientY,posX:t.position.x,posY:t.position.y};let $=z=>{let P=z;if(!g.current)return;let B=P.clientX-g.current.x,I=P.clientY-g.current.y;i&&i(t.container_id,{x:g.current.posX+B,y:g.current.posY+I})},A=()=>{g.current=null,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",A)},[t.container_id,t.position.x,t.position.y,r,i]),f=w(T=>{let C=T;C.preventDefault(),C.stopPropagation(),h.current={x:C.clientX,y:C.clientY,w:t.size.width,h:t.size.height};let $=z=>{let P=z;if(!h.current)return;let B=P.clientX-h.current.x,I=P.clientY-h.current.y,N=Math.max(160,h.current.w+B),L=Math.max(120,h.current.h+I);s&&s(t.container_id,{width:N,height:L})},A=()=>{h.current=null,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",A)},[t.container_id,t.size.width,t.size.height,s]),p=w(T=>{T.preventDefault(),u(!0)},[]),y=w(()=>{u(!1)},[]),b=w(T=>{let C=T;if(C.preventDefault(),u(!1),a&&C.dataTransfer){let $=C.dataTransfer.getData("text/plain");$&&a($,t.container_id)}},[t.container_id,a]),m={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:"#ffffff",border:n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:d?"0 0 0 3px rgba(59,130,246,0.3), 0 4px 16px rgba(0,0,0,0.1)":"0 2px 8px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:"0",boxSizing:"border-box"},x={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},v={flex:"1",overflow:"auto",position:"relative",padding:"4px"},D={position:"absolute",bottom:"0",right:"0",width:"14px",height:"14px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"};return o("div",{className:"board-container",style:m,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:p,onDragLeave:y,onDrop:b},o("div",{className:"board-container__title",style:x,onMouseDown:c,"data-testid":`container-title-${t.container_id}`},t.name),o("div",{className:"board-container__contents",style:v,"data-testid":`container-contents-${t.container_id}`},l),o("div",{style:D,"data-role":"resize",onMouseDown:f,"aria-label":"Resize container"}))}function Si(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}var vi="board-card-link-arrowhead";function _t(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,canvasWidth:s,canvasHeight:a}=e,l=new Map;for(let c=0;c<n.length;c++)l.set(n[c].card_id,n[c]);let d=w(c=>{i(c)},[i]),u=[];for(let c=0;c<t.length;c++){let{source:f,link:p}=t[c],y=l.get(p.target_card_id);if(!y)continue;let b=Si(f),m=Si(y),x=p.link_id===r,v=x?"#3b82f6":p.color||"#94a3b8",D=m.x-b.x,T=m.y-b.y,C=Math.sqrt(D*D+T*T),$=Math.min(40,C*.15),A=C>0?-T/C:0,z=C>0?D/C:0,P=(b.x+m.x)/2,B=(b.y+m.y)/2,I=P+A*$,N=B+z*$,L=`M ${b.x} ${b.y} Q ${I} ${N} ${m.x} ${m.y}`;u.push(o("path",{key:`hit-${p.link_id}`,d:L,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(p.link_id),"data-testid":`link-hit-${p.link_id}`})),u.push(o("path",{key:p.link_id,d:L,fill:"none",stroke:v,"stroke-width":x?"3":"2","pointer-events":"none","marker-end":`url(#${vi})`,"data-testid":`link-${p.link_id}`})),p.link_name&&u.push(o("text",{key:`label-${p.link_id}`,x:String(I),y:String(N-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${p.link_id}`},p.link_name))}let g={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},h=o("defs",{},o("marker",{id:vi,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse"},o("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})));return o("svg",{style:g,width:String(s),height:String(a),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},h,o("g",{style:{pointerEvents:"auto"}},...u))}var $n=20,Ot=5e3;function Tn(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Pc(e){let t=[],n=[],r=[...e];for(;r.length>0;){let i=r.pop();if(we(i)){t.push(i);for(let s=0;s<i.card_link.length;s++)n.push({source:i,link:i.card_link[s]})}else if(Ee(i))for(let s=i.contents.length-1;s>=0;s--)r.push(i.contents[s])}return{cards:t,links:n}}function Ht(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d}=e,{collection:u,viewport:g}=t,h=ne(null),c=ne(!1),f=ne(null),p=w(S=>{let k=S,E=k.target;if(E.closest(".board-card")||E.closest(".board-container"))return;let F=k.button===1,R=k.button===0&&k.shiftKey;F||R?(k.preventDefault(),c.current=!0,f.current={x:k.clientX,y:k.clientY,panX:g.panX,panY:g.panY}):k.button===0&&i&&i(null)},[g.panX,g.panY,i]);se(()=>{let S=E=>{if(!c.current||!f.current)return;let F=E,R=F.clientX-f.current.x,W=F.clientY-f.current.y;n({type:"PAN",panX:f.current.panX+R,panY:f.current.panY+W})},k=()=>{c.current=!1,f.current=null};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",k)}},[n]);let y=w(S=>{let k=S;if(!k.ctrlKey)return;k.preventDefault();let E=k.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:g.zoom+E})},[g.zoom,n]),b=ne(null);se(()=>{let S=h.current;if(!S)return;let k=_=>{let O=[];for(let H=0;H<_.touches.length;H++)O.push({x:_.touches[H].clientX,y:_.touches[H].clientY});return O},E=(_,O)=>Math.sqrt((_.x-O.x)**2+(_.y-O.y)**2),F=_=>{let O=_;if(O.touches.length===2){O.preventDefault();let H=k(O);b.current={touches:H,panX:g.panX,panY:g.panY,zoom:g.zoom,dist:E(H[0],H[1])}}},R=_=>{let O=_;if(O.touches.length!==2||!b.current)return;O.preventDefault();let H=k(O),X=b.current,J=(X.touches[0].x+X.touches[1].x)/2,K=(X.touches[0].y+X.touches[1].y)/2,U=(H[0].x+H[1].x)/2,j=(H[0].y+H[1].y)/2;n({type:"PAN",panX:X.panX+(U-J),panY:X.panY+(j-K)});let V=E(H[0],H[1]);X.dist>0&&n({type:"ZOOM",zoom:X.zoom*(V/X.dist)})},W=()=>{b.current=null};return S.addEventListener("touchstart",F,{passive:!1}),S.addEventListener("touchmove",R,{passive:!1}),S.addEventListener("touchend",W),()=>{S.removeEventListener("touchstart",F),S.removeEventListener("touchmove",R),S.removeEventListener("touchend",W)}},[g.panX,g.panY,g.zoom,n]);let m=w(S=>{i&&i(S)},[i]),x=w((S,k)=>{let E=k;s&&(E=Tn(k,$n)),n({type:"MOVE_ITEM",itemId:S,position:E})},[n,s]),v=w((S,k)=>{n({type:"RESIZE_ITEM",itemId:S,size:k})},[n]),D=w(S=>{n({type:"REMOVE_ITEM",itemId:S}),i&&r===S&&i(null)},[n,r,i]),T=w((S,k)=>{n({type:"NEST_ITEM",itemId:S,containerId:k})},[n]),C=a.toLowerCase(),$=new Set,A=[],z=[...u];for(;z.length>0;){let S=z.pop();if(A.push(S),Ee(S))for(let k=0;k<S.contents.length;k++)z.push(S.contents[k])}if(C)for(let S=0;S<A.length;S++){let k=A[S];(we(k)?k.card_title:k.name).toLowerCase().includes(C)||$.add(He(k))}if(l)for(let S=0;S<A.length;S++){let k=A[S];we(k)&&k.color!==l&&$.add(k.card_id)}let{cards:P,links:B}=Pc(u);function I(S){let k=He(S),E=$.has(k),F;if(we(S))F=o(Wt,{key:k,card:S,selected:k===r,onSelect:m,onMove:x,onResize:v,onDelete:D,dispatch:n,onOpenProject:d});else{let R=S.contents.map(W=>I(W));F=o(yi,{key:k,container:S,selected:k===r,onSelect:m,onMove:x,onResize:v,onDrop:T},...R)}return E?o("div",{key:`dim-${k}`,style:{opacity:"0.3"}},F):F}let N=u.map(S=>I(S)),L={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${$n}px ${$n}px`},M={transform:`translate(${g.panX}px, ${g.panY}px) scale(${g.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Ot}px`,height:`${Ot}px`};return o("div",{ref:h,className:"board-canvas",style:L,onMouseDown:p,onWheel:y,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:M,"data-testid":"board-canvas-inner"},o(_t,{links:B,cards:P,selectedLinkId:null,onSelectLink:()=>{},canvasWidth:Ot,canvasHeight:Ot}),...N))}function $c(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(we(r))t.push(r);else if(Ee(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function zn(e,t,n,r){let i=r??40,s=$c(e);if(s.length===0)return{panX:0,panY:0,zoom:1};let a=1/0,l=1/0,d=-1/0,u=-1/0;for(let m=0;m<s.length;m++){let x=s[m];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,D=x.position.y+x.size.height;v>d&&(d=v),D>u&&(u=D)}let g=d-a+i*2,h=u-l+i*2,c=t/g,f=n/h,p=Math.max(.25,Math.min(4,Math.min(c,f))),y=-a*p+(t-(d-a)*p)/2,b=-l*p+(n-(u-l)*p)/2;return{panX:y,panY:b,zoom:p}}var yt=["transparent","#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Dn(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:g,onGridToggle:h,onSearch:c}=e,[f,p]=G(""),y=w($=>{let A=$.target.value;p(A),c(A)},[c]),b={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},m={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...m,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},D={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},T={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=yt.map($=>{let A=$===r,z=$===i,P=()=>{A&&g?g(z?null:$):u($)},B="1px solid rgba(0,0,0,0.15)";z?B="3px solid #ef4444":A&&(B="2px solid #3b82f6");let I=$==="transparent";return o("button",{key:$,title:I?"Transparent":$,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:I?"#ffffff":$,backgroundImage:I?"linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)":"none",backgroundSize:I?"6px 6px":"auto",backgroundPosition:I?"0 0, 3px 3px":"0 0",border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:z?"1":i?"0.5":"1"},onClick:P,"aria-label":z?`Clear color filter ${$}`:`Select color ${$}`,"data-testid":`color-swatch-${$}`})});return o("div",{className:"board-toolbar",style:b,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:m,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:D}),o("button",{style:m,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:v,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:m,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:D}),...C,o("div",{style:D}),o("button",{style:n?x:m,onClick:h,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:D}),o("input",{type:"text",placeholder:"Search cards...",value:f,onInput:y,style:T,"data-testid":"search-input","aria-label":"Search cards"}))}var wi=50,Ye={id:st(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function ki(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(He(d)===t){n=d;continue}if(Ee(d)){let g=r(d.contents);a.push({...d,contents:g})}else a.push(d)}return a}return[r(e),n]}function qe(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];He(s)===t?r.push(n(s)):Ee(s)?r.push({...s,contents:qe(s.contents,t,n)}):r.push(s)}return r}function Yt(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Ee(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):Ee(s)?r.push({...s,contents:Yt(s.contents,t,n)}):r.push(s)}return r}function Tc(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if(Ee(u)&&u.container_id===t){let g=[];for(let h=0;h<u.contents.length;h++){let c=u.contents[h];He(c)===n?r=c:g.push(c)}l.push({...u,contents:g})}else Ee(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function zc(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function An(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:Yt(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=ki(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:qe(e.collection,t.itemId,n=>({...n,position:t.position,...we(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:qe(e.collection,t.itemId,n=>({...n,size:t.size,...we(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,card_type:t.newType,content:zc(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:Yt(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let[n,r]=ki(e.collection,t.itemId);return r?{...e,collection:Yt(n,t.containerId,r)}:e}case"UNNEST_ITEM":{let[n,r]=Tc(e.collection,t.containerId,t.itemId);return r?{...e,collection:[...n,r]}:e}case"ADD_LINK":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,card_link:n.card_link.filter(r=>r.link_id!==t.linkId),updatedAt:Date.now()}:n)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;case"RENAME_BOARD":return{...e,name:t.name};default:return e}}function Dc(e){return e.type==="PAN"||e.type==="ZOOM"}function Ln(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=An(e.present,t.action);if(n===e.present)return e;if(Dc(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>wi&&r.splice(0,r.length-wi),{past:r,present:n,future:[]}}default:return e}}function Bn(e){let t={past:[],present:e||Ye,future:[]},[n,r]=Qt(Ln,t),i=w(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=w(()=>{r({type:"UNDO"})},[r]),a=w(()=>{r({type:"REDO"})},[r]);return{state:n.present,dispatch:i,undo:s,redo:a,canUndo:n.past.length>0,canRedo:n.future.length>0}}function Fn(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Bn(),d=ne(!1);se(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(h=>{r({type:"SET_BOARD",state:h})}).catch(()=>{}))},[e,t,r]);let u=ne(null),g=ne(n);return g.current=n,se(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,g.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,n]),{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}}var St=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...Ye}}catch{return{...Ye}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Ac(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(we(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Nn(e){let{collection:t,onCardDropped:n,children:r}=e,i=Oe(),s=ne([]);se(()=>{let u=Ac(t),g=s.current,h=new Set(g.map(f=>f.card_id)),c=new Set(u.map(f=>f.card_id));for(let f of u)h.has(f.card_id)||i.publish("project-board",{event:"card-created",card:f});for(let f of g)c.has(f.card_id)||i.publish("project-board",{event:"card-deleted",cardId:f.card_id});for(let f of u)if(h.has(f.card_id)){let p=g.find(y=>y.card_id===f.card_id);p&&p.updatedAt!==f.updatedAt&&i.publish("project-board",{event:"card-updated",card:f})}s.current=u},[t,i]);let a=w(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let g=u.data;n(String(g.title||"Dropped Item"),String(g.description||""))}},[n]),{isOver:l}=ht({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var Lc=new St;function Ci(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(we(r))t.push(r);else if(Ee(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var Ve=Date.now(),Bc={id:"sample-board-001",name:"Sample Project",collection:[{type:"card",card_id:"sample-1",card_type:"text",card_title:"Auth API",card_link:[{link_id:"link-1",link_name:"blocks",target_card_id:"sample-2",color:"#94a3b8",attributes:{}}],content:{text:"Design the auth flow"},position:{x:50,y:50},size:{width:180,height:120},color:"#3b82f6",priority:"high",assignee:"Alice",createdAt:Ve,updatedAt:Ve},{type:"card",card_id:"sample-2",card_type:"text",card_title:"Dashboard",card_link:[],content:{text:"Build the main dashboard"},position:{x:300,y:80},size:{width:180,height:120},color:"#22c55e",priority:"medium",assignee:"Bob",createdAt:Ve,updatedAt:Ve},{type:"card",card_id:"sample-3",card_type:"text",card_title:"Deploy",card_link:[],content:{text:"Set up CI pipeline"},position:{x:150,y:250},size:{width:180,height:120},color:"#f59e0b",priority:"low",createdAt:Ve,updatedAt:Ve},{type:"card",card_id:"sample-4",card_type:"text",card_title:"Docs",card_link:[],content:{text:"Write API reference"},position:{x:400,y:280},size:{width:180,height:120},color:"#a855f7",priority:"medium",assignee:"Carol",createdAt:Ve,updatedAt:Ve}],viewport:{panX:0,panY:0,zoom:1}};function Fc(e){return e.collection.length===0}function Mi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Fn(Lc,t),[d,u]=G(yt[0]),[g,h]=G(!1),[c,f]=G(""),[p,y]=G(null),[b,m]=G(null),[x,v]=G(n.name||"Untitled"),[D,T]=G(!1),[C,$]=G(""),A=ne(!1);se(()=>{!A.current&&Fc(n)?(A.current=!0,r({type:"SET_BOARD",state:Bc})):n.collection.length>0&&(A.current=!0)},[n,r]);let z=w(()=>{let te=(-n.viewport.panX+300)/n.viewport.zoom,le=(-n.viewport.panY+200)/n.viewport.zoom,ce=(Math.random()-.5)*300,oe=(Math.random()-.5)*200,ue={type:"card",card_id:st(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(te+ce),y:Math.round(le+oe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ue})},[n.viewport,d,r]),P=w(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),B=w(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),I=w(()=>{r({type:"ZOOM",zoom:1})},[r]),N=w(()=>{h(te=>!te)},[]),L=w(te=>{f(te)},[]),M=w(te=>{y(te)},[]),S=w(te=>{m(te)},[]),k=w(()=>{r({type:"SET_BOARD",state:Ye}),y(null)},[r]),E=w(()=>{let te=JSON.stringify(n,null,2),le=new Blob([te],{type:"application/json"}),ce=URL.createObjectURL(le),oe=document.createElement("a");oe.href=ce,oe.download=`board-${t}.json`,oe.style.display="none",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(ce)},[n,t]),F=w(()=>{let te=document.createElement("input");te.type="file",te.accept=".json,application/json",te.style.display="none",te.addEventListener("change",()=>{let le=te.files&&te.files[0];if(!le)return;let ce=new FileReader;ce.onload=()=>{try{let oe=JSON.parse(ce.result);oe&&oe.collection&&oe.viewport&&r({type:"SET_BOARD",state:oe})}catch{}},ce.readAsText(le)}),document.body.appendChild(te),te.click(),document.body.removeChild(te)},[r]),R=w(()=>{window.print()},[]),W=Ci(n.collection),_=w(()=>{let te=Ci(n.collection);te.length>0&&y(te[0].card_id)},[n.collection]),O=w(()=>{p&&(r({type:"REMOVE_ITEM",itemId:p}),y(null))},[p,r]),H=w(()=>{if(n.collection.length===0)return;let ce=zn(n.collection,800,600);r({type:"PAN",panX:ce.panX,panY:ce.panY}),r({type:"ZOOM",zoom:ce.zoom})},[n.collection,r]);se(()=>{let te={menus:[{label:"File",items:[{label:"New Board",onClick:k},{label:"Export JSON",onClick:E},{label:"Import JSON",onClick:F},{divider:!0},{label:"Print",onClick:R}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:_},{label:"Delete Selected",onClick:O}]},{label:"View",items:[{label:"Zoom In",onClick:P},{label:"Zoom Out",onClick:B},{label:"Fit All",onClick:H},{divider:!0},{label:"Toggle Grid",onClick:N}]}]}},[k,E,F,R,i,s,a,l,_,O,P,B,H,N]),se(()=>{let te=le=>{let ce=le;ce.ctrlKey&&ce.key==="z"?(ce.preventDefault(),i()):ce.ctrlKey&&ce.key==="y"&&(ce.preventDefault(),s())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[i,s]);let X=w(()=>{$(x),T(!0)},[x]),J=w(()=>{let te=C.trim();te&&(v(te),r({type:"RENAME_BOARD",name:te})),T(!1)},[C,r]),K=w(()=>{T(!1)},[]),U=w(te=>{$(te.target.value)},[]),j=w(te=>{let le=te;le.key==="Enter"&&(le.preventDefault(),J()),le.key==="Escape"&&(le.preventDefault(),K())},[J,K]),V={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},Y=w((te,le)=>{let ce=(-n.viewport.panX+300)/n.viewport.zoom,oe=(-n.viewport.panY+200)/n.viewport.zoom,ue=(Math.random()-.5)*300,re=(Math.random()-.5)*200,ie={type:"card",card_id:st(),card_type:"text",card_title:te,card_link:[],content:{text:le},color:d,position:{x:Math.round(ce+ue),y:Math.round(oe+re)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ie})},[n.viewport,d,r]),Z={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},Q={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ae=o("div",{style:Z,"data-testid":"app-menu-bar"},o("button",{style:Q,onClick:X,title:"Project menu"},"Project"),o("button",{style:Q,title:"Settings"},"Settings"),o("button",{style:Q,title:"Help"},"Help"),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${x}`)),ee=D?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:K},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:te=>te.stopPropagation(),role:"dialog","aria-label":"Rename project"},o("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"}},"Rename Project"),o("input",{type:"text",value:C,onInput:U,onKeyDown:j,autoFocus:!0,style:{width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},"data-testid":"rename-input"}),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{onClick:K,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:J,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null;return o("div",{className:"project-manager-app",style:V,"data-testid":"project-manager-app"},ae,o(Dn,{zoom:n.viewport.zoom,gridEnabled:g,selectedColor:d,colorFilter:b,onNewCard:z,onZoomIn:P,onZoomOut:B,onZoomReset:I,onColorSelect:u,onColorFilter:S,onGridToggle:N,onSearch:L}),o(Nn,{collection:n.collection,onCardDropped:Y},o(Ht,{state:n,dispatch:r,searchQuery:c,gridEnabled:g,selectedId:p,onSelectItem:M,colorFilter:b})),ee)}var Nc=28,Wc=5e3;var Ei=0;function Ri(e){return Ei++,`${e}-${Ei}`}function Pi(e){return e.replace(/\s*\(\d+\)$/,"")}function _c(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function Oc(){let e=Oe(),t=ne(!1);return se(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function Hc(){let[e,t]=G([]),n=Xe();mt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=w(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function Yc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(Pi(e)){case"Files":return o(_e,{appId:"files"},o(Hc,null));case"Terminal":return o(_e,{appId:"terminal"},o(Oc,null));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(r=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},r)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(r=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},r)));case"Word Processor":return o(At,null);case"IDE":return o(Lt,null);case"Trading":return o(Nt,null);case"Project Board":return o(Mi,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Vc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=pt(),d=l.activeMenuBar,u=l.dockSignals,g=ne(l);g.current=l;let[h,c]=G([]),[f,p]=G([]),[y,b]=G(!1),[m,x]=G(!1),[v,D]=G(null),[T,C]=G({x:0,y:0}),[$,A]=G(null),z=w(()=>{b(re=>!re)},[]),P=w(re=>{p(ie=>ie.filter(de=>de.id!==re))},[]);se(()=>{if(f.length===0)return;let re=f[0],ie=Date.now()-re.timestamp,de=Math.max(0,Wc-ie),pe=setTimeout(()=>{p(me=>me.filter(he=>he.id!==re.id))},de);return()=>clearTimeout(pe)},[f]);let B=ne(t);B.current=t;let I=ne(r);I.current=r;let N=w(re=>{let de=B.current.find(pe=>pe.id===re);de&&(c(pe=>{let he=pe.filter(De=>De.appId===re).length+1,fe=he===1?de.label:`${de.label} (${he})`,ye=Ri(re),Pe=pe.length>0?Math.max(...pe.map(De=>De.zIndex))+1:1,ct={id:ye,appId:de.id,title:fe,icon:de.icon,x:60+pe.length*30,y:40+pe.length*30,width:600,height:400,zIndex:Pe,focused:!0,windowState:"normal"};return[...pe.map(De=>({...De,focused:!1})),ct]}),re==="files"&&g.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),re==="terminal"&&g.current.signalDock("terminal",{badge:3}),I.current&&I.current(re))},[]),L=w(re=>{c(ie=>{if(!ie.find(me=>me.id===re))return ie;let pe=Math.max(...ie.map(me=>me.zIndex))+1;return ie.map(me=>me.id===re?{...me,focused:!0,zIndex:pe,windowState:me.windowState==="minimized"?"normal":me.windowState}:{...me,focused:!1})})},[]),M=w(re=>{c(ie=>{let de=ie.filter(fe=>fe.appId===re);if(de.length===0)return ie;let me=[...de].sort((fe,ye)=>ye.zIndex-fe.zIndex)[0],he=Math.max(...ie.map(fe=>fe.zIndex))+1;return ie.map(fe=>fe.id===me.id?{...fe,focused:!0,zIndex:he,windowState:fe.windowState==="minimized"?"normal":fe.windowState}:{...fe,focused:!1})}),c(ie=>{if(ie.filter(pe=>pe.appId===re).length===0){let me=B.current.find(Pe=>Pe.id===re);if(!me)return ie;let he=Ri(re),fe=ie.length>0?Math.max(...ie.map(Pe=>Pe.zIndex))+1:1,ye={id:he,appId:me.id,title:me.label,icon:me.icon,x:60+ie.length*30,y:40+ie.length*30,width:600,height:400,zIndex:fe,focused:!0,windowState:"normal"};return re==="files"&&g.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),re==="terminal"&&g.current.signalDock("terminal",{badge:3}),I.current&&I.current(re),[...ie.map(Pe=>({...Pe,focused:!1})),ye]}return ie})},[]),S=t.map(re=>{let ie=h.some(me=>me.appId===re.id),de=u.get(re.id),pe={id:re.id,icon:re.icon,label:de?.tooltip||re.label,active:ie};return de&&(de.badge!=null&&(pe.badge=de.badge>0?de.badge:void 0),de.progress!=null&&(pe.progress=de.progress>0?de.progress:void 0),de.urgent&&(pe.urgent=!0)),pe}),k=h.find(re=>re.focused),E=k?k.title:void 0,F=w(()=>{x(!0)},[]),R=w(()=>{x(!1)},[]),W=w((re,ie)=>{D(re),C(ie)},[]),_=w(()=>{D(null)},[]),O=w(()=>{},[]),H=w(()=>{i&&i()},[i]),X=[];n&&(X.push({label:n.name,icon:void 0,onClick:O,divider:!1}),X.push({label:"",icon:void 0,onClick:O,divider:!0})),X.push({label:"Lock",icon:void 0,onClick:F,divider:!1}),X.push({label:"Logout",icon:void 0,onClick:H,divider:!1});let J=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),K={display:"flex",flex:"1",overflow:"hidden"},U={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},j={width:"100%",height:"100%",position:"relative"},V=o(Cn,{activeAppName:E,activitiesButton:{label:"Activities",onClick:z},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:X.length>0?X:void 0,height:Nc}),Y=o(Mn,{items:S,orientation:"vertical",position:"left",iconSize:36,onItemClick:M,onItemContextMenu:W}),Z=o(_c,{toasts:f,onDismiss:P}),Q=h.filter(re=>re.windowState!=="minimized").map(re=>o(bt,{key:re.id,id:re.id,title:re.title,icon:re.icon,defaultPosition:{x:re.x,y:re.y},defaultSize:{width:re.width,height:re.height},zIndex:re.zIndex,focused:re.focused,windowState:re.windowState,onClose:()=>{c(ie=>ie.filter(de=>de.id!==re.id))},onFocus:()=>{c(ie=>{let de=Math.max(...ie.map(pe=>pe.zIndex))+1;return ie.map(pe=>pe.id===re.id?{...pe,focused:!0,zIndex:de}:{...pe,focused:!1})})},onMinimize:()=>{c(ie=>ie.map(de=>de.id===re.id?{...de,windowState:"minimized"}:de))},onMaximize:()=>{c(ie=>ie.map(de=>de.id===re.id?{...de,windowState:de.windowState==="maximized"?"normal":"maximized"}:de))}},Yc(re.title))),ae=[];a&&ae.push(a),ae.push(...Q),ae.push(Z);let ee=o(En,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:j},...ae)),te=y?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:z},...t.map(re=>o("button",{key:re.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:ie=>{ie.stopPropagation(),b(!1),M(re.id)}},o("span",{style:{fontSize:"32px",display:"block"}},re.icon),o("span",null,re.label)))):null,le=m?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:R},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,ce=(()=>{if(!v)return null;let re=t.find(fe=>fe.id===v),ie=h.filter(fe=>fe.appId===v),de={padding:"6px 14px",cursor:"pointer"},pe={onMouseEnter:fe=>{fe.currentTarget.style.backgroundColor="#444"},onMouseLeave:fe=>{fe.currentTarget.style.backgroundColor="transparent"}},me={borderBottom:"1px solid #444",margin:"4px 0"},he=[];return he.push(o("div",{key:"new",style:de,...pe,onClick:()=>{N(v),D(null)},role:"menuitem"},"\u25CF New")),ie.length>0&&(he.push(o("div",{key:"sep-1",style:me})),ie.forEach((fe,ye)=>{let Pe=ie.length===1?re?.label||fe.title:`${re?.label||Pi(fe.title)} (${ye+1})`;he.push(o("div",{key:`inst-${fe.id}`,style:de,...pe,onClick:()=>{L(fe.id),D(null)},role:"menuitem"},Pe))})),he.push(o("div",{key:"sep-2",style:me})),he.push(o("div",{key:"about",style:de,...pe,onClick:()=>{A(v),D(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:_},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${T.y}px`,left:`${T.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:fe=>fe.stopPropagation()},...he))})(),oe=$?t.find(re=>re.id===$):null,ue=oe?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>A(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:re=>re.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},oe.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>A(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:J,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},V),o("div",{style:K},o("div",{className:"unity-desktop__dock",style:U},Y),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},ee,te)),ce,ue,le)}function Ii(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(vn,{onWindowOpen:r},o(ft,null,o(gt,null,o(Vc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function $i(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:g,onDeactivate:h,children:c}=e,f=pt(),p=q(()=>f.windows.find($=>$.id===t),[f.windows,t]);se(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=ne(!1),b=p?p.focused:!1;se(()=>{let $=y.current;y.current=b,b&&!$?g&&g():!b&&$&&h&&h()},[b,g,h]);let m=w(()=>{f.closeWindow(t),d&&d()},[f,t,d]),x=w(()=>{f.focusWindow(t)},[f,t]),v=w($=>{f.moveWindow(t,$)},[f,t]),D=w($=>{f.resizeWindow(t,$)},[f,t]),T=w(()=>{f.minimizeWindow(t)},[f,t]),C=w(()=>{p&&p.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,p]);return p?o(_e,{appId:t},o(bt,{id:t,title:n,icon:r,defaultPosition:p.position,defaultSize:p.size,minSize:a,resizable:l,windowState:p.windowState,focused:p.focused,zIndex:p.zIndex,onClose:m,onFocus:x,onMove:v,onResize:D,onMinimize:T,onMaximize:C,children:c})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var Ti={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},zi={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function Di(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:g,active:h=!1}=e,c=q(()=>{let f=Ti[i]??Ti.md,p=zi[r]??zi.secondary,y={padding:f.padding,fontSize:f.fontSize,borderRadius:f.borderRadius,border:`1px solid ${p.border}`,backgroundColor:h?"#3b82f6":p.bg,color:h?"white":p.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,h,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":g,"aria-pressed":h?"true":void 0},t)}var Uc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],at=Math.PI/180;function jc(e,t,n,r,i,s,a,l,d,u){let g=Math.cos(r*at),h=Math.sin(r*at),c=Math.cos(i*at),f=Math.sin(i*at),p=Math.cos(s*at),y=Math.sin(s*at),b=e*p-t*y,m=e*y+t*p,x=b*c-m*f,v=b*f+m*c,D=n,T=x,C=v*g-D*h,$=v*h+D*g,A=1+a*.001*$,z=l+T*u*A,P=d-C*u*A;return{sx:z,sy:P,depth:$}}function Ai(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function Li(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function Bi(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:g=2,colorScale:h=Uc,gridColor:c="#94a3b8",title:f}=e,p=q(()=>{let L=0,M=0,S=0;for(let k=0;k<t.length;k++){let E=t[k],F=E.data.length;F>L&&(L=F);for(let R=0;R<F;R++){let W=E.data[R].length;W>M&&(M=W);for(let _=0;_<W;_++){let O=Math.abs(E.data[R][_]??0);O>S&&(S=O)}}}return{maxRows:Math.max(L,1),maxCols:Math.max(M,1),maxHeight:S>0?S:1}},[t]),y=q(()=>{let L=p.maxHeight+(t.length-1)*g+p.maxHeight,M=Math.sqrt(p.maxCols*p.maxCols+p.maxRows*p.maxRows+L*L),S=Math.min(n,r)*.75;return M>0?S/M:1},[p,t.length,g,n,r]),b=n/2,m=r/2,x=w((L,M,S)=>jc(L,M,S,s,a,l,i,b,m,y),[s,a,l,i,b,m,y]),v=w(()=>{if(!u)return[];let L=[],M=Math.max(p.maxCols,p.maxRows),S=p.maxCols/2,k=p.maxRows/2,E=x(-S,-k,0),F=x(S,-k,0);L.push(o("line",{key:"axis-x",x1:String(E.sx),y1:String(E.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-x-label",x:String(F.sx+8),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let R=x(-S,k,0);L.push(o("line",{key:"axis-y",x1:String(E.sx),y1:String(E.sy),x2:String(R.sx),y2:String(R.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-y-label",x:String(R.sx-12),y:String(R.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=p.maxHeight+(t.length-1)*g,_=x(-S,-k,W);return L.push(o("line",{key:"axis-z",x1:String(E.sx),y1:String(E.sy),x2:String(_.sx),y2:String(_.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-z-label",x:String(_.sx-4),y:String(_.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),L},[u,p,t.length,g,x]),D=w(()=>{let L=[],M=p.maxCols/2,S=p.maxRows/2,k=[];for(let E=0;E<t.length;E++){let F=t[E],R=F.color??h[E%h.length],W=F.opacity??.7,_=E*g,O=F.data.length;for(let H=0;H<O-1;H++){let X=F.data[H],J=F.data[H+1],K=Math.min(X.length,J.length);for(let U=0;U<K-1;U++){let j=U-M,V=U+1-M,Y=H-S,Z=H+1-S,Q=(X[U]??0)+_,ae=(X[U+1]??0)+_,ee=(J[U]??0)+_,te=(J[U+1]??0)+_,le=x(j,Y,Q),ce=x(V,Y,ae),oe=x(j,Z,ee),ue=x(V,Z,te),re=(le.depth+ce.depth+oe.depth+ue.depth)/4,ie=`${le.sx},${le.sy} ${ce.sx},${ce.sy} ${ue.sx},${ue.sy} ${oe.sx},${oe.sy}`;k.push({points:ie,fill:Ai(R,W),stroke:Li(R,.7),strokeWidth:"0.5",depth:re,key:`quad-${E}-${H}-${U}`})}}if(O===1||O>0&&F.data[0].length===1)for(let H=0;H<O;H++){let X=F.data[H];for(let J=0;J<X.length;J++){let K=J-M,U=H-S,j=(X[J]??0)+_,V=x(K,U,j),Y=3,Z=`${V.sx},${V.sy-Y} ${V.sx+Y},${V.sy} ${V.sx},${V.sy+Y} ${V.sx-Y},${V.sy}`;k.push({points:Z,fill:Ai(R,W),stroke:Li(R,.7),strokeWidth:"0.5",depth:V.depth,key:`point-${E}-${H}-${J}`})}}}k.sort((E,F)=>E.depth-F.depth);for(let E=0;E<k.length;E++){let F=k[E];L.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return L},[t,p,g,h,x]),T=w(()=>{let L=[],M=p.maxCols/2,S=p.maxRows/2;for(let k=0;k<=p.maxRows;k++){let E=k-S,F=x(-M,E,0),R=x(M,E,0);L.push(o("line",{key:`base-h-${k}`,x1:String(F.sx),y1:String(F.sy),x2:String(R.sx),y2:String(R.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let k=0;k<=p.maxCols;k++){let E=k-M,F=x(E,-S,0),R=x(E,S,0);L.push(o("line",{key:`base-v-${k}`,x1:String(F.sx),y1:String(F.sy),x2:String(R.sx),y2:String(R.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return L},[p,c,x]),C=w(()=>{if(!d)return[];let L=[],M=p.maxCols/2,S=p.maxRows/2;for(let k=0;k<t.length;k++){let E=t[k],F=k*g,R=0,W=0;for(let X=0;X<E.data.length;X++){let J=E.data[X];for(let K=0;K<J.length;K++)R+=J[K]??0,W++}let _=W>0?R/W:0,O=x(M+1,0,_+F),H=E.color??h[k%h.length];L.push(o("text",{key:`layer-label-${k}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:H},E.label))}return L},[d,t,p,g,h,x]),A=w(()=>f?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n])(),z=T(),P=v(),B=D(),I=C(),N=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...A,...N,...z,...P,...B,...I)}function Gc(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function Xc(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Fi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:g="currentColor",trendUpColor:h="#22c55e",trendDownColor:c="#ef4444",backgroundColor:f="#ffffff"}=e,p=q(()=>Gc(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),b=l!=null&&l.length>1,m=n!=null&&n.length>0,x=y&&s>=0?h:c,v=20,D=m?u*.38:u*.45,T=Math.min(d*.15,48),C=T*.55,$=D+T*.4+8,A=m?$+22:D+T*.4+22,z=b?Math.min(u*.22,36):0,P=u-v-z,B=d-v*2,I=w(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:f,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,f]),N=w(()=>{let O=[],H=r+p+i;return O.push(o("text",{key:"value",x:String(d/2),y:String(D),"text-anchor":"middle","dominant-baseline":"central","font-size":String(T),"font-weight":"bold","font-family":"sans-serif",fill:g,"aria-label":`Value: ${H}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,p,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),O},[d,D,T,C,p,r,i,g]),L=w(()=>m?[o("text",{key:"label",x:String(d/2),y:String($),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[m,d,$,n]),M=w(()=>{if(!y)return[];let O=[],H=s,X=H>=0,J=8,K=Xc(H),U=(X?"+":"-")+K+(a?" "+a:""),j=d/2-40,V=A;if(X){let Y=`${j},${V} ${j-J/2},${V+J} ${j+J/2},${V+J}`;O.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${V+J} ${j-J/2},${V} ${j+J/2},${V}`;O.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return O.push(o("text",{key:"trend-text",x:String(j+J+4),y:String(V+J*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${U}`},U)),O},[y,s,a,x,d,A]),S=w(()=>{if(!b)return[];let O=[],H=l,X=[];for(let Q of H)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&X.push(Q);if(X.length<2)return[];let J=1/0,K=-1/0;for(let Q of X)Q<J&&(J=Q),Q>K&&(K=Q);J===K&&(J-=1,K+=1);let U=K-J,j=B/(X.length-1),V="";for(let Q=0;Q<X.length;Q++){let ae=v+Q*j,ee=P+z-(X[Q]-J)/U*z;Q===0?V+=`M ${ae} ${ee}`:V+=` L ${ae} ${ee}`}let Y=v+(X.length-1)*j,Z=V+` L ${Y} ${P+z} L ${v} ${P+z} Z`;return O.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),O.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),O.push(o("path",{key:"spark-line",d:V,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[b,l,B,P,z,v]),k=I(),E=N(),F=L(),R=M(),W=S(),_=`${r}${p}${i}${m?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":_,style:{fontFamily:"sans-serif"}},...k,...W,...E,...F,...R)}var Vt=Math.PI/180;function qc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Vt),u=Math.sin(r*Vt),g=Math.cos(i*Vt),h=Math.sin(i*Vt),c=e*g+n*h,f=-e*h+n*g,p=t*d-f*u,y=t*u+f*d;return{sx:s+c*l,sy:a-p*l,depth:y}}function lt(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function Ut(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function Ue(e,t,n){let{x:r,y:i,z:s}=lt(e),a=Math.cos(n),l=Math.sin(n),d,u,g;return t==="x"?(d=r,u=i*a-s*l,g=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,g=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,g=s),Ut(d,u,g)}function Wn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Ue(e,"x",Math.PI);case"Y":return Ue(e,"y",Math.PI);case"Z":return Ue(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=lt(e);return Ut(s,-i,r)}case"S":return Ue(e,"z",Math.PI/2);case"T":return Ue(e,"z",Math.PI/4);case"Rx":return Ue(e,"x",n);case"Ry":return Ue(e,"y",n);case"Rz":return Ue(e,"z",n)}}function Ni(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:g=!0,showLabels:h=!0,showWireframe:c=!0,showTrail:f=!0,trailMaxPoints:p=200,trailColor:y="#ef4444",wireframeColor:b="#cbd5e1",vectorColor:m="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:D,onStateChange:T}=e,[C,$]=G(t??{theta:0,phi:0}),[A,z]=G(s),[P,B]=G(a),[I,N]=G(l),L=ne([]),M=ne(!1),S=ne(null),k=ne(null);se(()=>{t&&$(t)},[t?.theta,t?.phi]);let E=ne(0);se(()=>{if(!n||n.length===0)return;E.current=0;let j=0,V=()=>{E.current>=n.length||($(Y=>{let Z=Wn(Y,n[E.current]);return E.current++,T&&T(Z),Z}),j=requestAnimationFrame(V))};return j=requestAnimationFrame(V),()=>cancelAnimationFrame(j)},[n]),se(()=>{let j=lt(C);L.current.push(j),L.current.length>p&&L.current.splice(0,L.current.length-p)},[C.theta,C.phi]);let F=v*I,R=r/2,W=i/2,_=w((j,V,Y)=>qc(j,V,Y,P,A,R,W,F),[P,A,R,W,F]),O=w(j=>{if(!d)return;let V=j;M.current=!0,S.current={mx:V.clientX,my:V.clientY,rx:P,ry:A}},[d,P,A]),H=w(j=>{if(!M.current||!S.current)return;let V=j,Y=S.current;z(Y.ry+(V.clientX-Y.mx)*.5),B(Y.rx-(V.clientY-Y.my)*.5)},[]),X=w(()=>{M.current=!1},[]),J=w(j=>{if(!u)return;let V=j;V.preventDefault(),N(Y=>Math.max(.5,Math.min(3,Y*(V.deltaY>0?.95:1.05))))},[u]),K=[];if(x&&K.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),D&&K.push(o("text",{key:"title",x:String(R),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D)),c){let V=[];for(let Q=0;Q<=60;Q++){let ae=Q/60*2*Math.PI,ee=_(Math.cos(ae),Math.sin(ae),0);V.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}K.push(o("path",{key:"eq",d:V.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let ae=Q/60*2*Math.PI,ee=_(Math.cos(ae),0,Math.sin(ae));Y.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}K.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let Q=0;Q<=60;Q++){let ae=Q/60*2*Math.PI,ee=_(0,Math.cos(ae),Math.sin(ae));Z.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}K.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}))}let U=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let j of U){let V=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),Z=_(0,0,0);K.push(o("line",{key:`axis-${j.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(V.sx),y2:String(V.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(h){let j=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let V of j){let Y=_(V.pos[0],V.pos[1],V.pos[2]);K.push(o("text",{key:`lbl-${V.text}`,x:String(Y.sx),y:String(Y.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},V.text))}}if(f&&L.current.length>1){let j=L.current,V=[];for(let Y=0;Y<j.length;Y++){let Z=j[Y],Q=_(Z.x,Z.y,Z.z);V.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}K.push(o("path",{key:"trail",d:V.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(g){let j=lt(C),V=_(0,0,0),Y=_(j.x,j.y,j.z);K.push(o("line",{key:"vec-line",x1:String(V.sx),y1:String(V.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:m,"stroke-width":"2.5","stroke-linecap":"round"})),K.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:m,stroke:"#fff","stroke-width":"1.5"}));let Z=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);K.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${Z}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:k,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":D??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?M.current?"grabbing":"grab":"default"},onMouseDown:d?O:void 0,onMouseMove:d?H:void 0,onMouseUp:d?X:void 0,onMouseLeave:d?X:void 0,onWheel:u?J:void 0},...K)}function Kc(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function _n(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function On(e){let t=Kc(e);if(t.length===0)return null;let n=_n(t,25),r=_n(t,50),i=_n(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let f of t)if(f>=a){d=f;break}let u=t[t.length-1];for(let f=t.length-1;f>=0;f--)if(t[f]<=l){u=t[f];break}let g=0;for(let f of t)g+=f;let h=g/t.length,c=[];for(let f of t)(f<a||f>l)&&c.push(f);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:h,outliers:c,min:t[0],max:t[t.length-1]}}function Zc(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Wi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:g,padding:h=60}=e,c=i==="vertical",f=n-h*2,p=r-h*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=q(()=>{let S=[];for(let k of t)S.push(On(k.values));return S},[t]),m=q(()=>{let S=1/0,k=-1/0;for(let R of b){if(R===null)continue;let W=s&&R.outliers.length>0?Math.min(R.whiskerLow,R.outliers[0]):R.whiskerLow,_=s&&R.outliers.length>0?Math.max(R.whiskerHigh,R.outliers[R.outliers.length-1]):R.whiskerHigh;W<S&&(S=W),_>k&&(k=_)}isFinite(S)||(S=0,k=1);let E=k-S,F=E>0?E*.05:.5;return{min:S-F,max:k+F}},[b,s]),x=c?p:f,v=c?f:p,D=t.length>0?t.length:1,T=v/D,C=T*Math.min(Math.max(d,.1),.95),$=w(S=>{let k=m.max-m.min;return k===0?x/2:(S-m.min)/k*x},[m,x]),A=w(()=>{if(!u)return[];let S=[],k=m.max-m.min,E=Zc(k),F=Math.ceil(m.min/E)*E;for(let R=F;R<=m.max;R+=E){let W=$(R),_=String(Math.round(R*1e3)/1e3);if(c){let O=h+p-W;S.push(o("line",{key:`grid-${R}`,x1:String(h),y1:String(O),x2:String(h+f),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`glabel-${R}`,x:String(h-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=h+W;S.push(o("line",{key:`grid-${R}`,x1:String(O),y1:String(h),x2:String(O),y2:String(h+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`glabel-${R}`,x:String(O),y:String(h+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return S},[u,m,$,c,h,f,p]),z=w(()=>{let S=[];return S.push(o("line",{key:"axis-value",x1:String(h),y1:String(c?h:h+p),x2:String(h),y2:String(h+p),stroke:"#374151","stroke-width":"1.5"})),S.push(o("line",{key:"axis-category",x1:String(h),y1:String(h+p),x2:String(h+f),y2:String(h+p),stroke:"#374151","stroke-width":"1.5"})),S},[h,f,p,c]),P=w(()=>{let S=[];for(let k=0;k<t.length;k++){let E=b[k];if(E===null)continue;let F=t[k],R=F.color??y[k%y.length],W=T*k+T/2,_=C/2;if(c){let O=h+p-$(E.q1),H=h+p-$(E.q3),X=h+p-$(E.median),J=h+p-$(E.whiskerLow),K=h+p-$(E.whiskerHigh),U=h+W;S.push(o("line",{key:`wl-${k}`,x1:String(U),y1:String(O),x2:String(U),y2:String(J),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wlc-${k}`,x1:String(U-_*.4),y1:String(J),x2:String(U+_*.4),y2:String(J),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wh-${k}`,x1:String(U),y1:String(H),x2:String(U),y2:String(K),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`whc-${k}`,x1:String(U-_*.4),y1:String(K),x2:String(U+_*.4),y2:String(K),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,H),V=Math.abs(O-H);if(S.push(o("rect",{key:`box-${k}`,x:String(U-_),y:String(j),width:String(C),height:String(Math.max(V,1)),fill:R,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),S.push(o("line",{key:`med-${k}`,x1:String(U-_),y1:String(X),x2:String(U+_),y2:String(X),stroke:"#fff","stroke-width":"2.5"})),a){let Y=h+p-$(E.mean);S.push(o("circle",{key:`mean-${k}`,cx:String(U),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let Z=h+p-$(E.outliers[Y]);S.push(o("circle",{key:`out-${k}-${Y}`,cx:String(U),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}S.push(o("text",{key:`cat-${k}`,x:String(U),y:String(h+p+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let O=h+$(E.q1),H=h+$(E.q3),X=h+$(E.median),J=h+$(E.whiskerLow),K=h+$(E.whiskerHigh),U=h+W;S.push(o("line",{key:`wl-${k}`,x1:String(O),y1:String(U),x2:String(J),y2:String(U),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wlc-${k}`,x1:String(J),y1:String(U-_*.4),x2:String(J),y2:String(U+_*.4),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wh-${k}`,x1:String(H),y1:String(U),x2:String(K),y2:String(U),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`whc-${k}`,x1:String(K),y1:String(U-_*.4),x2:String(K),y2:String(U+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,H),V=Math.abs(H-O);if(S.push(o("rect",{key:`box-${k}`,x:String(j),y:String(U-_),width:String(Math.max(V,1)),height:String(C),fill:R,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),S.push(o("line",{key:`med-${k}`,x1:String(X),y1:String(U-_),x2:String(X),y2:String(U+_),stroke:"#fff","stroke-width":"2.5"})),a){let Y=h+$(E.mean);S.push(o("circle",{key:`mean-${k}`,cx:String(Y),cy:String(U),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let Z=h+$(E.outliers[Y]);S.push(o("circle",{key:`out-${k}-${Y}`,cx:String(Z),cy:String(U),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}S.push(o("text",{key:`cat-${k}`,x:String(h-6),y:String(U+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return S},[t,b,$,c,h,f,p,T,C,l,s,a,y]),B=w(()=>g?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,h]),I=A(),N=z(),L=P(),M=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Box plot",style:{fontFamily:"sans-serif"}},...M,...I,...N,...L)}function _i(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Jc(e,t,n){return e<t?t:e>n?n:e}function Hn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Oi(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:g=4,defaultColor:h="#3b82f6",opacity:c=.7,title:f,padding:p=60}=e,y=q(()=>{let L=[];for(let M=0;M<t.length;M++){let S=t[M];Hn(S.x)&&Hn(S.y)&&Hn(S.r)&&L.push(S)}return L},[t]),b=n-p*2,m=r-p*2,x=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let L=1/0,M=-1/0,S=1/0,k=-1/0,E=1/0,F=-1/0;for(let R of y)R.x<L&&(L=R.x),R.x>M&&(M=R.x),R.y<S&&(S=R.y),R.y>k&&(k=R.y),R.r<E&&(E=R.r),R.r>F&&(F=R.r);return L===M&&(L-=1,M+=1),S===k&&(S-=1,k+=1),E===F&&(E=0,F=F>0?F:1),{xMin:L,xMax:M,yMin:S,yMax:k,rMin:E,rMax:F}},[y]),v=w(L=>{let M=x.xMax-x.xMin;return p+(L-x.xMin)/M*b},[x,p,b]),D=w(L=>{let M=x.yMax-x.yMin;return p+m-(L-x.yMin)/M*m},[x,p,m]),T=w(L=>{let M=x.rMax-x.rMin;if(M===0)return(g+u)/2;let S=(L-x.rMin)/M;return g+S*(u-g)},[x,g,u]),C=w(()=>{if(!a)return[];let L=[],M=_i(x.xMax-x.xMin),S=Math.ceil(x.xMin/M)*M;for(let F=S;F<=x.xMax;F+=M){let R=v(F);L.push(o("line",{key:`grid-x-${F}`,x1:String(R),y1:String(p),x2:String(R),y2:String(p+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-xlabel-${F}`,x:String(R),y:String(p+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let k=_i(x.yMax-x.yMin),E=Math.ceil(x.yMin/k)*k;for(let F=E;F<=x.yMax;F+=k){let R=D(F);L.push(o("line",{key:`grid-y-${F}`,x1:String(p),y1:String(R),x2:String(p+b),y2:String(R),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-ylabel-${F}`,x:String(p-6),y:String(R+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return L},[a,x,v,D,p,b,m]),$=w(()=>{if(!l)return[];let L=[];return L.push(o("line",{key:"axis-y",x1:String(p),y1:String(p),x2:String(p),y2:String(p+m),stroke:"#374151","stroke-width":"1.5"})),L.push(o("line",{key:"axis-x",x1:String(p),y1:String(p+m),x2:String(p+b),y2:String(p+m),stroke:"#374151","stroke-width":"1.5"})),i&&L.push(o("text",{key:"x-label",x:String(p+b/2),y:String(p+m+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&L.push(o("text",{key:"y-label",x:String(p-40),y:String(p+m/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${p-40}, ${p+m/2})`},s)),L},[l,p,b,m,i,s]),A=w(()=>{let L=[];for(let M=0;M<y.length;M++){let S=y[M],k=v(S.x),E=D(S.y),F=Jc(T(S.r),g,u),R=S.color??h;L.push(o("circle",{key:`bubble-${M}`,cx:String(k),cy:String(E),r:String(F),fill:R,opacity:String(c),stroke:R,"stroke-width":"1","stroke-opacity":"0.8","aria-label":S.label??`Bubble at (${S.x}, ${S.y}) size ${S.r}`,role:"img"})),d&&S.label&&L.push(o("text",{key:`label-${M}`,x:String(k),y:String(E-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},S.label))}return L},[y,v,D,T,h,c,d,g,u]),z=w(()=>f?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n,p]),P=C(),B=$(),I=A(),N=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...P,...B,...I)}var Qc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ed=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function td(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function Hi(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function Yi(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function nd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function od(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Yi(t[i]),l=Yi(t[i+1]);return nd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var rd=["#9be9a8","#40c463","#30a14e","#216e39"];function Vi(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=rd,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:g}=e,{dateMap:h,startDate:c,endDate:f,maxVal:p}=q(()=>{let I=new Map,N=0,L=null,M=null;for(let E of t){let F=td(E.date);if(isNaN(F.getTime()))continue;let R=Hi(F);I.set(R,(I.get(R)??0)+E.value);let W=I.get(R);W>N&&(N=W),(L===null||F<L)&&(L=F),(M===null||F>M)&&(M=F)}if(L===null||M===null){let E=new Date;L=new Date(E.getFullYear(),0,1),M=new Date(E.getFullYear(),11,31)}let S=new Date(L);S.setDate(S.getDate()-S.getDay());let k=new Date(M);return k.setDate(k.getDate()+(6-k.getDay())),{dateMap:I,startDate:S,endDate:k,maxVal:N>0?N:1}},[t]),y=d?30:0,b=l?16:0,m=g?28:0,x=y+10,v=m+b+4,D=w(()=>{let I=[],N=new Date(c),L=0;for(;N<=f;){let M=N.getDay();M===0&&N>c&&L++;let S=Hi(N),k=h.get(S),E=k!==void 0&&k>0?od(k/p,i):u,F=x+L*(s+a),R=v+M*(s+a);I.push(o("rect",{key:`day-${S}`,x:String(F),y:String(R),width:String(s),height:String(s),rx:"2",ry:"2",fill:E,"aria-label":`${S}: ${k??0}`})),N.setDate(N.getDate()+1)}return I},[c,f,h,p,i,u,s,a,x,v]),T=w(()=>{if(!l)return[];let I=[],N=new Date(c),L=0,M=-1;for(;N<=f;){let S=N.getDay();S===0&&N>c&&L++;let k=N.getMonth();if(k!==M&&S===0){M=k;let E=x+L*(s+a);I.push(o("text",{key:`month-${L}`,x:String(E),y:String(m+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Qc[k]))}N.setDate(N.getDate()+1)}return I},[l,c,f,s,a,x,m,b]),C=w(()=>{if(!d)return[];let I=[],N=[1,3,5];for(let L of N){let M=v+L*(s+a)+s/2;I.push(o("text",{key:`day-label-${L}`,x:String(y),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},ed[L]))}return I},[d,s,a,v,y]),$=w(()=>g?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let A=$(),z=T(),P=C(),B=D();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Calendar heat map",style:{fontFamily:"sans-serif"}},...A,...z,...P,...B)}var id=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Fe(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function sd(e,t,n,r,i,s){let a=Fe(e,t,n,i),l=Fe(e,t,n,s),d=Fe(e,t,r,i),u=Fe(e,t,r,s),h=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${h} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${h} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function ad(e,t,n,r,i,s,a){let l=Fe(e,t,n,r),d=Fe(e,t,n,i),u=Fe(e,t,n,s),g=Fe(e,t,n,a),h=i-r,c=a-s,f=h>Math.PI?1:0,p=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${f} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${p} 1 ${g.x} ${g.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function ld(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let f=0;for(let p=0;p<i;p++){let y=e[c]?.[p]??0;f+=Math.max(0,y)}s.push(f),a+=f}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),f=[],p=0;for(let y=0;y<i;y++)f.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:p,endAngle:p+c,value:0}),p+=c+r;return{groups:f,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let f=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+f,value:s[c]}),u+=f+r}let g=[];for(let c=0;c<i;c++)g.push(d[c].startAngle);let h=[];for(let c=0;c<i;c++)for(let f=c;f<i;f++){let p=Math.max(0,e[c]?.[f]??0),y=c===f?0:Math.max(0,e[f]?.[c]??0);if(p===0&&y===0)continue;let b=p+y,m=s[c]>0?p/a*l:0,x=g[c],v=x+m;g[c]=v;let D=s[f]>0?p/a*l:0,T=g[f],C=T+D;if(g[f]=C,c===f){p>0&&h.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:T,targetEndAngle:C,value:p,color:d[c].color});continue}let $=s[f]>0?y/a*l:0,z=g[f]+$;g[f]=z;let P=s[c]>0?y/a*l:0,I=g[c]+P;g[c]=I,(p>0||y>0)&&h.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:T,targetEndAngle:Math.max(C,T+.001),value:b,color:d[c].color})}return{groups:d,chords:h}}function Ui(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=id,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:g=.9,title:h}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,f=i/2,p=Math.min(r,i)/2-40,y=p*Math.max(.5,Math.min(.99,g)),b=p+16,m=q(()=>ld(t,n,s,a),[t,n,s,a]),x=w(()=>{let A=[];for(let z=0;z<m.groups.length;z++){let P=m.groups[z];if(P.endAngle-P.startAngle<.001)continue;let I=sd(c,f,p,y,P.startAngle,P.endAngle);if(A.push(o("path",{key:`arc-${z}`,d:I,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let N=(P.startAngle+P.endAngle)/2,L=Fe(c,f,b,N),k=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,E=k?"start":"end",F=N*180/Math.PI-90;k||(F+=180);let R=d?`${P.label} (${P.value})`:P.label;A.push(o("text",{key:`label-${z}`,x:String(L.x),y:String(L.y),"text-anchor":E,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${L.x}, ${L.y})`,"dominant-baseline":"central","pointer-events":"none"},R))}}return A},[m,c,f,p,y,b,l,d]),v=w(()=>{let A=[];for(let z=0;z<m.chords.length;z++){let P=m.chords[z],B=ad(c,f,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);A.push(o("path",{key:`ribbon-${z}`,d:B,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return A},[m,c,f,y,u]),D=w(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r]),T=v(),C=x(),$=D();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Chord diagram",style:{fontFamily:"sans-serif"}},...$,...T,...C)}var cd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function dd(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],g=[];for(let h=0;h<u.length;h++)g.push(n+r.length+h);t.push({id:d,node:s,depth:a,parentId:l,childIndices:g});for(let h=0;h<u.length;h++)r.push([u[h],a+1,d])}return{flatNodes:t,maxDepth:i}}function ud(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function pd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=dd(e);if(d.length===0)return[];let g=ud(d),h=t-s*2,c=n-s*2,f=a==="horizontal",p=u+1,y=f?p>1?(h-r)/u:0:p>1?(c-i)/u:0,b=new Array(d.length),m=g[0],x=f?c:h,v=m>0?x/m:x,D=new Array(d.length);D[0]=[0,m];let T=[0],C=0;for(;C<T.length;){let $=T[C];C++;let A=d[$],[z,P]=D[$],B=(z+P)/2,I=s+A.depth*y,N=s+(B-.5)*v,L=f?I:N,M=f?N:I,S=A.node.color??l[A.depth%l.length];b[$]={id:A.id,label:A.node.label,value:A.node.value!==void 0?String(A.node.value):"",color:S,depth:A.depth,x:L,y:M,parentId:A.parentId,childCount:A.childIndices.length,subtreeLeafCount:g[$]};let k=z;for(let E of A.childIndices)if(E<d.length){let F=g[E],R=k+F;D[E]=[k,R],k=R,T.push(E)}}return b}function ji(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:g=cd,title:h,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let f=i==="horizontal",p=q(()=>pd(t,n,r,s,a,c,i,g),[t,n,r,s,a,c,i,g]),y=q(()=>{let C=new Map;for(let $=0;$<p.length;$++){let A=p[$];C.set(A.id,A)}return C},[p]),b=w(()=>{if(!d)return[];let C=[];for(let $=0;$<p.length;$++){let A=p[$];if(A.parentId===null)continue;let z=y.get(A.parentId);if(!z)continue;let P,B,I,N;f?(P=z.x+s,B=z.y+a/2,I=A.x,N=A.y+a/2):(P=z.x+s/2,B=z.y+a,I=A.x+s/2,N=A.y);let L=(P+I)/2,M=(B+N)/2,S;f?S=`M ${P} ${B} C ${L} ${B}, ${L} ${N}, ${I} ${N}`:S=`M ${P} ${B} C ${P} ${M}, ${I} ${M}, ${I} ${N}`,C.push(o("path",{key:`conn-${$}`,d:S,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[p,y,f,s,a,d,u]),m=w(()=>{let C=[];for(let $=0;$<p.length;$++){let A=p[$];C.push(o("rect",{key:`node-rect-${A.id}`,x:String(A.x),y:String(A.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:A.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":A.value?`${A.label}: ${A.value}`:A.label}));let z=l&&A.value?A.y+a/2-2:A.y+a/2+4;C.push(o("text",{key:`node-label-${A.id}`,x:String(A.x+s/2),y:String(z),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},A.label)),l&&A.value&&C.push(o("text",{key:`node-value-${A.id}`,x:String(A.x+s/2),y:String(A.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},A.value))}return C},[p,s,a,l]),x=w(()=>h?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),v=b(),D=m(),T=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Decomposition tree",style:{fontFamily:"sans-serif"}},...T,...v,...D)}var Gi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function fd(e){return Gi[e%Gi.length]}function Xi(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],g=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??fd(d),x:u.x??r+s*Math.cos(g),y:u.y??i+s*Math.sin(g),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function qi(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let g=Math.sqrt(u),h=l/g,c=d/g,f=n-g;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=h*f,a.y+=c*f):a.fixed?(i.x-=h*f,i.y-=c*f):(i.x-=h*f*.5,i.y-=c*f*.5,a.x+=h*f*.5,a.y+=c*f*.5);let p=i.vx-a.vx,y=i.vy-a.vy,b=p*h+y*c;b<=0||(i.fixed?(a.vx+=b*h,a.vy+=b*c):a.fixed?(i.vx-=b*h,i.vy-=b*c):(i.vx-=b*h,i.vy-=b*c,a.vx+=b*h,a.vy+=b*c))}}}function md(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let g=new Map;for(let x=0;x<u;x++)g.set(e[x].id,x);let h=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let D=x+1;D<u;D++){let T=e[D],C=v.x-T.x,$=v.y-T.y,A=C*C+$*$;A<1&&(A=1);let z=Math.sqrt(A),P=i/A,B=C/z*P,I=$/z*P;h[x]+=B,c[x]+=I,h[D]-=B,c[D]-=I}}for(let x=0;x<t.length;x++){let v=t[x],D=g.get(v.source),T=g.get(v.target);if(D===void 0||T===void 0)continue;let C=e[D],$=e[T],A=$.x-C.x,z=$.y-C.y,P=Math.sqrt(A*A+z*z);if(P<.1)continue;let B=v.weight??1,I=P-l,N=s*I*B,L=A/P*N,M=z/P*N;h[D]+=L,c[D]+=M,h[T]-=L,c[T]-=M}let f=n/2,p=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];h[x]+=(f-v.x)*y,c[x]+=(p-v.y)*y}let b=20,m=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){m.push({...v,vx:0,vy:0});continue}let D=(v.vx+h[x])*a,T=(v.vy+c[x])*a,C=Math.sqrt(D*D+T*T),$=10;C>$&&(D=D/C*$,T=T/C*$);let A=v.x+D,z=v.y+T;A=Math.max(b,Math.min(n-b,A)),z=Math.max(b,Math.min(r-b,z)),m.push({...v,x:A,y:z,vx:D,vy:T})}return qi(m,d),m}function gd(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function Ki(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:g=300,attractionForce:h=.01,damping:c=.9,edgeLength:f=100,edgeColor:p="#94a3b8",edgeWidth:y=1.5,title:b,customForce:m,trails:x}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty force-directed graph"},b?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let v=ne(Xi(t,r,i)),[D,T]=G(0),C=ne(!0),$=ne(!1),A=ne(n);A.current=n;let z=ne(m);z.current=m;let P=ne(null),B=ne({repulsionForce:g,attractionForce:h,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:g,attractionForce:h,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l};let I=ne(new Map);se(()=>{v.current=Xi(t,r,i),$.current=!1,C.current=!0,I.current=new Map,T(ae=>ae+1)},[t.length]),se(()=>{let ae=0,ee=()=>{if(!C.current)return;let te=B.current,le=z.current,ce;if(le?(ce=le(v.current,A.current,te.width,te.height,P.current),te.solidNodes&&qi(ce,te.nodeRadius)):ce=md(v.current,A.current,te.width,te.height,te.repulsionForce,te.attractionForce,te.damping,te.edgeLength,te.nodeRadius),v.current=ce,x)for(let oe=0;oe<x.length;oe++){let ue=x[oe],re=ce.find(pe=>pe.id===ue.nodeId);if(!re)continue;let ie=I.current.get(ue.nodeId);ie||(ie=[],I.current.set(ue.nodeId,ie)),ie.push({x:re.x,y:re.y});let de=ue.maxPoints??200;ie.length>de&&ie.splice(0,ie.length-de)}if(!le&&gd(ce)<.01){$.current=!0,T(oe=>oe+1);return}T(oe=>oe+1),ae=requestAnimationFrame(ee)};return ae=requestAnimationFrame(ee),()=>{C.current=!1,cancelAnimationFrame(ae)}},[]);let N=v.current,L=w(ae=>{v.current=v.current.map(ee=>ee.id===ae?{...ee,fixed:!ee.fixed,vx:0,vy:0}:ee),$.current&&($.current=!1,C.current=!0,T(ee=>ee+1))},[]),M=ne(null),S=ne(null),k=w(ae=>{let ee=ae,te=S.current;if(!te)return{x:ee.clientX,y:ee.clientY};let le=te.getBoundingClientRect(),ce=r/le.width,oe=i/le.height;return{x:(ee.clientX-le.left)*ce,y:(ee.clientY-le.top)*oe}},[r,i]),E=ne(!1),F=w((ae,ee)=>{ee.stopPropagation(),M.current=ae;let te=v.current.find(le=>le.id===ae);E.current=te?.fixed??!1,v.current=v.current.map(le=>le.id===ae?{...le,fixed:!0,vx:0,vy:0}:le)},[]),R=w(ae=>{let ee=k(ae);if(P.current={x:ee.x,y:ee.y},!M.current)return;let te=M.current,le=20;v.current=v.current.map(ce=>ce.id===te?{...ce,x:Math.max(le,Math.min(r-le,ee.x)),y:Math.max(le,Math.min(i-le,ee.y))}:ce),$.current&&($.current=!1,C.current=!0),T(ce=>ce+1)},[r,i,k]),W=w(()=>{let ae=M.current;ae&&(v.current=v.current.map(ee=>ee.id===ae?{...ee,fixed:E.current}:ee)),M.current=null},[]),_=w(()=>{M.current=null,P.current=null},[]),O=q(()=>{let ae=new Map;for(let ee=0;ee<N.length;ee++)ae.set(N[ee].id,N[ee]);return ae},[D]),H=w(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:p})))]:[],[u,s,p]),X=w(()=>{let ae=[];for(let ee=0;ee<n.length;ee++){let te=n[ee],le=O.get(te.source),ce=O.get(te.target);if(!le||!ce||te.weight!==void 0&&te.weight<=0)continue;let oe=te.weight?Math.max(.5,Math.min(6,y*te.weight)):y,ue={key:`edge-${ee}`,x1:String(le.x),y1:String(le.y),x2:String(ce.x),y2:String(ce.y),stroke:te.color??p,"stroke-width":String(oe),"stroke-opacity":"0.6"};u&&(ue["marker-end"]="url(#arrowhead)"),ae.push(o("line",ue))}return ae},[D,p,y,u]),J=w(()=>{let ae=[];for(let ee=0;ee<N.length;ee++){let te=N[ee];ae.push(o("circle",{key:`node-${te.id}`,cx:String(te.x),cy:String(te.y),r:String(s),fill:te.color,stroke:te.fixed?"#0f172a":"#fff","stroke-width":te.fixed?"3":String(a),style:{cursor:M.current===te.id?"grabbing":"grab"},onMouseDown:le=>F(te.id,le),onDblClick:()=>L(te.id),role:"button",tabIndex:0,"aria-label":`Node: ${te.label}${te.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&ae.push(o("text",{key:`label-${te.id}`,x:String(te.x),y:String(te.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},te.label))}return ae},[D,s,d,L]),K=w(()=>b?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,r]),U=w(()=>{if(!x||x.length===0)return[];let ae=[];for(let ee=0;ee<x.length;ee++){let te=x[ee],le=I.current.get(te.nodeId);if(!le||le.length<2)continue;let ce=[];for(let oe=0;oe<le.length;oe++){let ue=le[oe];ce.push(`${oe===0?"M":"L"}${ue.x.toFixed(1)},${ue.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${te.nodeId}`,d:ce.join(" "),fill:"none",stroke:te.color??"#3b82f6","stroke-width":String(te.width??1),opacity:String(te.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ae},[D,x]),j=H(),V=U(),Y=X(),Z=J(),Q=K();return o("svg",{ref:S,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:M.current?"grabbing":"default"},onMouseMove:R,onMouseUp:W,onMouseLeave:_},...j,...Q,...V,...Y,...Z)}var Zi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Ji(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=Zi,title:g}=e,h=i==="vertical",c=g?30:0,f=120,p=q(()=>{let A=0;for(let z=0;z<t.length;z++)t[z].value>A&&(A=t[z].value);return A>0?A:1},[t]),y=w(A=>p===0?0:Math.max(.05,A/p),[p]),b=w((A,z)=>z||(u[A%u.length]??Zi[0]),[u]),m=w(()=>{if(t.length===0)return[];let A=[],z=40,P=n-z*2-f,B=r-c-z*2,I=d*(t.length-1),N=Math.max(1,(B-I)/t.length),L=z+P/2;for(let M=0;M<t.length;M++){let S=t[M],k=M<t.length-1?t[M+1]:null,E=b(M,S.color),F=y(S.value),R=k!==null?y(k.value):F*.6,W=P/2*F,_=P/2*R,O=c+z+M*(N+d),H=L-W,X=L+W,J=L+_,K=L-_,U=`${H},${O} ${X},${O} ${J},${O+N} ${K},${O+N}`;A.push(o("polygon",{key:`section-${M}`,points:U,fill:E,stroke:"#fff","stroke-width":"1"}));let j=z+P+12,V=O+N/2;if(s&&A.push(o("text",{key:`label-${M}`,x:String(j),y:String(V-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},S.label)),a||l){let Y="";if(a&&(Y=String(S.value)),l&&t.length>0){let Z=t[0].value,Q=Z>0?Math.round(S.value/Z*100):0;Y+=a?` (${Q}%)`:`${Q}%`}A.push(o("text",{key:`value-${M}`,x:String(j),y:String(V+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return A},[t,n,r,c,d,s,a,l,b,y,f]),x=w(()=>{if(t.length===0)return[];let A=[],z=40,P=n-z*2,I=r-c-z*2-40,N=d*(t.length-1),L=Math.max(1,(P-N)/t.length),M=c+z+I/2;for(let S=0;S<t.length;S++){let k=t[S],E=S<t.length-1?t[S+1]:null,F=b(S,k.color),R=y(k.value),W=E!==null?y(E.value):R*.6,_=I/2*R,O=I/2*W,H=z+S*(L+d),X=M-_,J=M-O,K=M+O,U=M+_,j=`${H},${X} ${H+L},${J} ${H+L},${K} ${H},${U}`;A.push(o("polygon",{key:`section-${S}`,points:j,fill:F,stroke:"#fff","stroke-width":"1"}));let V=H+L/2,Y=c+z+I+14;if(s&&A.push(o("text",{key:`label-${S}`,x:String(V),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},k.label)),a||l){let Z="";if(a&&(Z=String(k.value)),l&&t.length>0){let Q=t[0].value,ae=Q>0?Math.round(k.value/Q*100):0;Z+=a?` (${ae}%)`:`${ae}%`}A.push(o("text",{key:`value-${S}`,x:String(V),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return A},[t,n,r,c,d,s,a,l,b,y]),v=w(()=>g?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n]),D=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),T=v(),C=h?m():x(),$=D();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Funnel chart",style:{fontFamily:"sans-serif"}},...T,...C,...$)}var Qi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function es(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function hd(e,t){return t||Qi[e%Qi.length]}function ts(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:g,padding:h=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,f=q(()=>{let B=1/0,I=-1/0;for(let N of t){N.start<B&&(B=N.start);let L=N.start+N.duration;L>I&&(I=L)}return B===1/0&&(B=0,I=1),{min:B,max:I,range:I-B}},[t]),p=q(()=>{let B=t.slice();return B.sort((I,N)=>I.group!==N.group?(I.group??"").localeCompare(N.group??""):I.start-N.start),B},[t]),y=r??h*2+p.length*(i+s)+s+20,b=n-h-c-h,m=h+(g?20:0),x=w(B=>f.range===0?c+h:c+h+(B-f.min)/f.range*b,[f,b,c,h]),v=w(()=>{if(!a)return[];let B=[],I=es(f.range),N=Math.ceil(f.min/I)*I,L=m+p.length*(i+s)+s;for(let M=N;M<=f.max;M+=I){let S=x(M);B.push(o("line",{key:`grid-${M}`,x1:String(S),y1:String(m),x2:String(S),y2:String(L),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,f,m,p.length,i,s,x]),D=w(()=>{let B=[],I=es(f.range),N=Math.ceil(f.min/I)*I,L=m-8;for(let M=N;M<=f.max;M+=I){let S=x(M);B.push(o("text",{key:`taxis-${M}`,x:String(S),y:String(L),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(M)))}return B.push(o("text",{key:"time-unit",x:String(n-h),y:String(L),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),B},[f,m,x,u,n,h]),T=w(()=>{let B=[],I="";for(let N=0;N<p.length;N++){let L=p[N],M=m+N*(i+s)+s,S=x(L.start),k=Math.max(2,x(L.start+L.duration)-S),E=hd(N,L.color);L.group&&L.group!==I&&(I=L.group,l&&B.push(o("text",{key:`group-${N}`,x:String(h),y:String(M+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},L.group))),B.push(o("rect",{key:`bar-${L.id}`,x:String(S),y:String(M),width:String(k),height:String(i),rx:"4",ry:"4",fill:E,role:"graphics-symbol","aria-label":`${L.label}: start ${L.start}, duration ${L.duration}`})),l&&B.push(o("text",{key:`label-${L.id}`,x:String(c+h-8),y:String(M+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},L.label.length>16?L.label.substring(0,14)+"..":L.label)),d&&k>30&&B.push(o("text",{key:`prog-${L.id}`,x:String(S+k/2),y:String(M+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${L.start}-${L.start+L.duration}`))}return B},[p,m,i,s,x,l,d,c,h]),C=w(()=>g?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,n,h]),$=v(),A=D(),z=T(),P=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...$,...A,...z)}var bd=Math.PI/180;function xd(e){return e*bd}function Le(e,t,n,r){let i=xd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ns(e,t,n,r,i){let s=Le(e,t,n,i),a=Le(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function yd(e,t,n){return e<t?t:e>n?n:e}function Ke(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function os(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:g=!0,showTicks:h=!0,tickCount:c=10,label:f,unit:p,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:b="#374151",backgroundColor:m="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,D=isFinite(t)&&!isNaN(t)?yd(t,x,v):x,T=(u?24:0)+(f?18:0),C=i/2,$=(s-T)*.6,A=Math.min(i/2,(s-T)*.55)-d/2-10,z=A-d,P=A-d/2,B=l-a,I=w(U=>{let j=v-x;if(j===0)return a;let V=(U-x)/j;return a+V*B},[x,v,a,B]),N=w(()=>{let U=ns(C,$,P,a,l);return[o("path",{key:"bg-arc",d:U,fill:"none",stroke:m,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,$,P,a,l,m,d]),L=w(()=>{if(y.length===0)return[];let U=[],j=B/y.length;for(let V=0;V<y.length;V++){let Y=a+V*j,Z=Y+j,Q=ns(C,$,P,Y,Z);U.push(o("path",{key:`seg-${V}`,d:Q,fill:"none",stroke:y[V],"stroke-width":String(d),"stroke-linecap":V===0||V===y.length-1?"round":"butt",opacity:"0.85"}))}return U},[y,B,a,C,$,P,d]),M=w(()=>{if(!h||c<=0)return[];let U=[],j=Math.max(1,Math.min(c,100));for(let V=0;V<=j;V++){let Y=V/j,Z=a+Y*B,Q=V%2===0,ae=Q?10:6,ee=Le(C,$,A+4,Z),te=Le(C,$,A+4+ae,Z);if(U.push(o("line",{key:`tick-${V}`,x1:String(ee.x),y1:String(ee.y),x2:String(te.x),y2:String(te.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let le=x+Y*(v-x),ce=Le(C,$,A+4+ae+12,Z);U.push(o("text",{key:`tick-label-${V}`,x:String(ce.x),y:String(ce.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Ke(le)))}}return U},[h,c,a,B,C,$,A,x,v]),S=w(()=>{let U=[],j=I(D),V=z-8,Y=Le(C,$,V,j),Z=6,Q=j+90,ae=j-90,ee=Le(C,$,Z,Q),te=Le(C,$,Z,ae);return U.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${ee.x},${ee.y} ${te.x},${te.y}`,fill:b,stroke:"none"})),U.push(o("circle",{key:"needle-cap",cx:String(C),cy:String($),r:"8",fill:b,stroke:"#fff","stroke-width":"2"})),U},[D,I,C,$,z,b]),k=w(()=>{if(!u)return[];let U=[],j=Ke(D),V=j+(p?" "+p:""),Y=$+P+20;return U.push(o("text",{key:"value-text",x:String(C),y:String(Y),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${V}`},j,p?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+p):null)),U},[u,D,p,C,$,P]),E=w(()=>{if(!f)return[];let U=$+P+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(U),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},f)]},[f,C,$,P,u]),F=w(()=>{if(!g)return[];let U=[],j=Le(C,$,P,a),V=Le(C,$,P,l);return U.push(o("text",{key:"min-label",x:String(j.x-4),y:String(j.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Ke(x))),U.push(o("text",{key:"max-label",x:String(V.x+4),y:String(V.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Ke(v))),U},[g,C,$,P,a,l,x,v]),R=N(),W=L(),_=M(),O=S(),H=k(),X=E(),J=F(),K=`Gauge: ${Ke(D)}${p?" "+p:""}, range ${Ke(x)} to ${Ke(v)}${f?", "+f:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(D),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":K,style:{fontFamily:"sans-serif"}},...R,...W,..._,...O,...H,...X,...J)}var vt={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.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.1,-2.9 .6,-1.3 -.2,-2.3 2.4,-.5 4.5,4.4 1.3,3.4 1.9,1.6 .3,5.1 -1.4,0 -1.3,-2.3 -3.1,-2.4 h -.6 l 1.1,2.8 1.7,.2 .2,2.1 -.9,.1 -4.1,-4.4 -.1,-.9 1.9,-1 0,-1 -.5,-.8 -1.6,-.6 -1.7,-1.3 1.4,.1 .5,-.4 -.6,-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31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function rs(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:g="Map of the United States"}=e,h=q(()=>Object.keys(vt),[]),c=w(m=>{l&&l(m)},[l]),f=w((m,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(m)},[d,u]),p=w((m,x)=>{let v=x.currentTarget;if(v){let D=r[m]??i;v.setAttribute("fill",D)}d&&d(null)},[d,r,i]),y=q(()=>{let m=[];for(let x=0;x<h.length;x++){let v=h[x],D=vt[v],T=r[v]??i,C={key:`state-${v}`,d:D.path,fill:T,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":D.name,style:{cursor:l?"pointer":"default"}};if(l){let A=v;C.onClick=()=>c(A),C.onKeyDown=z=>{(z.key==="Enter"||z.key===" ")&&c(A)},C.tabindex=0,C.role="button",C["aria-label"]=D.name}let $=v;C.onMouseOver=A=>f($,A),C.onMouseOut=A=>p($,A),m.push(o("path",C))}return m},[h,r,i,s,a,l,c,f,p]),b=o("title",{key:"map-title"},g);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g,style:{fontFamily:"sans-serif"}},b,...y)}function Yn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Sd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function vd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Yn(t[i]),l=Yn(t[i+1]);return Sd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function wd(e){let{r:t,g:n,b:r}=Yn(e);return(.299*t+.587*n+.114*r)/255}var kd=["#3b82f6","#fbbf24","#ef4444"];function is(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=kd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:g="#fff",cellBorderWidth:h=1,title:c,padding:f=60}=e,p=t.length,y=q(()=>{let M=0;for(let S of t)S.length>M&&(M=S.length);return M},[t]),{minVal:b,maxVal:m}=q(()=>{let M=l??1/0,S=d??-1/0;for(let k of t)for(let E of k)l===void 0&&E<M&&(M=E),d===void 0&&E>S&&(S=E);return M===1/0&&(M=0),S===-1/0&&(S=1),M===S&&(S=M+1),{minVal:M,maxVal:S}},[t,l,d]),x=c?30:0,v=n?f:20,D=r?f:20,T=i-v-20,C=s-x-D-20,$=y>0?T/y:0,A=p>0?C/p:0,z=w(()=>{let M=[];for(let S=0;S<p;S++){let k=t[S];for(let E=0;E<y;E++){let F=E<k.length?k[E]:0,R=(F-b)/(m-b),W=vd(R,a),_=v+E*$,O=x+20+S*A;if(M.push(o("rect",{key:`cell-${S}-${E}`,x:String(_),y:String(O),width:String($),height:String(A),fill:W,stroke:g,"stroke-width":String(h)})),u){let H=wd(W)>.5?"#111827":"#ffffff";M.push(o("text",{key:`val-${S}-${E}`,x:String(_+$/2),y:String(O+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,$*.3,A*.4)),"font-family":"sans-serif",fill:H},String(Math.round(F*100)/100)))}}}return M},[t,p,y,b,m,a,$,A,v,x,u,g,h]),P=w(()=>{let M=[];if(n)for(let S=0;S<p;S++){let k=S<n.length?n[S]:"",E=x+20+S*A+A/2;M.push(o("text",{key:`row-label-${S}`,x:String(v-8),y:String(E),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},k))}if(r)for(let S=0;S<y;S++){let k=S<r.length?r[S]:"",E=v+S*$+$/2,F=x+20+p*A+16;M.push(o("text",{key:`col-label-${S}`,x:String(E),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},k))}return M},[n,r,p,y,$,A,v,x]),B=w(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(p===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let I=B(),N=z(),L=P();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...I,...N,...L)}function Cd(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function Md(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Vn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ss(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:g,yLabel:h,padding:c=60}=e,f=Math.max(1,Math.round(n)),p=q(()=>Cd(t,f),[t,f]),y=q(()=>{let I=0;for(let N=0;N<p.length;N++)p[N].count>I&&(I=p[N].count);return I>0?I:1},[p]),b=r-c*2,m=i-c*2,x=w(()=>{if(!l)return[];let I=Md(y),N=[];for(let L=I;L<=y;L+=I){let M=c+m-L/y*m;N.push(o("line",{key:`grid-${L}`,x1:String(c),y1:String(M),x2:String(c+b),y2:String(M),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${L}`,x:String(c-8),y:String(M+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(L)))}return N},[l,y,c,b,m]),v=w(()=>{let I=[];return I.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),I.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+m),x2:String(c+b),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),I},[c,b,m]),D=w(()=>{if(p.length===0)return[];let I=[],N=a*(p.length-1),L=Math.max(1,(b-N)/p.length);for(let M=0;M<p.length;M++){let S=p[M],k=S.count/y*m,E=c+M*(L+a),F=c+m-k;if(I.push(o("rect",{key:`bar-${M}`,x:String(E),y:String(F),width:String(L),height:String(k),fill:s})),d&&S.count>0&&I.push(o("text",{key:`val-${M}`,x:String(E+L/2),y:String(F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(S.count))),p.length<=15||M%2===0||M===p.length-1){let W=(p.length===1,Vn(S.min));I.push(o("text",{key:`xlabel-${M}`,x:String(E+L/2),y:String(c+m+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(p.length>0){let M=p[p.length-1],S=c+b;I.push(o("text",{key:"xlabel-end",x:String(S),y:String(c+m+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Vn(M.max)))}return I},[p,y,a,s,d,c,b,m]),T=w(()=>{let I=[];return u&&I.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),g&&I.push(o("text",{key:"x-label",x:String(c+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},g)),h&&I.push(o("text",{key:"y-label",x:String(14),y:String(c+m/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+m/2})`},h)),I},[u,g,h,r,i,c,b,m]),C=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),$=x(),A=v(),z=D(),P=T(),B=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...P,...$,...A,...z,...B)}function Ed(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function as(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:g=!0,title:h,padding:c=60}=e,f=i==="vertical",p=f?30:0,y=n-c*2,b=r-c*2-p,m=f?b:y,x=f?y:b,v=q(()=>{let M=0;for(let S=0;S<t.length;S++)t[S].value>M&&(M=t[S].value);return M>0?M:1},[t]),D=q(()=>t.length===0?0:x/t.length,[t.length,x]),T=w(()=>{if(!u)return[];let M=Ed(v),S=[];for(let k=M;k<=v;k+=M){let E=k/v*m;if(f){let F=c+b-E;S.push(o("line",{key:`grid-${k}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`grid-label-${k}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(k)))}else{let F=c+E;S.push(o("line",{key:`grid-${k}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+b),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`grid-label-${k}`,x:String(F),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(k)))}}return S},[u,v,f,c,y,b,m]),C=w(()=>{let M=[];return f?M.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})):M.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),M.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+y),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),M},[f,c,y,b]),$=w(()=>{if(t.length===0)return[];let M=[];for(let S=0;S<t.length;S++){let k=t[S],E=k.value/v*m,F=D*S+D/2,R=k.color??d;if(f){let W=c+F,_=c+b,O=c+b-E;M.push(o("line",{key:`stem-${S}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),M.push(o("circle",{key:`dot-${S}`,cx:String(W),cy:String(O),r:String(l),fill:R})),g&&M.push(o("text",{key:`val-${S}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(k.value)));let H=W,X=c+b+16;M.push(o("text",{key:`cat-${S}`,x:String(H),y:String(X),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${X})`},k.label))}else{let W=c+F,_=c,O=c+E;M.push(o("line",{key:`stem-${S}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),M.push(o("circle",{key:`dot-${S}`,cx:String(O),cy:String(W),r:String(l),fill:R})),g&&M.push(o("text",{key:`val-${S}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(k.value))),M.push(o("text",{key:`cat-${S}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},k.label))}}return M},[t,v,D,d,l,s,a,g,f,c,y,b,m]),A=w(()=>h?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,c]),z=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),P=T(),B=C(),I=$(),N=A(),L=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...P,...B,...I,...L)}function Un(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Rd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Pd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Un(t[i]),l=Un(t[i+1]);return Rd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Id(e){let{r:t,g:n,b:r}=Un(e);return(.299*t+.587*n+.114*r)/255}var $d=["#f0f9ff","#3b82f6","#1e3a8a"];function ls(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=$d,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:g="#e5e7eb",title:h,padding:c=70,symmetric:f=!1}=e,p=r??n,y=i??n,b=t.length,m=q(()=>{let R=0;for(let W of t)W.length>R&&(R=W.length);return R},[t]),x=q(()=>{if(!f||b===0)return t;let R=[],W=Math.max(b,m);for(let _=0;_<W;_++){let O=[];for(let H=0;H<W;H++){let X=t[_],J=X&&H<X.length?X[H]:0,K=t[H],U=K&&_<K.length?K[_]:0;J!==0?O.push(J):O.push(U)}R.push(O)}return R},[t,f,b,m]),v=x.length,D=q(()=>{let R=0;for(let W of x)W.length>R&&(R=W.length);return R},[x]),{minVal:T,maxVal:C}=q(()=>{let R=1/0,W=-1/0;for(let _ of x)for(let O of _)O<R&&(R=O),O>W&&(W=O);return R===1/0&&(R=0),W===-1/0&&(W=1),R===W&&(W=R+1),{minVal:R,maxVal:W}},[x]),$=h?30:0,A=p?c:20,z=y?c:20,P=s-A-20,B=a-$-z-20,I=D>0?P/D:0,N=v>0?B/v:0,L=w(()=>{let R=[];for(let W=0;W<v;W++){let _=x[W];for(let O=0;O<D;O++){let H=O<_.length?_[O]:0,X=(H-T)/(C-T),J=Pd(X,l),K=A+O*I,U=$+20+W*N,j=W===O,V=j&&u?"currentColor":g,Y=j&&u?"2":"1";if(R.push(o("rect",{key:`cell-${W}-${O}`,x:String(K),y:String(U),width:String(I),height:String(N),fill:J,stroke:V,"stroke-width":Y})),d){let Z=Id(J)>.5?"#111827":"#ffffff",Q=Math.min(12,I*.3,N*.35);R.push(o("text",{key:`val-${W}-${O}`,x:String(K+I/2),y:String(U+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(H*100)/100)))}}}return R},[x,v,D,T,C,l,I,N,A,$,d,u,g]),M=w(()=>{let R=[];if(p)for(let W=0;W<v;W++){let _=W<p.length?p[W]:"",O=$+20+W*N+N/2;R.push(o("text",{key:`row-label-${W}`,x:String(A-8),y:String(O),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}if(y)for(let W=0;W<D;W++){let _=W<y.length?y[W]:"",O=A+W*I+I/2,H=$+20+v*N+12;R.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(H),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return R},[p,y,v,D,I,N,A,$]),S=w(()=>h?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,s]);if(v===0||D===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let k=S(),E=L(),F=M();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix visualization",style:{fontFamily:"sans-serif"}},...k,...E,...F)}var Td=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function jt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function zd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Dd(e,t,n,r,i,s,a){let l=[];if(jt(e)<=0)return l;let g=zd(e)+1,h=s==="horizontal",c=h?i/g:r/g,f=[];for(f.push({node:e,depth:0,spanStart:h?t:n,spanEnd:h?t+r:n+i,colorIndex:0});f.length>0;){let p=f.shift(),{node:y,depth:b,spanStart:m,spanEnd:x,colorIndex:v}=p,D=jt(y);if(D<=0)continue;let T=x-m,C,$,A,z;if(h?(C=m,$=n+b*c,A=T,z=c):(C=t+b*c,$=m,A=c,z=T),l.push({x:C,y:$,w:A,h:z,label:y.label,value:D,color:y.color??a[v%a.length],depth:b}),y.children&&y.children.length>0){let P=m;for(let B=0;B<y.children.length;B++){let I=y.children[B],N=jt(I);if(N<=0)continue;let L=N/D*T;f.push({node:I,depth:b+1,spanStart:P,spanEnd:P+L,colorIndex:b===0?B:v}),P+=L}}}return l}function cs(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Td,borderColor:d="#ffffff",borderWidth:u=1,title:g,padding:h=10}=e,c=g?30:0,f=h,p=h+c,y=n-h*2,b=r-h*2-c;if(q(()=>jt(t),[t])<=0||y<=0||b<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=q(()=>Dd(t,f,p,y,b,i,l),[t,f,p,y,b,i,l]),v=[];g&&v.push(o("text",{key:"title",x:String(n/2),y:String(h+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g));for(let D=0;D<x.length;D++){let T=x[D];if(v.push(o("rect",{key:`cell-${D}`,x:String(T.x),y:String(T.y),width:String(Math.max(0,T.w)),height:String(Math.max(0,T.h)),fill:T.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${T.label}: ${T.value}`})),s&&T.w>20&&T.h>14){let C=Math.floor(T.w/7),$=T.label.length>C?T.label.substring(0,Math.max(1,C-2))+"..":T.label;v.push(o("text",{key:`label-${D}`,x:String(T.x+T.w/2),y:String(T.y+T.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},$))}a&&T.w>30&&T.h>28&&v.push(o("text",{key:`value-${D}`,x:String(T.x+T.w/2),y:String(T.y+T.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(T.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function jn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function ds(e,t){let n=new Set;for(let i of e)n.add(jn(i,t));let r=Array.from(n);return r.sort(),r}function Gt(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function Xt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Ad(e,t,n,r,i){let s=ds(e,t),a=ds(e,n),l=new Map;for(let f of e){let p=jn(f,t),y=jn(f,n),b=`${p}::${y}`;l.has(b)||l.set(b,[]);let m=l.get(b),x=0;for(let v of r){let D=f[v];if(typeof D=="number")x+=D;else if(typeof D=="string"){let T=parseFloat(D);isNaN(T)||(x+=T)}}m.push(x)}let d=new Map;for(let[f,p]of l)d.set(f,Gt(p,i));let u=new Map;for(let f of s){let p=[];for(let y of a){let b=d.get(`${f}::${y}`);b!==void 0&&p.push(b)}u.set(f,Gt(p,i==="count"?"sum":i))}let g=new Map;for(let f of a){let p=[];for(let y of s){let b=d.get(`${y}::${f}`);b!==void 0&&p.push(b)}g.set(f,Gt(p,i==="count"?"sum":i))}let h=[];for(let f of u.values())h.push(f);let c=Gt(h,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:g,grandTotal:c}}function us(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:g="#3b82f6",cellPadding:h=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>Ad(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:f,colKeys:p,cells:y,rowTotals:b,colTotals:m,grandTotal:x}=c,v=u?30:0,D=p.length+(d?1:0),T=f.length+(d?1:0),C=1+D,$=1+T,A=Math.max(40,(a-h*2)/C),z=Math.max(20,Math.min(36,(l-v-h*2)/$)),P=A*C,B=z*$,I=Math.max(0,(a-P)/2),N=v+Math.max(0,(l-v-B)/2),L=[];u&&L.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),L.push(o("rect",{key:"header-row-bg",x:String(I),y:String(N),width:String(P),height:String(z),fill:g})),L.push(o("rect",{key:"header-col-bg",x:String(I),y:String(N+z),width:String(A),height:String(z*T),fill:g,opacity:"0.85"})),L.push(o("text",{key:"corner",x:String(I+A/2),y:String(N+z/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let M=0;M<p.length;M++){let S=I+(M+1)*A,k=Math.floor(A/7),E=p[M],F=E.length>k?E.substring(0,Math.max(1,k-2))+"..":E;L.push(o("text",{key:`ch-${M}`,x:String(S+A/2),y:String(N+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&L.push(o("text",{key:"ch-total",x:String(I+(p.length+1)*A+A/2),y:String(N+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let M=0;M<f.length;M++){let S=f[M],k=N+(M+1)*z;M%2===0&&L.push(o("rect",{key:`row-bg-${M}`,x:String(I+A),y:String(k),width:String(A*D),height:String(z),fill:"#f9fafb"}));let E=Math.floor(A/7),F=S.length>E?S.substring(0,Math.max(1,E-2))+"..":S;L.push(o("text",{key:`rh-${M}`,x:String(I+A/2),y:String(k+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let R=0;R<p.length;R++){let W=p[R],_=`${S}::${W}`,O=y.get(_),H=I+(R+1)*A;L.push(o("rect",{key:`border-${M}-${R}`,x:String(H),y:String(k),width:String(A),height:String(z),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),L.push(o("text",{key:`cell-${M}-${R}`,x:String(H+A/2),y:String(k+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?Xt(O):"-"))}if(d){let R=I+(p.length+1)*A,W=b.get(S)??0;L.push(o("rect",{key:`rt-bg-${M}`,x:String(R),y:String(k),width:String(A),height:String(z),fill:"#eff6ff"})),L.push(o("text",{key:`rt-${M}`,x:String(R+A/2),y:String(k+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Xt(W)))}}if(d){let M=N+(f.length+1)*z;L.push(o("rect",{key:"total-row-bg",x:String(I),y:String(M),width:String(P),height:String(z),fill:"#eff6ff"})),L.push(o("text",{key:"total-label",x:String(I+A/2),y:String(M+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let k=0;k<p.length;k++){let E=p[k],F=m.get(E)??0,R=I+(k+1)*A;L.push(o("text",{key:`ct-${k}`,x:String(R+A/2),y:String(M+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Xt(F)))}let S=I+(p.length+1)*A;L.push(o("text",{key:"grand-total",x:String(S+A/2),y:String(M+z/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Xt(x)))}return L.push(o("rect",{key:"outer-border",x:String(I),y:String(N),width:String(P),height:String(B),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...L)}function qt(e,t){return Math.PI*2*e/t-Math.PI/2}function Kt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function ps(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:g="#d1d5db",title:h}=e,c=t.length,f=h?30:0,p=d&&n.length>0?30:0,y=60,b=Math.min((r-y*2)/2,(i-y*2-f-p)/2),m=r/2,x=y+f+b,v=q(()=>{let L=[];for(let M=0;M<c;M++){let S=t[M]?.max;if(S!==void 0&&S>0){L.push(S);continue}let k=0;for(let E of n){let F=E.values[M];F!==void 0&&F>k&&(k=F)}L.push(k>0?k:1)}return L},[t,n,c]),D=w(()=>{if(c<3)return[];let L=[];for(let M=1;M<=s;M++){let S=b*M/s,k=[];for(let E=0;E<c;E++){let F=qt(E,c),R=Kt(m,x,S,F);k.push(`${R.x},${R.y}`)}L.push(o("polygon",{key:`ring-${M}`,points:k.join(" "),fill:"none",stroke:g,"stroke-width":M===s?"1.5":"0.5","stroke-dasharray":M===s?"none":"3 2"}))}for(let M=0;M<c;M++){let S=qt(M,c),k=Kt(m,x,b,S);L.push(o("line",{key:`spoke-${M}`,x1:String(m),y1:String(x),x2:String(k.x),y2:String(k.y),stroke:g,"stroke-width":"0.75"}))}return L},[c,s,b,m,x,g]),T=w(()=>{if(!a||c<3)return[];let L=[],M=16;for(let S=0;S<c;S++){let k=qt(S,c),E=Kt(m,x,b+M,k),F="middle";E.x<m-5?F="end":E.x>m+5&&(F="start");let R=Math.abs(E.y-x)<5?"0.35em":E.y<x?"0em":"0.7em";L.push(o("text",{key:`label-${S}`,x:String(E.x),y:String(E.y),"text-anchor":F,dy:R,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[S]?.label??`Axis ${S}`))}return L},[a,c,t,b,m,x]),C=w(()=>{if(c<3||n.length===0)return[];let L=[];for(let M=0;M<n.length;M++){let S=n[M],k=[],E=[],F=[];for(let R=0;R<c;R++){let W=S.values[R]??0,_=v[R],O=Math.min(W/_,1),H=b*O,X=qt(R,c),J=Kt(m,x,H,X);k.push(`${J.x},${J.y}`),u&&E.push(o("circle",{key:`dot-${M}-${R}`,cx:String(J.x),cy:String(J.y),r:"3.5",fill:S.color,stroke:"#fff","stroke-width":"1.5"})),l&&F.push(o("text",{key:`val-${M}-${R}`,x:String(J.x),y:String(J.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:S.color},String(Math.round(W*100)/100)))}L.push(o("polygon",{key:`series-fill-${M}`,points:k.join(" "),fill:S.color,"fill-opacity":String(S.fillOpacity??.15),stroke:"none"})),L.push(o("polygon",{key:`series-line-${M}`,points:k.join(" "),fill:"none",stroke:S.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let R of E)L.push(R);for(let R of F)L.push(R)}return L},[c,n,v,b,m,x,u,l]),$=w(()=>{if(!d||n.length===0)return[];let L=[],M=x+b+40,S=100,k=n.length*S,E=m-k/2;for(let F=0;F<n.length;F++){let R=n[F],W=E+F*S;L.push(o("rect",{key:`legend-swatch-${F}`,x:String(W),y:String(M),width:"12",height:"12",rx:"2",fill:R.color})),L.push(o("text",{key:`legend-text-${F}`,x:String(W+16),y:String(M+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},R.label))}return L},[d,n,m,x,b]),A=w(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let z=D(),P=T(),B=C(),I=$(),N=A();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart",style:{fontFamily:"sans-serif"}},...N,...z,...P,...B,...I)}var Ld=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Bd(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let g of u){let h=n.get(g),c=d+1;(h===void 0||c>h)&&n.set(g,c),s.includes(g)||s.push(g)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Fd(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,g=t.filter(P=>P.value>0),h=e.map(P=>P.id),c=Bd(h,g),f=new Map,p=new Map;for(let P of h)f.set(P,0),p.set(P,0);for(let P of g)p.set(P.source,(p.get(P.source)??0)+P.value),f.set(P.target,(f.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let b=new Map;for(let P=0;P<=y;P++)b.set(P,[]);for(let[P,B]of c)b.get(B).push(P);let m=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)m.set(P,a+P*x);let v=new Map;for(let P=0;P<e.length;P++)v.set(e[P].id,e[P]);let D=[],T=new Map;for(let P=0;P<=y;P++){let B=b.get(P);if(B.length===0)continue;let I=0;for(let S of B){let k=f.get(S)??0,E=p.get(S)??0;I+=Math.max(k,E,1)}let N=u-s*(B.length-1),L=I>0?N/I:1,M=a;for(let S=0;S<B.length;S++){let k=B[S],E=v.get(k),F=f.get(k)??0,R=p.get(k)??0,W=Math.max(F,R,1),_=Math.max(4,W*L),O=e.findIndex(X=>X.id===k),H={id:k,label:E.label,color:E.color??l[O%l.length],column:P,x:m.get(P),y:M,height:_,totalIn:F,totalOut:R,totalValue:W};D.push(H),T.set(k,H),M+=_+s}}let C=new Map,$=new Map;for(let P of h)C.set(P,0),$.set(P,0);let A=[...g].sort((P,B)=>B.value-P.value),z=[];for(let P of A){let B=T.get(P.source),I=T.get(P.target);if(!B||!I)continue;let N=B.totalOut||1,L=I.totalIn||1,M=P.value/N*B.height,S=P.value/L*I.height,k=Math.max(1,(M+S)/2),E=C.get(P.source),F=$.get(P.target),R=B.y+E+M/2,W=I.y+F+S/2;C.set(P.source,E+M),$.set(P.target,F+S);let _=v.get(P.source);z.push({source:P.source,target:P.target,value:P.value,color:P.color??_?.color??B.color,sourceY:R,targetY:W,width:k})}return{layoutNodes:D,layoutLinks:z}}function fs(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:g=Ld,title:h,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let f=q(()=>Fd(t,n,r,i,s,a,c,g),[t,n,r,i,s,a,c,g]),p=w(()=>{let D=[];for(let T=0;T<f.layoutLinks.length;T++){let C=f.layoutLinks[T],$=f.layoutNodes.find(N=>N.id===C.source),A=f.layoutNodes.find(N=>N.id===C.target);if(!$||!A)continue;let z=$.x+s,P=A.x,B=(z+P)/2,I=`M ${z} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${P} ${C.targetY}`;D.push(o("path",{key:`link-${T}`,d:I,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&D.push(o("text",{key:`link-val-${T}`,x:String(B),y:String((C.sourceY+C.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(C.value)))}return D},[f,s,u,d]),y=w(()=>{let D=[];for(let T=0;T<f.layoutNodes.length;T++){let C=f.layoutNodes[T];if(D.push(o("rect",{key:`node-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(C.height),fill:C.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${C.label}: ${C.totalValue}`})),l){let $=f.layoutNodes.reduce((L,M)=>Math.max(L,M.column),0),A=C.column===$,z=A?C.x+s+6:C.x-6,P=A?"start":"end",B=C.column===0,I=B?C.x-6:z,N=B?"end":P;D.push(o("text",{key:`label-${C.id}`,x:String(I),y:String(C.y+C.height/2+4),"text-anchor":N,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return D},[f,s,l]),b=w(()=>h?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r,c]),m=p(),x=y(),v=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...m,...x)}var Nd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gn=2*Math.PI;function wt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Wd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function _d(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,g=e+r*Math.cos(d),h=t+r*Math.sin(d),c=e+r*Math.cos(u),f=t+r*Math.sin(u),p=e+n*Math.cos(u),y=t+n*Math.sin(u),b=e+n*Math.cos(d),m=t+n*Math.sin(d);if(a>=Gn-.001){let x=d+Math.PI,v=e+r*Math.cos(x),D=t+r*Math.sin(x),T=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${g} ${h}`,`A ${r} ${r} 0 1 1 ${v} ${D}`,`A ${r} ${r} 0 1 1 ${g} ${h}`,`L ${b} ${m}`,`A ${n} ${n} 0 1 0 ${T} ${C}`,`A ${n} ${n} 0 1 0 ${b} ${m}`,"Z"].join(" ")}return[`M ${g} ${h}`,`A ${r} ${r} 0 ${l} 1 ${c} ${f}`,`L ${p} ${y}`,`A ${n} ${n} 0 ${l} 0 ${b} ${m}`,"Z"].join(" ")}function Od(e,t,n,r){let i=[],s=wt(e);if(s<=0)return i;let a=Wd(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let g=0;g<e.children.length;g++){let h=e.children[g],c=wt(h);if(c<=0)continue;let f=c/s*Gn;d.push({node:h,startAngle:u,endAngle:u+f,depth:0,colorIndex:g}),u+=f}}else return i.push({startAngle:0,endAngle:Gn,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:g,startAngle:h,endAngle:c,depth:f,colorIndex:p}=u,y=wt(g);if(y<=0)continue;let b=t+f*l,m=b+l;if(i.push({startAngle:h,endAngle:c,innerR:b,outerR:m,label:g.label,value:y,color:g.color??r[p%r.length],depth:f}),g.children&&g.children.length>0){let x=h,v=c-h;for(let D=0;D<g.children.length;D++){let T=g.children[D],C=wt(T);if(C<=0)continue;let $=C/y*v;d.push({node:T,startAngle:x,endAngle:x+$,depth:f+1,colorIndex:p}),x+=$}}}return i}function ms(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Nd,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,g=n/2,h=r/2,c=u?20:0,f=Math.min(g,h-c)-10;if(q(()=>wt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(g),y:String(h),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>Od(t,i,f,a),[t,i,f,a]),b=[];u&&b.push(o("text",{key:"title",x:String(g),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let m=h+c/2;for(let x=0;x<y.length;x++){let v=y[x],D=_d(g,m,v.innerR,v.outerR,v.startAngle,v.endAngle);if(b.push(o("path",{key:`arc-${x}`,d:D,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let T=v.endAngle-v.startAngle,C=v.startAngle+T/2-Math.PI/2,$=(v.innerR+v.outerR)/2,A=v.outerR-v.innerR,z=T*$;if(z>20&&A>14){let P=g+$*Math.cos(C),B=m+$*Math.sin(C),I=Math.floor(Math.min(z,A)/7),N=v.label.length>I?v.label.substring(0,Math.max(1,I-1))+"..":v.label;b.push(o("text",{key:`label-${x}`,x:String(P),y:String(B+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},N))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...b)}var Hd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Zt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function gs(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function Yd(e,t,n,r,i,s){let a=[],l=[],d=Zt(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],g=r*i,h=[];for(let c=0;c<u.length;c++){let f=u[c],p=Zt(f);p<=0||h.push({label:f.label,value:p,area:p/d*g,color:f.color??s[c%s.length],node:f})}for(h.sort((c,f)=>f.area-c.area),l.push({nodes:h,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:f,rect:p,depth:y}=c;if(f.length===0)continue;let b={...p},m=0;for(;m<f.length&&b.w>0&&b.h>0;){let x=b.w>=b.h,v=x?b.h:b.w,D=[],T=[];D.push(f[m]),T.push(f[m].area),m++;let C=gs(T,v);for(;m<f.length;){let P=[...T,f[m].area],B=gs(P,v);if(B>C)break;D.push(f[m]),T.push(f[m].area),C=B,m++}let $=0;for(let P of T)$+=P;let A=v>0?$/v:0,z=0;for(let P=0;P<D.length;P++){let B=D[P],I=A>0?B.area/A:0,N,L,M,S;if(x?(N=b.x,L=b.y+z,M=A,S=I):(N=b.x+z,L=b.y,M=I,S=A),a.push({x:N,y:L,w:M,h:S,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let E=N+2,F=L+2+14,R=M-4,W=S-4-14;if(R>4&&W>4){let _=[],O=B.value,H=R*W;for(let X=0;X<B.node.children.length;X++){let J=B.node.children[X],K=Zt(J);K<=0||_.push({label:J.label,value:K,area:K/O*H,color:J.color??s[(X+y+1)%s.length],node:J})}_.sort((X,J)=>J.area-X.area),l.push({nodes:_,rect:{x:E,y:F,w:R,h:W},depth:y+1})}}z+=I}x?b={x:b.x+A,y:b.y,w:b.w-A,h:b.h}:b={x:b.x,y:b.y+A,w:b.w,h:b.h-A}}}return a}function hs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Hd,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:g}=e,h=g?30:0,c=u,f=u+h,p=n-u*2,y=r-u*2-h;if(q(()=>Zt(t),[t])<=0||p<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let m=q(()=>Yd(t,c,f,p,y,a),[t,c,f,p,y,a]),x=[];g&&x.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g));for(let v=0;v<m.length;v++){let D=m[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(D.x),y:String(D.y),width:String(Math.max(0,D.w)),height:String(Math.max(0,D.h)),fill:D.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),i&&D.w>20&&D.h>14){let T=Math.floor(D.w/7),C=D.label.length>T?D.label.substring(0,Math.max(1,T-2))+"..":D.label;x.push(o("text",{key:`label-${v}`,x:String(D.x+4),y:String(D.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&D.w>30&&D.h>28&&x.push(o("text",{key:`value-${v}`,x:String(D.x+4),y:String(D.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(D.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function bs(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function Vd(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function xs(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=bs(t[s]),u=bs(t[a]);return Vd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Jt(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function Ud(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let g=Math.max(2,Math.min(50,r)),h=d/(g-1),c=u/(g-1);if(n){let p=[];for(let x=0;x<g;x++)for(let v=0;v<g;v++)p.push({x:i+v*h,y:a+x*c});let b=n(p,{gridSize:g,xMin:i,xMax:s,yMin:a,yMax:l}),m=[];for(let x=0;x<p.length;x++){let v=p[x],D=b[x]??{dx:0,dy:0},T=Math.sqrt(D.dx*D.dx+D.dy*D.dy);m.push({x:v.x,y:v.y,dx:D.dx,dy:D.dy,magnitude:T})}return m}if(!t)return[];let f=[];for(let p=0;p<g;p++)for(let y=0;y<g;y++){let b=i+y*h,m=a+p*c,x=t(b,m),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);f.push({x:b,y:m,dx:x.dx,dy:x.dy,magnitude:v})}return f}function jd(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:g,yMax:h,xSpan:c,ySpan:f,showGrid:p,showAxes:y,colorByMagnitude:b,colorScale:m,arrowColor:x,arrowWidth:v,effectiveArrowScale:D,maxMagnitude:T,title:C,tickFontSize:$}=i,A=B=>s+(B-d)/c*a,z=B=>s+(h-B)/f*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),p){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${$}px sans-serif`,e.fillStyle="#6b7280";let B=Jt(c,10),I=Math.ceil(d/B)*B;for(let M=I;M<=u;M+=B){let S=A(M);e.beginPath(),e.moveTo(S,s),e.lineTo(S,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(M*100)/100),S,s+l+4)}let N=Jt(f,10),L=Math.ceil(g/N)*N;for(let M=L;M<=h;M+=N){let S=z(M);e.beginPath(),e.moveTo(s,S),e.lineTo(s+a,S),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(M*100)/100),s-6,S)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,g<=0&&h>=0){let B=z(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=A(0);e.beginPath(),e.moveTo(B,s),e.lineTo(B,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let B=0;B<r.length;B++){let I=r[B],N=I.magnitude??Math.sqrt(I.dx*I.dx+I.dy*I.dy);if(N<1e-10)continue;let L=A(I.x),M=z(I.y),S=I.dx*D,k=-I.dy*D,E=L+S,F=M+k,R;if(b){let _=N/T;R=xs(_,m)}else R=x;e.save(),e.strokeStyle=R,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(L,M),e.lineTo(E,F),e.stroke();let W=Math.sqrt(S*S+k*k);if(W>2){let _=S/W,O=k/W,H=-O,X=_,J=Math.min(P,W*.4),K=E-_*J+H*J*.5,U=F-O*J+X*J*.5,j=E-_*J-H*J*.5,V=F-O*J-X*J*.5;e.fillStyle=R,e.beginPath(),e.moveTo(E,F),e.lineTo(K,U),e.lineTo(j,V),e.closePath(),e.fill()}e.restore()}}function ys(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:g=!0,showAxes:h=!0,colorByMagnitude:c=!1,colorScale:f=["#3b82f6","#8b5cf6","#ef4444"],title:p,padding:y=50,tickFontSize:b=10,arrowWidth:m=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:D}=e,T=Math.max(2,Math.min(50,s)),C=r-y*2,$=i-y*2,A=a[0],z=a[1],P=l[0],B=l[1],I=z-A,N=B-P,L=q(()=>K=>y+(K-A)/I*C,[y,A,I,C]),M=q(()=>K=>y+(B-K)/N*$,[y,B,N,$]),S=q(()=>Ud(t,n,D,T,A,z,P,B,I,N),[t,n,D,T,A,z,P,B,I,N]),k=q(()=>{let K=0;for(let U=0;U<S.length;U++){let j=S[U],V=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);V>K&&(K=V)}return K>0?K:1},[S]),E=q(()=>Math.min(C,$)/Math.max(T,2)/(2*k)*d,[C,$,T,k,d]);if(x==="canvas"){let K=ne(null),U=ne(0);return se(()=>{let j=K.current;if(!j)return;let V=j.getContext("2d");if(V)return U.current&&cancelAnimationFrame(U.current),U.current=requestAnimationFrame(()=>{jd(V,r,i,S,{padding:y,chartWidth:C,chartHeight:$,xMin:A,xMax:z,yMin:P,yMax:B,xSpan:I,ySpan:N,showGrid:g,showAxes:h,colorByMagnitude:c,colorScale:f,arrowColor:u,arrowWidth:m,effectiveArrowScale:E,maxMagnitude:k,title:p,tickFontSize:b})}),()=>{U.current&&cancelAnimationFrame(U.current)}},[S,r,i,y,C,$,A,z,P,B,I,N,g,h,c,f,u,m,E,k,p,b]),o("canvas",{ref:K,width:r,height:i,role:"img","aria-label":p??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=w(()=>{if(!g)return[];let K=[],U=Jt(I,10),j=Math.ceil(A/U)*U;for(let Z=j;Z<=z;Z+=U){let Q=L(Z);K.push(o("line",{key:`gridv-${Z}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+$),stroke:"#e5e7eb","stroke-width":"0.5"})),K.push(o("text",{key:`xtick-${Z}`,x:String(Q),y:String(y+$+16),"text-anchor":"middle","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let V=Jt(N,10),Y=Math.ceil(P/V)*V;for(let Z=Y;Z<=B;Z+=V){let Q=M(Z);K.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),K.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return K},[g,A,z,P,B,I,N,L,M,y,C,$]),R=w(()=>{if(!h)return[];let K=[];if(P<=0&&B>=0){let U=M(0);K.push(o("line",{key:"axis-x",x1:String(y),y1:String(U),x2:String(y+C),y2:String(U),stroke:"#374151","stroke-width":String(m)}))}if(A<=0&&z>=0){let U=L(0);K.push(o("line",{key:"axis-y",x1:String(U),y1:String(y),x2:String(U),y2:String(y+$),stroke:"#374151","stroke-width":String(m)}))}return K.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String($),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),K},[h,A,z,P,B,L,M,y,C,$]),W=w(()=>{let K=[];for(let j=0;j<S.length;j++){let V=S[j],Y=V.magnitude??Math.sqrt(V.dx*V.dx+V.dy*V.dy);if(Y<1e-10)continue;let Z=L(V.x),Q=M(V.y),ae=V.dx*E,ee=-V.dy*E,te=Z+ae,le=Q+ee,ce;if(c){let ue=Y/k;ce=xs(ue,f)}else ce=u;K.push(o("line",{key:`arrow-line-${j}`,x1:String(Z),y1:String(Q),x2:String(te),y2:String(le),stroke:ce,"stroke-width":String(m),"stroke-linecap":"round"}));let oe=Math.sqrt(ae*ae+ee*ee);if(oe>2){let ue=ae/oe,re=ee/oe,ie=-re,de=ue,pe=Math.min(4,oe*.4),me=te-ue*pe+ie*pe*.5,he=le-re*pe+de*pe*.5,fe=te-ue*pe-ie*pe*.5,ye=le-re*pe-de*pe*.5;K.push(o("polygon",{key:`arrow-head-${j}`,points:`${te},${le} ${me},${he} ${fe},${ye}`,fill:ce}))}}return K},[S,L,M,E,c,k,f,u]),_=w(()=>p?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,r,y]),O=F(),H=R(),X=W(),J=_();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Vector field plot",style:{fontFamily:"sans-serif"}},...J,...O,...H,...X)}function Gd(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function Xd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Ss(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:g=!0,title:h,padding:c=60}=e,f=n-c*2,p=r-c*2,y=q(()=>Gd(t),[t]),{minVal:b,maxVal:m}=q(()=>{let k=0,E=0;for(let F=0;F<y.length;F++){let R=y[F];R.start<k&&(k=R.start),R.end<k&&(k=R.end),R.start>E&&(E=R.start),R.end>E&&(E=R.end)}return k===E&&(E=k+1),{minVal:k,maxVal:E}},[y]),x=m-b,v=w(k=>c+p-(k-b)/x*p,[c,p,b,x]),D=q(()=>y.length===0?0:f/y.length,[y.length,f]),T=6,C=Math.max(1,D-T),$=w(()=>{if(!u)return[];let k=Xd(x),E=[],F=Math.ceil(b/k)*k;for(let R=F;R<=m;R+=k){let W=v(R);E.push(o("line",{key:`grid-${R}`,x1:String(c),y1:String(W),x2:String(c+f),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),E.push(o("text",{key:`grid-label-${R}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}return E},[u,x,b,m,v,c,f]),A=w(()=>{let k=[];k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"}));let E=b<=0&&m>=0?v(0):c+p;return k.push(o("line",{key:"axis-x",x1:String(c),y1:String(E),x2:String(c+f),y2:String(E),stroke:"#374151","stroke-width":"1.5"})),k},[c,f,p,b,m,v]),z=w(()=>{if(y.length===0)return[];let k=[];for(let E=0;E<y.length;E++){let F=y[E],R=c+E*D+T/2,W=Math.max(F.start,F.end),_=Math.min(F.start,F.end),O=v(W),H=v(_),X=Math.max(0,H-O),J;if(F.type==="total"?J=a:F.type==="decrease"?J=s:J=i,k.push(o("rect",{key:`bar-${E}`,x:String(R),y:String(O),width:String(C),height:String(X),fill:J,rx:"2",ry:"2"})),d){let K=F.type==="decrease"||F.value<0?H+14:O-4,U=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);k.push(o("text",{key:`val-${E}`,x:String(R+C/2),y:String(K),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},U))}if(k.push(o("text",{key:`cat-${E}`,x:String(R+C/2),y:String(c+p+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),g&&E<y.length-1){let K=y[E+1],U=v(F.end),j=c+(E+1)*D+T/2;K.type!=="total"&&k.push(o("line",{key:`conn-${E}`,x1:String(R+C),y1:String(U),x2:String(j),y2:String(U),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return k},[y,D,C,v,i,s,a,l,d,g,c,p]),P=w(()=>h?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,c]),B=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),I=$(),N=A(),L=z(),M=P(),S=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Waterfall chart",style:{fontFamily:"sans-serif"}},...M,...I,...N,...L,...S)}var qd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Kd=[0,-45,45,90];function Zd(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),g=Math.abs(Math.sin(d)),h=a*u+l*g,c=a*g+l*u;return{x:r-h/2,y:i-c/2,w:h,h:c}}function Jd(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function Qd(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function eu(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function vs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=qd,rotations:d=Kd,padding:u=4,spiral:g="archimedean",title:h}=e,c=q(()=>{if(t.length===0)return[];let p=t.map((C,$)=>({...C,originalIndex:$})).filter(C=>C.text.length>0&&C.weight>0).sort((C,$)=>$.weight-C.weight);if(p.length===0)return[];let y=p[p.length-1].weight,m=p[0].weight-y;function x(C){if(m===0)return(i+s)/2;let $=(C-y)/m;return i+$*(s-i)}let v=[],D=n/2,T=r/2;for(let C=0;C<p.length;C++){let $=p[C],A=x($.weight),z=d[eu($.text)%d.length],P=$.color??l[C%l.length],B=!1,I=500,N=g==="archimedean"?4:5;for(let L=0;L<I;L++){let M,S;if(g==="archimedean"){let _=L*.1,O=N*_;M=O*Math.cos(_),S=O*Math.sin(_)}else{let _=Math.floor(L/4)+1,O=L%4,H=(L%4===0?0:L)*N;switch(O){case 0:M=_*N*4,S=H;break;case 1:M=-H,S=_*N*4;break;case 2:M=-_*N*4,S=-H;break;default:M=H,S=-_*N*4;break}}let k=D+M,E=T+S,F=Zd($.text,A,z,k,E),R={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!Qd(R,n,r))continue;let W=!1;for(let _ of v)if(Jd(R,_.bbox)){W=!0;break}if(!W){v.push({text:$.text,x:k,y:E,fontSize:A,rotation:z,color:P,bbox:R}),B=!0;break}}}return v},[t,n,r,i,s,l,d,u,g]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let f=[];h&&f.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},h));for(let p=0;p<c.length;p++){let y=c[p],b=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;f.push(o("text",{key:`word-${p}`,transform:b,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Word cloud",style:{fontFamily:a}},...f)}var tu={0:"#1e293b",1:"#3b82f6"},nu="#666";function ws(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:g="#0f172a",padding:h=10,onCellClick:c,onCellHover:f,title:p}=e,y=n??tu,b=t.length,m=q(()=>{let k=0;for(let E=0;E<t.length;E++){let F=t[E];F!==void 0&&F.length>k&&(k=F.length)}return k},[t]),x=u?20:0,v=p?24:0,D=q(()=>{let k=r-h*2-x,E=i-h*2-x-v;if(b===0||m===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,(k-s*(m-1))/m),R=Math.max(0,(E-s*(b-1))/b);return{cellWidth:F,cellHeight:R}},[r,i,h,b,m,s,x,v]),T=w(k=>{let E=y[k];return E!==void 0?E:nu},[y]),C=w(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:g}),[r,i,g]),$=w(()=>p?[o("text",{key:"title",x:String(r/2),y:String(h+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},p)]:[],[p,r,h]),A=w(()=>{if(!l||b===0||m===0)return[];let{cellWidth:k,cellHeight:E}=D,F=h+x,R=h+x+v,W=m*k+(m-1)*s,_=b*E+(b-1)*s,O=[];for(let H=0;H<=m;H++){let X=F+H*(k+s)-s/2;O.push(o("line",{key:`vgrid-${H}`,x1:String(X),y1:String(R-s/2),x2:String(X),y2:String(R+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let H=0;H<=b;H++){let X=R+H*(E+s)-s/2;O.push(o("line",{key:`hgrid-${H}`,x1:String(F-s/2),y1:String(X),x2:String(F+W+s/2),y2:String(X),stroke:d,"stroke-width":"0.5"}))}return O},[l,b,m,D,h,x,v,s,d]),z=w(()=>{if(!u||b===0||m===0)return[];let{cellWidth:k,cellHeight:E}=D,F=h+x,R=h+x+v,W=[];for(let _=0;_<m;_++){let O=F+_*(k+s)+k/2,H=R-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(H),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<b;_++){let O=F-6,H=R+_*(E+s)+E/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(H),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,b,m,D,h,x,v,s]),P=w(()=>{if(b===0||m===0)return[];let{cellWidth:k,cellHeight:E}=D,F=h+x,R=h+x+v,W=[];for(let _=0;_<b;_++){let O=t[_];if(O!==void 0)for(let H=0;H<m;H++){let X=H<O.length?O[H]:0,J=F+H*(k+s),K=R+_*(E+s),U=T(X),j={key:`cell-${_}-${H}`,x:String(J),y:String(K),width:String(k),height:String(E),fill:U,rx:String(a),ry:String(a)};if(c){let V=_,Y=H,Z=X;j.onClick=()=>c(V,Y,Z),j.role="button",j.tabIndex=0}if(f){let V=_,Y=H,Z=X;j.onMouseEnter=()=>f(V,Y,Z)}W.push(o("rect",j))}}return W},[b,m,t,D,h,x,v,s,a,T,c,f]),B=C(),I=$(),N=A(),L=z(),M=P(),S=p?`${p} \u2014 ${b}x${m} discrete grid`:`${b}x${m} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":S},B,...I,...N,...L,...M)}