@skdx/web-components-charts 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/area.cjs +38 -35
- package/dist/area.d.cts +1 -1
- package/dist/area.d.ts +1 -1
- package/dist/area.js +28 -25
- package/dist/bar.cjs +38 -35
- package/dist/bar.d.cts +1 -1
- package/dist/bar.d.ts +1 -1
- package/dist/bar.js +28 -25
- package/dist/boxplot.cjs +33 -30
- package/dist/boxplot.d.cts +1 -1
- package/dist/boxplot.d.ts +1 -1
- package/dist/boxplot.js +40 -37
- package/dist/bubble.cjs +37 -34
- package/dist/bubble.d.cts +1 -1
- package/dist/bubble.d.ts +1 -1
- package/dist/bubble.js +25 -22
- package/dist/bullet.cjs +40 -37
- package/dist/bullet.d.cts +1 -1
- package/dist/bullet.d.ts +1 -1
- package/dist/bullet.js +38 -35
- package/dist/bump.cjs +38 -35
- package/dist/bump.d.cts +1 -1
- package/dist/bump.d.ts +1 -1
- package/dist/bump.js +38 -35
- package/dist/candlestick.cjs +40 -37
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +35 -32
- package/dist/chord.cjs +26 -23
- package/dist/chord.d.cts +1 -1
- package/dist/chord.d.ts +1 -1
- package/dist/chord.js +40 -37
- package/dist/circle-packing.cjs +26 -23
- package/dist/circle-packing.d.cts +1 -1
- package/dist/circle-packing.d.ts +1 -1
- package/dist/circle-packing.js +40 -37
- package/dist/combo.cjs +38 -35
- package/dist/combo.d.cts +1 -1
- package/dist/combo.d.ts +1 -1
- package/dist/combo.js +28 -25
- package/dist/dumbbell.cjs +32 -29
- package/dist/dumbbell.d.cts +1 -1
- package/dist/dumbbell.d.ts +1 -1
- package/dist/dumbbell.js +40 -37
- package/dist/funnel.cjs +30 -27
- package/dist/funnel.d.cts +1 -1
- package/dist/funnel.d.ts +1 -1
- package/dist/funnel.js +40 -37
- package/dist/gantt.cjs +40 -37
- package/dist/gantt.d.cts +1 -1
- package/dist/gantt.d.ts +1 -1
- package/dist/gantt.js +30 -27
- package/dist/gauge.cjs +34 -31
- package/dist/gauge.d.cts +1 -1
- package/dist/gauge.d.ts +1 -1
- package/dist/gauge.js +39 -36
- package/dist/heatmap.cjs +40 -37
- package/dist/heatmap.d.cts +1 -1
- package/dist/heatmap.d.ts +1 -1
- package/dist/heatmap.js +30 -27
- package/dist/histogram.cjs +30 -27
- package/dist/histogram.d.cts +1 -1
- package/dist/histogram.d.ts +1 -1
- package/dist/histogram.js +30 -27
- package/dist/icicle.cjs +45 -42
- package/dist/icicle.d.cts +1 -1
- package/dist/icicle.d.ts +1 -1
- package/dist/icicle.js +45 -42
- package/dist/{index-oF5ss8v9.d.cts → index-D44-61v7.d.cts} +11 -5
- package/dist/{index-oF5ss8v9.d.ts → index-D44-61v7.d.ts} +11 -5
- package/dist/index.cjs +40 -37
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +40 -37
- package/dist/line.cjs +38 -35
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +28 -25
- package/dist/linear-gauge.cjs +40 -37
- package/dist/linear-gauge.d.cts +1 -1
- package/dist/linear-gauge.d.ts +1 -1
- package/dist/linear-gauge.js +38 -35
- package/dist/map.cjs +40 -37
- package/dist/map.d.cts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +40 -37
- package/dist/marimekko.cjs +31 -28
- package/dist/marimekko.d.cts +1 -1
- package/dist/marimekko.d.ts +1 -1
- package/dist/marimekko.js +32 -29
- package/dist/network.cjs +26 -23
- package/dist/network.d.cts +1 -1
- package/dist/network.d.ts +1 -1
- package/dist/network.js +40 -37
- package/dist/organization.cjs +29 -26
- package/dist/organization.d.cts +1 -1
- package/dist/organization.d.ts +1 -1
- package/dist/organization.js +40 -37
- package/dist/parallel.cjs +25 -22
- package/dist/parallel.d.cts +1 -1
- package/dist/parallel.d.ts +1 -1
- package/dist/parallel.js +37 -34
- package/dist/pareto.cjs +30 -27
- package/dist/pareto.d.cts +1 -1
- package/dist/pareto.d.ts +1 -1
- package/dist/pareto.js +30 -27
- package/dist/pie.cjs +40 -37
- package/dist/pie.d.cts +1 -1
- package/dist/pie.d.ts +1 -1
- package/dist/pie.js +39 -36
- package/dist/polar-area.cjs +40 -37
- package/dist/polar-area.d.cts +1 -1
- package/dist/polar-area.d.ts +1 -1
- package/dist/polar-area.js +40 -37
- package/dist/radar.cjs +27 -24
- package/dist/radar.d.cts +1 -1
- package/dist/radar.d.ts +1 -1
- package/dist/radar.js +40 -37
- package/dist/radial.cjs +39 -36
- package/dist/radial.d.cts +1 -1
- package/dist/radial.d.ts +1 -1
- package/dist/radial.js +39 -36
- package/dist/range.cjs +30 -27
- package/dist/range.d.cts +1 -1
- package/dist/range.d.ts +1 -1
- package/dist/range.js +30 -27
- package/dist/sankey.cjs +31 -28
- package/dist/sankey.d.cts +1 -1
- package/dist/sankey.d.ts +1 -1
- package/dist/sankey.js +40 -37
- package/dist/scatter.cjs +28 -25
- package/dist/scatter.d.cts +1 -1
- package/dist/scatter.d.ts +1 -1
- package/dist/scatter.js +29 -26
- package/dist/sparkline.cjs +23 -20
- package/dist/sparkline.d.cts +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +38 -35
- package/dist/sunburst.cjs +40 -37
- package/dist/sunburst.d.cts +1 -1
- package/dist/sunburst.d.ts +1 -1
- package/dist/sunburst.js +40 -37
- package/dist/swarm.cjs +36 -33
- package/dist/swarm.d.cts +1 -1
- package/dist/swarm.d.ts +1 -1
- package/dist/swarm.js +37 -34
- package/dist/timeline.cjs +24 -21
- package/dist/timeline.d.cts +1 -1
- package/dist/timeline.d.ts +1 -1
- package/dist/timeline.js +40 -37
- package/dist/tree.cjs +25 -22
- package/dist/tree.d.cts +1 -1
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +40 -37
- package/dist/treemap.cjs +27 -24
- package/dist/treemap.d.cts +1 -1
- package/dist/treemap.d.ts +1 -1
- package/dist/treemap.js +40 -37
- package/dist/waffle.cjs +38 -35
- package/dist/waffle.d.cts +1 -1
- package/dist/waffle.d.ts +1 -1
- package/dist/waffle.js +38 -35
- package/dist/waterfall.cjs +31 -28
- package/dist/waterfall.d.cts +1 -1
- package/dist/waterfall.d.ts +1 -1
- package/dist/waterfall.js +34 -31
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
"use strict";var Dr=Object.defineProperty;var as=Object.getOwnPropertyDescriptor;var ii=Object.getOwnPropertyNames;var li=Object.prototype.hasOwnProperty;var ci=(e,n)=>{for(var t in n)Dr(e,t,{get:n[t],enumerable:!0})},di=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of ii(n))!li.call(e,a)&&a!==t&&Dr(e,a,{get:()=>n[a],enumerable:!(r=as(n,a))||r.enumerable});return e};var mi=e=>di(Dr({},"__esModule",{value:!0}),e),m=(e,n,t,r)=>{for(var a=r>1?void 0:r?as(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(a=(r?s(n,t,a):s(a))||a);return r&&a&&Dr(n,t,a),a};var wl={};ci(wl,{SkdxAreaChart:()=>lr,SkdxBarChart:()=>sr,SkdxBoxplot:()=>Mt,SkdxBubbleChart:()=>qe,SkdxBulletChart:()=>Wt,SkdxBumpChart:()=>Bt,SkdxCandlestickChart:()=>lt,SkdxChordChart:()=>mn,SkdxCirclePackingChart:()=>an,SkdxComboChart:()=>cr,SkdxDumbbellChart:()=>Tt,SkdxFunnelChart:()=>Ut,SkdxGanttChart:()=>Kt,SkdxGaugeChart:()=>Qe,SkdxHeatmap:()=>Be,SkdxHistogram:()=>Ue,SkdxIcicleChart:()=>Ot,SkdxLineChart:()=>ir,SkdxLinearGauge:()=>It,SkdxMapChart:()=>$t,SkdxMarimekkoChart:()=>hn,SkdxNetworkChart:()=>Dt,SkdxOrganizationChart:()=>Zt,SkdxParallelCoordinatesChart:()=>Jt,SkdxParetoChart:()=>at,SkdxPieChart:()=>it,SkdxPolarAreaChart:()=>Ct,SkdxRadarChart:()=>tt,SkdxRadialBarChart:()=>rt,SkdxRangeChart:()=>Pe,SkdxSankeyChart:()=>pt,SkdxScatterChart:()=>Xe,SkdxSparkline:()=>ft,SkdxSunburstChart:()=>nt,SkdxSwarmPlot:()=>pn,SkdxTimelineChart:()=>wn,SkdxTreeChart:()=>Lt,SkdxTreemap:()=>vt,SkdxWaffleChart:()=>Ft,SkdxWaterfallChart:()=>bt,csv:()=>Cr,exportChart:()=>Ar,makeFormatter:()=>re,seriesCsv:()=>fo,svgMarkup:()=>Tr,syncGroup:()=>rr});module.exports=mi(wl);var Js=require("lit/decorators.js");var os=e=>Number(e.toPrecision(12)),ui,ia=e=>(ui??(ui=new Intl.NumberFormat)).format(os(e)),hi=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),a=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(a)}m`:a>0?`${t}${a}m ${o(n%60)}s`:`${t}${n}s`};function re(e){if(e===void 0)return ia;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:a="",timeZone:o}=e,s=u=>a?h=>u(h)+a:u,c=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let h=new Intl.NumberFormat(t,u);return s(f=>h.format(os(f)))},d=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return f=>h.format(f)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(c(2));case"percent":return l({style:"percent",...c(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...c()});case"compact":return l({notation:"compact",...c(1)});case"scientific":return l({notation:"scientific",...c(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return s(hi)}}function qt(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?re(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):ia(t)}var We=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function ot([e,n],[t,r]){let a=n-e;return o=>a===0?t:t+(o-e)/a*(r-t)}function ut(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),a=10**Math.floor(Math.log10(r)),o=r/a,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*a,c=Math.floor(e/s)*s,l=Math.ceil(n/s)*s,d=[];for(let u=c;u<=l+s/2;u+=s)d.push(ss(u));return d}function Ve(e,[n,t],r=.2){let a=e===0?0:(t-n)/e,o=a*(1-Math.max(0,Math.min(.9,r)));return{step:a,bandwidth:o,start:s=>n+s*a+(a-o)/2,center:s=>n+(s+.5)*a}}var ss=e=>Number(e.toPrecision(12)),i=e=>Number(e.toFixed(2)),H=e=>typeof e=="number"&&Number.isFinite(e),Fe=e=>e.filter(H);function ve(e){let n=1/0,t=-1/0;for(let r of e)H(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function st(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let d=`M${t.x} ${t.y}`;for(let u=1;u<e.length;u++){let h=e[u-1],f=e[u];n==="stepAfter"?d+=`H${f.x}V${f.y}`:n==="stepBefore"?d+=`V${f.y}H${f.x}`:d+=`H${i((h.x+f.x)/2)}V${f.y}H${f.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,a=e.slice(1).map((d,u)=>d.x-e[u].x),o=e.slice(1).map((d,u)=>d.y-e[u].y),s=a.map((d,u)=>d===0?0:o[u]/d),c=[s[0]];for(let d=1;d<r-1;d++){let u=s[d-1],h=s[d];c.push(u*h<=0?0:(u+h)/2)}c.push(s[r-2]);for(let d=0;d<r-1;d++){let u=s[d];if(u===0){c[d]=0,c[d+1]=0;continue}let h=c[d]/u,f=c[d+1]/u,x=Math.hypot(h,f);x>3&&(c[d]=3*h*u/x,c[d+1]=3*f*u/x)}let l=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let u=e[d],h=e[d+1],f=a[d]/3;l+=`C${i(u.x+f)} ${i(u.y+f*c[d])} ${i(h.x-f)} ${i(h.y-f*c[d+1])} ${h.x} ${h.y}`}return l}var pr=1e3,br=60*pr,gr=60*br,xr=24*gr,fi=[pr,5*pr,15*pr,30*pr,br,5*br,15*br,30*br,gr,3*gr,6*gr,12*gr,xr,2*xr,7*xr,14*xr];function Yn(e,n,t=6){if(!(n>e))return[e];let r=n-e,a=fi.find(h=>r/h<=t),o=[];if(a!==void 0){for(let h=Math.ceil(e/a)*a;h<=n;h+=a)o.push(h);return o.length?o:[e,n]}let s=r/(30*xr),c=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,l=new Date(e),d=l.getUTCFullYear(),u=Math.ceil((l.getUTCMonth()+(l.getUTCDate()>1?1:0))/c)*c;for(let h=Date.UTC(d,u,1);h<=n;)o.push(h),u+=c,u>=12&&(d+=Math.floor(u/12),u%=12),h=Date.UTC(d,u,1);return o.length?o:[e,n]}function is(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),a=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let c of a)o.push(ss(c*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function Kn(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((l,d)=>l-d);let[t,r]=n.domain??ve(e),a=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(a)+1)),s=n.binWidth??(r>t?(r-t)/o:1),c=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:c+1},(l,d)=>Number((t+d*s).toPrecision(12)))}function Xn(e,n){let t=[];for(let o=0;o+1<n.length;o++)t.push({x0:n[o],x1:n[o+1],count:0});if(t.length===0)return t;let r=n[0],a=n[n.length-1];for(let o of Fe(e)){if(o<r||o>a)continue;let s=0,c=t.length-1;for(;s<c;){let l=s+c+1>>1;t[l].x0<=o?s=l:c=l-1}t[s].count++}return t}var pi=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,bi=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,gi={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function xi(e,n,t){return e.replace(bi,(r,a,o)=>{let s=gi[a];if(s===void 0)return a+o;let l=(o.match(pi)??[]).map((d,u)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let f=u%s;return s===7?f===5?String(h+n):f===6?String(h+t):d:String(f%2===0?h+n:h+t)});return a+l.join(" ")})}var ls=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:xi(r.d,n,t)}}});var la=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),Y={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"},St=(e="neutral")=>e==="neutral"?Y.axis:`var(--skdx-color-${e}-500)`,ca=(e="neutral")=>e==="neutral"?Y.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,cs=(e,n)=>n??la[e%la.length];var me={top:16,right:16,bottom:32,left:48};function ke(e,n,t=me){return{x:t.left,y:t.top,width:Math.max(0,e-t.left-t.right),height:Math.max(0,n-t.top-t.bottom)}}function Wn(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function ma(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var Br=e=>e.crosshair===!0||ma(e).trigger==="axis",Fr=20,yi=120,ds=e=>{let n=Wn(e);return n&&(n.position==="left"||n.position==="right")?n.width??yi:0},le=(e,n=600,t=300)=>({width:(e.width??n)-ds(e),height:(e.height??t)-(Wn(e)?.position==="bottom"?Fr:0)}),ce=(e,n,t)=>{let r=Wn(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,ms(n,t??le(e).width,r)):1)*Fr},ue=6.5,te=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:cs(n)),be=(e,n)=>e.hiddenSeries?.includes(n)??!1;function da(e,n,t=[],r={},a=10,o=8,s=!1){let c=[],l=r.maxItems,d=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,u=e.length-d.length,h=r.interactive??!0,f=o,x=a,v=(g,A,E,b)=>{let N=(A?18:4)+g.length*ue;f>o&&(s||f+N>n-8)&&(f=o,x+=Fr),A&&c.push({kind:"rect",part:"legend-swatch",x:f,y:x-5,width:10,height:10,fill:A,opacity:b?.3:void 0,item:E}),c.push({kind:"text",part:"legend-label",x:f+(A?14:0),y:x,text:g,baseline:"middle",fill:b?Y.grid:Y.label,item:E}),f+=N+12};for(let g of d){let A=t.includes(g.name),E=h?{label:g.name,series:g.name,legend:!0}:void 0;v(r.formatter?.(g.name)??g.name,g.color,E,A)}return u>0&&v(`+${u} more`,void 0,void 0,!1),r.align==="end"?vi(c,n):c}function vi(e,n){let t=new Map;for(let a of e){let o=a.kind==="rect"?a.y+5:a.y;t.set(o,[...t.get(o)??[],a])}let r=[];for(let a of t.values()){let o=Math.max(...a.map(c=>c.kind==="rect"?c.x+c.width:c.x+c.text.length*ue)),s=n-8-o;for(let c of a)r.push({...c,x:c.x+s})}return r}var ms=(e,n,t={})=>new Set(da(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function de(e,n,t,r=[]){let a=Wn(e),o=a&&e.direction==="rtl"&&a.align===void 0?{...a,align:"end"}:a,s=ma(e),c=o?.position==="bottom",l=ds(e),d=e.hiddenSeries??[],u=o?l?da(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):da(r,n,d,o,c?t+10:10):[],h=c?ms(r,n,o):0;return{width:n+l,height:c?t+Math.max(1,h)*Fr:t,legendOffset:o?.position==="left"?l:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function ua(e){let n=e.legendOffset;if(!n)return e;let t=[...ls(e.shapes.filter(l=>!l.part.startsWith("legend-")),n,0),...e.shapes.filter(l=>l.part.startsWith("legend-"))],r=l=>({...l,x:l.x+n}),a=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(l=>l+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:l=>o.scale(l)+n,invert:l=>o.invert(l-n),bars:o.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,c=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:a,edit:s,map:c,legendOffset:void 0}}function Pr(e,n,t,r,a,o="auto"){let s=Array.isArray(t)?t:[t],c=Math.max(...s.map(f=>f.length))*ue+12,l=6+s.length*16,d=o==="top"?{x:e-c/2,y:n-l-8}:o==="bottom"?{x:e-c/2,y:n+8}:o==="left"?{x:e-c-8,y:n-l/2}:o==="right"?{x:e+8,y:n-l/2}:{x:e+12,y:n-l-6},u=Math.max(0,Math.min(r-c,d.x)),h=Math.max(0,Math.min(a-l,d.y));return[{kind:"rect",part:"tooltip",x:i(u),y:i(h),width:i(c),height:l,fill:"var(--skdx-color-surface-raised)",stroke:Y.axis,rx:3},...s.map((f,x)=>({kind:"text",part:"tooltip-label",x:i(u+6),y:i(h+11+x*16),text:f,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:s.length>1&&x===0?"bold":void 0}))]}function Pt(e,n){let[t,r]=ve(e);return n?[Math.min(0,t),Math.max(0,r)]:[t,r]}function He([e,n],t,r=!1,a){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=re(o.format??a),c=o.min??e,l=o.max??n;o.reversed&&(t=[t[1],t[0]]);let d={id:o.id,position:o.position,options:o};if(o.scale==="sqrt"){let g=M=>Math.sign(M)*Math.sqrt(Math.abs(M)),A=o.nice===!1?[c,l]:ut(c,l,o.ticks),E=o.min??A[0],b=o.max??A[A.length-1],N=ot([g(E),g(b)],t),L=M=>N(g(M)),w=ut(E,b,o.ticks).filter(M=>M>=E-1e-9&&M<=b+1e-9);return{...d,scale:L,domain:[E,b],format:s,ticks:(w.length>=2?w:[E,b]).map(M=>({pos:i(L(M)),label:s(M)})),zero:i(L(Math.min(Math.max(0,E),b)))}}if(o.scale==="log"){let g=Math.max(c,Number.EPSILON),A=Math.max(l,g),E=is(g,A),b=[Math.log10(g),Math.log10(A)],N=ot(b,t),L=w=>N(Math.log10(Math.max(w,Number.EPSILON)));return{...d,scale:L,domain:b,format:s,ticks:E.map(w=>({pos:i(L(w)),label:s(w)})),zero:i(t[0])}}let u=ut(c,l,o.ticks),h=[o.min??(o.nice===!1?c:u[0]),o.max??(o.nice===!1?l:u[u.length-1])],f=ot(h,t),x=u.filter(g=>g>=h[0]-1e-9&&g<=h[1]+1e-9),v=(x.length>=2?x:[h[0],h[1]]).map(g=>({pos:i(f(g)),label:s(g)}));return{...d,scale:f,domain:h,format:s,ticks:v,zero:i(f(Math.min(Math.max(0,h[0]),h[1])))}}var Vr=([e,n],t)=>Math.max(me.left,ut(e,n).reduce((r,a)=>Math.max(r,t(a).length),0)*ue+14),Rn=e=>e?.grid!==!1;function Re(e,n){if(e.length<2)return e;let t=e.reduce((a,o)=>Math.max(a,o.label.length),0)*ue+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((a,o)=>o%r===0)}var yr=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function oe(e,n,t,r){let a=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!a)return null;let{width:o,height:s}=le(e,t,r),c=a==="error"?e.error:a==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return a==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:4}),l.push({kind:"text",part:`state-${a}`,x:i(o/2),y:i(s/2),text:c,anchor:"middle",baseline:"middle",fill:a==="error"?"var(--skdx-color-text-danger)":Y.label}),{...de(e,o,s),shapes:l,tooltip:!1}}var Hr=(e,n,t)=>{let r=n.length*ue/2;return e+r>t?"end":e-r<0?"start":"middle"};function Ze(e,n={}){let{plot:t,xTicks:r,yTicks:a,baseline:o}=e,s=t.x+t.width,c=t.y+t.height,l=[],d=n.grid??!0,u=(v,g)=>g?{kind:"line",part:"grid",x1:v.pos,x2:v.pos,y1:t.y,y2:c,stroke:Y.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:v.pos,y2:v.pos,stroke:Y.grid},h=n.x?.tickRotation??0,f=(v,g,A,E)=>h?X(v,g,A,{part:E,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):X(v,g,A,{part:E,anchor:Hr(v,A,e.width)}),x=(v,g,A,E,b)=>{for(let N of v)l.push(g==="x"?{kind:"line",part:"tick",x1:N.pos,x2:N.pos,y1:A,y2:i(A+E*b),stroke:Y.axis}:{kind:"line",part:"tick",x1:A,x2:i(A+E*b),y1:N.pos,y2:N.pos,stroke:Y.axis})};if(n.categoryGrid)for(let v of r)l.push(u(v,!n.horizontal));if(n.horizontal){let v=n.axes??[{ticks:a,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let g of a)l.push(u(g,!0));v[0]?.showLine!==!1&&l.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:c,stroke:Y.axis});for(let g of v){let A=g.position==="top"||g.position==="right",E=i(A?t.y-g.offset:c+g.offset),b=A||g.offset>0;g.showLine&&b&&l.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:E,y2:E,stroke:Y.axis}),g.showTicks&&x(g.ticks,"x",E,A?-1:1,g.tickSize??4);let N=i(A?E-8:E+20);for(let L of g.ticks)l.push(A?X(L.pos,N,L.label,{part:"x-label-top",anchor:Hr(L.pos,L.label,e.width)}):f(L.pos,N,L.label,"x-label"));g.label&&l.push(b?X(4,N,g.label,{part:"axis-title",anchor:"start",baseline:A?void 0:"middle"}):X(4,t.y-6,g.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&l.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:c,stroke:Y.axis}),n.x?.showTicks&&x(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let g of r)l.push(n.rtl?X(s+8,g.pos,g.label,{part:"y-label",anchor:"start",baseline:"middle"}):X(t.x-8,g.pos,g.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let g of a)l.push(u(g,!1));n.y?.showLine!==!1&&l.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:Y.axis});let v=n.axes??[{ticks:a,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let g of v){let A=g.position==="left",E=A?t.x-g.offset:s+g.offset,b=A?"y-label":"y-label-right";g.showLine&&l.push({kind:"line",part:"axis",x1:i(E),x2:i(E),y1:t.y,y2:c,stroke:Y.axis}),g.showTicks&&x(g.ticks,"y",i(E),A?-1:1,g.tickSize??4);for(let N of g.ticks)l.push(X(i(A?E-8:E+8),N.pos,N.label,{part:b,anchor:A?"end":"start",baseline:"middle"}));g.label&&l.push(X(i(A?g.offset===0?4:Math.max(4,E-40):g.offset===0?e.width-4:Math.min(e.width-4,E+40)),t.y-6,g.label,{part:"axis-title",anchor:A?"start":"end"}))}n.x?.showTicks&&x(r,"x",c,1,n.x.tickSize??4);for(let g of r)l.push(f(g.pos,c+(h?12:20),g.label,"x-label"))}return n.xLabel&&l.push(X(i(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&l.push(X(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),l}var X=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:Y.label,...r}),zt=(e,n,t,r,a,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:a,item:o});function Vt(e,n){let t=[],{plot:r}=n,a=r.x+r.width,o=r.y+r.height,s=l=>Math.max(r.x,Math.min(a,l)),c=l=>Math.max(r.y,Math.min(o,l));for(let l of e??[]){let d=l.color??St(l.variant),u=l.color??ca(l.variant),h={part:"reference-label",fill:u},f=n.horizontal===!0;if("y"in l){let x=i(n.y(l.y,l.axis??"left"));if(f){let v=s(x);t.push(...hs(v,r.y,o,d,l.label,h))}else{let v=c(x);t.push(...us(r.x,a,v,d,l.label,h))}}else if("x"in l){let x=n.x(l.x);if(x===void 0)continue;f?t.push(...us(r.x,a,c(i(x)),d,l.label,h)):t.push(...hs(s(i(x)),r.y,o,d,l.label,h))}else if("y1"in l){let x=i(n.y(l.y1,l.axis??"left")),v=i(n.y(l.y2,l.axis??"left"));f?t.push(...ps(s(Math.min(x,v)),s(Math.max(x,v)),r,d,l.label,u)):t.push(...fs(c(Math.min(x,v)),c(Math.max(x,v)),r,d,l.label,u))}else{let x=n.x(l.x1),v=n.x(l.x2);if(x===void 0||v===void 0)continue;let g=i(Math.min(x,v)),A=i(Math.max(x,v));f?t.push(...fs(c(g),c(A),r,d,l.label,u)):t.push(...ps(s(g),s(A),r,d,l.label,u))}}return t}function us(e,n,t,r,a,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:a};return a?[s,X(n-4,t-5,a,{...o,anchor:"end"})]:[s]}function hs(e,n,t,r,a,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:a};return a?[s,X(e+4,n+10,a,{...o,anchor:"start"})]:[s]}function fs(e,n,t,r,a,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:i(Math.max(0,n-e)),fill:r,opacity:.12,title:a};return a?[s,X(t.x+t.width-4,e+12,a,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function ps(e,n,t,r,a,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:i(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:a};return a?[s,X(e+4,t.y+12,a,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function En(e,n){let t=[],{plot:r}=n,a=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let c=s.color??St(s.variant),l=s.color??ca(s.variant),d=(v,g,A)=>{let E=n.x(v);if(E===void 0)return;let b=n.y(g,A??"left");return n.horizontal?{x:i(b),y:i(E)}:{x:i(E),y:i(b)}},u=s.id??s.label,h=v=>({label:v,id:u,name:s.label});if(s.type==="line"||s.type==="band"){let{type:v,id:g,...A}=s;t.push(...Vt([A],n));continue}if(s.type==="rect"){let v=d(s.x1,s.y1,s.axis),g=d(s.x2,s.y2,s.axis);if(!v||!g)continue;let A=Math.max(r.x,Math.min(v.x,g.x)),E=Math.max(r.y,Math.min(v.y,g.y)),b=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:i(A),y:i(E),width:i(Math.max(0,Math.min(a,Math.max(v.x,g.x))-A)),height:i(Math.max(0,Math.min(o,Math.max(v.y,g.y))-E)),fill:c,opacity:.12,stroke:c,title:b||void 0,item:b?h(b):void 0}),s.label&&t.push(X(i(A+4),i(E+12),s.label,{part:"annotation-label",fill:l}));continue}let f=d(s.x,s.y,s.axis);if(!f)continue;if(s.type==="text"){t.push(X(f.x,f.y,s.text,{part:"annotation-text",fill:l,anchor:"middle",baseline:"middle",title:s.label}));continue}let x=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:f.x,cy:f.y,r:5,fill:c,stroke:"var(--skdx-color-surface-default)",title:x,item:h(x)}),s.type==="callout"&&s.label){let[v,g]=s.offset??[16,-16],A=i(Math.max(r.x,Math.min(a,f.x+v))),E=i(Math.max(r.y,Math.min(o,f.y+g)));t.push({kind:"line",part:"annotation-leader",x1:f.x,y1:f.y,x2:A,y2:E,stroke:c},X(A,E,s.label,{part:"annotation-label",fill:l,anchor:v>=0?"start":"end",baseline:"middle"}))}}return t}var ha=2e3;function Mi(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:ha}:typeof e=="string"?{strategy:e,threshold:ha}:{strategy:e.strategy,threshold:e.threshold??ha}}function wi(e,n){let t=e.length;if(n>=t||n<3)return e.map((c,l)=>l);let r=[0],a=[],o=(t-2)/(n-2),s=0;for(let c=0;c<n-2;c++){let l=Math.floor((c+1)*o)+1,d=Math.min(t-1,Math.floor((c+2)*o)+1),u=0,h=0,f=0;for(let N=l;N<d;N++){let L=e[N];H(L)&&(u+=N,h+=L,f++)}u=f?u/f:(l+d)/2,h=f?h/f:0;let x=Math.floor(c*o)+1,v=Math.min(t-1,Math.floor((c+1)*o)+1),g=e[s],A=H(g)?g:0,E=-1,b=-1;for(let N=x;N<v;N++){let L=e[N];if(!H(L)){a.push(N);continue}let w=Math.abs((s-u)*(L-A)-(s-N)*(h-A));w>b&&(b=w,E=N)}E<0&&(E=x),r.push(E),s=E}return r.push(t-1),a.length?[...new Set([...r,...a])].sort((c,l)=>c-l):r}function $i(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,c)=>c);let a=[],o=t/r;for(let s=0;s<r;s++){let c=Math.floor(s*o),l=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1;for(let h=c;h<l;h++){let f=e[h];if(!H(f)){a.push(h);continue}(d<0||f<e[d])&&(d=h),(u<0||f>e[u])&&(u=h)}d>=0&&a.push(Math.min(d,u)),u>=0&&u!==d&&a.push(Math.max(d,u))}return[...new Set(a)].sort((s,c)=>s-c)}function ki(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,c)=>c);let a=[],o=t/r;for(let s=0;s<r;s++){let c=Math.floor(s*o),l=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1,h=-1,f=-1;for(let x=c;x<l;x++){let v=e[x];if(!H(v)){a.push(x);continue}h<0&&(h=x),f=x,(d<0||v<e[d])&&(d=x),(u<0||v>e[u])&&(u=x)}for(let x of[h,d,u,f])x>=0&&a.push(x)}return[...new Set(a)].sort((s,c)=>s-c)}function bs(e,n,t){let r=Mi(t);if(!r||n<=r.threshold||e.length===0)return;let a=r.strategy==="minmax"?$i:r.strategy==="m4"?ki:wi,o=new Set;for(let s of e)for(let c of a(s.slice(0,n),r.threshold))o.add(c);return[...o].sort((s,c)=>s-c)}var vr=e=>Math.max(0,Math.min(1,e));function gs(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],a=r.length===3?r.split("").map(o=>o+o).join(""):r;return[0,2,4].map(o=>parseInt(a.slice(o,o+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function xs(e,n){if(e.length===0)return Y.axis;if(e.length===1)return e[0];let t=vr(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),a=t-r,o=gs(e[r]),s=gs(e[r+1]);if(!o||!s)return e[Math.round(t)];let c=l=>Math.round(o[l]+(s[l]-o[l])*a);return`rgb(${c(0)}, ${c(1)}, ${c(2)})`}var ys=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(vr(e)*n))/(n-1):vr(e);function Nt(e,n,t,r=Y.negative,a=String){let[o,s]=ve(n),c=e??{type:"sequential"},l=A=>i(.15+.85*A);if(c.type==="threshold"){let{thresholds:A,colors:E,labels:b}=c,N=w=>{if(typeof w!="number"||!Number.isFinite(w))return;let M=0;for(;M<A.length&&w>=A[M];)M++;return{fill:E[Math.min(M,E.length-1)]??t,opacity:1}},L=E.map((w,M)=>({fill:w,opacity:1,label:b?.[M]??(M===0?`< ${a(A[0]??0)}`:M===A.length?`\u2265 ${a(A[M-1])}`:`${a(A[M-1])} \u2013 ${a(A[M])}`)}));return{color:N,domain:[o,s],swatches:L,kind:"threshold"}}if(c.type==="ordinal"){let A=c.colors?.length?c.colors:[t];return{color:b=>typeof b=="number"&&Number.isFinite(b)?{fill:A[Math.abs(Math.round(b))%A.length],opacity:1}:void 0,domain:[o,s],swatches:A.map((b,N)=>({fill:b,opacity:1,label:String(N)})),kind:"ordinal"}}if(c.type==="diverging"){let[A,E,b]=c.domain??[-Math.max(Math.abs(o),Math.abs(s)),0,Math.max(Math.abs(o),Math.abs(s))],N=c.colors,L=I=>I<E?.5*(I-A)/Math.max(1e-12,E-A):.5+.5*(I-E)/Math.max(1e-12,b-E),w=I=>{let D=ys(c.reversed?1-vr(I):I,c.steps);if(N&&N.length>=2)return{fill:xs(N,D),opacity:1};let F=D<.5?r:t,p=Math.abs(D-.5)*2;return{fill:F,opacity:l(p)}},M=I=>typeof I=="number"&&Number.isFinite(I)?w(L(I)):void 0,R=c.steps??5,C=Array.from({length:R},(I,D)=>{let F=R===1?.5:D/(R-1),p=F<.5?A+(E-A)*(F*2):E+(b-E)*((F-.5)*2);return{...w(F),label:a(p)}});return{color:M,domain:[A,b],swatches:C,kind:"diverging"}}let[d,u]=c.domain??[o,s],h=c.colors,f=A=>{let E=ys(c.reversed?1-vr(A):A,c.steps);return h&&h.length>=2?{fill:xs(h,E),opacity:1}:{fill:h?.[0]??t,opacity:l(E)}},x=A=>typeof A!="number"||!Number.isFinite(A)?void 0:f(u===d?1:(A-d)/(u-d)),v=c.steps??5,g=Array.from({length:v},(A,E)=>{let b=v===1?1:E/(v-1);return{...f(b),label:a(d+(u-d)*b)}});return{color:x,domain:[d,u],swatches:g,kind:"sequential"}}var Ii=34,Ti=72;function Dn(e){if(!e)return{bottom:0,right:0,options:{}};let n=e===!0?{}:e;return n.orientation==="vertical"?{bottom:0,right:Ti,options:n}:{bottom:Ii,right:0,options:n}}function Qn(e,n,t){let r=typeof t=="string"?{title:t}:t??{},a=r.title,o=e.swatches;if(o.length===0||n.width<=0)return[];if(r.orientation==="vertical"){let u=Math.max(0,n.height-(a?16:0)),h=Math.min(16,u/o.length),f=n.y+(a?16:0),x=o.map((g,A)=>({kind:"rect",part:"color-legend-swatch",x:i(n.x),y:i(f+A*h),width:10,height:i(h),fill:g.fill,opacity:g.opacity,title:g.label})),v=h>=12?1:2;return o.forEach((g,A)=>{A%v!==0&&A!==o.length-1||x.push({kind:"text",part:"color-legend-label",x:i(n.x+14),y:i(f+(A+.5)*h),text:g.label,baseline:"middle",fill:Y.label})}),a&&x.push({kind:"text",part:"color-legend-title",x:i(n.x),y:i(n.y+6),text:a,baseline:"middle",fill:Y.label}),x}let s=Math.min(n.width/o.length,96),c=n.x+(n.width-s*o.length)/2,l=o.map((u,h)=>({kind:"rect",part:"color-legend-swatch",x:i(c+h*s),y:i(n.y),width:i(s),height:10,fill:u.fill,opacity:u.opacity,title:u.label})),d=e.kind==="threshold"?1:Math.max(1,Math.ceil(o.length*7*ue/Math.max(1,s*o.length)));return o.forEach((u,h)=>{h%d!==0&&h!==o.length-1||l.push({kind:"text",part:"color-legend-label",x:i(c+(h+.5)*s),y:i(n.y+22),text:u.label,anchor:"middle",fill:Y.label})}),a&&l.push({kind:"text",part:"color-legend-title",x:i(c-6),y:i(n.y+5),text:a,anchor:"end",baseline:"middle",fill:Y.label}),l}var Ai=1e4,Ci=e=>Array.isArray(e)?{x:e[0],y:e[1],size:e[2],label:void 0,id:void 0,color:void 0,value:void 0}:{x:e.x,y:e.y,size:e.size,label:e.label,id:e.id,color:e.color,value:e.value};function fa(e,n,t,r,a,o,s,c){if(r==="circle")return{...zt(e,n,t,a,o,s),part:c};let l=r==="square"?`M${i(e-t)} ${i(n-t)}h${i(2*t)}v${i(2*t)}h${i(-2*t)}Z`:r==="diamond"?`M${i(e)} ${i(n-t*1.3)}L${i(e+t*1.3)} ${i(n)}L${i(e)} ${i(n+t*1.3)}L${i(e-t*1.3)} ${i(n)}Z`:`M${i(e)} ${i(n-t*1.2)}L${i(e+t*1.15)} ${i(n+t*.9)}L${i(e-t*1.15)} ${i(n+t*.9)}Z`;return{kind:"path",part:c,d:l,fill:a,title:o,item:s}}function pa(e,n){let t=[],r=e.series.map((j,_)=>({name:j.name,id:j.id,symbol:j.symbol??"circle",color:te(e,_,j.color),data:be(e,j.name)?[]:j.data.flatMap((S,V)=>{let P=Ci(S);return H(P.x)&&H(P.y)?[{...P,index:V}]:[]})})),a=e.sampling==="auto"?Ai:typeof e.sampling=="object"?e.sampling.threshold:1/0,o=r.reduce((j,_)=>j+_.data.length,0),s=o>a?Math.ceil(o/a):1;s>1&&t.push({code:"sampled",severity:"warning",message:`${o} points exceed the sampling threshold of ${a}; every ${s}th point is drawn.`});let c=s>1?r.map(j=>({...j,data:j.data.filter((_,S)=>S%s===0)})):r,l=c.flatMap(j=>j.data),d=oe(e,l.length===0);if(d)return{...d,issues:t};let{width:u,height:h}=le(e),f=e.colorScale?Dn(e.colorLegend):{bottom:0,right:0,options:{}},x=ke(u,h,{...me,top:me.top+ce(e)+(e.yAxis?.label?12:0),right:me.right+f.right,bottom:me.bottom+(e.xAxis?.label?14:0)+f.bottom}),v=e.markerSize??3,g=Math.max(0,e.hitRadius??0),A=Math.max(0,e.jitter??0),E=new Map,b=e.colorScale?Nt(e.colorScale,l.map(j=>j.value),te(e,0),void 0,re(e.format)):void 0,N=He(Pt(l.map(j=>j.x),!1),[x.x,x.x+x.width],e.xAxis??{},e.format),L=He(Pt(l.map(j=>j.y),!1),[x.y+x.height,x.y],e.yAxis??{},e.format),w=ve(l.map(j=>j.size)),M=e.series.map((j,_)=>({name:j.name,color:te(e,_,j.color)})),R=de(e,u,h,M),C=[],I=[],D=[],F=[];for(let j of c){let _=j.data.some(S=>S.size!==void 0);for(let S of j.data){let V=S.index,P=n.describe(j.name,S,N,L),U=_?n.radius(S.size,w):v,k=i(N.scale(S.x)),B=i(L.scale(S.y));if(A>0){let Z=`${Math.round(k)},${Math.round(B)}`,K=E.get(Z)??0;if(E.set(Z,K+1),K>0){let ne=K*2.399963;k=i(k+A*Math.cos(ne)),B=i(B+A*Math.sin(ne))}}let z=b?.color(S.value),W={label:P,id:S.id,series:j.name,seriesId:j.id??j.name,name:S.label,index:V,value:S.y},J=S.color??z?.fill??j.color;if(C.push(fa(k,B,i(U),j.symbol,J,P,W,_?n.part:"point")),g>0&&C.push({kind:"circle",part:"hit",cx:k,cy:B,r:i(U+g),fill:J,opacity:0,title:P,item:W}),e.labels&&S.label){let Z=S.label.length*ue,K=k-Z/2,ne=B-U-4;F.some(ee=>Math.abs(ee.y-ne)<12&&K<ee.x+ee.w+4&&K+Z+4>ee.x)||(F.push({x:K,y:ne,w:Z}),I.push(X(k,i(ne),S.label,{part:"point-label",anchor:"middle",fill:"var(--skdx-color-text-default)"})))}}if(e.trendline&&j.data.length>=2){let S=e.trendline===!0?"linear":e.trendline,V=Li(j.data.map(P=>[P.x,P.y]),S);if(V){let[P,U]=N.domain,k=`${j.name} trend${S==="linear"?"":` (${S})`}: r\xB2 ${V.r2.toFixed(2)}`,B=j.color;if(S==="linear")D.push({kind:"line",part:"trendline",x1:i(N.scale(P)),y1:i(L.scale(V.predict(P))),x2:i(N.scale(U)),y2:i(L.scale(V.predict(U))),stroke:B,dash:"5 4",strokeWidth:1.5,title:k});else{let z=Array.from({length:40},(W,J)=>P+(U-P)*J/39).map(W=>({v:W,p:V.predict(W)})).filter(({p:W})=>Number.isFinite(W)).map(({v:W,p:J})=>({x:i(N.scale(W)),y:i(L.scale(J))}));z.length>1&&D.push({kind:"path",part:"trendline",d:st(z),stroke:B,dash:"5 4",strokeWidth:1.5,title:k})}}}}let p={...R,plot:x,xTicks:N.ticks,yTicks:L.ticks,baseline:L.zero},O={plot:x,x:j=>N.scale(We(j)),y:j=>L.scale(j)},y=Vt(e.references,O),$=b&&(f.bottom||f.right)?Qn(b,f.right?{x:x.x+x.width+12,y:x.y,width:f.right,height:x.height}:{x:x.x,y:h-f.bottom+8,width:x.width,height:f.bottom},f.options):[],G=n.opacity;return{...R,shapes:[...Ze(p,{xLabel:e.xAxis?.label,yLabel:e.yAxis?.label}),...y,...G!==void 0&&C.some(j=>j.part===n.part)?C.map(j=>(j.kind==="circle"||j.kind==="path")&&j.part!=="hit"?{...j,opacity:G}:j):C,...D,...I,...En(e.annotations,O),...$,...R.shapes],issues:t}}function Li(e,n="linear"){let t;if(n==="polynomial"){let l=0,d=0,u=0,h=0,f=0,x=0,v=0,g=0;for(let[M,R]of e)l+=1,d+=M,u+=M*M,h+=M**3,f+=M**4,x+=R,v+=M*R,g+=M*M*R;let A=M=>M[0]*(M[4]*M[8]-M[5]*M[7])-M[1]*(M[3]*M[8]-M[5]*M[6])+M[2]*(M[3]*M[7]-M[4]*M[6]),b=A([f,h,u,h,u,d,u,d,l]);if(Math.abs(b)<1e-12)return;let N=A([g,h,u,v,u,d,x,d,l])/b,L=A([f,g,u,h,v,d,u,x,l])/b,w=A([f,h,g,h,u,v,u,d,x])/b;t=M=>N*M*M+L*M+w}else{let l=n==="logarithmic"||n==="power"?Math.log:x=>x,d=n==="exponential"||n==="power"?Math.log:x=>x,u=e.filter(([x,v])=>Number.isFinite(l(x))&&Number.isFinite(d(v))),h=Oi(u.map(([x,v])=>[l(x),d(v)]));if(!h)return;let f=n==="exponential"||n==="power"?Math.exp:x=>x;t=x=>f(h.intercept+h.slope*l(x))}let r=t,a=e.filter(([l])=>Number.isFinite(r(l)));if(a.length===0)return;let o=a.reduce((l,[,d])=>l+d,0)/a.length,s=0,c=0;for(let[l,d]of a)s+=(d-r(l))**2,c+=(d-o)**2;return{predict:r,r2:c===0?1:Math.max(0,1-s/c)}}function ba(e){let[n,t]=e.sizeRange??[3,18];return pa(e,{part:"bubble",opacity:.7,radius:(r,[a,o])=>H(r)?o===a?(n+t)/2:n+Math.sqrt((r-a)/(o-a))*(t-n):3,describe:(r,a,o,s)=>`${r}${a.label?` ${a.label}`:""}: ${o.format(a.x)}, ${s.format(a.y)}${H(a.size)?` (${s.format(a.size)})`:""}`})}function Oi(e){let n=e.length,t=e.reduce((d,u)=>d+u[0],0)/n,r=e.reduce((d,u)=>d+u[1],0)/n,a=0,o=0,s=0;for(let[d,u]of e)a+=(d-t)**2,o+=(d-t)*(u-r),s+=(u-r)**2;if(a===0)return;let c=o/a,l=s===0?1:o*o/(a*s);return{slope:c,intercept:r-c*t,r2:l}}var Si=e=>{let n=0;return e.map(t=>H(t)?n+=t:null)},zi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&H(n)&&H(r)?n-r:null}),Ni=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&H(n)&&H(r)&&r!==0?(n-r)/Math.abs(r):null});function ga(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,a)=>{if(a<t-1)return null;let o=0;for(let s=a-t+1;s<=a;s++){let c=e[s];if(!H(c))return null;o+=c}return o/t})}function vs(e,n){let t=Math.max(1,Math.floor(n)),r=2/(t+1),a,o=0,s=0;return e.map(c=>H(c)?a===void 0?(o+=c,s++,s<t?null:(a=o/t,a)):(a=r*c+(1-r)*a,a):a??null)}function Ri(e,n="max"){let t=0;for(let r of e)H(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>H(r)?t===0?0:r/t:null)}function Ei(e,n="desc"){let t=e.filter(H).sort((r,a)=>n==="asc"?r-a:a-r);return e.map(r=>H(r)?t.indexOf(r)+1:null)}var Di=(e,n=-1/0,t=1/0)=>e.map(r=>H(r)&&r>=n&&r<=t?r:null),Bi=(e,n="asc")=>[...e].sort((t,r)=>H(t)?H(r)?n==="asc"?t-r:r-t:-1:H(r)?1:0);function Fi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),a=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(H);if(s.length===0){a.push(null);continue}let c=s.reduce((l,d)=>l+d,0);a.push(t==="sum"?c:t==="mean"?c/s.length:t==="min"?Math.min(...s):Math.max(...s))}return a}function Pi(e,n={}){let t=e.filter(H),r=Kn(t,n);return{edges:r,counts:Xn(t,r).map(a=>a.count)}}function xa(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=Si(t);break;case"difference":t=zi(t);break;case"percentageChange":t=Ni(t);break;case"movingAverage":t=ga(t,r.window);break;case"normalize":t=Ri(t,r.to);break;case"rank":t=Ei(t,r.order);break;case"filter":t=Di(t,r.min,r.max);break;case"sort":t=Bi(t,r.order);break;case"aggregate":t=Fi(t,r.every,r.method);break;case"bin":t=Pi(t,r).counts;break}return t}var Vi=100,Hi=2e3,Ms=32,ws=28,jr=e=>e.position==="right"||e.position==="top";function _i(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((a,o)=>({...a,id:a.id??(o===0?"left":o===1?"right":String(o)),position:a.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(a=>a.id==="right"||jr(a));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(a=>a.axis==="right")&&t.push({id:"right",position:"right"}),t}function ks(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(jr))?.id:e.find(r=>r.id===n)?.id}var _r=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function Ht(e,n){let t=re(e.format),{series:r,categories:a,issues:o,axes:s}=Gi(e,n,t),c=e.direction==="rtl",l=e.baseline??0,d=Math.max(a.length,...r.map(T=>Math.max(T.data.length,T.low.length))),u=r.every(T=>Fe(T.data).length===0&&Fe(T.high).length===0),h=oe(e,u);if(h)return{...h,issues:o};let f=e.xAxis?.type??"category",x=f!=="category"&&a.length>0&&a.every(T=>typeof T!="string"||f==="time"&&H(We(T))),v=x?a.map(We):[],[g,A]=ve(v),E=e.xAxis?.format??(f==="time"?{style:A-g<2*864e5?"time":"date"}:void 0),b=Array.from({length:d},(T,ae)=>{let he=a[ae];return he===void 0?String(ae+1):qt(he,E)}),N=ji(e.zoom,d),L=Array.from({length:N.end-N.start},(T,ae)=>N.start+ae),w=e.orientation==="horizontal",R=r.map(T=>({...T,hidden:T.hidden||w&&!_r(T)})).filter(T=>!T.hidden),C=R.some(T=>!_r(T))?bs(R.filter(T=>!_r(T)).map(T=>L.map(ae=>(T.kind==="range"?T.high[ae]:T.data[ae])??null)),L.length,e.sampling):void 0,I=C?C.map(T=>L[T]):L,D=e.stacked==="percent"||e.stackOffset==="expand",F=e.stackOffset??"zero",p=new Map,O=new Map,y=new Map;for(let T of R)T.stack!==void 0&&T.kind!=="range"&&y.set(T.stack,[...y.get(T.stack)??[],T]);for(let T of y.values()){let ae=new Array(d).fill(l),he=new Array(d).fill(l),Ae=new Array(d).fill(0);if(D)for(let $e of T)$e.data.forEach((ye,Ce)=>{H(ye)&&(Ae[Ce]=Ae[Ce]+Math.abs(ye))});for(let $e of T){let ye=[],Ce=[];for(let we=0;we<d;we++){let Te=$e.data[we];if(!H(Te)){ye.push(null),Ce.push(null);continue}let xe=Ae[we],fe=D?xe>0?Te/xe:0:Te,Le=fe>=0?ae:he;ye.push(Le[we]),Le[we]=Le[we]+fe,Ce.push(Le[we])}p.set($e,ye),O.set($e,Ce)}if(F==="silhouette"||F==="wiggle"){let $e=new Array(d).fill(0);if(F==="silhouette")for(let ye=0;ye<d;ye++)$e[ye]=-(ae[ye]-l)/2;else{let ye=0;for(let Ce=0;Ce<d;Ce++){let we=T.length,Te=0;for(let fe=0;fe<we;fe++){let Le=T[fe],ze=Le.data[Ce],De=Le.data[Ce-1],mt=Ce>0&&H(ze)&&H(De)?ze-De:0;Te+=(we-fe-.5)*mt}let xe=ae[Ce]-l;ye=Ce===0?-xe/2:ye-(xe>0?Te/Math.max(1,we):0),$e[Ce]=ye}}for(let ye of T){let Ce=p.get(ye),we=O.get(ye);for(let Te=0;Te<d;Te++){let xe=Ce[Te],fe=we[Te];H(xe)&&(Ce[Te]=xe+$e[Te]),H(fe)&&(we[Te]=fe+$e[Te])}}}}let $=T=>T.kind==="range"?{from:T.low,to:T.high}:{from:p.get(T)??new Array(d).fill(l),to:O.get(T)??T.data},G=T=>{let ae=[],he=!1;for(let ye of R){if(ye.axis!==T)continue;let{from:Ce,to:we}=$(ye);for(let Te of I){let xe=we[Te];if(H(xe)&&ae.push(xe),ye.kind==="range"||ye.stack!==void 0){let fe=Ce[Te];H(fe)&&ae.push(fe)}}if(ye.errors)for(let Te of I){let xe=$s(ye.data[Te],ye.errors[Te]);xe&&ae.push(xe[0],xe[1])}(ye.kind==="bar"||ye.kind==="area")&&F==="zero"&&(he=!0)}let[Ae,$e]=ve(ae);return he?[Math.min(l,Ae),Math.max(l,$e)]:[Ae,$e]},{width:j,height:_}=le(e),S=e.brush?Ms+ws:0,V=I.reduce((T,ae)=>Math.max(T,b[ae].length),0)*ue,P=D?{style:"percent"}:void 0,U=T=>{if(T.scale==="log")return me.left;let[ae,he]=G(T.id),Ae=re(T.format??P??e.format);return Vr([T.min??ae,T.max??he],Ae)+(T.showTicks?T.tickSize??4:0)},k=T=>w?jr(T)?"top":"bottom":jr(T)!==c?"right":"left",B=T=>w?24+(T.showTicks?T.tickSize??4:0):U(T),z=new Set(R.map(T=>T.axis)),W=s.filter(T=>z.has(T.id)||s.length>1),J=new Map,Z={left:0,right:0,top:0,bottom:0};for(let T of W){let ae=k(T);J.set(T.id,Z[ae]),Z[ae]+=B(T)}let K=W.find(T=>k(T)==="bottom"),ne={top:me.top+ce(e)+(s.some(T=>T.label)?12:0)+Z.top,right:w?c?Math.max(me.left,V+16):me.right:Math.max(me.right,Z.right),bottom:me.bottom+S+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+Z.bottom-(K?B(K):0),left:w?c?me.right:Math.max(me.left,V+16):Math.max(me.left,Z.left)},ee=ke(j,_,ne),Me=w?c?[ee.x+ee.width,ee.x]:[ee.x,ee.x+ee.width]:[ee.y+ee.height,ee.y],pe=w?[ee.y,ee.y+ee.height]:c?[ee.x+ee.width,ee.x]:[ee.x,ee.x+ee.width],je=new Map(s.map(T=>[T.id,{...He(G(T.id),Me,{format:P,...T},e.format),position:k(T),offset:J.get(T.id)??0}])),q=s[0]?.id,ie=je.get(q),Oe=T=>je.get(ks(s,T)??q)??ie,Ye=(T,ae)=>Oe(ae).scale(T),kn=T=>i(T.scale(Math.min(Math.max(l,Math.min(...T.domain)),Math.max(...T.domain)))),gn=Ve(I.length,pe,e.barGap),In=I.map(T=>v[T]),Tn=[...In].sort((T,ae)=>T-ae),sn=1/0;for(let T=1;T<Tn.length;T++)sn=Math.min(sn,Tn[T]-Tn[T-1]);let[ln,An]=ve(In),Ge=sn===1/0?Math.max(1,Math.abs(An)*.05||1):sn/2,cn=ot([ln-Ge,An+Ge],pe),xn=T=>i(x?cn(In[T]):gn.center(T)),dr=x?Math.abs(cn(ln+(sn===1/0?Ge:sn))-cn(ln))*.8:gn.bandwidth,Zo=T=>x?xn(T)-dr/2:gn.start(T),ri=x?(f==="time"?Yn(ln-Ge,An+Ge):ut(ln-Ge,An+Ge)).filter(T=>T>=ln-Ge&&T<=An+Ge).map(T=>({pos:i(cn(T)),label:qt(T,E)})):Re(I.map((T,ae)=>({pos:xn(ae),label:b[T]})),w?1/0:ee.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),Qr={...de(e,j,_,r.map(T=>({name:T.name,color:T.color}))),plot:ee,xTicks:ri,yTicks:w?Re(ie.ticks,ee.width):ie.ticks,baseline:kn(ie)},ai=s[0],qo=Ze(Qr,{horizontal:w,rtl:c,axes:W.map(T=>{let ae=je.get(T.id);return{ticks:w?Re(ae.ticks,ee.width):ae.ticks,position:ae.position,offset:ae.offset??0,label:T.label,showLine:T.showLine,showTicks:T.showTicks,tickSize:T.tickSize}}),xLabel:e.xAxis?.label,grid:Rn(ai),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),oi=T=>{if(typeof T=="number"&&a.every(he=>typeof he=="string"))return T;let ae=typeof T=="string"?T:We(T);for(let he=0;he<d;he++){let Ae=a[he];if(Ae!==void 0&&(typeof ae=="string"?Ae===ae||b[he]===ae:We(Ae)===ae))return he}},Uo={plot:ee,horizontal:w,x:T=>{if(x&&(typeof T!="string"||H(We(T))))return cn(We(T));let ae=oi(T),he=ae===void 0?-1:I.indexOf(ae);return he<0?void 0:gn.center(he)},y:(T,ae)=>Ye(T,ae)};qo.push(...Vt(e.references,Uo));let Jr=[],ea=new Map;for(let T of R){if(!_r(T))continue;let ae=T.stack??T,he=Jr.indexOf(ae);he<0&&(he=Jr.push(ae)-1),ea.set(T,he)}let Sr=dr/Math.max(1,Jr.length),Nn=Math.min(Sr,e.barWidth??1/0),Yo=(Sr-Nn)/2,ta=[],zr=[],na=[],ra=[],aa=[],Ko=[],Nr=[],Rr=T=>Oe(T.axis).format,oa=Math.max(0,e.minBarSize??0),si=(T,ae,he)=>{let Ae=Math.abs(ae-T);if(Ae>=oa)return[Math.min(T,ae),Ae];let ye=T+(w?he?1:-1:he?-1:1)*oa;return[Math.min(T,ye),oa]},mr=(T,ae,he,Ae)=>({label:Ae,series:T.name,seriesId:T.id??T.name,category:b[ae],index:ae,value:he}),Xo=(T,ae,he,Ae)=>{let $e=$s(Ae,T.errors?.[ae]);if(!$e)return;let ye=i(Ye($e[0],T.axis)),Ce=i(Ye($e[1],T.axis)),we=4,Te="var(--skdx-color-text-default)",xe=`${T.name}, ${b[ae]}: ${Rr(T)($e[0])} \u2013 ${Rr(T)($e[1])}`;Ko.push(w?{kind:"line",part:"error-bar",x1:ye,x2:Ce,y1:he,y2:he,stroke:Te,title:xe}:{kind:"line",part:"error-bar",x1:he,x2:he,y1:ye,y2:Ce,stroke:Te,title:xe},w?{kind:"line",part:"error-cap",x1:ye,x2:ye,y1:i(he-we),y2:i(he+we),stroke:Te}:{kind:"line",part:"error-cap",x1:i(he-we),x2:i(he+we),y1:ye,y2:ye,stroke:Te},w?{kind:"line",part:"error-cap",x1:Ce,x2:Ce,y1:i(he-we),y2:i(he+we),stroke:Te}:{kind:"line",part:"error-cap",x1:i(he-we),x2:i(he+we),y1:Ce,y2:Ce,stroke:Te})};for(let T of R){let{from:ae,to:he}=$(T),Ae=Rr(T),$e=I.length<=Hi;if(T.kind==="bar"){let xe="";I.forEach((fe,Le)=>{let ze=T.data[fe],De=ae[fe],mt=he[fe];if(!H(ze)||!H(De)||!H(mt))return;let Un=Ye(De,T.axis),Gn=Ye(mt,T.axis),[ur,hr]=si(Un,Gn,mt>=De),fr=Zo(Le)+ea.get(T)*Sr+Yo,Jo=i(w?ur:fr),es=i(w?fr:ur),sa=i(w?hr:Nn),ts=i(w?Nn:hr);if(!$e){xe+=`M${Jo} ${es}h${sa}v${ts}h${-sa}Z`;return}let ns=yr(T.name,b[fe],D?mt-De:ze,Ae);if(zr.push({kind:"rect",part:"bar",x:Jo,y:es,width:sa,height:ts,fill:T.color,rx:e.radius,title:ns,item:mr(T,fe,ze,ns)}),Xo(T,fe,i(fr+Nn/2),ze),e.labels){let rs=Ae(D?mt-De:ze);aa.push(w?X(i(Math.max(Un,Gn)+4),i(fr+Nn/2),rs,{baseline:"middle"}):X(i(fr+Nn/2),i(Math.min(Un,Gn)-4),rs,{anchor:"middle"}))}}),xe&&zr.push({kind:"path",part:"bars",d:xe,fill:T.color,title:T.name});continue}if(T.kind==="range"&&T.style==="bar"){I.forEach((xe,fe)=>{let Le=ae[xe],ze=he[xe];if(!H(Le)||!H(ze))return;let De=Ye(Math.min(Le,ze),T.axis),mt=Ye(Math.max(Le,ze),T.axis),Un=Zo(fe)+ea.get(T)*Sr+Yo,Gn=`${T.name}, ${b[xe]}: ${Ae(Math.min(Le,ze))} \u2013 ${Ae(Math.max(Le,ze))}`,ur=mr(T,xe,ze,Gn),hr=Math.max(1,Math.abs(mt-De));zr.push(w?{kind:"rect",part:"range",x:i(Math.min(De,mt)),y:i(Un),width:i(hr),height:i(Nn),fill:T.color,rx:e.radius,title:$e?Gn:void 0,item:ur}:{kind:"rect",part:"range",x:i(Un),y:i(Math.min(De,mt)),width:i(Nn),height:i(hr),fill:T.color,rx:e.radius,title:$e?Gn:void 0,item:ur})});continue}let ye=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,Ce=[],we=[];I.forEach((xe,fe)=>{let Le=ae[xe],ze=he[xe];if(!H(ze)||!H(Le)){!ye&&we.length&&(Ce.push(we),we=[]);return}we.push({x:xn(fe),y:i(Ye(ze,T.axis)),y0:i(Ye(Le,T.axis)),i:xe})}),we.length&&Ce.push(we);let Te=T.markers??I.length<=Vi;for(let xe of Ce){let fe=st(xe,T.curve);if(T.kind==="range"&&T.style==="line"){na.push({kind:"path",part:"range-high",d:fe,stroke:T.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:st(xe.map(Le=>({x:Le.x,y:Le.y0})),T.curve),stroke:T.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(T.kind==="range"){let Le=st([...xe].reverse().map(ze=>({x:ze.x,y:ze.y0})),T.curve);ta.push({kind:"path",part:"range",d:`${fe}L${Le.slice(1)}Z`,fill:T.color,fillOpacity:.2,title:T.name});continue}if(T.kind==="area"){let Le=kn(Oe(T.axis)),ze=T.stack!==void 0?st([...xe].reverse().map(mt=>({x:mt.x,y:mt.y0})),T.curve).slice(1):`${xe[xe.length-1]?.x} ${Le}L${xe[0]?.x} ${Le}`,De=`skdx-g-${T.index}`;T.gradient&&!Nr.some(mt=>mt.id===De)&&Nr.push({id:De,vertical:!0,stops:[{offset:0,color:T.color,opacity:T.fillOpacity},{offset:1,color:T.color,opacity:0}]}),ta.push({kind:"path",part:"area",d:`${fe}L${ze}Z`,fill:T.gradient?`url(#${De})`:T.color,fillOpacity:T.gradient?void 0:T.fillOpacity})}na.push({kind:"path",part:"line",d:fe,stroke:T.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:T.dash})}if(T.kind==="range"&&$e)for(let xe of Ce)for(let fe of xe){let Le=T.low[fe.i],ze=T.high[fe.i],De=`${T.name}, ${b[fe.i]}: ${Ae(Math.min(Le,ze))} \u2013 ${Ae(Math.max(Le,ze))}`;ra.push({...zt(fe.x,fe.y,.01,T.color,De,mr(T,fe.i,ze,De)),part:"anchor"})}if(T.kind!=="range")for(let xe of Ce)for(let fe of xe){if(!Te&&!$e&&!e.labels&&!T.errors)continue;let Le=T.data[fe.i],ze=D?he[fe.i]-ae[fe.i]:Le,De=yr(T.name,b[fe.i],ze,Ae);(Te||$e)&&ra.push(Te&&T.symbol!=="circle"?fa(fe.x,fe.y,T.markerSize,T.symbol,T.color,$e?De:void 0,mr(T,fe.i,Le,De),"point"):{...zt(fe.x,fe.y,Te?T.markerSize:.01,T.color,$e?De:void 0,mr(T,fe.i,Le,De)),part:Te?"point":"anchor"}),$e&&Xo(T,fe.i,w?fe.y:fe.x,he[fe.i]),e.labels&&aa.push(X(fe.x,fe.y-8,Ae(ze),{anchor:"middle"}))}}let Qo={plot:ee,xs:w?[]:I.map((T,ae)=>xn(ae)),rows:I.map(T=>[b[T],...R.map(ae=>{let he=Rr(ae);if(ae.kind==="range"){let $e=ae.low[T],ye=ae.high[T];return`${ae.name}: ${H($e)&&H(ye)?`${he($e)} \u2013 ${he(ye)}`:"\u2014"}`}let Ae=ae.data[T];return`${ae.name}: ${H(Ae)?he(D?(O.get(ae)?.[T]??0)-(p.get(ae)?.[T]??0):Ae):"\u2014"}`})]),count:d,zoom:N,crosshair:Br(e)},Er=[];if(e.brush&&!w){let T={x:ee.x,y:ee.y+ee.height+ws,width:ee.width,height:Ms},ae=R.find(Ae=>Ae.kind!=="range"),he={x:i(T.x+N.start/Math.max(1,d)*T.width),y:T.y,width:i((N.end-N.start)/Math.max(1,d)*T.width),height:T.height};if(Er.push({kind:"rect",part:"brush",x:T.x,y:T.y,width:T.width,height:T.height,fill:"var(--skdx-color-surface-sunken)",stroke:Y.grid}),ae){let Ae=Fe(ae.data),[$e,ye]=ve(Ae),Ce=d>1?T.width/(d-1):0,we=ae.data.flatMap((xe,fe)=>H(xe)?[{x:i(T.x+fe*Ce),y:i(T.y+T.height-(ye===$e?.5:(xe-$e)/(ye-$e))*(T.height-4)-2)}]:[]),Te=st(we);we.length>1&&Er.push({kind:"path",part:"brush-series",d:`${Te}L${we[we.length-1]?.x} ${T.y+T.height}L${we[0]?.x} ${T.y+T.height}Z`,fill:ae.color,fillOpacity:.3})}Er.push({kind:"rect",part:"brush-window",...he,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:Y.axis},{kind:"rect",part:"brush-handle",x:i(he.x-3),y:T.y+8,width:6,height:T.height-16,fill:Y.axis,rx:2},{kind:"rect",part:"brush-handle",x:i(he.x+he.width-3),y:T.y+8,width:6,height:T.height-16,fill:Y.axis,rx:2}),Qo.brush={box:T,window:he}}return{...Qr,shapes:[...qo,...ta,...zr,...na,...Ko,...ra,...aa,...En(e.annotations,Uo),...Er,...Qr.shapes],hit:Qo,issues:o,defs:Nr.length?Nr:void 0}}function $s(e,n){if(!(!H(e)||n===null||n===void 0))return typeof n=="number"?H(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:H(n[0])&&H(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function ji(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function Gi(e,n,t){let r=b=>b.type??n,a=[],o=_i(e),s=e.categories??[],c=(e.transforms??[]).filter(b=>b.type==="sort"||b.type==="bin"||b.type==="aggregate"),l=(e.transforms??[]).filter(b=>!c.includes(b)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",u=(b,N,L)=>{let w=L.filter(M=>M!==null&&!(typeof M=="number"&&Number.isFinite(M))).length;w&&a.push({code:"invalid-value",severity:"warning",message:`Series "${b}" has ${w} value${w===1?"":"s"} that ${w===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:N??b}),s.length&&L.length!==s.length&&!e.transform&&a.push({code:"length-mismatch",severity:"warning",message:`Series "${b}" has ${L.length} values for ${s.length} categories.`,itemId:N??b})},h=e.series.map((b,N)=>{let L=r(b),w=d?!0:void 0,M=b.type==="range"?void 0:b.stack,R=M===!1?void 0:M===!0||M===void 0&&w?`${L}`:M;b.type==="range"?(u(b.name,b.id,b.low),u(b.name,b.id,b.high)):u(b.name,b.id,b.data);let C=D=>e.nulls==="zero"?D.map(F=>H(F)?F:0):D,I=ks(o,b.axis);return I===void 0&&a.push({code:"unknown-axis",severity:"warning",message:`Series "${b.name}" names axis "${String(b.axis)}", which is not defined; drawn on the first axis.`,itemId:b.id??b.name}),{name:b.name,id:b.id,color:te(e,N,b.color),axis:I??o[0]?.id,hidden:be(e,b.name),index:N,kind:L,data:b.type==="range"?[]:C(xa(xa(b.data,l),b.transforms)),low:b.type==="range"?b.low:[],high:b.type==="range"?b.high:[],curve:b.curve??e.curve??"linear",dash:b.type==="range"?void 0:b.dash,markers:b.type==="range"?void 0:b.markers,symbol:b.type==="range"?"circle":b.symbol??"circle",markerSize:b.type==="range"?3:b.markerSize??3,errors:b.type==="range"?void 0:b.errors,stack:L==="range"||L==="line"?void 0:R,style:b.type==="range"?b.style??"area":"area",fillOpacity:(b.type==="range"?void 0:b.fillOpacity)??e.fillOpacity??.25,gradient:b.type!=="range"&&b.gradient===!0}}),f=()=>Math.max(s.length,...h.map(b=>Math.max(b.data.length,b.low.length))),x=b=>{let N=w=>w.length?b.map(M=>w[M]??null):w,L=Array.from({length:f()},(w,M)=>s[M]??String(M+1));s=b.map(w=>L[w]),h=h.map(w=>({...w,data:N(w.data),low:N(w.low),high:N(w.high)}))},v=(b,N)=>{let L=(N!==void 0?h.find(M=>M.name===N):void 0)??h.find(M=>!M.hidden&&M.kind!=="range")??h[0];N!==void 0&&!h.some(M=>M.name===N)&&a.push({code:"unknown-series",severity:"warning",message:`sort.by names "${N}", which is not a series; sorted by the first series.`});let w=Array.from({length:f()},(M,R)=>R).sort((M,R)=>{let C=L?.data[M]??L?.high[M],I=L?.data[R]??L?.high[R],D=H(C)?C:-1/0,F=H(I)?I:-1/0;return b==="asc"?D-F:F-D});x(w)},g=b=>{let N=h.flatMap(w=>Fe(w.data)),L=Kn(N,b);s=L.slice(1).map((w,M)=>`${t(L[M])}\u2013${t(w)}`),h=h.map(w=>{let M=Fe(w.data),R=0,C=Xn(M,L).map(I=>e.binMode==="density"?M.length?I.count/(M.length*(I.x1-I.x0)):0:e.binMode==="cumulative"?R+=I.count:I.count);return{...w,data:C}})},A=(b,N)=>{let L=Math.max(1,Math.floor(b)),w=f(),M=C=>{if(!C.length)return C;let I=[];for(let D=0;D<w;D+=L){let F=Fe(C.slice(D,D+L));I.push(F.length===0?null:N==="sum"?F.reduce((p,O)=>p+O,0):N==="mean"?F.reduce((p,O)=>p+O,0)/F.length:N==="min"?Math.min(...F):Math.max(...F))}return I};s=Array.from({length:w},(C,I)=>s[I]??String(I+1)).filter((C,I)=>I%L===0),h=h.map(C=>({...C,data:M(C.data),low:M(C.low),high:M(C.high)}))};e.transform==="histogram"?g({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(b=>{let N=0;return{...b,data:b.data.map(L=>H(L)?N+=L:N)}}));for(let b of c)b.type==="sort"?v(b.order??"desc"):b.type==="bin"?g(b):b.type==="aggregate"&&A(b.every,b.method??"sum");typeof e.sort=="string"?v(e.sort):e.sort&&v(e.sort.order,e.sort.by);let E=e.xAxis?.domain;if(E){let b=f(),N=Array.from({length:b},(R,C)=>s[C]??String(C+1)),L=R=>{let C=typeof R=="string"?R:We(R);return N.findIndex(I=>typeof C=="string"?I===C||qt(I)===C:We(I)===C)},w=E.map(L),M=R=>R.length?w.map(C=>C<0?null:R[C]??null):R;s=[...E],h=h.map(R=>({...R,data:M(R.data),low:M(R.low),high:M(R.high)}))}return{series:h,categories:s,issues:a,axes:o}}var ya=e=>Ht(e,"bar");var va=e=>Ht(e,"line"),Ma=e=>Ht(e,"area");function Bn(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var wa=e=>e.id??e.name??e.series,Is=e=>e.seriesId??e.series;function yn(e,n){let t=!1;return n.id!==void 0&&(t=!0,wa(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Is(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}var $a=(e,n,t=Bn(n))=>t.some(r=>yn(e,r)),Zn=e=>Bn(e).flatMap(n=>n.id!==void 0?[n.id]:[]);function Fn(e){let n={},t=wa(e);t!==void 0&&(n.id=t);let r=Is(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var ka=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ia(e,n,t){let r=Bn(e),a=Fn(n),o=r.some(s=>yn(n,s));return t==="single"?o?[]:[a]:o?r.filter(s=>!yn(n,s)):[...r,a]}var Wi=.2;function Zi(e){let n=Y.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var qi=(e,n)=>e.kind==="text"?{...e,fill:Y.grid}:{...e,opacity:(e.opacity??1)*n};function Ta(e,n){let t=Bn(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:Bn(n.highlighted),a=r[0];if(t.length===0&&!a)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],c=u=>!a||r.some(h=>yn(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&yn(u,{series:h.series})):!1,l=u=>{if(!a||o.faded==="none"||c(u))return!1;if(o.faded==="series"){let h=a.series;return h!==void 0&&yn(u,{series:h})}return!0},d=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(f=>yn(h,f))){let f=Zi(u);f&&s.push(f)}return l(h)?qi(u,Wi):u});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}var Mr=2*Math.PI;function Ke(e,n,t,r,a,o){let s=(d,u)=>`${i(e+d*Math.sin(u))} ${i(n-d*Math.cos(u))}`;if(o-a>=Mr-1e-9){let d=a+Mr/2;return`${Ke(e,n,t,r,a,d)}${Ke(e,n,t,r,d,o)}`}let c=o-a>Math.PI?1:0,l=`M${s(t,a)}A${t} ${t} 0 ${c} 1 ${s(t,o)}`;return r>0?`${l}L${s(r,o)}A${r} ${r} 0 ${c} 0 ${s(r,a)}Z`:`${l}L${i(e)} ${i(n)}Z`}function Ui(e,n,t,r,a,o,s){let c=o-a;if(s<=0||c>=Mr-1e-9)return Ke(e,n,t,r,a,o);let l=Math.sin(Math.min(Math.PI/2,c/2)),d=Math.min(s,r>0?(t-r)/2:t/2,t*l/(1+l));if(r>0&&l<1&&(d=Math.min(d,r*l/(1-l))),d<=.25)return Ke(e,n,t,r,a,o);let u=(A,E)=>`${i(e+A*Math.sin(E))} ${i(n-A*Math.cos(E))}`,h=A=>`A${i(d)} ${i(d)} 0 0 1 ${A}`,f=Math.asin(d/(t-d)),x=Math.sqrt((t-d)**2-d*d),v=o-a-2*f>Math.PI?1:0,g=`M${u(x,a)}${h(u(t,a+f))}A${t} ${t} 0 ${v} 1 ${u(t,o-f)}${h(u(x,o))}`;if(r>0){let A=Math.asin(d/(r+d)),E=Math.sqrt((r+d)**2-d*d),b=o-a-2*A>Math.PI?1:0;g+=`L${u(E,o)}${h(u(r,o-A))}A${r} ${r} 0 ${b} 0 ${u(r,a+A)}${h(u(E,a))}Z`}else g+=`L${i(e)} ${i(n)}Z`;return g}function Aa(e){let n=[];for(let P of e.data)H(P.value)&&P.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${P.name}" is negative (${P.value}); a share of a whole cannot be, so it is drawn as zero.`,itemId:P.id??P.name});let t=oe(e,!e.data.some(P=>H(P.value)&&P.value>0),300,300);if(t)return{...t,issues:n};let r=re(e.format),a=e.percentFormat?re(e.percentFormat):P=>`${Math.round(P*100)}%`,o=Math.max(0,e.cornerRadius??0),{width:s,height:c}=le(e,300,300),l=ce(e),d=(e.startAngle??0)*Math.PI/180,u=(e.endAngle??(e.startAngle??0)+360)*Math.PI/180,h=Math.max(0,Math.min(Mr,u-d)),f=h<=Math.PI+1e-9&&Math.abs(Math.sin(d))>.99,x=e.labels&&e.labelPosition==="outside",v=s/2,g=Math.max(.2,Math.min(1,e.outerRadius??1)),A=x?40:8,E=(f?Math.max(0,Math.min(s/2,c-l)-A):Math.max(0,Math.min(s,c-l)/2-A))*g,b=f?d<0||d>Math.PI?c-A:l+A:l+(c-l)/2,N=E*Math.min(.95,Math.max(0,e.innerRadius??(e.variant==="donut"?.6:0))),L=e.data.map((P,U)=>({...P,i:U,value:H(P.value)&&!be(e,P.name)?Math.max(0,P.value):0})),w=e.sort?[...L].sort((P,U)=>e.sort==="asc"?P.value-U.value:U.value-P.value):L,M=w.reduce((P,U)=>P+U.value,0),R=w.filter(P=>P.value>0).length,C=Math.max(0,Math.min((e.padAngle??0)*Math.PI/180,h/Math.max(1,R)/2)),I=h>=Mr-1e-9,D=R>1?I?R:R-1:0,F=h-D*C,p=Math.min((e.minAngle??0)*Math.PI/180,F/Math.max(1,R)),O=w.map(P=>M>0?P.value/M*F:0);if(p>0)for(let P=0;P<w.length;P++){let U=w.map((z,W)=>z.value>0&&O[W]<p);if(!U.some(Boolean))break;let k=U.filter(Boolean).length*p,B=w.reduce((z,W,J)=>z+(U[J]||W.value<=0?0:W.value),0);if(w.forEach((z,W)=>{O[W]=U[W]?p:B>0?z.value/B*(F-k):0}),!w.some((z,W)=>z.value>0&&!U[W]&&O[W]<p))break}let y=Bn(e.selected),$=d+(I&&D?C/2:0),G=[],j=[],_=[],S=w.map((P,U)=>{let k=M>0?P.value/M:0,B=$,z=$+O[U];k>0&&($=z+C);let W=a(k),J=`${P.name}: ${r(P.value)} (${W})`,Z={label:J,id:P.id??P.name,name:P.name,index:P.i,value:P.value},K=(B+z)/2;if(e.labels&&k>0){let ee=`${P.name} ${W}`;if(x){let Me=Math.sin(K),pe=i(b-(E+14)*Math.cos(K));_.some(je=>Math.abs(je-pe)<12)||(_.push(pe),j.push({kind:"line",part:"label-connector",x1:i(v+E*Me),y1:i(b-E*Math.cos(K)),x2:i(v+(E+12)*Me),y2:i(b-(E+12)*Math.cos(K)),stroke:Y.axis}),G.push(X(i(v+(E+16)*Me),pe,ee,{part:"slice-label",anchor:Me>.1?"start":Me<-.1?"end":"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"})))}else if(k>.03){let Me=(E+N)/2;G.push(X(i(v+Me*Math.sin(K)),i(b-Me*Math.cos(K)),ee,{part:"slice-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}let ne=$a(Z,void 0,y)?Math.max(4,E*.06):0;return{kind:"path",part:"slice",d:k>0?Ui(v+ne*Math.sin(K),b-ne*Math.cos(K),E,N,B,z,o):"",fill:te(e,P.i,P.color),title:J,item:k>0?Z:void 0}});e.centerLabel&&G.push(X(i(v),i(f?b-12:b),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let V=de(e,s,c,e.data.map((P,U)=>({name:P.name,color:te(e,U,P.color)})));return{...V,shapes:[...S,...j,...V.shapes,...G],issues:n}}var xt=2;function Ca(e){let n=Fe(e.data),t=oe(e,n.length===0,120,32);if(t)return t;let r=re(e.format),{width:a,height:o}=le(e,120,32),s=e.data.length,c=n[0],l=n[n.length-1],d=e.lastValue?r(l):"",u=a-xt-(d?d.length*ue+6:0),h=e.variant??"area",f=h==="winloss",x=[...n,...e.band??[],...e.target!==void 0?[e.target]:[]],v=ot(f?[-1,1]:Pt(x,h==="bar"),[o-xt,xt]),g=e.x&&e.x.length>=s?e.x.map(We):void 0,[A,E]=g?ve(g):[0,1],b=ot([A,E],[xt,u]),N=C=>s<2?(xt+u)/2:g?E===A?(xt+u)/2:b(g[C]):xt+C/(s-1)*(u-xt),L=e.trend?l>=c?Y.positive:Y.negative:te(e,0,e.color),w=[];if(e.band&&!f){let[C,I]=e.band,D=Math.min(v(C),v(I));w.push({kind:"rect",part:"band",x:xt,y:i(D),width:i(Math.max(0,u-xt)),height:i(Math.abs(v(I)-v(C))),fill:Y.axis,opacity:.12,title:`${r(Math.min(C,I))} \u2013 ${r(Math.max(C,I))}`})}e.target!==void 0&&H(e.target)&&!f&&w.push({kind:"line",part:"target",x1:xt,x2:i(u),y1:i(v(e.target)),y2:i(v(e.target)),stroke:Y.axis,dash:"3 2",title:`Target: ${r(e.target)}`});let M=e.data.flatMap((C,I)=>H(C)?[{x:i(N(I)),y:i(v(C)),v:C,i:I}]:[]),R=M[M.length-1];if(h==="bar"||f){let C=s>0?(u-xt)/s:0,I=i(v(0));e.data.forEach((D,F)=>{if(!H(D))return;let p=i(v(f?Math.sign(D):D));w.push({kind:"rect",part:"bar",x:i(xt+F*C+C*.1),y:Math.min(p,I),width:i(Math.max(1,C*.8)),height:i(Math.max(1,Math.abs(I-p))),fill:f?D<0?Y.negative:Y.positive:D<0&&e.trend?Y.negative:L,title:e.tooltip===!1?void 0:r(D)})})}else{let C=st(M,e.curve),I=M[0];h==="area"&&w.push({kind:"path",part:"area",d:C&&I&&R?`${C}L${R.x} ${o-xt}L${I.x} ${o-xt}Z`:"",fill:L,fillOpacity:.15}),w.push({kind:"path",part:"line",d:C,stroke:L,strokeWidth:1.5});let D=e.markers??["last"];R&&D.includes("last")&&w.push(zt(R.x,R.y,2,L,void 0)),I&&D.includes("first")&&w.push({...zt(I.x,I.y,2,L,void 0),part:"first"})}if(e.extremes&&M.length>1){let C=M.reduce((D,F)=>F.v<D.v?F:D),I=M.reduce((D,F)=>F.v>D.v?F:D);w.push({...zt(C.x,C.y,2.5,Y.negative,r(C.v)),part:"min"},{...zt(I.x,I.y,2.5,Y.positive,r(I.v)),part:"max"})}return d&&R&&w.push(X(i(u+4),R.y,d,{part:"last-value",baseline:"middle",fill:"var(--skdx-color-text-default)"})),{...de(e,a,o),shapes:w}}function La(e){let n=e.metrics??(e.categories??[]).map(S=>({label:S})),t=oe(e,n.length===0||e.series.every(S=>Fe(S.data).length===0),300,300);if(t)return t;let r=[],a=re(e.format),{width:o,height:s}=le(e,300,300),c=ce(e),l=o/2,d=c+(s-c)/2,u=Math.max(0,Math.min(o,s-c)/2-36),h=n.length,f=(e.startAngle??0)*Math.PI/180-Math.PI/2,x=S=>f+S*2*Math.PI/Math.max(1,h),v=e.series.filter(S=>!be(e,S.name)),g=e.normalize===!0?"series":e.normalize===!1||e.normalize===void 0?e.metrics?"metric":"none":e.normalize;g==="series"&&v.length>1&&r.push({code:"misleading-scale",severity:"warning",message:"normalize: 'series' scales each series to its own maximum, so polygons cannot be compared in magnitude; prefer 'metric' or 'none'."});let A=Math.max(1,Math.round(e.levels??4)),E=e.max??Math.max(0,ve(v.flatMap(S=>S.data))[1]),b=g==="none"?ut(0,E,A):Array.from({length:A+1},(S,V)=>100*V/A),N=g==="none"?e.max??b[b.length-1]:100,L=n.map((S,V)=>{let P=v.map(W=>W.data[V]),[U,k]=ve(P),B=S.min??Math.min(0,U),z=ut(B,S.max??k,A);return{min:B,max:S.max??z[z.length-1]}}),w=e.series.map(S=>Math.max(0,ve(S.data)[1])),M=(S,V,P)=>{if(g==="series")return w[S]>0?P/w[S]*100:0;if(g==="metric"){let U=L[V];return U.max>U.min?(P-U.min)/(U.max-U.min)*100:0}return P},R=(S,V)=>{let P=N>0?Math.max(0,Math.min(V,N))/N*u:0;return{x:i(l+P*Math.cos(x(S))),y:i(d+P*Math.sin(x(S)))}},C=S=>h===0?"":`M${n.map((V,P)=>{let U=R(P,S(P));return`${U.x} ${U.y}`}).join("L")}Z`,I=S=>{if(e.gridShape==="circle"){let V=N>0?S/N*u:0;return{kind:"circle",part:"grid",cx:i(l),cy:i(d),r:i(V),fill:"none",stroke:Y.grid}}return{kind:"path",part:"grid",d:C(()=>S),stroke:Y.grid}},D=b.filter(S=>S>0&&S<=N),F=S=>g==="none"?a(S):g==="series"?`${S}%`:(()=>{let V=L[0];return re(n[0]?.format??e.format)(V.min+(V.max-V.min)*S/100)})(),p=[...D.map(I),...n.map((S,V)=>{let P=R(V,N);return{kind:"line",part:"grid",x1:i(l),y1:i(d),x2:P.x,y2:P.y,stroke:Y.grid}}),...D.map(S=>X(i(l+4),R(0,S).y,F(S),{part:"y-label",baseline:"middle"})),...n.map((S,V)=>{let P=Math.cos(x(V)),U=u+14;return X(i(l+U*P),i(d+U*Math.sin(x(V))),S.label,{part:"x-label",anchor:P>.1?"start":P<-.1?"end":"middle",baseline:"middle"})})],O=[],y=[],$=[],G=e.markers??!0,j=e.markerSize??3;e.series.forEach((S,V)=>{if(be(e,S.name))return;let P=te(e,V,S.color),U=k=>{let B=S.data[k];return H(B)?M(V,k,B):0};n.forEach((k,B)=>{let z=S.data[B];if(!H(z))return;let W=re(k.format??e.format),J=R(B,M(V,B,z)),Z=yr(S.name,k.label,z,W);O.push({...zt(J.x,J.y,G?j:.01,P,Z,{label:Z,id:k.id,series:S.name,seriesId:S.id,category:k.label,index:B,value:z}),part:G?"point":"anchor"}),e.labels&&$.push(X(J.x,i(J.y-7),W(z),{part:"value-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}),y.push({kind:"path",part:"area",d:C(U),fill:e.fill??!0?P:void 0,fillOpacity:.25,stroke:P,strokeWidth:2,title:S.name,item:{label:S.name,series:S.name,seriesId:S.id}})});let _=de(e,o,s,e.series.map((S,V)=>({name:S.name,color:te(e,V,S.color)})));return{..._,shapes:[...p,...y,...O,...$,..._.shapes],issues:r}}var Gr={top:24,right:8,bottom:8,left:64},Oa=864e5,Sa=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function Yi(e,n="monday"){let t=n==="sunday"?[Sa[6],...Sa.slice(0,6)]:Sa,r=e.map(g=>({day:Math.floor(new Date(g.date).getTime()/Oa),value:g.value})).filter(g=>Number.isFinite(g.day));if(r.length===0)return{rows:t,columns:[],data:t.map(()=>[]),dates:t.map(()=>[])};let[a,o]=ve(r.map(g=>g.day)),s=n==="sunday"?4:3,c=g=>((g+s)%7+7)%7,l=a-c(a),d=Math.floor((o-l)/7)+1,u=t.map(()=>new Array(d).fill(null)),h=t.map(()=>new Array(d).fill(void 0));for(let g of r){let A=Math.floor((g.day-l)/7);u[c(g.day)][A]=g.value,h[c(g.day)][A]=new Date(g.day*Oa).toISOString().slice(0,10)}let f=new Intl.DateTimeFormat(void 0,{month:"short"}),x=-1,v=Array.from({length:d},(g,A)=>{let E=new Date((l+A*7+6)*Oa),b=E.getUTCMonth();return b===x?"":(x=b,f.format(E))});return{rows:t,columns:v,data:u,dates:h}}var Ki=e=>e.colorScale??(e.diverging?{type:"diverging",steps:e.steps}:{type:"sequential",domain:e.domain,steps:e.steps}),Ts=(e,n)=>{let t=e.map((r,a)=>a);return n&&t.sort((r,a)=>(n==="asc"?1:-1)*(e[r]-e[a])),t};function za(e){let n=[],t=e.calendar?Yi(e.calendar,e.weekStart):void 0,r=t?.rows??e.rows??[],a=t?.columns??e.columns??[],o=t?.data??e.data??[];!t&&(o.length!==r.length||o.some(p=>p.length!==a.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${o.length} \xD7 ${o[0]?.length??0} but there are ${r.length} rows and ${a.length} columns; missing cells are blank.`});let s=o.flat().filter(p=>p!=null&&!H(p)).length;s&&n.push({code:"invalid-value",severity:"warning",message:`${s} cell${s===1?" is":"s are"} neither a number nor null; drawn as blank.`});let c=o.flat(),l=oe(e,r.length===0||a.length===0||!c.some(H));if(l)return{...l,issues:n};let d=re(e.format),{width:u,height:h}=le(e),f=Dn(e.colorLegend),x=ke(u,h,{...Gr,left:t?40:Gr.left,right:Gr.right+f.right,bottom:Gr.bottom+f.bottom}),v=p=>p.reduce((O,y)=>O+(H(y)?y:0),0),g=Ts(r.map((p,O)=>v(o[O]??[])),e.rowOrder),A=Ts(a.map((p,O)=>v(o.map(y=>y[O]))),e.columnOrder),E=g.map(p=>r[p]),b=A.map(p=>a[p]),N=x.width/Math.max(1,b.length),L=x.height/Math.max(1,E.length),w=Nt(Ki(e),c,te(e,0,e.color),e.negativeColor,d),M=[],R=[],C=e.cellGap??(t?1:0),I=e.cellRadius??(t?2:0);E.forEach((p,O)=>{b.forEach((y,$)=>{let G=o[g[O]]?.[A[$]],j=t?.dates[g[O]]?.[A[$]],_=t?j??p:`${p}, ${y}`,S=i(x.x+$*N+C),V=i(x.y+O*L+C),P={x:S,y:V,width:i(Math.max(0,N-2*C)),height:i(Math.max(0,L-2*C)),rx:I||void 0};if(!H(G)){e.missingColor&&(!t||j)&&M.push({kind:"rect",part:"missing",...P,fill:e.missingColor,title:`${_}: \u2014`});return}let U=w.color(G),k=`${_}: ${d(G)}`;M.push({kind:"rect",part:"cell",...P,fill:U.fill,opacity:U.opacity,title:k,item:{label:k,id:t?j:`${p}:${y}`,category:y,name:p,index:$,value:G}}),e.labels&&N>24&&L>12&&R.push(X(i(x.x+($+.5)*N),i(x.y+(O+.5)*L),d(G),{part:"cell-label",anchor:"middle",baseline:"middle",fill:U.opacity>=.5?"var(--skdx-color-text-on-accent)":"var(--skdx-color-text-default)"}))})});let D=de(e,u,h),F=e.colorLegend?Qn(w,f.right?{x:x.x+x.width+12,y:x.y,width:f.right,height:x.height}:{x:x.x,y:x.y+x.height+8,width:x.width,height:f.bottom},f.options):[];return{...D,shapes:[...E.map((p,O)=>X(x.x-8,i(x.y+(O+.5)*L),p,{part:"y-label",anchor:"end",baseline:"middle"})),...b.flatMap((p,O)=>p?[X(i(x.x+(O+.5)*N),x.y-8,p,{part:"x-label",anchor:t?"start":"middle"})]:[]),...M,...R,...F,...D.shapes],issues:n}}var Wr=8;function Na(e){let n=e.variant==="pyramid",t=[],r=e.sort??(n?"asc":void 0),a=e.data.filter(O=>H(O.value)?!0:(t.push({code:"invalid-value",severity:"warning",message:`Stage "${O.name}" has no valid value and was dropped.`,itemId:O.id??O.name}),!1)).sort((O,y)=>r==="asc"?O.value-y.value:r==="desc"?y.value-O.value:0),o=oe(e,a.length===0,400,300);if(o)return{...o,issues:t};let s=re(e.format),{width:c,height:l}=le(e,400,300),d=a.length,u=e.orientation==="horizontal",h=Math.max(0,e.gap??4),f=e.labelPosition??"inside",x=Math.max(0,...a.map(O=>O.value)),v=a.reduce((O,y)=>O+Math.max(0,y.value),0),g=a[0]?.value??0,A=ce(e),E=u?c:l-A,b=u?l-A:c,N=f==="outside",L=Math.max(0,(N?b*2/3:b)-2*Wr),w=d===0?0:(E-2*Wr)/d,M=Math.max(0,Math.min(1,e.neckWidth??0)),R=O=>x>0?(M+(1-M)*(Math.max(0,O)/x))*L:0,C=e.percentFormat?re(e.percentFormat):O=>`${Math.round(O*100)}%`,I=a.map((O,y)=>({name:O.name,color:te(e,y,O.color)})),D=(u?A+(l-A)/2:c/2)-(N?b/6:0),F=a.flatMap((O,y)=>{let $=R(O.value),G=R(a[y+1]?.value??O.value),j=Wr+y*w+(u?0:A),_=j+w-h,S=n?v>0?O.value/v:0:g>0?O.value/g:0,V=a[y-1]?.value,P=!n&&V!==void 0&&V>0?` \xB7 \u2212${C(1-O.value/V)} from ${a[y-1]?.name}`:"",U=`${O.name}: ${s(O.value)} (${C(S)})${P}`,B={kind:"path",part:"stage",d:u?`M${i(j)} ${i(D-$/2)}L${i(j)} ${i(D+$/2)}L${i(_)} ${i(D+G/2)}L${i(_)} ${i(D-G/2)}Z`:`M${i(D-$/2)} ${i(j)}L${i(D+$/2)} ${i(j)}L${i(D+G/2)} ${i(_)}L${i(D-G/2)} ${i(_)}Z`,fill:te(e,y,O.color),title:U,item:{label:U,id:O.id??O.name,name:O.name,index:y,value:O.value}};if(f==="none")return[B];let z=`${O.name} \xB7 ${s(O.value)}`,W=(j+_)/2;if(N){let J=D+L/2+Wr;return[B,X(i(u?W:J),i(u?J:W),z,{part:"stage-label",anchor:u?"middle":"start",baseline:u?"hanging":"middle",fill:"var(--skdx-color-text-default)"})]}return[B,X(i(u?W:D),i(u?D:W),z,{part:"stage-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})]}),p=de(e,c,l,I);return{...p,shapes:[...F,...p.shapes],issues:t}}var As=e=>e*Math.PI/180;function Ra(e){let n=e.data.filter(R=>H(R.value)),t=oe(e,n.length===0,300,300);if(t)return t;let r=re(e.format),{width:a,height:o}=le(e,300,300),s=ce(e),c=a/2,l=s+(o-s)/2,d=Math.max(0,Math.min(a,o-s)/2-(e.bands?20:8)),u=d*Math.min(.95,Math.max(0,e.innerRadius??.3)),h=As(e.startAngle??0),f=As(e.endAngle??(e.startAngle??0)+360),x=Math.max(0,Math.min(2*Math.PI,f-h)),v=e.max??Math.max(0,...n.map(R=>R.value)),g=n.length,A=Math.max(0,e.gap??.25),E=g===0?0:(d-u)/(g+A*(g-1)),b=e.rounded??!0,N=R=>v>0?Math.max(0,Math.min(1,R/v)):0,L=[],w=n.map((R,C)=>({name:R.name,color:te(e,C,R.color)}));for(let R of e.bands??[]){let C=h+N(R.from)*x,I=h+N(R.to)*x;I<=C||L.push({kind:"path",part:"band",d:Ke(c,l,d+14,d+6,C,I),fill:St(R.variant),opacity:.6,title:`${r(R.from)} \u2013 ${r(R.to)}`})}if(n.forEach((R,C)=>{if(be(e,R.name))return;let I=d-C*E*(1+A),D=I-E,F=te(e,C,R.color),p=h+N(R.value)*x,O=`${R.name}: ${r(R.value)} (${Math.round(N(R.value)*100)}%)`;if((e.track??!0)&&L.push({kind:"path",part:"track",d:Ke(c,l,I,D,h,h+x),fill:Y.grid,opacity:.6}),p>h&&(L.push({kind:"path",part:"bar",d:Ke(c,l,I,D,h,p),fill:F,title:O,item:{label:O,id:R.id,name:R.name,index:C,value:R.value}}),b&&x<2*Math.PI-1e-9)){let y=(D+I)/2;for(let $ of[h,p])L.push({kind:"circle",part:"bar-cap",cx:i(c+y*Math.sin($)),cy:i(l-y*Math.cos($)),r:i(E/2),fill:F})}if(e.labels){let y=(D+I)/2;L.push(X(i(c+y*Math.sin(h)-6*Math.cos(h)),i(l-y*Math.cos(h)-6*Math.sin(h)),`${R.name} ${r(R.value)}`,{part:"bar-label",anchor:Math.cos(h)>=0?"end":"start",baseline:"middle"}))}}),e.target!==void 0&&H(e.target)){let R=h+N(e.target)*x,C=d-g*E*(1+A)+E*A;L.push({kind:"line",part:"target",x1:i(c+C*Math.sin(R)),y1:i(l-C*Math.cos(R)),x2:i(c+(d+4)*Math.sin(R)),y2:i(l-(d+4)*Math.cos(R)),stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${r(e.target)}`})}e.centerLabel&&L.push(X(i(c),i(l),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let M=de(e,a,o,w);return{...M,shapes:[...L,...M.shapes]}}var Cs=e=>e*Math.PI/180;function Xi(e,n){let t=[0],r=[0],a=o=>{t.push(Math.sin(o)),r.push(-Math.cos(o))};a(e),a(n);for(let o=Math.ceil(e/(Math.PI/2));o*(Math.PI/2)<=n;o++)a(o*(Math.PI/2));return{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)}}function Ea(e){let n=oe(e,!H(e.value),300,300);if(n)return n;let t=re(e.format),{width:r,height:a}=le(e,300,300),o=ce(e),s=H(e.min)?e.min:0,c=H(e.max)?e.max:100,l=e.startAngle??-120,d=e.endAngle??120,u=Cs(l),h=Cs(Math.max(l,Math.min(l+360,d))),f=h-u,x=Z=>c>s?Math.max(0,Math.min(1,(Z-s)/(c-s))):0,v=Z=>u+x(Z)*f,g=e.variant==="solid",A=e.ticks===!1?0:e.ticks===!0||e.ticks===void 0?5:e.ticks,E=e.tickLabels??!0,b=Array.from({length:A},(Z,K)=>A===1?s:s+(c-s)*K/(A-1)),N=A>0&&E,L=N?Math.max(...b.map(Z=>t(Z).length))*ue:0,w=N?14+L:10,M=N?26:10,R=Xi(u,h),C=Math.max(R.x1-R.x0,.2),I=Math.max(R.y1-R.y0,.2),D=Math.max(0,Math.min((r-2*w)/C,(a-o-2*M)/I)),F=r/2-(R.x0+R.x1)/2*D,p=o+(a-o)/2-(R.y0+R.y1)/2*D,O=D*Math.max(.04,Math.min(.6,e.thickness??.18)),y=D-O,$=(Z,K)=>({x:i(F+Z*Math.sin(K)),y:i(p-Z*Math.cos(K))}),G=[],j=`${t(s)} \u2013 ${t(c)}`,_=(e.bands??[]).filter(Z=>H(Z.from)&&H(Z.to)),S=Z=>_.find(K=>Z>=K.from&&Z<=K.to),V=Z=>Z.color??St(Z.variant);G.push({kind:"path",part:"track",d:Ke(F,p,D,y,u,h),fill:Y.grid,opacity:.6});for(let Z of _){let K=v(Math.min(Z.from,Z.to)),ne=v(Math.max(Z.from,Z.to));if(ne<=K)continue;let ee=`${Z.label?`${Z.label}: `:""}${t(Z.from)} \u2013 ${t(Z.to)}`;G.push(g?{kind:"path",part:"band",d:Ke(F,p,D+6,D+2,K,ne),fill:V(Z),opacity:.7,title:ee}:{kind:"path",part:"band",d:Ke(F,p,D,y,K,ne),fill:V(Z),opacity:.75,title:ee})}let P=`${e.caption??"Value"}: ${t(e.value)} (${j})`,U={label:P,name:e.caption,value:e.value},k=v(e.value);if(g){let Z=S(e.value),K=Z?V(Z):te(e,0);k>u+1e-6?G.push({kind:"path",part:"value",d:Ke(F,p,D,y,u,k),fill:K,title:P,item:U}):G.push({...Qi(F,p),title:P,item:U})}else{let Z=$(y-4,k),K=4,ne=$(K,k-Math.PI/2),ee=$(K,k+Math.PI/2);G.push({kind:"path",part:"needle",d:`M${ne.x} ${ne.y}L${Z.x} ${Z.y}L${ee.x} ${ee.y}Z`,fill:"var(--skdx-color-text-default)",title:P,item:U},{kind:"circle",part:"hub",cx:i(F),cy:i(p),r:5,fill:"var(--skdx-color-text-default)"})}for(let Z of b){let K=v(Z),ne=$(D+2,K),ee=$(D+7,K);if(G.push({kind:"line",part:"tick",x1:ne.x,y1:ne.y,x2:ee.x,y2:ee.y,stroke:Y.axis}),E){let Me=$(D+12,K),pe=Math.sin(K);G.push(X(Me.x,Me.y,t(Z),{part:"tick-label",anchor:pe>.3?"start":pe<-.3?"end":"middle",baseline:"middle"}))}}if(H(e.target)){let Z=v(e.target),K=$(y-2,Z),ne=$(D+4,Z);G.push({kind:"line",part:"target",x1:K.x,y1:K.y,x2:ne.x,y2:ne.y,stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${t(e.target)}`})}let z=f<2*Math.PI-1e-6?R.y1<.2?p-y*.4:p+y*.45:p;G.push(X(i(F),i(z),e.centerLabel??t(e.value),{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),e.caption&&G.push(X(i(F),i(z+16),e.caption,{part:"caption",anchor:"middle",baseline:"middle"}));let W=de(e,r,a),J=H(e.target)?`, target ${t(e.target)}`:"";return{...W,description:e.description??`${e.caption??"Value"} ${t(e.value)} on a scale from ${t(s)} to ${t(c)}${J}.`,shapes:[...G,...W.shapes]}}var Qi=(e,n)=>({kind:"circle",part:"anchor",cx:i(e),cy:i(n),r:.01,fill:"none"});function Da(e){let[n,t]=e.sizeRange??[4,24],r=re(e.zAxis?.format??e.format),a=e.zAxis?.label,o=e.xAxis?.label,s=e.yAxis?.label,c=(l,d)=>l?`${l} ${d}`:d;return pa({...e,series:e.series.map(l=>({name:l.name,id:l.id,color:l.color,data:l.data.filter(d=>H(d.x)&&H(d.y)).map(d=>({x:d.x,y:d.y,size:H(d.z)?Math.max(0,d.z):0,label:d.label,id:d.id,color:d.color,value:d.value??d.z}))}))},{part:"bubble",opacity:.7,radius:(l,[,d])=>d>0&&H(l)?Math.max(n,Math.sqrt(l/d)*t):n,describe:(l,d,u,h)=>`${l}${d.label?` ${d.label}`:""}: ${c(o,u.format(d.x))}, ${c(s,h.format(d.y))}, ${c(a,r(d.size??0))}`})}function Ba(e){let n=Fe(e.data),t=oe(e,n.length===0);if(t)return t;let r=Kn(n,{bins:e.bins,binWidth:e.binWidth,domain:e.domain,thresholds:e.thresholds}),a=Xn(n,r),o=a.reduce((g,A)=>g+A.count,0),s=e.mode??"count",c=re(e.xAxis?.format??e.format),l=re(s==="percent"?{style:"percent",digits:1}:s==="density"?{style:"decimal",digits:3}:e.format),d=e.name??(s==="density"?"Density":s==="percent"?"Share":"Count"),u=g=>s==="density"?o>0&&g.x1>g.x0?g.count/(o*(g.x1-g.x0)):0:s==="percent"?o>0?g.count/o:0:g.count,h=a.map(g=>`${c(g.x0)}\u2013${c(g.x1)}`),f=Ht({...e,format:l,series:[{name:d,data:a.map(u),color:e.color}],categories:h,xAxis:e.xAxis?.label?{label:e.xAxis.label}:void 0,barGap:e.barGap??.05,transform:void 0},"bar"),x=f.shapes.map((g,A)=>{if(g.part!=="bar"||!g.item||g.item.index===void 0)return g;let E=a[g.item.index];if(!E)return g;let b=o>0?` (${Math.round(E.count/o*1e3)/10}%)`:"",N=`${h[g.item.index]??String(A)}: ${E.count}${b}${s==="count"?"":` \xB7 ${d} ${l(u(E))}`}`;return{...g,title:g.title===void 0?void 0:N,item:{...g.item,label:N}}}),v=f.hit?.rows.map((g,A)=>{let E=a[A];return E?[g[0],`${d}: ${l(u(E))}`,`Observations: ${E.count}`]:g});return{...f,shapes:x,hit:f.hit&&v?{...f.hit,rows:v}:f.hit}}function Ji(e,n){let t=[],r=n;for(let a of e??[]){let o=typeof a=="number"?{from:r,to:a}:a;H(o.to)&&(t.push(o),r=o.to)}return t}function wr(e){let n=e.data.filter(w=>H(w.value)),t=oe(e,n.length===0,600,40+44*Math.max(1,e.data.length));if(t)return t;let r=re(e.format),a=e.orientation==="vertical",{width:o,height:s}=le(e,600,a?300:40+44*n.length),c=w=>w.ranges??e.ranges,l=n.flatMap(w=>[w.value,w.target,...(c(w)??[]).map(M=>typeof M=="number"?M:M.to)]),[d,u]=ve(l),h=e.min??Math.min(0,d),f=Math.max(0,...n.map(w=>w.name.length))*ue,x=ke(o,s,{top:me.top+ce(e),right:e.labels&&!a?56:me.right,bottom:me.bottom,left:a?me.left:Math.max(me.left,f+16)}),v=a?[x.y+x.height,x.y]:[x.x,x.x+x.width],g=He([h,Math.max(h,u)],v,{min:h,max:e.max,ticks:e.ticks},e.format),A=Ve(n.length,a?[x.x,x.x+x.width]:[x.y,x.y+x.height],.3),E=de(e,o,s),b=n.map((w,M)=>({pos:i(A.center(M)),label:w.name})),N=Ze({...E,plot:x,xTicks:a?Re(b,x.width):b,yTicks:a?g.ticks:Re(g.ticks,x.width),baseline:g.zero},{horizontal:!a}),L=(w,M,R,C,I)=>{let D=g.scale(w),F=g.scale(M),p=Math.max(1,Math.abs(F-D));return a?{kind:"rect",x:i(R-C/2),y:i(Math.min(D,F)),width:i(C),height:i(p),...I}:{kind:"rect",x:i(Math.min(D,F)),y:i(R-C/2),width:i(p),height:i(C),...I}};return n.forEach((w,M)=>{if(be(e,w.name))return;let R=A.center(M),C=A.bandwidth,I=Ji(c(w),h);I.forEach((O,y)=>{let $=`${w.name} ${O.label??`range ${y+1}`}: ${r(O.from)} \u2013 ${r(O.to)}`;N.push(L(O.from,O.to,R,C,{part:"range",fill:O.color??(O.variant?St(O.variant):Y.axis),opacity:O.variant||O.color?.25:Math.max(.1,.4-y*.1),title:$}))});let D=H(w.target)?` \xB7 target ${r(w.target)}`:"",F=I.find(O=>w.value>=O.from&&w.value<=O.to),p=`${w.name}: ${r(w.value)}${D}${F?.label?` (${F.label})`:""}`;if(N.push(L(Math.min(h,w.value),w.value,R,C/3,{part:"measure",fill:te(e,M,w.color),title:p,item:{label:p,id:w.id,name:w.name,index:M,value:w.value}})),H(w.target)){let O=i(g.scale(w.target));N.push({kind:"line",part:"target",x1:a?i(R-C/2.5):O,x2:a?i(R+C/2.5):O,y1:a?O:i(R-C/2.5),y2:a?O:i(R+C/2.5),stroke:"var(--skdx-color-text-default)",strokeWidth:3,title:`${w.name} target: ${r(w.target)}`})}if(e.labels){let O=g.scale(H(w.target)?Math.max(w.value,w.target):w.value);N.push(a?X(i(R),i(O-6),r(w.value),{part:"value-label",anchor:"middle"}):X(i(O+6),i(R),r(w.value),{part:"value-label",baseline:"middle"}))}}),{...E,shapes:[...N,...E.shapes]}}var Fa=e=>Ht(e,"bar");function Pa(e){let n=e.variant??"area";return Ht({...e,series:e.series.map(t=>({type:"range",name:t.name,low:t.low,high:t.high,color:t.color,axis:t.axis,curve:t.curve,style:n}))},"bar")}var Zr=e=>Math.round(e*1e6)/1e6,Ls=60,el=500;function Va(e){let n=[],t=new Map;for(let q of e.nodes)t.has(q.id)?n.push({code:"duplicate-id",severity:"warning",message:`Node id "${q.id}" is duplicated; the first definition is kept.`,itemId:q.id}):t.set(q.id,q);let r=q=>q.group,a=[...t.values()].filter(q=>!(q.group!==void 0&&be(e,q.group))),o=new Set(a.map(q=>q.id)),s=e.edges.filter(q=>{let ie=o.has(q.source)&&o.has(q.target);return!ie&&!(t.has(q.source)&&t.has(q.target))&&n.push({code:"unknown-node",severity:"warning",message:`Edge ${q.source} \u2192 ${q.target} names a node that does not exist and was dropped.`,itemId:q.id}),ie}),c=oe(e,a.length===0);if(c)return{...c,issues:n};let l=re(e.format),{width:d,height:u}=le(e),[h,f]=e.nodeRange??[5,16],x=e.labels??a.length<=Ls,v=ke(d,u,{top:ce(e)+f+8,right:f+(x?48:8),bottom:f+8,left:f+8}),g=[...new Set(e.nodes.map(r).filter(q=>q!==void 0))],A=(q,ie)=>q.color??te(e,q.group!==void 0?g.indexOf(q.group):ie),[,E]=ve(a.map(q=>q.value)),b=q=>H(q)&&E>0?h+Math.sqrt(Math.max(0,q)/E)*(f-h):h,N=new Map;for(let q of s)N.set(q.source,(N.get(q.source)??0)+1),q.target!==q.source&&N.set(q.target,(N.get(q.target)??0)+1);let L=a.length,w=new Map(a.map((q,ie)=>[q.id,ie])),M,R,C=e.arrange??"force";C==="manual"&&a.every(q=>H(q.x)&&H(q.y))?(M=a.map(q=>q.x),R=a.map(q=>q.y)):C==="circular"||C==="manual"||L<3?(M=a.map((q,ie)=>Zr(Math.cos(2*Math.PI*ie/L-Math.PI/2))),R=a.map((q,ie)=>Zr(Math.sin(2*Math.PI*ie/L-Math.PI/2)))):{xs:M,ys:R}=tl(L,s.map(q=>[w.get(q.source),w.get(q.target)]),e.iterations??Math.max(50,Math.min(300,Math.floor(3e4/L))));let[I,D]=ve(M),[F,p]=ve(R),O=Math.max(D-I,p-F)||1,y=Math.min(v.width/O,v.height/O),$=v.x+(v.width-(D-I)*y)/2,G=v.y+(v.height-(p-F)*y)/2,j=a.map((q,ie)=>({node:q,index:ie,x:i($+(M[ie]-I)*y),y:i(G+(R[ie]-F)*y),r:i(b(q.value)),color:A(q,ie),degree:N.get(q.id)??0})),_=new Map(j.map(q=>[q.node.id,q])),S=Zn(e.selected)[0],V=S!==void 0?_.get(String(S)):void 0,P=new Set;if(V){P.add(V.node.id);for(let q of s)q.source===V.node.id&&P.add(q.target),q.target===V.node.id&&P.add(q.source)}let U=(q,ie=q)=>V&&!(P.has(q)&&P.has(ie))?.15:void 0,k=q=>!V||q.source===V.node.id||q.target===V.node.id,[,B]=ve(s.map(q=>q.value)),z=s.length<=el,W=[],J=(q,ie,Oe)=>W.some(Ye=>Math.abs(Ye.y-ie)<12&&q<Ye.x+Ye.w+4&&q+Oe+4>Ye.x)?!1:(W.push({x:q,y:ie,w:Oe}),!0),Z=[],K=[],ne=s.map(q=>{let ie=_.get(q.source),Oe=_.get(q.target),Ye=H(q.value)&&B>0?1+3*Math.sqrt(Math.max(0,q.value)/B):1,kn=`${ie.node.label??ie.node.id} \u2192 ${Oe.node.label??Oe.node.id}${q.label?` ${q.label}`:""}${H(q.value)?`: ${l(q.value)}`:""}`,gn=k(q)?U(q.source,q.target):.15,In=z?{label:kn,id:q.id,name:q.source,category:q.target,value:q.value}:void 0;if(ie===Oe){let Ge=ie.r*2.5;return{kind:"path",part:"edge",d:`M${i(ie.x)} ${i(ie.y-ie.r)}C${i(ie.x-Ge)} ${i(ie.y-Ge*1.5)} ${i(ie.x+Ge)} ${i(ie.y-Ge*1.5)} ${i(ie.x)} ${i(ie.y-ie.r)}`,stroke:Y.axis,strokeWidth:Ye,opacity:gn??.7,title:z?kn:void 0,item:In}}let Tn=Math.sqrt((Oe.x-ie.x)*(Oe.x-ie.x)+(Oe.y-ie.y)*(Oe.y-ie.y))||1,sn=(Oe.x-ie.x)/Tn,ln=(Oe.y-ie.y)/Tn;if(e.directed){let Ge=Oe.x-sn*Oe.r,cn=Oe.y-ln*Oe.r,xn=Ge-sn*6,dr=cn-ln*6;Z.push({kind:"path",part:"arrow",d:`M${i(Ge)} ${i(cn)}L${i(xn-ln*3)} ${i(dr+sn*3)}L${i(xn+ln*3)} ${i(dr-sn*3)}Z`,fill:Y.axis,opacity:gn??.7})}let An=`${q.label??""}${H(q.value)?`${q.label?": ":""}${l(q.value)}`:""}`;if(e.edgeLabels&&An){let Ge=(ie.x+Oe.x)/2,cn=(ie.y+Oe.y)/2,xn=An.length*ue;J(Ge-xn/2,cn,xn)&&K.push(X(i(Ge),i(cn),An,{part:"edge-label",anchor:"middle",baseline:"middle"}))}return{kind:"path",part:"edge",d:`M${i(ie.x)} ${i(ie.y)}L${i(Oe.x)} ${i(Oe.y)}`,stroke:Y.axis,strokeWidth:Ye,opacity:gn??.7,title:z?kn:void 0,item:In}}),ee=[],Me=[];for(let q of j){let ie=q.node.label??q.node.id,Oe=H(q.node.value)?`: ${l(q.node.value)}`:"",Ye=q.node.group!==void 0?` \xB7 ${q.node.group}`:"",kn=`${ie}${Oe}${Ye} \xB7 ${q.degree} connection${q.degree===1?"":"s"}`;if(ee.push({kind:"circle",part:"node",cx:q.x,cy:q.y,r:q.r,fill:q.color,stroke:V?.node.id===q.node.id?"var(--skdx-color-text-default)":"var(--skdx-color-surface-default)",opacity:U(q.node.id),title:kn,item:{label:kn,name:q.node.id,category:q.node.group,index:q.index,value:q.node.value}}),!x)continue;let gn=ie.length*ue,In=q.x+q.r+4,Tn=q.y;J(In,Tn,gn)&&Me.push(X(i(In),i(Tn),ie,{part:"node-label",baseline:"middle",fill:U(q.node.id)===void 0?"var(--skdx-color-text-default)":Y.grid}))}let pe=g.map((q,ie)=>({name:q,color:te(e,ie)})),je=de(e,d,u,pe);return{...je,shapes:[...ne,...Z,...ee,...K,...Me,...je.shapes],issues:n}}function tl(e,n,t){let r=Array.from({length:e},(l,d)=>Zr(Math.cos(2*Math.PI*d/e))),a=Array.from({length:e},(l,d)=>Zr(Math.sin(2*Math.PI*d/e))),o=Math.sqrt(4/e),s=new Array(e).fill(0),c=new Array(e).fill(0);for(let l=0;l<t;l++){let d=.1*(1-l/t)+.005;s.fill(0),c.fill(0);for(let u=0;u<e;u++)for(let h=u+1;h<e;h++){let f=r[u]-r[h],x=a[u]-a[h];f===0&&x===0&&(f=.001*(u%7+1),x=.001*(h%5+1));let v=f*f+x*x,g=o*o/v;s[u]=s[u]+f*g,c[u]=c[u]+x*g,s[h]=s[h]-f*g,c[h]=c[h]-x*g}for(let[u,h]of n){if(u===h)continue;let f=r[u]-r[h],x=a[u]-a[h],v=Math.sqrt(f*f+x*x)||1e-6,g=v*v/o/v;s[u]=s[u]-f*g,c[u]=c[u]-x*g,s[h]=s[h]+f*g,c[h]=c[h]+x*g}for(let u=0;u<e;u++){let h=Math.sqrt(s[u]*s[u]+c[u]*c[u])||1e-6,f=Math.min(h,d);r[u]=r[u]+s[u]/h*f,a[u]=a[u]+c[u]/h*f}}return{xs:r,ys:a}}var Ha=14;function _a(e){let n=[],t=e.events.map((y,$)=>({event:y,index:$,time:new Date(y.date).getTime()})).filter(y=>Number.isFinite(y.time)?!(y.event.group!==void 0&&be(e,y.event.group)):(n.push({code:"invalid-value",severity:"warning",message:`Event "${y.event.label}" has an unparseable date and was dropped.`,itemId:y.event.id??y.event.label}),!1)).sort((y,$)=>y.time-$.time||y.index-$.index),r=oe(e,t.length===0);if(r)return{...r,issues:n};let{width:a,height:o}=le(e),s=e.orientation==="vertical",c=[...new Set(e.events.map(y=>y.group).filter(y=>y!==void 0))],l=c.length?c:[""],[d,u]=ve(t.map(y=>y.time)),h=e.xAxis?.format??{style:u-d<2*864e5?"time":"date"},f=y=>qt(y,h),x=e.labels??!0,v=t.map(y=>{let $=y.event.group,G=y.event.color??(y.event.variant?St(y.event.variant):te(e,$===void 0?0:c.indexOf($))),j=y.event.description?` \u2014 ${y.event.description}`:"";return{...y,lane:$===void 0?0:c.indexOf($),color:G,text:`${y.event.label} \xB7 ${f(y.time)}${j}`}}),g=c.map((y,$)=>({name:y,color:te(e,$)})),A=de(e,a,o,g),E=y=>({label:y.text,id:y.event.id,name:y.event.label,category:y.event.group,index:y.index,value:y.time}),b=[];if(s){let y=Math.max(...v.map(_=>f(_.time).length))*ue+16,$=ke(a,o,{top:8+ce(e),right:8,bottom:8,left:y+12}),G=Ve(v.length,[$.y,$.y+$.height],0),j=i($.x);return b.push({kind:"line",part:"axis",x1:j,x2:j,y1:$.y,y2:$.y+$.height,stroke:Y.axis}),v.forEach((_,S)=>{let V=i(G.center(S));if(b.push(X(i($.x-12),V,f(_.time),{part:"x-label",anchor:"end",baseline:"middle"}),{kind:"circle",part:"event",cx:j,cy:V,r:5,fill:_.color,stroke:"var(--skdx-color-surface-default)",title:_.text,item:E(_)}),x){let P=_.event.description,U=G.step>=2*Ha&&P;b.push(X(i($.x+12),U?i(V-7):V,_.event.label,{part:"event-label",baseline:"middle",fill:"var(--skdx-color-text-default)"})),U&&b.push(X(i($.x+12),i(V+7),P,{part:"event-description",baseline:"middle"}))}}),{...A,shapes:[...b,...A.shapes],issues:n}}let N=c.length?Math.max(...c.map(y=>y.length))*ue+16:8,L=Math.max(f(d).length,f(u).length)*ue/2+4,w=ke(a,o,{top:8+ce(e),right:Math.max(16,L),bottom:32+(e.xAxis?.label?14:0),left:Math.max(16,N,L)}),M=(u-d)*.04||36e5,R=ot([d-M,u+M],[w.x,w.x+w.width]),C=Yn(d-M,u+M).filter(y=>y>=d-M&&y<=u+M).map(y=>({pos:i(R(y)),label:f(y)}));for(let y of Re(C,w.width))b.push({kind:"line",part:"grid",x1:y.pos,x2:y.pos,y1:w.y,y2:w.y+w.height,stroke:Y.grid},X(y.pos,w.y+w.height+20,y.label,{part:"x-label",anchor:"middle"}));e.xAxis?.label&&b.push(X(i(w.x+w.width/2),o-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let I=Ve(l.length,[w.y,w.y+w.height],0),D=Math.max(0,Math.floor((I.step/2-14)/Ha));l.forEach((y,$)=>{let G=i(I.center($));b.push({kind:"line",part:"axis",x1:w.x,x2:w.x+w.width,y1:G,y2:G,stroke:Y.axis}),y&&b.push(X(w.x-8,G,y,{part:"y-label",anchor:"end",baseline:"middle"}))});let F=l.map(()=>[]),p=[],O=[];for(let y of v){let $=i(R(y.time)),G=i(I.center(y.lane));if(O.push({kind:"circle",part:"event",cx:$,cy:G,r:5,fill:y.color,stroke:"var(--skdx-color-surface-default)",title:y.text,item:E(y)}),!x)continue;let j=y.event.label.length*ue,_=$-j/2,S=F[y.lane],V=0;for(;V<=D&&(S[V]??-1/0)>_-6;)V++;if(V>D)continue;S[V]=_+j;let P=i(G-12-V*Ha),U=i(Math.max(j/2+2,Math.min(a-j/2-2,$)));V>0&&p.push({kind:"line",part:"connector",x1:$,x2:$,y1:i(G-6),y2:i(P+4),stroke:Y.grid}),p.push(X(U,P,y.event.label,{part:"event-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}return{...A,shapes:[...b,...p,...O,...A.shapes],issues:n}}function tr(e,n,t,r,a){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*a/o.height:t}}var ja=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Os(e,n){let t=0,r=1/0;return e.xs.forEach((a,o)=>{let s=Math.abs(a-n);s<r&&(r=s,t=o)}),t}function $r(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Os(t,n),a=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(a,r)??a}}function Ga(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Os(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:Y.axis,dash:"3 3"}}function Wa(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!ja(r.plot,n,t))return[];let a=Ga(e,n),{rows:o}=$r(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[a,...Pr(a.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Za(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let a=t.xs[r];return Wa(e,a,t.plot.y+8)}function qa(e,n,t,r,a){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:d}=tr(t,r,a,e.width,e.height);if(ja(e.hit.plot,l,d)){let u=$r(e,l),h=Ga(e,l);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?Pn(e,n)?.item:void 0,c=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return c?{lines:Array.isArray(c)?c:[c],shapes:[]}:{lines:[],shapes:[]}}function Ss(e,n,t,r,a,o,s){let c=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?Pn(s,e)?.item:void 0,d=l&&s?.tooltipFormatter?.(l)||c&&Array.from(c.children).find(v=>v.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let u=s?.tooltipAnchored?Pn(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:f,y:x}=h?kr(h):tr(n,t,r,a,o);return Pr(f,x,d,a,o,s?.tooltipPlacement)}function Ua(e,n,t,r,a){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=tr(t,r,a,e.width,e.height),c=Wa(e,o,s);if(c.length>0)return c}return Ss(n,t,r,a,e.width,e.height,e)}function Ya(e,n){let t=Pn(e,n);return t&&!t.item.legend?Fn(t.item):null}var nl=(e,n)=>{let{x:t,y:r}=kr(e),a=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&a>=n.y&&a<=n.y+n.height};function Ka(e,n){let t=new Set,r=[];for(let a of e.shapes){if(!a.item||a.item.legend||a.part==="anchor"||!nl(a,n))continue;let o=Fn(a.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Xa=e=>({kind:"rect",part:"selection-box",x:i(e.x),y:i(e.y),width:i(e.width),height:i(e.height),fill:Y.focus,opacity:.12,stroke:Y.focus}),Ur=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function zs(e,n,t){let r=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){let s=e[a],c=e[o];s.y>t!=c.y>t&&n<(c.x-s.x)*(t-s.y)/(c.y-s.y)+s.x&&(r=!r)}return r}function Qa(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let a of e.shapes){if(!a.item||a.item.legend||a.part==="anchor")continue;let{x:o,y:s}=kr(a),c=a.kind==="circle"?a.cy:a.kind==="rect"?a.y+a.height/2:s;if(!zs(n,o,c))continue;let l=Fn(a.item),d=JSON.stringify(l);t.has(d)||(t.add(d),r.push(l))}return r}var Ja=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${i(n.x)} ${i(n.y)}`).join("L")}`:"",fill:Y.focus,fillOpacity:.12,stroke:Y.focus,dash:"4 3"}),qr=6;function eo(e,n,t){let r=e.edit;if(r){for(let a of r.bars)if(!(t<a.y||t>a.y+a.height||n<a.x0-qr||n>a.x1+qr))return Math.abs(n-a.x0)<=qr?{bar:a,mode:"start"}:Math.abs(n-a.x1)<=qr?{bar:a,mode:"end"}:{bar:a,mode:"move"}}}function to(e,n,t){let r=e.edit;return Ns(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function no(e,n,t){let r=e.edit,a=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!a||!(t.shiftKey||t.altKey))return;let o=r.bars.find(l=>l.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",c=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Ns(r,{bar:o,mode:s},a*c)}function Ns(e,{bar:n,mode:t},r){let a=c=>e.snap?Math.round(c/e.snap)*e.snap:c,o=n.start,s=n.end;return t==="move"?(o=a(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(a(n.start+r),n.end):s=Math.max(a(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function ro(e,n,t){let r=e.edit,a=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:i(Math.min(a,o)),y:i(n.bar.y),width:i(Math.max(1,Math.abs(o-a))),height:i(n.bar.height),fill:Y.focus,opacity:.25,stroke:Y.focus,rx:2}}var rl=64,al=e=>Math.max(1,Math.min(rl,e));function ao(e,n,t,r){let a=n>0?.8:1.25,o=al(e.view.zoom*a);if(o===e.view.zoom)return e.view;let{plot:s,scale:c}=e,[l,d]=e.view.center,u=(t-(s.x+s.width/2))/c,h=(r-(s.y+s.height/2))/c,f=e.view.zoom/o;return{center:[l+u*(1-f),e.fromY(e.toY(d)-h*(1-f))],zoom:o}}function oo(e,n,t,r){let{scale:a}=e;return{center:[n.center[0]-t/a,e.fromY(e.toY(n.center[1])+r/a)],zoom:n.zoom}}function Pn(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),a=Number.isInteger(r)?e.shapes[r]?.item:void 0;return a?{index:r,item:a}:void 0}var Yr=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function kr(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function so(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=Y.focus,a;switch(t.kind){case"rect":a={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":a={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":a={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":a={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ue+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":a={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=kr(t),c=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[a,...c?Pr(i(o),i(s),c,e.width,e.height):[]]}function io(e,n,t){let r=Yr(e);if(r.length===0)return;let a=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,a+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,a<=0?0:a-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var Jn=2,er=(e,n,t)=>{let r=Math.max(Jn,Math.min(t,Math.round(n))),a=Math.max(0,Math.min(t-r,Math.round(e)));return{start:a,end:a+r}},Rs=(e,n)=>!e||e.start<=0&&e.end>=n;function lo(e,n,t){if(e.count<=Jn||!e.plot.width)return;let{start:r,end:a}=e.zoom,o=a-r,s=n>0?1.25:.8,c=Math.max(Jn,Math.min(e.count,Math.round(o*s)));if(c===o)return n>0&&!Rs(e.zoom,e.count)?er(r,c,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+l*o;return er(d-l*c,c,e.count)}function co(e,n,t,r){let a=n.end-n.start,o=Math.max(Jn,Math.min(e.count,Math.round(a/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return er(n.start+s*a-s*o,o,e.count)}function mo(e,n,t){let r=n.end-n.start,a=e.plot.width/Math.max(1,r);return er(n.start-t/a,r,e.count)}function uo(e,n,t){let r=e.brush;if(!r||!ja(r.box,n,t))return;let a=r.window;if(Math.abs(n-a.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(a.x+a.width))<=6)return{grab:"right",zoom:e.zoom};if(n>a.x&&n<a.x+a.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:er(s-o/2,o,e.count)}}function ho(e,n,t,r){let a=e.brush;if(!a)return t;let o=r/Math.max(1,a.box.width)*e.count;if(n==="move")return er(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Jn,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+Jn,Math.round(t.end+o)));return{start:t.start,end:s}}function Ar(e,n){switch(n.type){case"svg":return Promise.resolve(Tr(e,n.label,n.resolve));case"csv":return Promise.resolve(Cr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Tr(e,n.label,n.resolve);return Bs(t,e.width,e.height,n.scale,n.background)}}}var Cn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),Ir=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${Cn(String(t))}"`).join("");function Es(e){let n=e.title?`<title>${Cn(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Ir([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${Ir([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${Ir([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${Ir([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Ir([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${Cn(e.text)}</text>`}}function Ds(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${Cn(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${Cn(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Tr(e,n,t){let r=Ds(e)+e.shapes.map(Es).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(a,o)=>t(o).trim()||a)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${Cn(n)}" font-family="${Cn(Y.fontFamily)}" font-size="${Cn(Y.fontSize)}"><title>${Cn(n)}</title>${r}</svg>`}function Bs(e,n,t,r=2,a){return new Promise((o,s)=>{let c=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(c);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let u=d.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));a&&(u.fillStyle=a,u.fillRect(0,0,d.width,d.height)),u.drawImage(l,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(c),s(new Error("svg could not be decoded"))},l.src=c})}function Cr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
|
|
2
|
-
`)}function fo(e,n=[]){let t=Math.max(n.length,...e.map(a=>a.data.length)),r=[["",...e.map(a=>a.name)]];for(let a=0;a<t;a++){let o=n[a];r.push([o instanceof Date?o.toISOString():o??a+1,...e.map(s=>s.data[a])])}return Cr(r)}var Ee=e=>H(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+Ee(t),0),po=e=>H(e.value)||(e.children??[]).some(po),Lr=e=>e.length===0?0:1+Math.max(...e.map(n=>Lr(n.children??[]))),et=e=>e.id??e.name;function Fs(e,n){for(let t of e){if(et(t)===n||t.name===n)return[t];let r=Fs(t.children??[],n);if(r)return[t,...r]}}var nr=(e,n)=>n==="asc"||n==="desc"?[...e].sort((t,r)=>n==="asc"?Ee(t)-Ee(r):Ee(r)-Ee(t)):[...e];function dn(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:Ee(r),children:void 0}:{...r,children:r.children?dn(r.children,n,t+1):void 0})}function vn(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Fs(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function bo(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let c=r.rows[0];if(r.rows.length>t)return;let l=["",...c.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],d=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[l,...d]}let a=e.shapes.flatMap(c=>c.item&&!c.item.legend&&!(c.part==="anchor"&&!c.title)?[c.item]:[]);if(a.length===0||a.length>t)return;let o=["series","name","category","value"].filter(c=>a.some(l=>l[c]!==void 0)),s=(c,l)=>c[l]===void 0?"":String(c[l]);return[o.map(c=>c[0]?.toUpperCase()+c.slice(1)),...a.map(c=>o.map(l=>s(c,l)))]}var go=new Map;function rr(e){let n=go.get(e);if(n)return n.group;let t=new Set,r={},a={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&go.delete(e)}},publish(o,s){Object.assign(r,o);for(let c of t)c(o,s)}};return go.set(e,{group:a,listeners:t}),a}var Ps='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',xo=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Ps}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${Ps}{animation:none;transition:none}}`;function yo(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function vo(e){let n=[],t=e.nodes?new Set(e.nodes.map(p=>p.id)):void 0,r=e.links.filter(p=>!H(p.value)||p.value<=0?(n.push({code:"invalid-value",severity:"warning",message:`Link ${p.source} \u2192 ${p.target} has no positive value and was dropped.`,itemId:p.id}),!1):p.source===p.target?(n.push({code:"self-link",severity:"warning",message:`Link ${p.source} \u2192 ${p.target} points at its own node and was dropped.`,itemId:p.id}),!1):t&&!(t.has(p.source)&&t.has(p.target))?(n.push({code:"unknown-node",severity:"warning",message:`Link ${p.source} \u2192 ${p.target} names a node not in \`nodes\` and was dropped.`,itemId:p.id}),!1):!0),{links:a,back:o}=ol(r),s=e.cyclePolicy??"drop";for(let p of o)n.push({code:"cycle",severity:s==="error"?"error":"warning",message:`Link ${p.source} \u2192 ${p.target} closes a cycle and was ${s==="error"?"rejected":"dropped"}.`,itemId:p.id});let c=oe(s==="error"&&o.length>0?{...e,error:e.error??`${o.length} link${o.length===1?"":"s"} close a cycle`}:e,a.length===0);if(c)return{...c,issues:n};let l=re(e.format),d=Math.max(0,e.nodePadding??8),u=Math.max(1,e.nodeWidth??16),{width:h,height:f}=le(e),x=ke(h,f,{top:8+ce(e),right:96,bottom:8,left:8}),v=new Map,g=new Map((e.nodes??[]).map(p=>[p.id,p])),A=p=>{let O=v.get(p);if(!O){let y=g.get(p);O={id:p,name:y?.label??p,depth:0,value:0,color:te(e,v.size,y?.color),x:0,y:0,height:0,outY:0,inY:0},v.set(p,O)}return O};for(let p of e.nodes??[])A(p.id);for(let p of a)A(p.source),A(p.target);for(let p=0,O=!0;O&&p<=v.size;p++){O=!1;for(let y of a){let $=A(y.source).depth+1;$>A(y.target).depth&&(A(y.target).depth=$,O=!0)}}let E=new Map,b=new Map;for(let p of a)E.set(p.source,(E.get(p.source)??0)+p.value),b.set(p.target,(b.get(p.target)??0)+p.value);if(e.align==="justify"){let p=Math.max(0,...[...v.values()].map(O=>O.depth));for(let O of v.values())E.has(O.id)||(O.depth=p)}let N=Zn(e.selected).map(String),L=p=>N.includes(p),w=p=>N.length===0||L(p)||a.some(O=>L(O.source)&&O.target===p||L(O.target)&&O.source===p);for(let p of v.values())p.value=Math.max(E.get(p.id)??0,b.get(p.id)??0);let M=new Map;for(let p of v.values())M.set(p.depth,[...M.get(p.depth)??[],p]);if(e.nodeSort)for(let p of M.values())p.sort((O,y)=>e.nodeSort==="asc"?O.value-y.value:y.value-O.value);let R=Math.max(0,...M.keys()),C=Math.min(...[...M.values()].map(p=>(x.height-d*(p.length-1))/p.reduce((O,y)=>O+y.value,0)));for(let[p,O]of M){let y=x.y;for(let $ of O)$.x=x.x+(R===0?0:p*(x.width-u)/R),$.y=y,$.height=$.value*C,$.outY=$.inY=y,y+=$.height+d}let I=[...a];e.linkSort&&I.sort((p,O)=>e.linkSort==="asc"?p.value-O.value:O.value-p.value);let D=[],F=[];for(let p of I){let O=A(p.source),y=A(p.target),$=p.value*C,G=N.length===0||L(p.source)||L(p.target),j=O.x+u,_=y.x,S=(j+_)/2,V=O.outY,P=y.inY;O.outY+=$,y.inY+=$;let U=`${O.name} \u2192 ${y.name}: ${l(p.value)}`;D.push({kind:"path",part:"link",d:`M${i(j)} ${i(V)}C${i(S)} ${i(V)} ${i(S)} ${i(P)} ${i(_)} ${i(P)}L${i(_)} ${i(P+$)}C${i(S)} ${i(P+$)} ${i(S)} ${i(V+$)} ${i(j)} ${i(V+$)}Z`,fill:O.color,opacity:G?.4:.08,title:U,item:{label:U,id:p.id??`${p.source}\u2192${p.target}`,name:p.source,category:p.target,value:p.value}});let k=_-j>(O.name.length+l(p.value).length)*ue+24;e.linkLabels&&$>=12&&G&&k&&F.push(X(i(S),i((V+P+$)/2),l(p.value),{part:"link-label",anchor:"middle",baseline:"middle"}))}for(let p of v.values()){let O=`${p.name}: ${l(p.value)}`;D.push({kind:"rect",part:"node",x:i(p.x),y:i(p.y),width:u,height:i(p.height),fill:p.color,opacity:w(p.id)?void 0:.3,title:O,item:{label:O,id:p.id,name:p.name,value:p.value}});let y=p.depth===R;(e.nodeLabels??!0)&&D.push(X(i(y?p.x-6:p.x+u+6),i(p.y+p.height/2),p.name,{anchor:y?"end":"start",baseline:"middle"}))}return{...de(e,h,f),shapes:[...D,...F],issues:n}}function ol(e){let n=new Map;for(let o of e)n.set(o.source,[...n.get(o.source)??[],o]);let t=new Map,r=new Set,a=o=>{t.set(o,"active");for(let s of n.get(o)??[]){let c=t.get(s.target);c==="active"?r.add(s):c===void 0&&a(s.target)}t.set(o,"done")};for(let o of e)t.has(o.source)||a(o.source);return{links:e.filter(o=>!r.has(o)),back:[...r]}}function Mo(e,n,t,r,a,o){if(e.length===0)return;let s=(h,f)=>{let x=h.reduce((A,E)=>A+E.area,0),v=Math.max(...h.map(A=>A.area)),g=Math.min(...h.map(A=>A.area));return Math.max(f*f*v/(x*x),x*x/(f*f*g))},c=Math.min(r,a),l=[],d=0;for(;d<e.length;){let h=[...l,e[d]];if(l.length===0||s(h,c)<=s(l,c))l=h,d++;else break}let u=l.reduce((h,f)=>h+f.area,0);if(r>=a){let h=u/a,f=t;for(let x of l){let v=x.area/h;o(x,[n,f,h,v]),f+=v}Mo(e.slice(d),n+h,t,r-h,a,o)}else{let h=u/r,f=n;for(let x of l){let v=x.area/h;o(x,[f,t,v,h]),f+=v}Mo(e.slice(d),n,t+h,r,a-h,o)}}function sl(e,n,t,r,a,o,s){let c=e.reduce((d,u)=>d+u.area,0),l=s?t:n;for(let d of e){let u=c>0?d.area/c:0;if(s){let h=a*u;o(d,[n,l,r,h]),l+=h}else{let h=r*u;o(d,[l,t,h,a]),l+=h}}}function wo(e){let{nodes:n,path:t}=vn(e.data,e.rootId),r=dn(n,e.maxDepth),a=oe(e,!r.some(w=>Ee(w)>0));if(a)return a;let o=re(e.format),{width:s,height:c}=le(e),l=e.breadcrumbs&&t.length>0,d=ce(e)+(l?20:0),u=Math.max(0,e.padding??2),h=e.sort??"desc",f=e.tiling??"squarify",x=e.labels??!0,v=[],g=r.map((w,M)=>({name:w.name,color:te(e,M,w.color)})),A=[],E=w=>{for(let M of w)M.children?.length?E(M.children):A.push(Ee(M))};E(r);let b=e.colorScale?Nt(e.colorScale,A,te(e,0),void 0,o):void 0,N=(w,M,R,C,I,D,F)=>{let p=w.reduce(($,G)=>$+Math.max(0,Ee(G)),0),O=nr(w,h).map($=>{let G=Ee($),_=!(($.children?.length??0)>0)&&b?b.color(G):void 0;return{node:$,value:G,color:_?.fill??$.color??D??te(e,w.indexOf($)),opacity:_?.opacity,area:p>0?Math.max(0,G)/p*C*I:0}}).filter($=>$.area>0&&!(D===void 0&&be(e,$.node.name))),y=($,[G,j,_,S])=>{let V=`${$.node.name}: ${o($.value)}`,P=($.node.children?.length??0)>0;v.push({kind:"rect",part:P?"branch":"tile",x:i(G),y:i(j),width:i(_),height:i(S),fill:$.color,opacity:P?.15:$.opacity,stroke:"var(--skdx-color-surface-default)",title:V,item:{label:V,id:et($.node),name:$.node.name,value:$.value}}),P?N($.node.children,G+u,j+u,Math.max(0,_-2*u),Math.max(0,S-2*u),$.color,F+1):x&&_>40&&S>20&&v.push(X(i(G+6),i(j+6),$.node.name,{baseline:"hanging",fill:"var(--skdx-color-text-on-accent)"}))};f==="squarify"?Mo(O,M,R,C,I,y):sl(O,M,R,C,I,y,f==="slice"||f==="sliceDice"&&F%2===0)};N(r,0,d,s,c-d,void 0,0),l&&v.push(...ar(t,8,ce(e)+10));let L=de(e,s,c,g);return{...L,shapes:[...v,...L.shapes]}}function ar(e,n,t){let r=[],a=n;return e.forEach((o,s)=>{s>0&&(r.push(X(i(a),t,"\u203A",{part:"breadcrumb-separator",baseline:"middle"})),a+=ue+6),r.push(X(i(a),t,o.name,{part:"breadcrumb",baseline:"middle",fill:"var(--skdx-color-text-default)",title:o.name,item:{label:o.name,id:et(o),name:o.name}})),a+=o.name.length*ue+6}),r}var il=.22,ll=20,Vs=32,Hs=28,cl=e=>H(e.open)&&H(e.high)&&H(e.low)&&H(e.close);function $o(e){let n=[],t=e.data.filter(z=>cl(z)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Candle "${String(z.label)}" has a non-finite open/high/low/close and was dropped.`,itemId:z.id}),!1)),r=oe(e,t.length===0);if(r)return{...r,issues:n};let a=e.upColor??Y.positive,o=e.downColor??Y.negative,s=re(e.format),c=t.length,l=Math.max(0,Math.min(c-2,Math.floor(e.zoom?.start??0))),d=e.zoom?Math.max(l+2,Math.min(c,Math.ceil(e.zoom.end))):c,u={start:l,end:d},h=t.slice(l,d),f=t.some(z=>H(z.volume)),{width:x,height:v}=le(e),g=e.brush?Vs+Hs:0,A=e.rangeSelector??[],E=e.compare?h[0].close:void 0,b=z=>E!==void 0&&E!==0?z/E-1:z,N=E!==void 0?{style:"percent",digits:1}:void 0,L=re({style:"percent",digits:1}),w=t.map(z=>z.close),M=(e.overlays??[]).map((z,W)=>{let J=z.name??`${z.type.toUpperCase()} ${z.period}`,Z=z.type==="ema"?vs(w,z.period):ga(w,z.period);return{name:J,color:z.color??te(e,W+2),values:Z.slice(l,d),hidden:be(e,J)}}),R=Pt([...h.flatMap(z=>[b(z.low),b(z.high)]),...M.filter(z=>!z.hidden).flatMap(z=>z.values.map(W=>H(W)?b(W):W))],!1),C=ke(x,v,{...me,top:me.top+ce(e)+(A.length?ll:0),bottom:me.bottom+g,left:e.scale==="log"?me.left:Vr(R,re(N??e.format))}),I=f?C.height*il:0,D={...C,height:Math.max(0,C.height-I-(f?8:0))},F=He(R,[D.y+D.height,D.y],{scale:e.scale==="log"?"log":"linear",format:N},e.format),p=h.map(z=>We(z.label)),O=e.xAxis?.type==="time"&&p.every(z=>Number.isFinite(z)),y=Ve(h.length,[D.x,D.x+D.width]),$;if(O){let z=[...p].sort((pe,je)=>pe-je),W=1/0;for(let pe=1;pe<z.length;pe++)W=Math.min(W,z[pe]-z[pe-1]);let[J,Z]=ve(p),K=W===1/0?Math.max(1,Math.abs(Z)*.05||1):W/2,ne=ot([J-K,Z+K],[D.x,D.x+D.width]),ee=Math.abs(ne(J+(W===1/0?K:W))-ne(J))*.8;y={step:ee,bandwidth:ee,start:pe=>ne(p[pe])-ee/2,center:pe=>ne(p[pe])};let Me=e.xAxis?.format??{style:"date"};$=Yn(J-K,Z+K).filter(pe=>pe>=J-K&&pe<=Z+K).map(pe=>({pos:i(ne(pe)),label:qt(pe,Me)}))}let G=h.map(z=>qt(z.label,e.xAxis?.format)),j=[{name:"Up",color:a},{name:"Down",color:o},...M.map(z=>({name:z.name,color:z.color}))],_=de(e,x,v,j),S={..._,plot:D,xTicks:Re($??h.map((z,W)=>({pos:i(y.center(W)),label:G[W]})),D.width),yTicks:F.ticks,baseline:D.y+D.height},V=Ze(S),P={plot:D,x:z=>{let W=typeof z=="string"?z:We(z),J=h.findIndex((Z,K)=>typeof W=="string"?G[K]===W||Z.label===W:We(Z.label)===W);return J<0?void 0:y.center(J)},y:z=>F.scale(b(z))};V.push(...Vt(e.references,P)),A.forEach((z,W)=>{let J=z.candles>0?{start:Math.max(0,c-z.candles),end:c}:{start:0,end:c},Z=J.start===l&&J.end===d;V.push(X(i(D.x+W*40),i(C.y-8),z.label,{part:"range-button",baseline:"middle",fill:Z?"var(--skdx-color-text-default)":Y.label,weight:Z?"bold":void 0,title:`${z.label}: last ${z.candles>0?Math.min(z.candles,c):c} candles`,item:{label:z.label,name:z.label,range:J}}))});let U=e.variant==="ohlc",k=[];if(h.forEach((z,W)=>{let Z=z.close>=z.open?a:o,K=i(y.center(W)),ne=E!==void 0?` (${L(b(z.close))})`:"",ee=`${G[W]}: O ${s(z.open)} H ${s(z.high)} L ${s(z.low)} C ${s(z.close)}${ne}${H(z.volume)?` V ${s(z.volume)}`:""}`,Me={label:ee,id:z.id,category:G[W],index:l+W,value:z.close};k.push([G[W],`Open: ${s(z.open)}`,`High: ${s(z.high)}`,`Low: ${s(z.low)}`,`Close: ${s(z.close)}${ne}`,...H(z.volume)?[`Volume: ${s(z.volume)}`]:[],...M.filter(q=>!q.hidden).map(q=>`${q.name}: ${H(q.values[W])?s(q.values[W]):"\u2014"}`)]);let pe=F.scale(b(Math.max(z.open,z.close))),je=F.scale(b(Math.min(z.open,z.close)));if(U){let q=y.bandwidth/2;V.push({kind:"line",part:"wick",x1:K,x2:K,y1:i(F.scale(b(z.high))),y2:i(F.scale(b(z.low))),stroke:Z,strokeWidth:1.5,title:ee,item:Me},{kind:"line",part:"open",x1:i(K-q),x2:K,y1:i(F.scale(b(z.open))),y2:i(F.scale(b(z.open))),stroke:Z,strokeWidth:1.5},{kind:"line",part:"close",x1:K,x2:i(K+q),y1:i(F.scale(b(z.close))),y2:i(F.scale(b(z.close))),stroke:Z,strokeWidth:1.5})}else V.push({kind:"line",part:"wick",x1:K,x2:K,y1:i(F.scale(b(z.high))),y2:i(F.scale(b(z.low))),stroke:Z,title:ee},{kind:"rect",part:"candle",x:i(y.start(W)),y:i(pe),width:i(y.bandwidth),height:i(Math.max(1,je-pe)),fill:Z,title:ee,item:Me})}),f){let z=D.y+D.height+8,[,W]=ve(h.map(J=>J.volume));h.forEach((J,Z)=>{if(!H(J.volume))return;let K=W>0?J.volume/W*I:0;V.push({kind:"rect",part:"volume",x:i(y.start(Z)),y:i(z+I-K),width:i(y.bandwidth),height:i(Math.max(K,0)),fill:J.close>=J.open?a:o,opacity:.4,title:`${G[Z]}: volume ${s(J.volume)}`})})}for(let z of M){if(z.hidden)continue;let W=z.values.flatMap((J,Z)=>H(J)?[{x:i(y.center(Z)),y:i(F.scale(b(J)))}]:[]);W.length<2||V.push({kind:"path",part:"overlay",d:st(W),stroke:z.color,strokeWidth:1.5,strokeLinejoin:"round",title:z.name,item:{label:z.name,series:z.name}})}for(let z of e.flags??[]){let W=P.x(z.label);if(W===void 0)continue;let J=h.findIndex((ee,Me)=>y.center(Me)===W),Z=h[J],K=F.scale(b(Z.high))-6,ne=St(z.variant??"primary");V.push({kind:"path",part:"flag",d:`M${i(W)} ${i(K)}V${i(K-10)}H${i(W+8)}L${i(W+5)} ${i(K-7)}L${i(W+8)} ${i(K-4)}H${i(W)}Z`,fill:ne,stroke:ne,title:z.text,item:{label:z.text,name:z.text,category:G[J],index:l+J}})}V.push(...En(e.annotations,P));let B={plot:C,xs:h.map((z,W)=>i(y.center(W))),rows:k,count:c,zoom:u,crosshair:Br(e)};if(e.brush){let z={x:C.x,y:C.y+C.height+Hs,width:C.width,height:Vs},W=t.map(Me=>Me.close),[J,Z]=ve(W),K=c>1?z.width/(c-1):0,ne=W.map((Me,pe)=>({x:i(z.x+pe*K),y:i(z.y+z.height-(Z===J?.5:(Me-J)/(Z-J))*(z.height-4)-2)})),ee={x:i(z.x+l/c*z.width),y:z.y,width:i((d-l)/c*z.width),height:z.height};V.push({kind:"rect",part:"brush",...z,fill:"var(--skdx-color-surface-sunken)",stroke:Y.grid},{kind:"path",part:"brush-series",d:ne.length>1?`${st(ne)}L${ne[ne.length-1]?.x} ${z.y+z.height}L${ne[0]?.x} ${z.y+z.height}Z`:"",fill:"var(--skdx-color-primary-500)",fillOpacity:.3},{kind:"rect",part:"brush-window",...ee,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:Y.axis},{kind:"rect",part:"brush-handle",x:i(ee.x-3),y:z.y+8,width:6,height:z.height-16,fill:Y.axis,rx:2},{kind:"rect",part:"brush-handle",x:i(ee.x+ee.width-3),y:z.y+8,width:6,height:z.height-16,fill:Y.axis,rx:2}),B.brush={box:z,window:ee}}return{..._,shapes:[...V,..._.shapes],hit:B,issues:n}}var dl="var(--skdx-color-success-500)",ml="var(--skdx-color-danger-500)";function ko(e){let n=[],t=e.data.filter(M=>M.type==="subtotal"||M.type==="total"||M.subtotal||H(M.value)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Row "${M.name}" has no valid value and was dropped.`,itemId:M.id??M.name}),!1)),r=oe(e,t.length===0);if(r)return{...r,issues:n};let a=re(e.format),{width:o,height:s}=le(e),c=e.orientation==="horizontal",l=e.positiveColor??dl,d=e.negativeColor??ml,u=e.totalColor??te(e,0),h=[],f=H(e.start)?e.start:0,x=M=>`${M>=0?"+":""}${a(M)}`;H(e.start)&&e.startLabel!==void 0&&h.push({id:void 0,name:e.startLabel,from:0,to:f,color:u,title:`${e.startLabel}: ${a(f)}`,flat:!0});for(let M of t){if((M.type??(M.subtotal?"subtotal":"change"))!=="change"){h.push({id:M.id,name:M.name,from:0,to:f,color:M.color??u,title:`${M.name}: ${a(f)}`,flat:!0});continue}let C=f;f+=M.value,h.push({id:M.id,name:M.name,from:C,to:f,color:M.color??(M.value>=0?l:d),title:`${M.name}: ${x(M.value)}`,flat:!1})}e.total!==void 0&&h.push({id:void 0,name:e.total,from:0,to:f,color:u,title:`${e.total}: ${a(f)}`,flat:!0});let v=c?Math.max(0,...h.map(M=>M.name.length))*ue+16:0,g=ke(o,s,{...me,top:me.top+ce(e),left:Math.max(me.left,v),right:e.labels&&c?56:me.right}),A=h.flatMap(M=>[M.from,M.to]),E=He([Math.min(0,...A),Math.max(0,...A)],c?[g.x,g.x+g.width]:[g.y+g.height,g.y],{},e.format),b=Ve(h.length,c?[g.y,g.y+g.height]:[g.x,g.x+g.width]),N=de(e,o,s,[{name:"Increase",color:l},{name:"Decrease",color:d}]),L=h.map((M,R)=>({pos:i(b.center(R)),label:M.name})),w=Ze({...N,plot:g,xTicks:c?L:Re(L,g.width),yTicks:c?Re(E.ticks,g.width):E.ticks,baseline:E.zero},{horizontal:c});return h.forEach((M,R)=>{let C=E.scale(M.from),I=E.scale(M.to),D=Math.min(C,I),F=Math.max(1,Math.abs(I-C));if(w.push({kind:"rect",part:"bar",x:i(c?D:b.start(R)),y:i(c?b.start(R):D),width:i(c?F:b.bandwidth),height:i(c?b.bandwidth:F),fill:M.color,title:M.title,item:{label:M.title,id:M.id??M.name,name:M.name,index:R,value:M.flat?M.to:M.to-M.from}}),e.labels){let O=M.flat?a(M.to):x(M.to-M.from),y=Math.max(C,I);w.push(c?X(i(y+6),i(b.center(R)),O,{part:"value-label",baseline:"middle"}):X(i(b.center(R)),i(D-4),O,{part:"value-label",anchor:"middle"}))}let p=h[R+1];if(p&&(e.connectors??!0)){let O=i(I),y=i(E.scale(p.flat?p.to:p.from));w.push(c?{kind:"line",part:"connector",x1:O,x2:y,y1:i(b.start(R)+b.bandwidth),y2:i(b.start(R+1)),stroke:Y.axis,dash:"4 3"}:{kind:"line",part:"connector",x1:i(b.start(R)+b.bandwidth),x2:i(b.start(R+1)),y1:O,y2:y,stroke:Y.axis,dash:"4 3"})}}),{...N,shapes:[...w,...N.shapes],issues:n}}function ul(e){let n=new Map;for(let l of e)l.id!==void 0&&!n.has(l.id)&&n.set(l.id,l),n.has(l.name)||n.set(l.name,l);let t=new Map,r=new Set,a=l=>{let d=t.get(l);if(d)return d;if(r.has(l))return{length:0,next:void 0};r.add(l);let u={length:0,next:void 0};for(let f of l.dependsOn??[]){let x=n.get(f);if(!x||x===l)continue;let v=a(x);v.length>u.length&&(u={length:v.length,next:x})}r.delete(l);let h={length:u.length+Math.max(0,l.end-l.start),next:u.next};return t.set(l,h),h},o,s=-1;for(let l of e){let d=a(l);d.length>s&&(s=d.length,o=l)}let c=new Set;for(let l=o;l&&!c.has(l);l=t.get(l)?.next)c.add(l);return c}function Io(e){let n=[],t=e.tasks.filter(k=>{let B=H(k.start)&&(k.milestone?!0:H(k.end));return B?!k.milestone&&k.end<k.start&&n.push({code:"inverted-range",severity:"warning",message:`Task "${k.name}" ends before it starts; the interval was normalized.`,itemId:k.id??k.name}):n.push({code:"invalid-value",severity:"warning",message:`Task "${k.name}" has no valid start/end and was dropped.`,itemId:k.id??k.name}),B}),r=oe(e,t.length===0);if(r)return{...r,issues:n};let{width:a,height:o}=le(e),s=e.criticalPath?ul(t):void 0,c=k=>k.id??k.name,l=new Map;for(let k of t)k.id!==void 0&&!l.has(k.id)&&l.set(k.id,k),l.has(k.name)||l.set(k.name,k);let d=new Map,u=[];for(let k of t){let B=k.parent===void 0?void 0:l.get(k.parent);B&&B!==k?d.set(B,[...d.get(B)??[],k]):u.push(k)}let h=new Set(e.collapsed??[]),f=k=>h.has(c(k))||h.has(k.name),x=[],v=(k,B,z)=>{if(!z.has(k)&&(z.add(k),x.push({task:k,depth:B}),!f(k)))for(let W of d.get(k)??[])v(W,B+1,z)},g=new Set;for(let k of u)v(k,0,g);let A=x.map(k=>k.task),E=new Map(x.map(k=>[k.task,k.depth])),b=k=>{let B=d.get(k)??[];if(B.length===0||H(k.end)&&k.end!==k.start)return{start:k.start,end:k.end};let z=B.map(b);return{start:Math.min(...z.map(W=>W.start)),end:Math.max(...z.map(W=>W.end))}},N=[...new Set(A.map(k=>k.group??k.name))],L=new Map;for(let k of A){let B=k.group??k.name;L.has(B)||L.set(B,E.get(k)??0)}let w=k=>A.some(B=>(B.group??B.name)===k&&f(B)&&(d.get(B)?.length??0)>0)?" +":"",M=Math.max(0,...N.map(k=>k.length+w(k).length))*ue+Math.max(0,...N.map(k=>(L.get(k)??0)*12)),R=ke(a,o,{top:8+ce(e),right:16,bottom:32+(e.xAxis?.label?14:0),left:Math.min(a/2,Math.max(64,M+16))}),C=re(e.xAxis?.format??e.format),I=e.today===void 0?void 0:We(e.today),[D,F]=ve([...A.flatMap(k=>{let B=b(k);return[...k.milestone?[k.start]:[B.start,B.end],...k.baseline?[k.baseline.start,k.baseline.end]:[]]}),...I!==void 0?[I]:[]]),p=He([D,F],[R.x,R.x+R.width],{ticks:e.xAxis?.ticks,format:e.xAxis?.format},e.format),O=Ve(N.length,[R.y,R.y+R.height]),y=[],$=[],G=k=>p.domain[0]+(k-R.x)/Math.max(1,R.width)*(p.domain[1]-p.domain[0]);for(let k of Re(p.ticks,R.width))y.push({kind:"line",part:"grid",x1:k.pos,x2:k.pos,y1:R.y,y2:R.y+R.height,stroke:Y.grid}),y.push(X(k.pos,R.y+R.height+20,k.label,{part:"x-label",anchor:Hr(k.pos,k.label,a)}));N.forEach((k,B)=>{let z=A.find(W=>(W.group??W.name)===k);y.push(X(R.x-8,i(O.center(B)),`${k}${w(k)}`,{part:"y-label",anchor:"end",baseline:"middle",item:z&&(d.get(z)?.length??0)>0?{label:k,id:c(z),name:z.name}:void 0}))});for(let k of y){if(k.kind!=="text"||k.part!=="y-label")continue;let B=L.get(k.text.replace(/ \+$/,""))??0;B&&(k.x=i(k.x+B*12))}let j=864e5;if(e.nonWorkingDays?.length&&F-D<=400*j&&F>D){let k=new Set(e.nonWorkingDays);for(let B=Math.floor(D/j)*j;B<F;B+=j){if(!k.has(new Date(B).getUTCDay()))continue;let z=Math.max(D,B),W=Math.min(F,B+j);W<=z||y.push({kind:"rect",part:"non-working",x:i(p.scale(z)),y:R.y,width:i(Math.max(0,p.scale(W)-p.scale(z))),height:R.height,fill:Y.grid,opacity:.12})}}e.xAxis?.label&&y.push(X(i(R.x+R.width/2),o-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let _={plot:R,x:k=>p.scale(We(k)),y:k=>O.center(k)};y.push(...Vt([...e.references??[],...I!==void 0?[{x:I,label:"Today",variant:"primary"}]:[]],_));let S=new Map,V=[];A.forEach(k=>{if(be(e,k.name))return;let B=t.indexOf(k),z=N.indexOf(k.group??k.name),W=b(k),J=p.scale(Math.min(W.start,W.end)),Z=k.milestone?J:p.scale(Math.max(W.start,W.end)),K=(d.get(k)?.length??0)>0;if(k.baseline&&!k.milestone){let ie=p.scale(Math.min(k.baseline.start,k.baseline.end)),Oe=p.scale(Math.max(k.baseline.start,k.baseline.end));y.push({kind:"rect",part:"baseline",x:i(ie),y:i(O.start(z)+O.bandwidth*.75),width:i(Math.max(1,Oe-ie)),height:i(O.bandwidth/4),fill:Y.axis,opacity:.6,rx:1,title:`${k.name} planned: ${C(k.baseline.start)} \u2013 ${C(k.baseline.end)}`})}let ne=O.center(z),ee=te(e,B,k.color),Me=s&&!s.has(k)?.35:void 0;if(S.has(k.name)||S.set(k.name,{x0:J,x1:Z,mid:ne}),k.id!==void 0&&!S.has(k.id)&&S.set(k.id,{x0:J,x1:Z,mid:ne}),k.milestone){let ie=O.bandwidth/2,Oe=`${k.name}: ${C(k.start)}`;y.push({kind:"path",part:"milestone",d:`M${i(J)} ${i(ne-ie)}L${i(J+ie)} ${i(ne)}L${i(J)} ${i(ne+ie)}L${i(J-ie)} ${i(ne)}Z`,fill:ee,opacity:Me,title:Oe,item:{label:Oe,id:k.id,name:k.name,category:k.group,index:B,value:k.start}});return}let pe=H(k.progress)?Math.max(0,Math.min(1,k.progress)):void 0,je=`${k.name}: ${C(W.start)} \u2013 ${C(W.end)}${pe!==void 0?` \xB7 ${Math.round(pe*100)}% done`:""}`;K||$.push({index:y.length,id:k.id??k.name,name:k.name,start:Math.min(k.start,k.end),end:Math.max(k.start,k.end),x0:i(J),x1:i(Z),y:i(O.start(z)),height:i(O.bandwidth)});let q=k.baseline?O.bandwidth*.7:O.bandwidth;y.push({kind:"rect",part:K?"summary":"bar",x:i(J),y:i(O.start(z)),width:i(Math.max(1,Z-J)),height:i(K?O.bandwidth/3:q),fill:ee,rx:2,opacity:Me,title:je,item:{label:je,id:k.id,name:k.name,category:k.group,index:B,value:Math.abs(k.end-k.start)}}),pe!==void 0&&pe>0&&V.push({kind:"rect",part:"progress",x:i(J),y:i(ne-O.bandwidth/4),width:i(Math.max(1,(Z-J)*pe)),height:i(O.bandwidth/2),fill:"var(--skdx-color-text-default)",opacity:.35,rx:1})});let P=new Map;for(let k of t)k.id!==void 0&&!P.has(k.id)&&P.set(k.id,k),P.has(k.name)||P.set(k.name,k);for(let k of t)for(let B of k.dependsOn??[]){let z=S.get(B),W=S.get(k.id??k.name);if(!z){n.push({code:"unknown-node",severity:"warning",message:`Task "${k.name}" depends on "${String(B)}", which does not exist.`,itemId:k.id??k.name});continue}if(!W||z===W)continue;let J=Math.max(z.x1+6,W.x0-6),Z=P.get(B),K=s&&Z&&s.has(Z)&&s.has(k),ne=`${Z?.name??String(B)} \u2192 ${k.name}`;V.push({kind:"path",part:"dependency",d:`M${i(z.x1)} ${i(z.mid)}H${i(J)}V${i(W.mid)}H${i(W.x0)}`,stroke:K?"var(--skdx-color-danger-500)":Y.axis,strokeWidth:K?2.5:1.5,opacity:s&&!K?.35:void 0,title:ne,item:{label:ne,name:Z?.name??String(B),category:k.name}})}y.push(...V,...En(e.annotations,_));let U=de(e,a,o,e.tasks.map((k,B)=>({name:k.name,color:te(e,B,k.color)})));return{...U,shapes:[...y,...U.shapes],issues:n,edit:{scale:k=>p.scale(k),invert:G,bars:$}}}var To=e=>{let n=e.length;return n===0?0:n%2?e[(n-1)/2]:(e[n/2-1]+e[n/2])/2},hl=(e,n)=>{if(e.length===0)return 0;let t=(e.length-1)*n,r=Math.floor(t),a=Math.ceil(t),o=e[r],s=e[a];return o+(s-o)*(t-r)},fl=(e,n)=>{let t=e.length;if(t===0)return 0;let r=(t+1)*n-1;if(r<=0)return e[0];if(r>=t-1)return e[t-1];let a=Math.floor(r),o=e[a],s=e[a+1];return o+(s-o)*(r-a)};function pl(e,n="linear"){let t=To(e),r=e.length;if(r===0)return{q1:0,median:0,q3:0};if(n==="tukey"){let o=Math.floor(r/2),s=e.slice(0,r%2?o+1:o),c=e.slice((r%2,o));return{q1:To(s),median:t,q3:To(c)}}let a=n==="exclusive"?fl:hl;return{q1:a(e,.25),median:t,q3:a(e,.75)}}function bl(e,n="linear",t=1.5){let r=Fe(e).sort((v,g)=>v-g),{q1:a,median:o,q3:s}=pl(r,n),c=s-a,l=a-t*c,d=s+t*c,u=r.filter(v=>v>=l&&v<=d),h=r.length?r.reduce((v,g)=>v+g,0)/r.length:0,f=u[0]??a,x=u[u.length-1]??s;return{name:"",q1:a,median:o,q3:s,min:f,max:x,low:f,high:x,mean:h,outliers:r.filter(v=>v<l||v>d),count:r.length}}var _s=e=>"median"in e&&!("data"in e),js=e=>"data"in e&&Array.isArray(e.data[0]);function Ao(e){let n=e.quartileMethod??"linear",t=e.whisker??1.5,r=[],a=e.categories,o=a!==void 0,s=(y,$)=>r.push({code:"invalid-value",severity:"warning",message:$,itemId:y.id??y.name}),c=[];e.series.forEach((y,$)=>{let G=te(e,$,y.color),j=(_,S,V)=>{let P=V??(S&&Fe(S).length?bl(S,n,t):void 0);return!P||![P.min,P.q1,P.median,P.q3,P.max].every(H)?!1:(P.count!==void 0&&P.count<5&&r.push({code:"small-sample",severity:"warning",message:`Series "${y.name}"${o?` at "${a[_]??_}"`:""} has ${P.count} observation${P.count===1?"":"s"}; quartiles are not meaningful below 5.`,itemId:y.id??y.name}),c.push({si:$,ci:_,name:y.name,id:y.id,color:G,st:{...P,name:y.name},raw:S}),!0)};if(!o){(_s(y)?j(0,void 0,y):js(y)?j(0,y.data.flat()):j(0,y.data))||s(y,`Series "${y.name}" has no valid observations or summary and was skipped.`);return}if(_s(y)){s(y,`Series "${y.name}" is a summary, which cannot be grouped by categories; it was skipped.`);return}if(!js(y)){s(y,`Series "${y.name}" is not grouped (its data is one sample, not one per category); it was drawn in the first category.`),j(0,y.data);return}a.forEach((_,S)=>j(S,y.data[S]))});let l=oe(e,c.length===0);if(l)return{...l,issues:r};let d=re(e.yAxis?.format??e.format),{width:u,height:h}=le(e),f=e.orientation==="horizontal",x=o?a:e.series.map(y=>y.name),v=Math.max(0,...x.map(y=>y.length))*ue,g=ke(u,h,{...me,top:me.top+ce(e)+(e.yAxis?.label?12:0),left:f?Math.max(me.left,v+16):me.left,bottom:me.bottom+(f&&e.yAxis?.label?14:0)}),A=c.filter(y=>!be(e,y.name)),E=A.flatMap(y=>[y.st.min,y.st.max,...y.st.outliers??[],...H(y.st.mean)?[y.st.mean]:[]]),b=He(Pt(E,!1),f?[g.x,g.x+g.width]:[g.y+g.height,g.y],e.yAxis??{},e.format),N=Ve(x.length,f?[g.y,g.y+g.height]:[g.x,g.x+g.width]),L=o?[...new Set(A.map(y=>y.si))]:[],w=o?N.bandwidth/Math.max(1,L.length):N.bandwidth,M=y=>o?N.start(y.ci)+(L.indexOf(y.si)+.5)*w:N.center(y.si),R=de(e,u,h,e.series.map((y,$)=>({name:y.name,color:te(e,$,y.color)}))),C=x.map((y,$)=>({pos:i(N.center($)),label:y})),I=Ze({...R,plot:g,xTicks:f?C:Re(C,g.width),yTicks:f?Re(b.ticks,g.width):b.ticks,baseline:f?g.x:g.y+g.height},{horizontal:f,grid:Rn(e.yAxis),...f?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}}),D=(y,$,G)=>{let j=i(b.scale(y)),_=i(b.scale($));return f?{x1:j,x2:_,y1:G,y2:G}:{x1:G,x2:G,y1:j,y2:_}},F=(y,$,G,j)=>{let _=b.scale(y),S=b.scale($),V=Math.max(1,Math.abs(S-_));return f?{x:i(Math.min(_,S)),y:i(G-j/2),width:i(V),height:i(j)}:{x:i(G-j/2),y:i(Math.min(_,S)),width:i(j),height:i(V)}},p=(y,$)=>f?`${i(b.scale(y))} ${i($)}`:`${i($)} ${i(b.scale(y))}`,O=(y,$,G,j,_,S,V)=>({kind:"circle",part:_,cx:f?i(b.scale(y)):i($),cy:f?i($):i(b.scale(y)),r:G,fill:j,opacity:V,title:S});for(let y of A){let{st:$,color:G,name:j,raw:_}=y,S=i(M(y)),V=o?a[y.ci]:void 0,P=V!==void 0?`${j}, ${V}`:j,U=`${P}: min ${d($.min)} Q1 ${d($.q1)} median ${d($.median)} Q3 ${d($.q3)} max ${d($.max)}${e.mean&&H($.mean)?` mean ${d($.mean)}`:""}`,k={label:U,id:y.id,series:j,seriesId:y.id??j,category:V,index:o?y.ci:y.si,value:$.median},B=w*.6,z=B/2,W=f?{x1:i(b.scale($.median)),x2:i(b.scale($.median)),y1:i(S-z),y2:i(S+z)}:{x1:i(S-z),x2:i(S+z),y1:i(b.scale($.median)),y2:i(b.scale($.median))},J=$.count,Z=e.notched&&J?Math.min(1.58*($.q3-$.q1)/Math.sqrt(J),($.q3-$.q1)/2):0,K=Z?{kind:"path",part:"box",d:`M${[p($.q1,S-z),p($.median-Z,S-z),p($.median,S-z+B/4),p($.median+Z,S-z),p($.q3,S-z),p($.q3,S+z),p($.median+Z,S+z),p($.median,S+z-B/4),p($.median-Z,S+z),p($.q1,S+z)].join("L")}Z`,fill:G,stroke:G,fillOpacity:.5,title:U,item:k}:{kind:"rect",part:"box",...F($.q1,$.q3,S,B),fill:G,stroke:G,opacity:.5,title:U,item:k};if(I.push({kind:"line",part:"whisker",...D($.max,$.min,S),stroke:G,title:U},K,{kind:"line",part:"median",...W,stroke:G,title:U},...($.outliers??[]).map(ne=>O(ne,S,3,G,"outlier",`${P}: ${d(ne)}`))),e.mean&&H($.mean)){let ne=f?i(b.scale($.mean)):S,ee=f?S:i(b.scale($.mean));I.push({kind:"path",part:"mean",d:`M${ne} ${i(ee-4)}L${i(ne+4)} ${ee}L${ne} ${i(ee+4)}L${i(ne-4)} ${ee}Z`,fill:"var(--skdx-color-text-default)",title:`${P} mean: ${d($.mean)}`})}e.points&&_&&Fe(_).forEach((ne,ee)=>{let Me=(ee*7919%97/96-.5)*B*.8;I.push(O(ne,S+Me,2,G,"observation",`${P}: ${d(ne)}`,.6))})}return{...R,shapes:[...I,...R.shapes],issues:r}}var Co=e=>e*Math.PI/180;function Lo(e){let{nodes:n,path:t}=vn(e.data,e.rootId),r=dn(n,e.maxDepth),a=oe(e,!r.some(p=>Ee(p)>0),300,300);if(a)return a;let o=re(e.format),{width:s,height:c}=le(e,300,300),l=Math.min(.9,Math.max(0,e.innerRadius??0)),d=e.breadcrumbs&&t.length>0,u=d&&l===0,h=ce(e)+(u?20:0),f=s/2,x=h+(c-h)/2,v=Math.max(0,Math.min(s,c-h)/2-8),g=v*l,A=(v-g)/Math.max(1,Lr(r)),E=Co(e.startAngle??0),b=Co(e.endAngle??(e.startAngle??0)+360),N=Math.max(0,Co(e.padAngle??0)),L=e.sort??"none",w=[],M=p=>{for(let O of p)O.children?.length?M(O.children):w.push(Ee(O))};M(r);let R=e.colorScale?Nt(e.colorScale,w,te(e,0),void 0,o):void 0,C=[],I=[],D=(p,O,y,$,G)=>{let j=k=>O===0&&be(e,k.name)?0:Math.max(0,Ee(k)),_=nr(p,L),S=_.reduce((k,B)=>k+j(B),0),V=Math.max(0,_.filter(k=>j(k)>0).length-1),P=Math.max(0,$-V*N),U=y;_.forEach(k=>{let B=j(k),z=S>0?B/S*P:0,J=!((k.children?.length??0)>0)&&R?R.color(B):void 0,Z=J?.fill??k.color??G??te(e,p.indexOf(k));if(z>0){let K=g+A*O,ne=K+A;if(e.labels&&z*((K+ne)/2)>k.name.length*ue+4){let Me=U+z/2,pe=(K+ne)/2;I.push(X(i(f+pe*Math.sin(Me)),i(x-pe*Math.cos(Me)),k.name,{part:"arc-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}let ee=`${k.name}: ${o(B)}`;C.push({kind:"path",part:"arc",d:Ke(f,x,ne,K,U,U+z),fill:Z,opacity:J?J.opacity:1-O*.2,stroke:"var(--skdx-color-surface-default)",title:ee,item:{label:ee,id:et(k),name:k.name,value:B}}),D(k.children??[],O+1,U,z,Z),U+=z+N}})};if(D(r,0,E,Math.max(0,Math.min(2*Math.PI,b-E)),void 0),e.centerLabel&&I.push(X(i(f),i(d&&!u?x-8:x),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),d){let p=t.reduce((O,y)=>O+y.name.length*ue+6,0)+(t.length-1)*(ue+6);I.push(...u?ar(t,8,ce(e)+10):ar(t,f-p/2,e.centerLabel?x+8:x))}let F=de(e,s,c,r.map((p,O)=>({name:p.name,color:te(e,O,p.color)})));return{...F,shapes:[...C,...I,...F.shapes]}}var gl=2*Math.PI,xl=12,Or=5;function yl(e){let n=[];if(e.links){let a=[...e.names??[]],o=new Set(a);for(let l of e.links)for(let d of[l.source,l.target])o.has(d)||(e.names&&n.push({code:"unknown-node",severity:"warning",message:`Link ${l.source} \u2192 ${l.target} names "${d}", which is not in \`names\`; it was added.`,itemId:l.id}),o.add(d),a.push(d));let s=new Map(a.map((l,d)=>[l,d])),c=a.map(()=>a.map(()=>0));for(let l of e.links){if(!H(l.value)||l.value<0){n.push({code:"invalid-value",severity:"warning",message:`Link ${l.source} \u2192 ${l.target} has no valid value and was dropped.`,itemId:l.id});continue}let d=c[s.get(l.source)];d[s.get(l.target)]=d[s.get(l.target)]+l.value}return{names:a,matrix:c,issues:n}}let t=e.names??[],r=e.matrix??[];return(r.length!==t.length||r.some(a=>a.length!==t.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${r.length} \xD7 ${r[0]?.length??0} but there are ${t.length} names; missing cells count as zero.`}),{names:t,matrix:r,issues:n}}function Oo(e){let{names:n,matrix:t,issues:r}=yl(e),a=oe(e,n.length===0||!t.some(_=>_.some(S=>H(S)&&S>0)),300,300);if(a)return{...a,issues:r};let o=re(e.format),{width:s,height:c}=le(e,300,300),l=ce(e),d=s/2,u=l+(c-l)/2,h=e.ticks?8+Or+14:8,f=h+Math.max(0,...n.map(_=>_.length))*ue+4,x=Math.max(0,Math.min(s/2-f,(c-l)/2-36)),v=Math.max(0,x-xl),g=(e.padding??2.3)*Math.PI/180,A=(_,S)=>{let V=t[_]?.[S];return H(V)?Math.max(0,V):0},E=_=>n.reduce((S,V,P)=>S+A(_,P)+A(P,_),0),b=n.map((_,S)=>S);e.sort&&b.sort((_,S)=>e.sort==="asc"?E(_)-E(S):E(S)-E(_));let N=b.map(_=>n[_]),L=_=>te(e,b[_]),w=N.length,M=Zn(e.selected)[0],R=M===void 0?-1:N.indexOf(String(M)),C=(_,S)=>be(e,N[_])||be(e,N[S])?0:A(b[_],b[S]),I=N.map((_,S)=>N.reduce((V,P,U)=>V+C(S,U),0)),D=I.reduce((_,S)=>_+S,0),F=D>0?(gl-g*w)/D:0,p=(_,S)=>`${i(d+S*Math.sin(_))} ${i(u-S*Math.cos(_))}`,O=[],y=0;for(let _=0;_<w;_++){let S=y,V=N.map((P,U)=>{let k=y;return y+=C(_,U)*F,{a0:k,a1:y}});O.push({a0:S,a1:y,sub:V}),y+=g}let $=[],G=[];for(let _=0;_<w;_++)for(let S=_;S<w;S++){let V=C(_,S),P=C(S,_);if(V+P===0)continue;let U=O[_].sub[S],k=O[S].sub[_],B=K=>K.a1-K.a0>Math.PI?1:0,z=_===S?`M${p(U.a0,v)}A${v} ${v} 0 ${B(U)} 1 ${p(U.a1,v)}Q${i(d)} ${i(u)} ${p(U.a0,v)}Z`:`M${p(U.a0,v)}A${v} ${v} 0 ${B(U)} 1 ${p(U.a1,v)}Q${i(d)} ${i(u)} ${p(k.a0,v)}A${v} ${v} 0 ${B(k)} 1 ${p(k.a1,v)}Q${i(d)} ${i(u)} ${p(U.a0,v)}Z`,W=V>=P?_:S,J=R<0||_===R||S===R,Z=_===S?`${N[_]}: ${o(V)}`:`${N[_]} \u2192 ${N[S]}: ${o(V)} \xB7 ${N[S]} \u2192 ${N[_]}: ${o(P)}`;$.push({kind:"path",part:"chord",d:z,fill:L(W),opacity:J?.5:.08,title:Z,item:{label:Z,id:`${N[_]}\u2192${N[S]}`,name:N[_],category:N[S],value:V+P}})}O.forEach((_,S)=>{if(_.a1<=_.a0)return;let V=`${N[S]}: ${o(I[S])}`;$.push({kind:"path",part:"group",d:Ke(d,u,x,v,_.a0,_.a1),fill:L(S),opacity:R<0||S===R||C(S,R)+C(R,S)>0?void 0:.3,title:V,item:{label:V,id:N[S],name:N[S],index:S,value:I[S]}});let P=(_.a0+_.a1)/2,U=Math.sin(P),k=x+h;if($.push(X(i(d+k*U),i(u-k*Math.cos(P)),N[S],{anchor:U>.1?"start":U<-.1?"end":"middle",baseline:"middle"})),!e.ticks)return;let B=I[S];ut(0,B,4).filter(z=>z<=B).forEach((z,W)=>{let J=_.a0+z*F,Z=Math.sin(J),K=Math.cos(J);if($.push({kind:"line",part:"tick",x1:i(d+x*Z),y1:i(u-x*K),x2:i(d+(x+Or)*Z),y2:i(u-(x+Or)*K),stroke:Y.axis}),W%2)return;let ne=i(d+(x+Or+3)*Z),ee=i(u-(x+Or+3)*K);G.some(Me=>Math.abs(Me.x-ne)<12&&Math.abs(Me.y-ee)<12)||(G.push({x:ne,y:ee}),$.push(X(ne,ee,o(z),{part:"tick-label",anchor:Z>.1?"start":Z<-.1?"end":"middle",baseline:"middle"})))})});let j=de(e,s,c,N.map((_,S)=>({name:_,color:L(S)})));return{...j,shapes:[...$,...j.shapes],issues:r}}var Vn=8,So=e=>e.geometry.type==="Polygon"?e.geometry.coordinates:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.flat():[],Ws=e=>e.geometry.type==="Point"?[e.geometry.coordinates]:e.geometry.type==="MultiPoint"?e.geometry.coordinates:[],Zs=e=>e.geometry.type==="LineString"?[e.geometry.coordinates]:e.geometry.type==="MultiLineString"?e.geometry.coordinates:[],Gs=e=>[...So(e).flat(),...Ws(e),...Zs(e).flat()],vl=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),or=e=>e!==void 0&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function zo(e){let n=[],t=e.features.filter(B=>{let z=Gs(B).some(or);return z||n.push({code:"invalid-geometry",severity:"warning",message:`Feature "${B.name}" has no valid coordinates and was dropped.`,itemId:B.id??B.name}),z}),r=oe(e,t.length===0);if(r)return{...r,issues:n};let a=re(e.format),{width:o,height:s}=le(e),c=ce(e),l=Dn(e.colorLegend).bottom,d=Dn(e.colorLegend).right,u=e.projection==="mercator"?vl:B=>B,h=t.filter(B=>So(B).length>0),f=(h.length?h:t).flatMap(B=>Gs(B).filter(or)),[x,v]=f.length?ve(f.map(B=>B[0])):[0,1],[g,A]=f.length?ve(f.map(B=>u(B[1]))):[0,1],E=Math.min((o-d-2*Vn)/Math.max(1e-9,v-x),(s-c-l-2*Vn)/Math.max(1e-9,A-g)),b={x:Vn,y:c+Vn,width:o-d-2*Vn,height:s-c-l-2*Vn},N=Math.max(1,Math.min(64,e.view?.zoom??1)),L=E*N,w=e.view?.center?[e.view.center[0],u(e.view.center[1])]:[(x+v)/2,(g+A)/2],M=b.x+b.width/2-w[0]*L,R=b.y+b.height/2+w[1]*L,C=([B,z])=>({x:i(M+B*L),y:i(R-u(z)*L)}),I=B=>{let{x:z,y:W}=C(B);return`${z} ${W}`},D=te(e,0,e.color),F=Nt(e.colorScale,t.map(B=>B.value),D,void 0,a),p=[],O=h.map(B=>{let z=So(B);if(e.labels&&z.length){let Z=z.reduce((pe,je)=>je.length>pe.length?je:pe),[K,ne]=ve(Z.map(pe=>pe[0])),[ee,Me]=ve(Z.map(pe=>u(pe[1])));p.push(X(i(M+((K+ne)/2-x)*L),i(R+(A-(ee+Me)/2)*L),B.name,{part:"region-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"}))}let W=B.color!==void 0?{fill:B.color,opacity:1}:F.color(B.value),J=`${B.name}${H(B.value)?`: ${a(B.value)}`:""}`;return{kind:"path",part:"region",d:z.map(Z=>`M${Z.filter(or).map(I).join("L")}Z`).join(""),fill:W?.fill??Y.grid,opacity:W?.opacity??.6,stroke:"var(--skdx-color-surface-default)",title:J,item:{label:J,id:B.id??B.name,name:B.name,value:B.value}}}),y=[...e.lines??[],...t.flatMap(B=>Zs(B).map(z=>({id:B.id,name:B.name,coordinates:z,value:B.value,color:B.color??(H(B.value)?F.color(B.value)?.fill:void 0),dash:void 0})))].filter(B=>B.coordinates.filter(or).length>=2),[,$]=ve(y.map(B=>B.value)),G=y.map((B,z)=>{let W=`${B.name}${H(B.value)?`: ${a(B.value)}`:""}`;return{kind:"path",part:"route",d:`M${B.coordinates.filter(or).map(I).join("L")}`,stroke:B.color??te(e,2),strokeWidth:H(B.value)&&$>0?1+3*Math.sqrt(Math.max(0,B.value)/$):1.5,strokeLinecap:"round",strokeLinejoin:"round",dash:B.dash,opacity:.85,title:W,item:{label:W,id:B.id??B.name,name:B.name,index:z,value:B.value}}}),j=[...e.points??[],...t.flatMap(B=>Ws(B).map(z=>({id:B.id,name:B.name,coordinates:z,value:B.value,color:B.color??(H(B.value)?F.color(B.value)?.fill:void 0)})))].filter(B=>or(B.coordinates)),[_,S]=e.sizeRange??[3,14],[,V]=ve(j.map(B=>B.value)),P=j.map((B,z)=>{let{x:W,y:J}=C(B.coordinates),Z=Number.isFinite(B.value)&&V>0,K=`${B.name}${Z?`: ${a(B.value)}`:""}`;return{kind:"circle",part:Z?"bubble":"point",cx:W,cy:J,r:i(Z?Math.max(_,Math.sqrt(Math.max(0,B.value)/V)*S):_),fill:B.color??te(e,1),stroke:"var(--skdx-color-surface-default)",opacity:.85,title:K,item:{label:K,id:B.id??B.name,name:B.name,index:z,value:B.value}}}),U=e.colorLegend?Qn(F,d?{x:b.x+b.width+12,y:b.y,width:d,height:b.height}:{x:Vn,y:s-l+8,width:o-2*Vn,height:l},Dn(e.colorLegend).options):[],k=e.projection==="mercator"?B=>Math.atan(Math.exp(B))*360/Math.PI-90:B=>B;return{...de(e,o,s),shapes:[...O,...G,...p,...P,...U],issues:n,map:{view:{center:[w[0],k(w[1])],zoom:N},bounds:{minLon:x,maxLon:v,minLat:g,maxLat:A},plot:b,scale:L,toY:u,fromY:k}}}function No(e){let n=[],t=e.segments.map((C,I)=>typeof C=="string"?{name:C,id:C,color:te(e,I)}:{name:C.name,id:C.id??C.name,color:te(e,I,C.color)}),r=t.map(C=>!be(e,C.name)),a=(C,I)=>{let D=C.values[I];return D==null?0:!H(D)||D<0?(n.push({code:H(D)?"negative-value":"invalid-value",severity:"warning",message:`"${t[I]?.name}" in "${C.name}" is ${H(D)?"negative":"not a number"}; drawn as zero.`,itemId:C.id??C.name}),0):D},o=e.data.map((C,I)=>{let D=t.map((O,y)=>r[y]?a(C,y):0),F=D.reduce((O,y)=>O+y,0),p=H(C.total)&&C.total>=0?C.total:F;return{c:C,ci:I,values:D,sum:F,total:p}}),s=o.reduce((C,I)=>C+I.total,0),c=oe(e,s<=0);if(c)return{...c,issues:n};let l=re(e.format),d=re(e.xAxis?.format??e.format),{width:u,height:h}=le(e),f=ke(u,h,{...me,top:me.top+ce(e),bottom:me.bottom+(e.xAxis?.label?14:0)+(e.xAxis?.format?14:0)}),x=Math.max(0,Math.min(.2,e.gap??.01))*f.width,v=Math.max(0,o.length-1),g=Math.max(0,f.width-x*v),A=He([0,1],[f.y+f.height,f.y],{format:{style:"percent"}}),E=de(e,u,h,t.map(C=>({name:C.name,color:C.color}))),b=f.x,N=o.map(C=>{let I=C.total/s*g,D={x:b,w:I};return b+=I+x,{...C,...D}}),L=N.map(C=>({pos:i(C.x+C.w/2),label:C.c.name})),w=Ze({...E,plot:f,xTicks:Re(L,f.width),yTicks:A.ticks,baseline:A.zero},{xLabel:e.xAxis?.label,yLabel:void 0});if(e.xAxis?.format)for(let C of N)C.w>24&&w.push(X(i(C.x+C.w/2),f.y+f.height+34,d(C.total),{part:"x-total",anchor:"middle"}));let M=[],R=[];for(let C of N){let I=0;C.values.forEach((D,F)=>{let p=t[F];if(D<=0||C.sum<=0)return;let O=D/C.sum,y=A.scale(I+O),$=A.scale(I);I+=O;let G=`${Math.round(O*100)}%`,j=`${p.name}, ${C.c.name}: ${l(D)} (${G}) \xB7 column ${d(C.total)}`,_=Math.max(0,$-y);M.push({kind:"rect",part:"cell",x:i(C.x),y:i(y),width:i(C.w),height:i(_),fill:p.color,stroke:"var(--skdx-color-surface-default)",title:j,item:{label:j,id:`${C.c.id??C.c.name}:${p.name}`,series:p.name,seriesId:p.id,category:C.c.name,index:C.ci,value:D}}),e.labels&&_>14&&C.w>24&&R.push(X(i(C.x+C.w/2),i(y+_/2),G,{part:"cell-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))})}return{...E,shapes:[...w,...M,...R,...E.shapes],issues:n}}var qs=500;function Ro(e){let n=[],t=e.dimensions,r=e.data.filter(L=>!(L.group!==void 0&&be(e,L.group))),a=oe(e,t.length===0||r.length===0);if(a)return{...a,issues:n};let{width:o,height:s}=le(e),c=[...new Set(e.data.map(L=>L.group).filter(L=>L!==void 0))],l=t[0],d=t[t.length-1],u=L=>(L.label??L.key).length*ue/2+8,h=ke(o,s,{top:28+ce(e),right:Math.max(16,u(d)),bottom:16,left:Math.max(48,u(l))}),f=(L,w)=>{let M=L.values[w];return M==null?null:H(M)?M:(n.push({code:"invalid-value",severity:"warning",message:`"${L.name}" has a value on "${w}" that is not a number; drawn as a gap.`,itemId:L.id??L.name}),null)},x=t.map((L,w)=>{let[M,R]=ve(r.map($=>f($,L.key))),C=ut(L.min??M,L.max??R),I=L.min??C[0],D=L.max??C[C.length-1],F=L.reversed?[h.y,h.y+h.height]:[h.y+h.height,h.y],p=ot([I,D],F),O=i(t.length===1?h.x+h.width/2:h.x+w*h.width/(t.length-1)),y=re(L.format??e.format);return{d:L,x:O,scale:$=>i(p(Math.max(I,Math.min(D,$)))),format:y,ticks:C.filter($=>$>=I-1e-9&&$<=D+1e-9)}}),v=[];x.forEach((L,w)=>{v.push({kind:"line",part:"axis",x1:L.x,x2:L.x,y1:h.y,y2:h.y+h.height,stroke:Y.axis});let M=w===x.length-1&&x.length>1?"start":"end";for(let R of L.ticks)v.push(X(i(M==="end"?L.x-6:L.x+6),L.scale(R),L.format(R),{part:"y-label",anchor:M,baseline:"middle"}));v.push(X(L.x,h.y-12,L.d.label??L.d.key,{part:"axis-title",anchor:"middle"}))});let g=r.length<=qs,A=e.opacity??(r.length>200?.25:.6),E=L=>(e.filters??[]).every(w=>{let M=f(L,w.key);return M!==null&&M>=(w.min??-1/0)&&M<=(w.max??1/0)}),b=r.map((L,w)=>{let M=[],R=[];for(let I of x){let D=f(L,I.d.key);if(D===null){!e.connectNulls&&R.length&&(M.push(R),R=[]);continue}R.push({x:I.x,y:I.scale(D)})}R.length&&M.push(R);let C=`${L.name}: ${x.map(I=>{let D=f(L,I.d.key);return`${I.d.label??I.d.key} ${D===null?"\u2014":I.format(D)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:M.map(I=>st(I,e.curve)).join(""),stroke:L.color??(L.group!==void 0?te(e,c.indexOf(L.group)):te(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:E(L)?A:.08,title:g?C:void 0,item:g?{label:C,id:L.id??L.name,name:L.name,category:L.group,index:w}:void 0}}),N=de(e,o,s,c.map((L,w)=>({name:L,color:te(e,w)})));return{...N,shapes:[...v,...b,...N.shapes],issues:n}}function Eo(e){let n=e.orientation==="vertical",t=oe(e,!H(e.value),600,n?300:64);if(t)return t;let r=re(e.format),a=e.min??0,o=(e.bands??[]).filter(d=>H(d.from)&&H(d.to)),s=e.max??Math.max(100,e.value,e.target??-1/0,...o.map(d=>d.to)),c=H(e.target)?`, target ${r(e.target)}`:"";return{...wr({...e,height:e.height??(n?300:64),data:[{id:"value",name:e.caption??"",value:e.value,target:e.target,ranges:o}],min:a,max:s,labels:e.labels??!0,ticks:e.ticks}),description:e.description??`${e.caption??"Value"} ${r(e.value)} on a scale from ${r(a)} to ${r(s)}${c}.`}}function Do(e){let n=[],t=e.data.filter(F=>{let p=H(F.start)||H(F.end);return p||n.push({code:"invalid-value",severity:"warning",message:`"${F.name}" has neither a valid start nor end and was dropped.`,itemId:F.id??F.name}),p}),r=oe(e,t.length===0);if(r)return{...r,issues:n};let a=re(e.xAxis?.format??e.format),{width:o,height:s}=le(e),c=e.orientation==="vertical",l=e.startLabel??"Start",d=e.endLabel??"End",u=be(e,l),h=be(e,d),f=[...t];if(e.sort){let F=p=>e.sort==="change"?(H(p.end)?p.end:0)-(H(p.start)?p.start:0):H(p.end)?p.end:-1/0;f.sort((p,O)=>e.sort==="asc"?F(p)-F(O):F(O)-F(p))}let x=Math.max(0,...f.map(F=>F.name.length))*ue,v=ke(o,s,{...me,top:me.top+ce(e)+(c&&e.xAxis?.label?12:0),right:e.labels&&!c?56:me.right,bottom:me.bottom+(!c&&e.xAxis?.label?14:0),left:c?me.left:Math.max(me.left,x+16)}),g=He(Pt(f.flatMap(F=>[u?void 0:F.start,h?void 0:F.end]),!1),c?[v.y+v.height,v.y]:[v.x,v.x+v.width],e.xAxis??{},e.format),A=Ve(f.length,c?[v.x,v.x+v.width]:[v.y,v.y+v.height]),E=te(e,0),b=te(e,1),N=de(e,o,s,[{name:l,color:E},{name:d,color:b}]),L=f.map((F,p)=>({pos:i(A.center(p)),label:F.name})),w=Ze({...N,plot:v,xTicks:c?Re(L,v.width):L,yTicks:c?g.ticks:Re(g.ticks,v.width),baseline:c?v.y+v.height:v.x},{horizontal:!c,grid:Rn(e.xAxis),...c?{yLabel:e.xAxis?.label}:{xLabel:e.xAxis?.label}});w.push(...Vt(e.references,{plot:v,horizontal:!c,x:F=>{let p=f.findIndex(O=>O.name===F);return p<0?void 0:A.center(p)},y:F=>g.scale(F)}));let M=e.markerSize??5,R=(F,p)=>c?{x:i(p),y:i(g.scale(F))}:{x:i(g.scale(F)),y:i(p)},C=[],I=[],D=[];return f.forEach((F,p)=>{let O=A.center(p),y=H(F.start)?a(F.start):"\u2014",$=H(F.end)?a(F.end):"\u2014",G=`${F.name}: ${y} \u2192 ${$}`,j={label:G,id:F.id??F.name,name:F.name,index:p,value:H(F.end)?F.end:void 0};if(!u&&!h&&H(F.start)&&H(F.end)){let _=R(F.start,O),S=R(F.end,O);C.push({kind:"line",part:"connector",x1:_.x,y1:_.y,x2:S.x,y2:S.y,stroke:F.color??Y.axis,strokeWidth:3,title:G,item:j})}for(let[_,S,V,P,U]of[[F.start,"start",l,E,u],[F.end,"end",d,b,h]]){if(U||!H(_))continue;let k=R(_,O),B=`${F.name} \xB7 ${V}: ${a(_)}`;I.push({kind:"circle",part:S,cx:k.x,cy:k.y,r:M,fill:P,stroke:"var(--skdx-color-surface-default)",title:B,item:{...j,label:B,series:V}}),e.labels&&D.push(c?X(k.x,i(k.y+(S==="end"?-M-4:M+12)),a(_),{part:"value-label",anchor:"middle"}):X(i(k.x+(S==="end"?M+4:-M-4)),k.y,a(_),{part:"value-label",anchor:S==="end"?"start":"end",baseline:"middle"}))}}),{...N,shapes:[...w,...C,...I,...D,...N.shapes],issues:n}}function Bo(e){let n=[],r=e.data.filter(u=>{let h=H(u.value)&&u.value>=0;return h||n.push({code:"invalid-value",severity:"warning",message:`"${u.name}" has no valid non-negative value and was dropped.`,itemId:u.id??u.name}),h}).map((u,h)=>({d:u,i:h})).sort((u,h)=>h.d.value-u.d.value||u.i-h.i),a=r.reduce((u,{d:h})=>u+h.value,0),o=0,s=r.map(({d:u})=>a>0?(o+=u.value)/a:0),c=e.threshold,l=Ht({...e,categories:r.map(({d:u})=>u.name),series:[{name:e.name??"Value",type:"bar",data:r.map(({d:u})=>u.value),color:r[0]?.d.color},{name:e.cumulativeLabel??"Cumulative",type:"line",axis:"right",data:s,curve:"linear"}],rightAxis:{min:0,max:1,format:{style:"percent"}},references:c!==void 0&&H(c)?[{y:c,axis:"right",label:`${Math.round(c*100)}%`,variant:"primary"}]:void 0},"bar"),d=l.shapes.map(u=>{if(u.part!=="bar"||u.kind!=="rect"||!u.item||u.item.index===void 0)return u;let h=r[u.item.index]?.d;return h?{...u,fill:h.color??u.fill,item:{...u.item,id:h.id??h.name,name:h.name}}:u});return{...l,shapes:d,issues:[...n,...l.issues??[]]}}function Kr(e){let{nodes:n,path:t}=vn(e.data,e.rootId),r=dn(n,e.maxDepth),a=oe(e,r.length===0);if(a)return a;let o=re(e.format),{width:s,height:c}=le(e),l=e.orientation!=="horizontal",d=e.nodeShape==="box",u=e.linkStyle??"curve",h=new Set(e.collapsed??[]),f=e.labels??!0,x=[],v=0,g=0,A=(V,P,U,k)=>{let B=h.has(et(V))||h.has(V.name),z=B?[]:V.children??[],W=V.color??U?.color??te(e,k),J={node:V,depth:P,slot:0,parent:U,collapsed:B,color:W};if(g=Math.max(g,P),z.length===0)J.slot=v++;else{let Z=z.map((K,ne)=>A(K,P+1,J,ne));J.slot=(Z[0].slot+Z[Z.length-1].slot)/2}return x.push(J),J};r.forEach((V,P)=>A(V,0,void 0,P));let E=V=>Math.max(V.name.length,V.subtitle?.length??0),b=Math.max(0,...x.map(V=>E(V.node)))*ue+16,N=e.nodeSize??36,L=e.nodeSize??5,w=d?b:2*L,M=d?N:2*L,R=!d&&f?b:0,C=ke(s,c,{top:ce(e)+M/2+4,bottom:M/2+4+(l&&!d?16:0),left:w/2+4,right:w/2+4+(l?0:R)}),I=Math.max(1,v),D=l?C.width:C.height,F=l?C.height:C.width,p=I===1?0:D/(I-1),O=g===0?0:F/g,y=V=>{let P=I===1?D/2:V.slot*p,U=V.depth*O;return l?{x:i(C.x+P),y:i(C.y+U)}:{x:i(C.x+U),y:i(C.y+P)}},$=[],G=[],j=[];for(let V of x){let{x:P,y:U}=y(V);if(V.parent){let W=y(V.parent),J=d?l?M/2:w/2:L,Z=l?W.x:i(W.x+J),K=l?i(W.y+J):W.y,ne=l?P:i(P-J),ee=l?i(U-J):U,Me=i((Z+ne)/2),pe=i((K+ee)/2),je=u==="straight"?`M${Z} ${K}L${ne} ${ee}`:u==="elbow"?l?`M${Z} ${K}V${pe}H${ne}V${ee}`:`M${Z} ${K}H${Me}V${ee}H${ne}`:l?`M${Z} ${K}C${Z} ${pe} ${ne} ${pe} ${ne} ${ee}`:`M${Z} ${K}C${Me} ${K} ${Me} ${ee} ${ne} ${ee}`;$.push({kind:"path",part:"link",d:je,stroke:Y.axis,strokeWidth:1.5,title:`${V.parent.node.name} \u2192 ${V.node.name}`})}let k=Ee(V.node),B=`${V.node.name}${V.node.subtitle?` \xB7 ${V.node.subtitle}`:""}${po(V.node)?`: ${o(k)}`:""}${V.collapsed?" (collapsed)":""}`,z={label:B,id:et(V.node),name:V.node.name,value:k};if(d){if(G.push({kind:"rect",part:"node",x:i(P-w/2),y:i(U-M/2),width:i(w),height:i(M),fill:V.color,rx:4,title:B,item:z}),f){let W=!!V.node.subtitle;j.push(X(P,i(W?U-7:U),V.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),W&&j.push(X(P,i(U+8),V.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else G.push({kind:"circle",part:"node",cx:P,cy:U,r:i(L),fill:V.color,stroke:"var(--skdx-color-surface-default)",title:B,item:z}),f&&j.push(l?X(P,i(U+L+12),V.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):X(i(P+L+4),U,V.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));V.collapsed&&j.push(X(i(d?P+w/2-8:P+L+(l?6:-2)),i(d?U-M/2+8:U-L-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:Y.label,weight:"bold"}))}let _=t.length?[X(8,ce(e)+10,t.map(V=>V.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],S=de(e,s,c);return{...S,shapes:[...$,...G,...j,..._,...S.shapes]}}var Fo=e=>Kr({...e,nodeShape:"box",linkStyle:"elbow"});function Us(e,n){let t=[],r=e.map((f,x)=>({r:f,i:x})).sort((f,x)=>x.r-f.r),a=new Array(e.length);for(let{r:f,i:x}of r){let v;if(t.length===0)v={x:0,y:0,r:f};else{let A=Math.max(1,f/4);e:for(let E=0;E<1e6;E+=A)for(let b=0;b<24;b++){let N=b/24*2*Math.PI+E*.05,L={x:E*Math.cos(N),y:E*Math.sin(N),r:f};if(t.every(w=>Math.hypot(w.x-L.x,w.y-L.y)>=w.r+L.r+n)){v=L;break e}}}let g=v??{x:0,y:0,r:f};t.push(g),a[x]=g}let o=1/0,s=-1/0,c=1/0,l=-1/0;for(let f of t)o=Math.min(o,f.x-f.r),s=Math.max(s,f.x+f.r),c=Math.min(c,f.y-f.r),l=Math.max(l,f.y+f.r);let d=(o+s)/2,u=(c+l)/2,h=0;for(let f of a)f.x-=d,f.y-=u,h=Math.max(h,Math.hypot(f.x,f.y)+f.r);return{circles:a,enclosing:h}}function Po(e){let n=[],{nodes:t}=vn(e.data,e.rootId),r=dn(t,e.maxDepth),a=new Map(r.map((w,M)=>[et(w),te(e,M,w.color)])),o=r.filter(w=>!be(e,w.name)),s=oe(e,!o.some(w=>Ee(w)>0),300,300);if(s)return{...s,issues:n};let c=re(e.format),{width:l,height:d}=le(e,300,300),u=ce(e),h=e.padding??2,f=e.labels??!0,x=[],v=w=>{w.children?.length?w.children.forEach(v):x.push(Ee(w))};o.forEach(v);let g=Nt(e.colorScale,x,te(e,0),void 0,c),A=[],E=[],b=(w,M,R,C,I)=>{let D=w.filter(y=>{let $=Ee(y)>0;return $||n.push({code:"invalid-value",severity:"warning",message:`"${y.name}" has no positive value and was dropped.`,itemId:et(y)}),$});if(D.length===0)return;let{circles:F,enclosing:p}=Us(D.map(y=>Math.sqrt(Ee(y))),0),O=p>0?(C-h)/p:0;D.forEach((y,$)=>{let G=F[$],j=i(M+G.x*O),_=i(R+G.y*O),S=Math.max(0,G.r*O-h/2),V=Ee(y),P=(y.children?.length??0)>0,U=y.color??I??a.get(et(y))??te(e,$),k=P?U:e.colorScale?g.color(V)?.fill??U:U,B=`${y.name}: ${c(V)}`;A.push({kind:"circle",part:P?"branch":"leaf",cx:j,cy:_,r:i(S),fill:k,opacity:P?.15:e.colorScale&&!P?g.color(V)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:B,item:{label:B,id:et(y),name:y.name,value:V}}),f&&!P&&S*2>y.name.length*ue+4&&E.push(X(j,_,y.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),f&&P&&S*2>y.name.length*ue+4&&E.push(X(j,i(_-S+10),y.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),P&&b(y.children,j,_,S,U)})},N=Math.max(0,Math.min(l,d-u)/2-8);b(o,l/2,u+(d-u)/2,N,void 0);let L=de(e,l,d,r.map(w=>({name:w.name,color:a.get(et(w))})));return{...L,shapes:[...A,...E,...L.shapes],issues:n}}function Vo(e){let n=[],{nodes:t,path:r}=vn(e.data,e.rootId),a=dn(t,e.maxDepth).filter(C=>!be(e,C.name)),o=oe(e,!a.some(C=>Ee(C)>0));if(o)return{...o,issues:n};let s=re(e.format),{width:c,height:l}=le(e),d=e.orientation==="horizontal",u=e.breadcrumbs&&r.length>0,h=ce(e)+(u?20:0),f=ke(c,l,{top:h,right:0,bottom:0,left:0}),x=e.padding??1,v=e.labels??!0,g=Math.max(1,Lr(a)),A=(d?f.width:f.height)/g,E=[],b=C=>{C.children?.length?C.children.forEach(b):E.push(Ee(C))};a.forEach(b);let N=Nt(e.colorScale,E,te(e,0),void 0,s),L=[],w=[],M=(C,I,D,F,p)=>{let O=nr(C,e.sort).filter(G=>{let j=Ee(G)>0;return j||n.push({code:"invalid-value",severity:"warning",message:`"${G.name}" has no positive value and was dropped.`,itemId:et(G)}),j}),y=O.reduce((G,j)=>G+Ee(j),0),$=D;O.forEach((G,j)=>{let _=Ee(G),S=y>0?_/y*F:0,V=(G.children?.length??0)>0,P=G.color??p??te(e,j),U=!V&&e.colorScale?N.color(_):void 0,k=I*A,B=d?{x:f.x+k+x/2,y:$+x/2,width:A-x,height:S-x}:{x:$+x/2,y:f.y+k+x/2,width:S-x,height:A-x},z=`${G.name}: ${s(_)}`;L.push({kind:"rect",part:"cell",x:i(B.x),y:i(B.y),width:i(Math.max(0,B.width)),height:i(Math.max(0,B.height)),fill:U?.fill??P,opacity:U?.opacity??(V?.7:void 0),title:z,item:{label:z,id:et(G),name:G.name,value:_}}),v&&B.width>G.name.length*ue+6&&B.height>12&&w.push(X(i(B.x+4),i(B.y+B.height/2),G.name,{part:"cell-label",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),V&&M(G.children,I+1,$,S,P),$+=S})};M(a,0,d?f.y:f.x,d?f.height:f.width,void 0),u&&L.push(...ar(r,8,ce(e)+10));let R=de(e,c,l,a.map((C,I)=>({name:C.name,color:te(e,I,C.color)})));return{...R,shapes:[...L,...w,...R.shapes],issues:n}}function Ho(e){let n=[],t=e.series.map((I,D)=>({...I,index:D,hidden:be(e,I.name)})),r=Math.max(e.categories?.length??0,...t.map(I=>I.data.length)),a=oe(e,r===0||t.every(I=>I.hidden||Fe(I.data).length===0));if(a)return{...a,issues:n};for(let I of t){let D=I.data.filter(F=>F!==null&&!H(F)).length;D&&n.push({code:"invalid-value",severity:"warning",message:`Series "${I.name}" has ${D} value${D===1?"":"s"} that ${D===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:I.id??I.name})}let o=re(e.format),{width:s,height:c}=le(e),l=t.filter(I=>!I.hidden),d=l.map(()=>new Array(r).fill(null));for(let I=0;I<r;I++){if(e.ranked){l.forEach((F,p)=>{let O=F.data[I];d[p][I]=H(O)?O:null});continue}l.map((F,p)=>({si:p,v:F.data[I]})).filter(F=>H(F.v)).sort((F,p)=>p.v-F.v||F.si-p.si).forEach((F,p)=>{d[F.si][I]=p+1})}let u=e.topRank??Math.max(1,l.length),h=Array.from({length:r},(I,D)=>{let F=e.categories?.[D];return F===void 0?String(D+1):qt(F,e.xAxis?.format)}),f=e.labels??!0,x=f?Math.max(0,...l.map(I=>I.name.length))*ue+12:0,v=ke(s,c,{...me,top:me.top+ce(e),right:Math.max(me.right,x),bottom:me.bottom+(e.xAxis?.label?14:0)}),g=ot([.5,u+.5],[v.y,v.y+v.height]),A=Ve(r,[v.x,v.x+v.width],0),E=de(e,s,c,e.series.map((I,D)=>({name:I.name,color:te(e,D,I.color)}))),b=Array.from({length:u},(I,D)=>({pos:i(g(D+1)),label:`#${D+1}`})),N=Ze({...E,plot:v,xTicks:Re(h.map((I,D)=>({pos:i(A.center(D)),label:I})),v.width),yTicks:u>20?b.filter((I,D)=>D%Math.ceil(u/20)===0):b,baseline:v.y+v.height},{xLabel:e.xAxis?.label,grid:e.xAxis?.grid!==!1}),L=e.markerSize??5,w=[],M=[],R=[],C=[];return l.forEach((I,D)=>{let F=te(e,I.index,I.color),p=[],O=[],y;for(let $=0;$<r;$++){let G=d[D][$];if(G==null||G>u||G<1){O.length&&p.push(O),O=[];continue}let j={x:i(A.center($)),y:i(g(G))};O.push(j),y=j;let _=I.data[$],S=`${I.name}, ${h[$]}: #${G}${e.ranked||!H(_)?"":` (${o(_)})`}`;M.push(zt(j.x,j.y,L,F,S,{label:S,id:I.id??I.name,series:I.name,seriesId:I.id??I.name,category:h[$],index:$,value:G}))}O.length&&p.push(O);for(let $ of p)w.push({kind:"path",part:"line",d:st($,e.curve??"monotone"),stroke:F,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",title:I.name,item:{label:I.name,id:I.id??I.name,series:I.name,seriesId:I.id??I.name}});f&&y&&!C.some($=>Math.abs($-y.y)<12)&&(C.push(y.y),R.push(X(i(y.x+L+4),y.y,I.name,{part:"series-label",baseline:"middle",fill:Y.label})))}),{...E,shapes:[...N,...w,...M,...R,...E.shapes],issues:n}}var _o=e=>e*Math.PI/180;function jo(e){let n=[],t=e.data.map(p=>{let O=H(p.value);return O?p.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${p.name}" is negative (${p.value}); a radius cannot be, so it is drawn as zero.`,itemId:p.id??p.name}):n.push({code:"invalid-value",severity:"warning",message:`"${p.name}" has no valid value and is drawn as zero.`,itemId:p.id??p.name}),{...p,value:O&&p.value>0?p.value:0}}),r=oe(e,!t.some(p=>p.value>0),300,300);if(r)return{...r,issues:n};let a=re(e.format),{width:o,height:s}=le(e,300,300),c=ce(e),l=o/2,d=c+(s-c)/2,u=Math.max(0,Math.min(o,s-c)/2-(e.labels?40:12)),h=u*Math.min(.9,Math.max(0,e.innerRadius??0)),f=Math.max(1,Math.round(e.levels??4)),x=Math.max(0,...t.map(p=>be(e,p.name)?0:p.value)),v=ut(0,e.max??x,f).filter(p=>p>0),g=e.max??v[v.length-1],A=(e.scale??"sqrt")==="sqrt",E=p=>{let O=g>0?Math.max(0,Math.min(1,p/g)):0;return h+(u-h)*(A?Math.sqrt(O):O)},b=_o(e.startAngle??0),N=_o(e.endAngle??(e.startAngle??0)+360),L=Math.max(0,Math.min(2*Math.PI,N-b)),w=t.length,M=L/Math.max(1,w),R=Math.min(M*.9,_o(Math.max(0,e.padAngle??0))),C=v.filter(p=>p<=g).flatMap(p=>[{kind:"circle",part:"grid",cx:i(l),cy:i(d),r:i(E(p)),fill:"none",stroke:Y.grid},X(i(l+4),i(d-E(p)),a(p),{part:"y-label",baseline:"middle"})]),I=[],D=[];t.forEach((p,O)=>{let y=b+O*M+R/2,$=y+M-R,G=be(e,p.name),j=`${p.name}: ${a(p.value)}`;if(!G&&p.value>0&&$>y&&I.push({kind:"path",part:"sector",d:Ke(l,d,E(p.value),h,y,$),fill:te(e,O,p.color),stroke:"var(--skdx-color-surface-default)",title:j,item:{label:j,id:p.id??p.name,name:p.name,index:O,value:p.value}}),e.labels&&!G){let _=(y+$)/2,S=Math.sin(_);D.push(X(i(l+(u+8)*S),i(d-(u+8)*Math.cos(_)),p.name,{part:"sector-label",anchor:S>.1?"start":S<-.1?"end":"middle",baseline:"middle"}))}});let F=de(e,o,s,e.data.map((p,O)=>({name:p.name,color:te(e,O,p.color)})));return{...F,shapes:[...C,...I,...D,...F.shapes],issues:n}}var Ys=2e3;function Ks(e,n,t){let r=[],a=[],o=(2*n)**2;for(let s of e){let c=[];for(let d=r.length-1;d>=0&&s-r[d].p<2*n;d--)c.push(r[d]);let l=0;for(let d=0;;d++){if(l=d===0?0:(d%2?1:-1)*Math.ceil(d/2),Math.abs(l)>t){l=Math.sign(l)*t;break}if(c.every(u=>(u.p-s)**2+(u.off-l)**2>=o))break}r.push({p:s,off:l}),a.push(l)}return a}function Go(e){let n=[];for(let b of e.series){let N=b.data.filter(L=>L!==null&&!Number.isFinite(L)).length;N&&n.push({code:"invalid-value",severity:"warning",message:`Series "${b.name}" has ${N} value${N===1?"":"s"} that ${N===1?"is":"are"} neither a number nor null; skipped.`,itemId:b.id??b.name})}let t=e.series.map(b=>be(e,b.name)?[]:Fe(b.data)),r=oe(e,t.every(b=>b.length===0));if(r)return{...r,issues:n};let a=re(e.yAxis?.format??e.format),{width:o,height:s}=le(e),c=e.orientation==="horizontal",l=Math.max(0,...e.series.map(b=>b.name.length))*ue,d=ke(o,s,{...me,top:me.top+ce(e)+(!c&&e.yAxis?.label?12:0),left:c?Math.max(me.left,l+16):me.left,bottom:me.bottom+(c&&e.yAxis?.label?14:0)}),u=He(Pt(t.flat(),!1),c?[d.x,d.x+d.width]:[d.y+d.height,d.y],e.yAxis??{},e.format),h=Ve(e.series.length,c?[d.y,d.y+d.height]:[d.x,d.x+d.width]),f=de(e,o,s,e.series.map((b,N)=>({name:b.name,color:te(e,N,b.color)}))),x=e.series.map((b,N)=>({pos:i(h.center(N)),label:b.name})),v=Ze({...f,plot:d,xTicks:c?x:Re(x,d.width),yTicks:c?Re(u.ticks,d.width):u.ticks,baseline:c?d.x:d.y+d.height},{horizontal:c,grid:Rn(e.yAxis),...c?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}});v.push(...Vt(e.references,{plot:d,horizontal:c,x:b=>{let N=e.series.findIndex(L=>L.name===b);return N<0?void 0:h.center(N)},y:b=>u.scale(b)}));let g=e.markerSize??3,A=Math.max(0,h.bandwidth/2-g),E=[];return e.series.forEach((b,N)=>{let L=te(e,N,b.color),w=h.center(N),M=(be(e,b.name)?[]:b.data).map((I,D)=>({v:I,index:D})).filter(I=>H(I.v)).sort((I,D)=>u.scale(I.v)-u.scale(D.v)),R=Ks(M.map(I=>u.scale(I.v)),g,A),C=M.length<=Ys;M.forEach((I,D)=>{let F=u.scale(I.v),p=R[D],O=`${b.name}: ${a(I.v)}`;E.push({kind:"circle",part:"dot",cx:i(c?F:w+p),cy:i(c?w+p:F),r:g,fill:L,title:C?O:void 0,item:C?{label:O,id:b.id??b.name,series:b.name,seriesId:b.id??b.name,index:I.index,value:I.v}:void 0})})}),{...f,shapes:[...v,...E,...f.shapes],issues:n}}var Xs=8;function Qs(e){let n=e.map(a=>Math.floor(a)),t=Math.round(e.reduce((a,o)=>a+o,0))-n.reduce((a,o)=>a+o,0),r=e.map((a,o)=>({i:o,frac:a-Math.floor(a)})).sort((a,o)=>o.frac-a.frac||a.i-o.i);for(let{i:a}of r){if(t<=0)break;n[a]++,t--}return n}function Wo(e){let n=[],t=e.data.map($=>{let G=H($.value)&&$.value>=0;return G||n.push({code:H($.value)?"negative-value":"invalid-value",severity:"warning",message:`"${$.name}" has no valid non-negative value and is drawn as zero.`,itemId:$.id??$.name}),{...$,value:G?$.value:0}}),r=t.reduce(($,G)=>$+(be(e,G.name)?0:G.value),0),a=oe(e,r<=0,300,300);if(a)return{...a,issues:n};let o=re(e.format),s=H(e.total)&&e.total>0?e.total:r,c=Math.max(1,Math.round(e.rows??10)),l=Math.max(1,Math.round(e.columns??10)),d=c*l,u=$=>s>0?$/s:0,h=Qs(t.map($=>be(e,$.name)?0:Math.min(1,u($.value))*d)),{width:f,height:x}=le(e,300,300),v=new Map(t.map($=>[$.name,`${Math.round(u($.value)*100)}%`])),g=Wn(e),A=e.data.map(($,G)=>({name:$.name,color:te(e,G,$.color)})),E=e.labels&&g?{...e,legend:{...g,formatter:$=>`${g.formatter?.($)??$} ${v.get($)??""}`}}:e,b=ce(E,A,f),N=Math.max(0,e.cellGap??2),L=Math.max(1,Math.min((f-2*Xs)/l,(x-b-2*Xs)/c)),w=(f-L*l)/2,M=b+(x-b-L*c)/2,R=e.orientation==="horizontal",C=$=>R?{x:w+$%l*L,y:M+Math.floor($/l)*L}:{x:w+Math.floor($/c)*L,y:M+(c-1-$%c)*L},I=($,G,j,_,S)=>{let{x:V,y:P}=C($);return{kind:"rect",part:"cell",x:i(V+N/2),y:i(P+N/2),width:i(Math.max(.5,L-N)),height:i(Math.max(.5,L-N)),fill:G,opacity:S,rx:e.cellRadius??2,title:j,item:_}},D=[],F=0;t.forEach(($,G)=>{let j=h[G],_=`${$.name}: ${o($.value)} (${Math.round(u($.value)*100)}%)`,S={label:_,id:$.id??$.name,name:$.name,index:G,value:$.value};for(let V=0;V<j&&F<d;V++,F++)D.push(I(F,te(e,G,$.color),_,S))});let p=s-r,O=p>0?`Other: ${o(p)} (${Math.round(u(p)*100)}%)`:"Empty";for(;F<d;F++)D.push(I(F,Y.grid,O,void 0,.6));let y=de(E,f,x,A);return{...y,shapes:[...D,...y.shapes],issues:n}}var ge=require("lit"),se=require("lit/decorators.js"),Ne=require("lit/directives/if-defined.js");var Se={fromAttribute:()=>!1},Q=class extends ge.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let a=this.drag;if(a?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Xa(Ur(a.x,a.y,o,s))];return}if(a?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);a.points=[...a.points??[],{x:o,y:s}],this.overlay=[Ja(a.points)];return}if(a?.grab==="edit"){if(!a.gantt)return;let{x:o}=this.viewBox(t,r);a.change=to(r,a.gantt,o-a.x),this.overlay=[ro(r,a.gantt,a.change)];return}if(a?.grab==="map"){if(!r.map||!a.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(oo(r.map,a.view,o-a.x,s-a.y));return}if(a&&r.hit){if(a.grab==="pinch"){let[s,c]=[...this.pointers.values()];if(s===void 0||c===void 0||!a.distance)return;this.setZoom(co(r.hit,a.zoom,Math.abs(s-c)/a.distance,(s+c)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(a.grab==="pan"?mo(r.hit,a.zoom,o-a.x):ho(r.hit,a.grab,a.zoom,o-a.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=qa(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=Ua(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ya(r,t.target)),this.syncId&&r.hit?.crosshair){let o=$r(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:a,y:o}=this.viewBox(t,r),s=Pn(r,t.target)?.item.legend,c=this.canEdit(r)?eo(r,a,o):void 0;if(c){this.drag={x:a,y:o,zoom:{start:0,end:0},grab:"edit",gantt:c},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:a,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:a,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let d=r.map.plot;if(a<d.x||a>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:a,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,a),this.pointers.size===2){let[d,u]=[...this.pointers.values()];this.drag={x:(d+u)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(d-u)||1}}else{let d=uo(l,a,o);if(d)this.drag={x:a,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==l.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&a>=l.plot.x&&a<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:a,y:o,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let a=this.drag,o=this.layout;if(o&&(a?.grab==="select"||a?.grab==="lasso"||a?.grab==="edit"||a?.grab==="map")){this.overlay=[];let{x:s,y:c}=this.viewBox(t,o);if(Math.abs(s-a.x)>2||Math.abs(c-a.y)>2){a.grab==="select"?this.setSelected(Ka(o,Ur(a.x,a.y,s,c))):a.grab==="lasso"?this.setSelected(Qa(o,a.points??[])):a.grab==="edit"&&a.change&&this.emit("skdx-task-change",a.change),this.drag={...a,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:a,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(a<l.x||a>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(ao(r.map,t.deltaY,a,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let c=lo(s,t.deltaY,a);c&&(t.preventDefault(),this.setZoom(c))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=Pn(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let c=r.shapes[this.focused]?.item;c&&(t.preventDefault(),this.select(c),this.emit("skdx-item-click",c));return}let a=this.canEdit(r)?no(r,this.focused,t):void 0;if(a){t.preventDefault(),this.emit("skdx-task-change",a);return}let o=io(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let s=o===null?void 0:r.shapes[o]?.item;this.highlight(s?Fn(s):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:a,tooltip:o,format:s,palette:c,loading:l,error:d,emptyMessage:u,description:h,decorative:f,animated:x,responsive:v,highlighted:g,highlightScope:A,accessibleTable:E}=this;return{...typeof v=="object"&&this.measured!==void 0&&this.measured<(v.breakpoint??480)?v.compact:void 0,width:v&&this.measured?this.measured:t,height:r,animate:x,responsive:v,legend:a,tooltip:o,format:s,palette:c,loading:l,error:d,emptyMessage:u,description:h,decorative:f,highlighted:g===void 0?this.highlightState:g,highlightScope:A,accessibleTable:E,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&rr(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=rr(this.syncId),r=a=>{"highlighted"in a&&(this.highlightState=a.highlighted??null),a.selected&&(this.selectedState=a.selected,this.crossFilter&&(this.highlightState=a.selected.length?a.selected:null)),"zoom"in a&&(this.zoomState=a.zoom),a.hiddenSeries&&(this.hiddenState=a.hiddenSeries),"crosshair"in a&&(this.crossState=a.crosshair??null)};r(t.current),this.leave=t.subscribe((a,o)=>{o!==this.token&&r(a)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,a=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=a,this.emit("skdx-hidden-series-change",a),this.publish({hiddenSeries:a})}highlight(t){let r=this.hover;r===t||r&&t&&ka(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Ia(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return tr(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let a=r.shapes.findIndex(o=>o.item&&!o.item.legend&&yn(o.item,t));return a<0?!1:(this.getSvgElement()?.focus(),this.focused=a,!0)}export(t){let r=this.layout;return r?Ar(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,a){this.join();let o=Ta(ua(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let E of o.issues??[])this.emit("skdx-data-issue",E)}let s=this.canZoom(o),c=this.canPan(o),l=this.canEdit(o),d=this.brushing(),u=s||c||l||d,h=!o.decorative&&Yr(o).length>0,f=o.description?`${r}-desc`:void 0,x=yo(o),v=bo(o,this.accessibleTable),g=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||a,A=this.portal;return ge.html`<svg
|
|
1
|
+
"use strict";var Pr=Object.defineProperty;var ds=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var bi=Object.prototype.hasOwnProperty;var gi=(e,n)=>{for(var t in n)Pr(e,t,{get:n[t],enumerable:!0})},xi=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of pi(n))!bi.call(e,a)&&a!==t&&Pr(e,a,{get:()=>n[a],enumerable:!(r=ds(n,a))||r.enumerable});return e};var yi=e=>xi(Pr({},"__esModule",{value:!0}),e),u=(e,n,t,r)=>{for(var a=r>1?void 0:r?ds(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(a=(r?s(n,t,a):s(a))||a);return r&&a&&Pr(n,t,a),a};var Ol={};gi(Ol,{SkdxAreaChart:()=>ur,SkdxBarChart:()=>dr,SkdxBoxplot:()=>At,SkdxBubbleChart:()=>Ue,SkdxBulletChart:()=>Kt,SkdxBumpChart:()=>_t,SkdxCandlestickChart:()=>Qe,SkdxChordChart:()=>pn,SkdxCirclePackingChart:()=>dn,SkdxComboChart:()=>hr,SkdxDumbbellChart:()=>zt,SkdxFunnelChart:()=>Jt,SkdxGanttChart:()=>tn,SkdxGaugeChart:()=>Je,SkdxHeatmap:()=>He,SkdxHistogram:()=>Ye,SkdxIcicleChart:()=>Dt,SkdxLineChart:()=>mr,SkdxLinearGauge:()=>St,SkdxMapChart:()=>Lt,SkdxMarimekkoChart:()=>gn,SkdxNetworkChart:()=>Vt,SkdxOrganizationChart:()=>Xt,SkdxParallelCoordinatesChart:()=>an,SkdxParetoChart:()=>ot,SkdxPieChart:()=>lt,SkdxPolarAreaChart:()=>Rt,SkdxRadarChart:()=>nt,SkdxRadialBarChart:()=>at,SkdxRangeChart:()=>_e,SkdxSankeyChart:()=>gt,SkdxScatterChart:()=>Xe,SkdxSparkline:()=>bt,SkdxSunburstChart:()=>rt,SkdxSwarmPlot:()=>yn,SkdxTimelineChart:()=>In,SkdxTreeChart:()=>Et,SkdxTreemap:()=>Tt,SkdxWaffleChart:()=>jt,SkdxWaterfallChart:()=>yt,csv:()=>Sr,exportChart:()=>Or,makeFormatter:()=>ae,seriesCsv:()=>xo,svgMarkup:()=>Lr,syncGroup:()=>ir});module.exports=yi(Ol);var si=require("lit/decorators.js");var ms=e=>Number(e.toPrecision(12)),vi,da=e=>(vi??(vi=new Intl.NumberFormat)).format(ms(e)),Mi=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),a=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(a)}m`:a>0?`${t}${a}m ${o(n%60)}s`:`${t}${n}s`};function ae(e){if(e===void 0)return da;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:a="",timeZone:o}=e,s=m=>a?h=>m(h)+a:m,c=m=>r===void 0?m===void 0?{}:{maximumFractionDigits:m}:{minimumFractionDigits:r,maximumFractionDigits:r},l=m=>{let h=new Intl.NumberFormat(t,m);return s(f=>h.format(ms(f)))},d=m=>{let h=new Intl.DateTimeFormat(t,o?{...m,timeZone:o}:m);return f=>h.format(f)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(c(2));case"percent":return l({style:"percent",...c(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...c()});case"compact":return l({notation:"compact",...c(1)});case"scientific":return l({notation:"scientific",...c(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Mi)}}function Qt(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?ae(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):da(t)}var qe=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function st([e,n],[t,r]){let a=n-e;return o=>a===0?t:t+(o-e)/a*(r-t)}function ht(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),a=10**Math.floor(Math.log10(r)),o=r/a,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*a,c=Math.floor(e/s)*s,l=Math.ceil(n/s)*s,d=[];for(let m=c;m<=l+s/2;m+=s)d.push(us(m));return d}function je(e,[n,t],r=.2){let a=e===0?0:(t-n)/e,o=a*(1-Math.max(0,Math.min(.9,r)));return{step:a,bandwidth:o,start:s=>n+s*a+(a-o)/2,center:s=>n+(s+.5)*a}}var us=e=>Number(e.toPrecision(12)),i=e=>Number(e.toFixed(2)),P=e=>typeof e=="number"&&Number.isFinite(e),Ve=e=>e.filter(P);function we(e){let n=1/0,t=-1/0;for(let r of e)P(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function it(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let d=`M${t.x} ${t.y}`;for(let m=1;m<e.length;m++){let h=e[m-1],f=e[m];n==="stepAfter"?d+=`H${f.x}V${f.y}`:n==="stepBefore"?d+=`V${f.y}H${f.x}`:d+=`H${i((h.x+f.x)/2)}V${f.y}H${f.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,a=e.slice(1).map((d,m)=>d.x-e[m].x),o=e.slice(1).map((d,m)=>d.y-e[m].y),s=a.map((d,m)=>d===0?0:o[m]/d),c=[s[0]];for(let d=1;d<r-1;d++){let m=s[d-1],h=s[d];c.push(m*h<=0?0:(m+h)/2)}c.push(s[r-2]);for(let d=0;d<r-1;d++){let m=s[d];if(m===0){c[d]=0,c[d+1]=0;continue}let h=c[d]/m,f=c[d+1]/m,M=Math.hypot(h,f);M>3&&(c[d]=3*h*m/M,c[d+1]=3*f*m/M)}let l=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let m=e[d],h=e[d+1],f=a[d]/3;l+=`C${i(m.x+f)} ${i(m.y+f*c[d])} ${i(h.x-f)} ${i(h.y-f*c[d+1])} ${h.x} ${h.y}`}return l}var xr=1e3,yr=60*xr,vr=60*yr,Mr=24*vr,wi=[xr,5*xr,15*xr,30*xr,yr,5*yr,15*yr,30*yr,vr,3*vr,6*vr,12*vr,Mr,2*Mr,7*Mr,14*Mr];function Qn(e,n,t=6){if(!(n>e))return[e];let r=n-e,a=wi.find(h=>r/h<=t),o=[];if(a!==void 0){for(let h=Math.ceil(e/a)*a;h<=n;h+=a)o.push(h);return o.length?o:[e,n]}let s=r/(30*Mr),c=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,l=new Date(e),d=l.getUTCFullYear(),m=Math.ceil((l.getUTCMonth()+(l.getUTCDate()>1?1:0))/c)*c;for(let h=Date.UTC(d,m,1);h<=n;)o.push(h),m+=c,m>=12&&(d+=Math.floor(m/12),m%=12),h=Date.UTC(d,m,1);return o.length?o:[e,n]}function hs(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),a=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let c of a)o.push(us(c*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function Jn(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((l,d)=>l-d);let[t,r]=n.domain??we(e),a=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(a)+1)),s=n.binWidth??(r>t?(r-t)/o:1),c=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:c+1},(l,d)=>Number((t+d*s).toPrecision(12)))}function er(e,n){let t=[];for(let o=0;o+1<n.length;o++)t.push({x0:n[o],x1:n[o+1],count:0});if(t.length===0)return t;let r=n[0],a=n[n.length-1];for(let o of Ve(e)){if(o<r||o>a)continue;let s=0,c=t.length-1;for(;s<c;){let l=s+c+1>>1;t[l].x0<=o?s=l:c=l-1}t[s].count++}return t}var ki=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,$i=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Ii={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Ti(e,n,t){return e.replace($i,(r,a,o)=>{let s=Ii[a];if(s===void 0)return a+o;let l=(o.match(ki)??[]).map((d,m)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let f=m%s;return s===7?f===5?String(h+n):f===6?String(h+t):d:String(f%2===0?h+n:h+t)});return a+l.join(" ")})}var fs=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:Ti(r.d,n,t)}}});var ma=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),K={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"},Bt=(e="neutral")=>e==="neutral"?K.axis:`var(--skdx-color-${e}-500)`,ua=(e="neutral")=>e==="neutral"?K.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,ps=(e,n)=>n??ma[e%ma.length];var fe={top:16,right:16,bottom:32,left:48};function Te(e,n,t=fe){return{x:t.left,y:t.top,width:Math.max(0,e-t.left-t.right),height:Math.max(0,n-t.top-t.bottom)}}function Zn(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function fa(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var Hr=e=>e.crosshair===!0||fa(e).trigger==="axis",Vr=20,Ai=120,bs=e=>{let n=Zn(e);return n&&(n.position==="left"||n.position==="right")?n.width??Ai:0},de=(e,n=600,t=300)=>({width:(e.width??n)-bs(e),height:(e.height??t)-(Zn(e)?.position==="bottom"?Vr:0)}),ue=(e,n,t)=>{let r=Zn(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,gs(n,t??de(e).width,r)):1)*Vr},ie=6.5;function pa(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/ie));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ne=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:ps(n)),xe=(e,n)=>e.hiddenSeries?.includes(n)??!1;function ha(e,n,t=[],r={},a=10,o=8,s=!1){let c=[],l=r.maxItems,d=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,m=e.length-d.length,h=r.interactive??!0,f=o,M=a,$=(g,w,R,k)=>{let T=(w?18:4)+g.length*ie;f>o&&(s||f+T>n-8)&&(f=o,M+=Vr),w&&c.push({kind:"rect",part:"legend-swatch",x:f,y:M-5,width:10,height:10,fill:w,opacity:k?.3:void 0,item:R}),c.push({kind:"text",part:"legend-label",x:f+(w?14:0),y:M,text:g,baseline:"middle",fill:k?K.grid:K.label,item:R}),f+=T+12};for(let g of d){let w=t.includes(g.name),R=h?{label:g.name,series:g.name,legend:!0}:void 0;$(r.formatter?.(g.name)??g.name,g.color,R,w)}return m>0&&$(`+${m} more`,void 0,void 0,!1),r.align==="end"?Ci(c,n):c}function Ci(e,n){let t=new Map;for(let a of e){let o=a.kind==="rect"?a.y+5:a.y;t.set(o,[...t.get(o)??[],a])}let r=[];for(let a of t.values()){let o=Math.max(...a.map(c=>c.kind==="rect"?c.x+c.width:c.x+c.text.length*ie)),s=n-8-o;for(let c of a)r.push({...c,x:c.x+s})}return r}var gs=(e,n,t={})=>new Set(ha(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function he(e,n,t,r=[]){let a=Zn(e),o=a&&e.direction==="rtl"&&a.align===void 0?{...a,align:"end"}:a,s=fa(e),c=o?.position==="bottom",l=bs(e),d=e.hiddenSeries??[],m=o?l?ha(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):ha(r,n,d,o,c?t+10:10):[],h=c?gs(r,n,o):0;return{width:n+l,height:c?t+Math.max(1,h)*Vr:t,legendOffset:o?.position==="left"?l:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:m}}function ba(e){let n=e.legendOffset;if(!n)return e;let t=[...fs(e.shapes.filter(l=>!l.part.startsWith("legend-")),n,0),...e.shapes.filter(l=>l.part.startsWith("legend-"))],r=l=>({...l,x:l.x+n}),a=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(l=>l+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:l=>o.scale(l)+n,invert:l=>o.invert(l-n),bars:o.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,c=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:a,edit:s,map:c,legendOffset:void 0}}function _r(e,n,t,r,a,o="auto"){let s=Array.isArray(t)?t:[t],c=Math.max(1,Math.floor((r-12)/ie)),l=s.flatMap(w=>{let R=[],k=Array.from(w);for(;k.length>c;){let T=k.slice(0,c+1).lastIndexOf(" ");T<1&&(T=c),R.push(k.slice(0,T).join("")),k=k.slice(T),k[0]===" "&&k.shift()}return R.push(k.join("")),R}),d=Math.max(1,Math.floor((a-6)/16)),m=l.slice(0,d);l.length>d&&(m[d-1]=pa(`${m[d-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...m.map(w=>Array.from(w).length))*ie+12),f=Math.min(a,6+m.length*16),M=o==="top"?{x:e-h/2,y:n-f-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-f/2}:o==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},$=Math.max(0,Math.min(r-h,M.x)),g=Math.max(0,Math.min(a-f,M.y));return[{kind:"rect",part:"tooltip",title:s.join(`
|
|
2
|
+
`),x:i($),y:i(g),width:i(h),height:f,fill:"var(--skdx-color-surface-raised)",stroke:K.axis,rx:8},...m.map((w,R)=>({kind:"text",part:"tooltip-label",x:i($+6),y:i(g+11+R*16),text:w,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:m.length>1&&R===0?"bold":void 0}))]}function Gt(e,n){let[t,r]=we(e);return n?[Math.min(0,t),Math.max(0,r)]:[t,r]}function Ge([e,n],t,r=!1,a){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=ae(o.format??a),c=o.min??e,l=o.max??n;o.reversed&&(t=[t[1],t[0]]);let d={id:o.id,position:o.position,options:o};if(o.scale==="sqrt"){let g=S=>Math.sign(S)*Math.sqrt(Math.abs(S)),w=o.nice===!1?[c,l]:ht(c,l,o.ticks),R=o.min??w[0],k=o.max??w[w.length-1],T=st([g(R),g(k)],t),D=S=>T(g(S)),v=ht(R,k,o.ticks).filter(S=>S>=R-1e-9&&S<=k+1e-9);return{...d,scale:D,domain:[R,k],format:s,ticks:(v.length>=2?v:[R,k]).map(S=>({pos:i(D(S)),label:s(S)})),zero:i(D(Math.min(Math.max(0,R),k)))}}if(o.scale==="log"){let g=Math.max(c,Number.EPSILON),w=Math.max(l,g),R=hs(g,w),k=[Math.log10(g),Math.log10(w)],T=st(k,t),D=v=>T(Math.log10(Math.max(v,Number.EPSILON)));return{...d,scale:D,domain:k,format:s,ticks:R.map(v=>({pos:i(D(v)),label:s(v)})),zero:i(t[0])}}let m=ht(c,l,o.ticks),h=[o.min??(o.nice===!1?c:m[0]),o.max??(o.nice===!1?l:m[m.length-1])],f=st(h,t),M=m.filter(g=>g>=h[0]-1e-9&&g<=h[1]+1e-9),$=(M.length>=2?M:[h[0],h[1]]).map(g=>({pos:i(f(g)),label:s(g)}));return{...d,scale:f,domain:h,format:s,ticks:$,zero:i(f(Math.min(Math.max(0,h[0]),h[1])))}}var jr=([e,n],t)=>Math.max(fe.left,ht(e,n).reduce((r,a)=>Math.max(r,t(a).length),0)*ie+14),En=e=>e?.grid!==!1;function Ne(e,n){if(e.length<2)return e;let t=e.reduce((a,o)=>Math.max(a,o.label.length),0)*ie+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((a,o)=>o%r===0)}var wr=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function le(e,n,t,r){let a=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!a)return null;let{width:o,height:s}=de(e,t,r),c=a==="error"?e.error:a==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return a==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:8}),l.push({kind:"text",part:`state-${a}`,x:i(o/2),y:i(s/2),text:c,anchor:"middle",baseline:"middle",fill:a==="error"?"var(--skdx-color-text-danger)":K.label}),{...he(e,o,s),shapes:l,tooltip:!1}}var tr=(e,n,t)=>{let r=n.length*ie/2;return e+r>t?"end":e-r<0?"start":"middle"};function Ze(e,n={}){let{plot:t,xTicks:r,yTicks:a,baseline:o}=e,s=t.x+t.width,c=t.y+t.height,l=[],d=n.grid??!0,m=($,g)=>g?{kind:"line",part:"grid",x1:$.pos,x2:$.pos,y1:t.y,y2:c,stroke:K.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:$.pos,y2:$.pos,stroke:K.grid},h=n.x?.tickRotation??0,f=($,g,w,R)=>h?J($,g,w,{part:R,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):Un($,g,w,e.width,{part:R,anchor:tr($,w,e.width)}),M=($,g,w,R,k)=>{for(let T of $)l.push(g==="x"?{kind:"line",part:"tick",x1:T.pos,x2:T.pos,y1:w,y2:i(w+R*k),stroke:K.axis}:{kind:"line",part:"tick",x1:w,x2:i(w+R*k),y1:T.pos,y2:T.pos,stroke:K.axis})};if(n.categoryGrid)for(let $ of r)l.push(m($,!n.horizontal));if(n.horizontal){let $=n.axes??[{ticks:a,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let g of a)l.push(m(g,!0));$[0]?.showLine!==!1&&l.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:c,stroke:K.axis});for(let g of $){let w=g.position==="top"||g.position==="right",R=i(w?t.y-g.offset:c+g.offset),k=w||g.offset>0;g.showLine&&k&&l.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:R,y2:R,stroke:K.axis}),g.showTicks&&M(g.ticks,"x",R,w?-1:1,g.tickSize??4);let T=i(w?R-8:R+20);for(let D of g.ticks)l.push(w?J(D.pos,T,D.label,{part:"x-label-top",anchor:tr(D.pos,D.label,e.width)}):f(D.pos,T,D.label,"x-label"));g.label&&l.push(k?J(4,T,g.label,{part:"axis-title",anchor:"start",baseline:w?void 0:"middle"}):J(4,t.y-6,g.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&l.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:c,stroke:K.axis}),n.x?.showTicks&&M(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let g of r)l.push(n.rtl?J(s+8,g.pos,g.label,{part:"y-label",anchor:"start",baseline:"middle"}):J(t.x-8,g.pos,g.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let g of a)l.push(m(g,!1));n.y?.showLine!==!1&&l.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:K.axis});let $=n.axes??[{ticks:a,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let g of $){let w=g.position==="left",R=w?t.x-g.offset:s+g.offset,k=w?"y-label":"y-label-right";g.showLine&&l.push({kind:"line",part:"axis",x1:i(R),x2:i(R),y1:t.y,y2:c,stroke:K.axis}),g.showTicks&&M(g.ticks,"y",i(R),w?-1:1,g.tickSize??4);for(let T of g.ticks)l.push(J(i(w?R-8:R+8),T.pos,T.label,{part:k,anchor:w?"end":"start",baseline:"middle"}));g.label&&l.push(J(i(w?g.offset===0?4:Math.max(4,R-40):g.offset===0?e.width-4:Math.min(e.width-4,R+40)),t.y-6,g.label,{part:"axis-title",anchor:w?"start":"end"}))}n.x?.showTicks&&M(r,"x",c,1,n.x.tickSize??4);for(let g of r)l.push(f(g.pos,c+(h?12:20),g.label,"x-label"))}return n.xLabel&&l.push(J(i(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&l.push(J(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),l}var J=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:K.label,...r});function Un(e,n,t,r,a={}){let o=Math.max(4,Math.min(r-4,e)),s=a.anchor??"start",c=s==="middle"?2*Math.min(o-4,r-o-4):s==="end"?o-4:r-o-4,l=pa(t,c);return{kind:"text",part:"label",x:o,y:n,fill:K.label,...a,text:l,title:l===t?a.title:t}}function ft(e){return e.flatMap(n=>{if(n.kind!=="text"||n.fill!=="var(--skdx-color-text-on-accent)"&&n.part!=="reference-label")return[n];let t=n.text.length*ie+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),a=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:a,width:t,height:18,rx:8,fill:"var(--skdx-color-surface-raised)"},{...n,fill:n.part==="reference-label"?n.fill:"var(--skdx-color-text-default)"}]})}var Ft=(e,n,t,r,a,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:a,item:o});function Wt(e,n){let t=[],{plot:r}=n,a=r.x+r.width,o=r.y+r.height,s=l=>Math.max(r.x,Math.min(a,l)),c=l=>Math.max(r.y,Math.min(o,l));for(let l of e??[]){let d=l.color??Bt(l.variant),m=l.color??ua(l.variant),h={part:"reference-label",fill:m},f=n.horizontal===!0;if("y"in l){let M=i(n.y(l.y,l.axis??"left"));if(f){let $=s(M);t.push(...ys($,r.y,o,d,l.label,h))}else{let $=c(M);t.push(...xs(r.x,a,$,d,l.label,h))}}else if("x"in l){let M=n.x(l.x);if(M===void 0)continue;f?t.push(...xs(r.x,a,c(i(M)),d,l.label,h)):t.push(...ys(s(i(M)),r.y,o,d,l.label,h))}else if("y1"in l){let M=i(n.y(l.y1,l.axis??"left")),$=i(n.y(l.y2,l.axis??"left"));f?t.push(...Ms(s(Math.min(M,$)),s(Math.max(M,$)),r,d,l.label,m)):t.push(...vs(c(Math.min(M,$)),c(Math.max(M,$)),r,d,l.label,m))}else{let M=n.x(l.x1),$=n.x(l.x2);if(M===void 0||$===void 0)continue;let g=i(Math.min(M,$)),w=i(Math.max(M,$));f?t.push(...vs(c(g),c(w),r,d,l.label,m)):t.push(...Ms(s(g),s(w),r,d,l.label,m))}}return t}function xs(e,n,t,r,a,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:a};return a?[s,J(n-4,t-5,a,{...o,anchor:"end"})]:[s]}function ys(e,n,t,r,a,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:a};return a?[s,J(e+4,n+10,a,{...o,anchor:"start"})]:[s]}function vs(e,n,t,r,a,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:i(Math.max(0,n-e)),fill:r,opacity:.12,title:a};return a?[s,J(t.x+t.width-4,e+12,a,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function Ms(e,n,t,r,a,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:i(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:a};return a?[s,J(e+4,t.y+12,a,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function Dn(e,n){let t=[],{plot:r}=n,a=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let c=s.color??Bt(s.variant),l=s.color??ua(s.variant),d=($,g,w)=>{let R=n.x($);if(R===void 0)return;let k=n.y(g,w??"left");return n.horizontal?{x:i(k),y:i(R)}:{x:i(R),y:i(k)}},m=s.id??s.label,h=$=>({label:$,id:m,name:s.label});if(s.type==="line"||s.type==="band"){let{type:$,id:g,...w}=s;t.push(...Wt([w],n));continue}if(s.type==="rect"){let $=d(s.x1,s.y1,s.axis),g=d(s.x2,s.y2,s.axis);if(!$||!g)continue;let w=Math.max(r.x,Math.min($.x,g.x)),R=Math.max(r.y,Math.min($.y,g.y)),k=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:i(w),y:i(R),width:i(Math.max(0,Math.min(a,Math.max($.x,g.x))-w)),height:i(Math.max(0,Math.min(o,Math.max($.y,g.y))-R)),fill:c,opacity:.12,stroke:c,title:k||void 0,item:k?h(k):void 0}),s.label&&t.push(J(i(w+4),i(R+12),s.label,{part:"annotation-label",fill:l}));continue}let f=d(s.x,s.y,s.axis);if(!f)continue;if(s.type==="text"){t.push(J(f.x,f.y,s.text,{part:"annotation-text",fill:l,anchor:"middle",baseline:"middle",title:s.label}));continue}let M=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:f.x,cy:f.y,r:5,fill:c,stroke:"var(--skdx-color-surface-default)",title:M,item:h(M)}),s.type==="callout"&&s.label){let[$,g]=s.offset??[16,-16],w=i(Math.max(r.x,Math.min(a,f.x+$))),R=i(Math.max(r.y,Math.min(o,f.y+g)));t.push({kind:"line",part:"annotation-leader",x1:f.x,y1:f.y,x2:w,y2:R,stroke:c},J(w,R,s.label,{part:"annotation-label",fill:l,anchor:$>=0?"start":"end",baseline:"middle"}))}}return t}var ga=2e3;function Li(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:ga}:typeof e=="string"?{strategy:e,threshold:ga}:{strategy:e.strategy,threshold:e.threshold??ga}}function Oi(e,n){let t=e.length;if(n>=t||n<3)return e.map((c,l)=>l);let r=[0],a=[],o=(t-2)/(n-2),s=0;for(let c=0;c<n-2;c++){let l=Math.floor((c+1)*o)+1,d=Math.min(t-1,Math.floor((c+2)*o)+1),m=0,h=0,f=0;for(let T=l;T<d;T++){let D=e[T];P(D)&&(m+=T,h+=D,f++)}m=f?m/f:(l+d)/2,h=f?h/f:0;let M=Math.floor(c*o)+1,$=Math.min(t-1,Math.floor((c+1)*o)+1),g=e[s],w=P(g)?g:0,R=-1,k=-1;for(let T=M;T<$;T++){let D=e[T];if(!P(D)){a.push(T);continue}let v=Math.abs((s-m)*(D-w)-(s-T)*(h-w));v>k&&(k=v,R=T)}R<0&&(R=M),r.push(R),s=R}return r.push(t-1),a.length?[...new Set([...r,...a])].sort((c,l)=>c-l):r}function Si(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,c)=>c);let a=[],o=t/r;for(let s=0;s<r;s++){let c=Math.floor(s*o),l=s===r-1?t:Math.floor((s+1)*o),d=-1,m=-1;for(let h=c;h<l;h++){let f=e[h];if(!P(f)){a.push(h);continue}(d<0||f<e[d])&&(d=h),(m<0||f>e[m])&&(m=h)}d>=0&&a.push(Math.min(d,m)),m>=0&&m!==d&&a.push(Math.max(d,m))}return[...new Set(a)].sort((s,c)=>s-c)}function zi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,c)=>c);let a=[],o=t/r;for(let s=0;s<r;s++){let c=Math.floor(s*o),l=s===r-1?t:Math.floor((s+1)*o),d=-1,m=-1,h=-1,f=-1;for(let M=c;M<l;M++){let $=e[M];if(!P($)){a.push(M);continue}h<0&&(h=M),f=M,(d<0||$<e[d])&&(d=M),(m<0||$>e[m])&&(m=M)}for(let M of[h,d,m,f])M>=0&&a.push(M)}return[...new Set(a)].sort((s,c)=>s-c)}function ws(e,n,t){let r=Li(t);if(!r||n<=r.threshold||e.length===0)return;let a=r.strategy==="minmax"?Si:r.strategy==="m4"?zi:Oi,o=new Set;for(let s of e)for(let c of a(s.slice(0,n),r.threshold))o.add(c);return[...o].sort((s,c)=>s-c)}var kr=e=>Math.max(0,Math.min(1,e));function ks(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],a=r.length===3?r.split("").map(o=>o+o).join(""):r;return[0,2,4].map(o=>parseInt(a.slice(o,o+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function $s(e,n){if(e.length===0)return K.axis;if(e.length===1)return e[0];let t=kr(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),a=t-r,o=ks(e[r]),s=ks(e[r+1]);if(!o||!s)return e[Math.round(t)];let c=l=>Math.round(o[l]+(s[l]-o[l])*a);return`rgb(${c(0)}, ${c(1)}, ${c(2)})`}var Is=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(kr(e)*n))/(n-1):kr(e);function Pt(e,n,t,r=K.negative,a=String){let[o,s]=we(n),c=e??{type:"sequential"},l=w=>i(.15+.85*w);if(c.type==="threshold"){let{thresholds:w,colors:R,labels:k}=c,T=v=>{if(typeof v!="number"||!Number.isFinite(v))return;let S=0;for(;S<w.length&&v>=w[S];)S++;return{fill:R[Math.min(S,R.length-1)]??t,opacity:1}},D=R.map((v,S)=>({fill:v,opacity:1,label:k?.[S]??(S===0?`< ${a(w[0]??0)}`:S===w.length?`\u2265 ${a(w[S-1])}`:`${a(w[S-1])} \u2013 ${a(w[S])}`)}));return{color:T,domain:[o,s],swatches:D,kind:"threshold"}}if(c.type==="ordinal"){let w=c.colors?.length?c.colors:[t];return{color:k=>typeof k=="number"&&Number.isFinite(k)?{fill:w[Math.abs(Math.round(k))%w.length],opacity:1}:void 0,domain:[o,s],swatches:w.map((k,T)=>({fill:k,opacity:1,label:String(T)})),kind:"ordinal"}}if(c.type==="diverging"){let[w,R,k]=c.domain??[-Math.max(Math.abs(o),Math.abs(s)),0,Math.max(Math.abs(o),Math.abs(s))],T=c.colors,D=z=>z<R?.5*(z-w)/Math.max(1e-12,R-w):.5+.5*(z-R)/Math.max(1e-12,k-R),v=z=>{let L=Is(c.reversed?1-kr(z):z,c.steps);if(T&&T.length>=2)return{fill:$s(T,L),opacity:1};let H=L<.5?r:t,b=Math.abs(L-.5)*2;return{fill:H,opacity:l(b)}},S=z=>typeof z=="number"&&Number.isFinite(z)?v(D(z)):void 0,O=c.steps??5,E=Array.from({length:O},(z,L)=>{let H=O===1?.5:L/(O-1),b=H<.5?w+(R-w)*(H*2):R+(k-R)*((H-.5)*2);return{...v(H),label:a(b)}});return{color:S,domain:[w,k],swatches:E,kind:"diverging"}}let[d,m]=c.domain??[o,s],h=c.colors,f=w=>{let R=Is(c.reversed?1-kr(w):w,c.steps);return h&&h.length>=2?{fill:$s(h,R),opacity:1}:{fill:h?.[0]??t,opacity:l(R)}},M=w=>typeof w!="number"||!Number.isFinite(w)?void 0:f(m===d?1:(w-d)/(m-d)),$=c.steps??5,g=Array.from({length:$},(w,R)=>{let k=$===1?1:R/($-1);return{...f(k),label:a(d+(m-d)*k)}});return{color:M,domain:[d,m],swatches:g,kind:"sequential"}}var Ni=34,Ri=72;function Bn(e){if(!e)return{bottom:0,right:0,options:{}};let n=e===!0?{}:e;return n.orientation==="vertical"?{bottom:0,right:Ri,options:n}:{bottom:Ni,right:0,options:n}}function nr(e,n,t){let r=typeof t=="string"?{title:t}:t??{},a=r.title,o=e.swatches;if(o.length===0||n.width<=0)return[];if(r.orientation==="vertical"){let m=Math.max(0,n.height-(a?16:0)),h=Math.min(16,m/o.length),f=n.y+(a?16:0),M=o.map((g,w)=>({kind:"rect",part:"color-legend-swatch",x:i(n.x),y:i(f+w*h),width:10,height:i(h),fill:g.fill,opacity:g.opacity,title:g.label})),$=h>=12?1:2;return o.forEach((g,w)=>{w%$!==0&&w!==o.length-1||M.push({kind:"text",part:"color-legend-label",x:i(n.x+14),y:i(f+(w+.5)*h),text:g.label,baseline:"middle",fill:K.label})}),a&&M.push({kind:"text",part:"color-legend-title",x:i(n.x),y:i(n.y+6),text:a,baseline:"middle",fill:K.label}),M}let s=Math.min(n.width/o.length,96),c=n.x+(n.width-s*o.length)/2,l=o.map((m,h)=>({kind:"rect",part:"color-legend-swatch",x:i(c+h*s),y:i(n.y),width:i(s),height:10,fill:m.fill,opacity:m.opacity,title:m.label})),d=e.kind==="threshold"?1:Math.max(1,Math.ceil(o.length*7*ie/Math.max(1,s*o.length)));return o.forEach((m,h)=>{h%d!==0&&h!==o.length-1||l.push({kind:"text",part:"color-legend-label",x:i(c+(h+.5)*s),y:i(n.y+22),text:m.label,anchor:"middle",fill:K.label})}),a&&l.push({kind:"text",part:"color-legend-title",x:i(c-6),y:i(n.y+5),text:a,anchor:"end",baseline:"middle",fill:K.label}),l}var Ei=1e4,Di=e=>Array.isArray(e)?{x:e[0],y:e[1],size:e[2],label:void 0,id:void 0,color:void 0,value:void 0}:{x:e.x,y:e.y,size:e.size,label:e.label,id:e.id,color:e.color,value:e.value};function xa(e,n,t,r,a,o,s,c){if(r==="circle")return{...Ft(e,n,t,a,o,s),part:c};let l=r==="square"?`M${i(e-t)} ${i(n-t)}h${i(2*t)}v${i(2*t)}h${i(-2*t)}Z`:r==="diamond"?`M${i(e)} ${i(n-t*1.3)}L${i(e+t*1.3)} ${i(n)}L${i(e)} ${i(n+t*1.3)}L${i(e-t*1.3)} ${i(n)}Z`:`M${i(e)} ${i(n-t*1.2)}L${i(e+t*1.15)} ${i(n+t*.9)}L${i(e-t*1.15)} ${i(n+t*.9)}Z`;return{kind:"path",part:c,d:l,fill:a,title:o,item:s}}function ya(e,n){let t=[],r=e.series.map((F,_)=>({name:F.name,id:F.id,symbol:F.symbol??"circle",color:ne(e,_,F.color),data:xe(e,F.name)?[]:F.data.flatMap((W,ee)=>{let te=Di(W);return P(te.x)&&P(te.y)?[{...te,index:ee}]:[]})})),a=e.sampling==="auto"?Ei:typeof e.sampling=="object"?e.sampling.threshold:1/0,o=r.reduce((F,_)=>F+_.data.length,0),s=o>a?Math.ceil(o/a):1;s>1&&t.push({code:"sampled",severity:"warning",message:`${o} points exceed the sampling threshold of ${a}; every ${s}th point is drawn.`});let c=s>1?r.map(F=>({...F,data:F.data.filter((_,W)=>W%s===0)})):r,l=c.flatMap(F=>F.data),d=le(e,l.length===0);if(d)return{...d,issues:t};let{width:m,height:h}=de(e),f=e.colorScale?Bn(e.colorLegend):{bottom:0,right:0,options:{}},M=e.series.map((F,_)=>({name:F.name,color:ne(e,_,F.color)})),$=Te(m,h,{...fe,top:fe.top+ue(e,M,m)+(e.yAxis?.label?12:0),right:fe.right+f.right,bottom:fe.bottom+(e.xAxis?.label?14:0)+f.bottom}),g=e.markerSize??3,w=Math.max(0,e.hitRadius??0),R=Math.max(0,e.jitter??0),k=we(l.map(F=>F.size)),T=F=>F==="diamond"?1.3:F==="triangle"?1.2:1,D=(F,_)=>Math.max(0,_?n.radius(F.size,k):g),v=0;for(let F of c){let _=F.data.some(ee=>ee.size!==void 0),W=T(F.symbol);for(let ee of F.data)v=Math.max(v,D(ee,_)*W)}let S=Math.min(1,Math.min($.width,$.height)*.45/Math.max(1,v+R)),O=R*S,E=v*S+O,z=new Map,L=e.colorScale?Pt(e.colorScale,l.map(F=>F.value),ne(e,0),void 0,ae(e.format)):void 0,H=Ge(Gt(l.map(F=>F.x),!1),[$.x+E,$.x+$.width-E],e.xAxis??{},e.format),b=Ge(Gt(l.map(F=>F.y),!1),[$.y+$.height-E,$.y+E],e.yAxis??{},e.format),x=he(e,m,h,M),C=[],y=[],B=[],U=[];for(let F of c){let _=F.data.some(W=>W.size!==void 0);for(let W of F.data){let ee=W.index,te=n.describe(F.name,W,H,b),re=D(W,_)*S,me=i(H.scale(W.x)),be=i(b.scale(W.y));if(O>0){let Be=`${Math.round(me)},${Math.round(be)}`,Fe=z.get(Be)??0;if(z.set(Be,Fe+1),Fe>0){let Mt=Fe*2.399963;me=i(me+O*Math.cos(Mt)),be=i(be+O*Math.sin(Mt))}}let Z=L?.color(W.value),oe={label:te,id:W.id,series:F.name,seriesId:F.id??F.name,name:W.label,index:ee,value:W.y},ke=W.color??Z?.fill??F.color;if(C.push(xa(me,be,i(re),F.symbol,ke,te,oe,_?n.part:"point")),w>0&&C.push({kind:"circle",part:"hit",cx:me,cy:be,r:i(re+w),fill:ke,opacity:0,title:te,item:oe}),e.labels&&W.label){let Be=W.label.length*ie,Fe=me-Be/2,Mt=be-re-4;U.some(wt=>Math.abs(wt.y-Mt)<12&&Fe<wt.x+wt.w+4&&Fe+Be+4>wt.x)||(U.push({x:Fe,y:Mt,w:Be}),y.push(J(me,i(Mt),W.label,{part:"point-label",anchor:"middle",fill:"var(--skdx-color-text-default)"})))}}if(e.trendline&&F.data.length>=2){let W=e.trendline===!0?"linear":e.trendline,ee=Bi(F.data.map(te=>[te.x,te.y]),W);if(ee){let[te,re]=H.domain,me=`${F.name} trend${W==="linear"?"":` (${W})`}: r\xB2 ${ee.r2.toFixed(2)}`,be=F.color;if(W==="linear")B.push({kind:"line",part:"trendline",x1:i(H.scale(te)),y1:i(b.scale(ee.predict(te))),x2:i(H.scale(re)),y2:i(b.scale(ee.predict(re))),stroke:be,dash:"5 4",strokeWidth:1.5,title:me});else{let Z=Array.from({length:40},(oe,ke)=>te+(re-te)*ke/39).map(oe=>({v:oe,p:ee.predict(oe)})).filter(({p:oe})=>Number.isFinite(oe)).map(({v:oe,p:ke})=>({x:i(H.scale(oe)),y:i(b.scale(ke))}));Z.length>1&&B.push({kind:"path",part:"trendline",d:it(Z),stroke:be,dash:"5 4",strokeWidth:1.5,title:me})}}}}let Y=-1/0,j=Ne(H.ticks,Math.max(1,$.width-2*E)),I=new Set;for(let F of[...j].sort((_,W)=>_.pos-W.pos)){let _=F.label.length*ie,W=e.xAxis?.tickRotation??0,ee=W?W<0?"end":"start":tr(F.pos,F.label,m),te=-(ee==="end"?_:ee==="middle"?_/2:0),re=W*Math.PI/180,me=[te,te+_].flatMap(oe=>[-7,7].map(ke=>F.pos+oe*Math.cos(re)-ke*Math.sin(re))),be=Math.min(...me),Z=Math.max(...me);be<Y+4||(Y=Z,I.add(F))}let G=j.filter(F=>I.has(F)),V={...x,plot:$,xTicks:G,yTicks:b.ticks,baseline:b.zero},Q={plot:$,x:F=>H.scale(qe(F)),y:F=>b.scale(F)},p=Wt(e.references,Q),q=L&&(f.bottom||f.right)?nr(L,f.right?{x:$.x+$.width+12,y:$.y,width:f.right,height:$.height}:{x:$.x,y:h-f.bottom+8,width:$.width,height:f.bottom},f.options):[],N=n.opacity;return{...x,shapes:[...Ze({...V,height:V.height-f.bottom},{xLabel:e.xAxis?.label,x:e.xAxis,y:{showLine:e.yAxis?.showLine,showTicks:e.yAxis?.showTicks,tickSize:e.yAxis?.tickSize,tickRotation:e.yAxis?.tickRotation}}),...e.yAxis?.label?[J(4,$.y-14,e.yAxis.label,{part:"axis-title",anchor:"start"})]:[],...p,...N!==void 0&&C.some(F=>F.part===n.part)?C.map(F=>(F.kind==="circle"||F.kind==="path")&&F.part!=="hit"?{...F,opacity:N}:F):C,...B,...y,...Dn(e.annotations,Q),...q,...x.shapes],issues:t}}function Bi(e,n="linear"){let t;if(n==="polynomial"){let l=0,d=0,m=0,h=0,f=0,M=0,$=0,g=0;for(let[S,O]of e)l+=1,d+=S,m+=S*S,h+=S**3,f+=S**4,M+=O,$+=S*O,g+=S*S*O;let w=S=>S[0]*(S[4]*S[8]-S[5]*S[7])-S[1]*(S[3]*S[8]-S[5]*S[6])+S[2]*(S[3]*S[7]-S[4]*S[6]),k=w([f,h,m,h,m,d,m,d,l]);if(Math.abs(k)<1e-12)return;let T=w([g,h,m,$,m,d,M,d,l])/k,D=w([f,g,m,h,$,d,m,M,l])/k,v=w([f,h,g,h,m,$,m,d,M])/k;t=S=>T*S*S+D*S+v}else{let l=n==="logarithmic"||n==="power"?Math.log:M=>M,d=n==="exponential"||n==="power"?Math.log:M=>M,m=e.filter(([M,$])=>Number.isFinite(l(M))&&Number.isFinite(d($))),h=Fi(m.map(([M,$])=>[l(M),d($)]));if(!h)return;let f=n==="exponential"||n==="power"?Math.exp:M=>M;t=M=>f(h.intercept+h.slope*l(M))}let r=t,a=e.filter(([l])=>Number.isFinite(r(l)));if(a.length===0)return;let o=a.reduce((l,[,d])=>l+d,0)/a.length,s=0,c=0;for(let[l,d]of a)s+=(d-r(l))**2,c+=(d-o)**2;return{predict:r,r2:c===0?1:Math.max(0,1-s/c)}}function va(e){let[n,t]=e.sizeRange??[3,18];return ya(e,{part:"bubble",opacity:.7,radius:(r,[a,o])=>P(r)?o===a?(n+t)/2:n+Math.sqrt((r-a)/(o-a))*(t-n):3,describe:(r,a,o,s)=>`${r}${a.label?` ${a.label}`:""}: ${o.format(a.x)}, ${s.format(a.y)}${P(a.size)?` (${s.format(a.size)})`:""}`})}function Fi(e){let n=e.length,t=e.reduce((d,m)=>d+m[0],0)/n,r=e.reduce((d,m)=>d+m[1],0)/n,a=0,o=0,s=0;for(let[d,m]of e)a+=(d-t)**2,o+=(d-t)*(m-r),s+=(m-r)**2;if(a===0)return;let c=o/a,l=s===0?1:o*o/(a*s);return{slope:c,intercept:r-c*t,r2:l}}var Pi=e=>{let n=0;return e.map(t=>P(t)?n+=t:null)},Hi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&P(n)&&P(r)?n-r:null}),Vi=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&P(n)&&P(r)&&r!==0?(n-r)/Math.abs(r):null});function Ma(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,a)=>{if(a<t-1)return null;let o=0;for(let s=a-t+1;s<=a;s++){let c=e[s];if(!P(c))return null;o+=c}return o/t})}function Ts(e,n){let t=Math.max(1,Math.floor(n)),r=2/(t+1),a,o=0,s=0;return e.map(c=>P(c)?a===void 0?(o+=c,s++,s<t?null:(a=o/t,a)):(a=r*c+(1-r)*a,a):a??null)}function _i(e,n="max"){let t=0;for(let r of e)P(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>P(r)?t===0?0:r/t:null)}function ji(e,n="desc"){let t=e.filter(P).sort((r,a)=>n==="asc"?r-a:a-r);return e.map(r=>P(r)?t.indexOf(r)+1:null)}var Gi=(e,n=-1/0,t=1/0)=>e.map(r=>P(r)&&r>=n&&r<=t?r:null),Wi=(e,n="asc")=>[...e].sort((t,r)=>P(t)?P(r)?n==="asc"?t-r:r-t:-1:P(r)?1:0);function qi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),a=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(P);if(s.length===0){a.push(null);continue}let c=s.reduce((l,d)=>l+d,0);a.push(t==="sum"?c:t==="mean"?c/s.length:t==="min"?Math.min(...s):Math.max(...s))}return a}function Zi(e,n={}){let t=e.filter(P),r=Jn(t,n);return{edges:r,counts:er(t,r).map(a=>a.count)}}function wa(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=Pi(t);break;case"difference":t=Hi(t);break;case"percentageChange":t=Vi(t);break;case"movingAverage":t=Ma(t,r.window);break;case"normalize":t=_i(t,r.to);break;case"rank":t=ji(t,r.order);break;case"filter":t=Gi(t,r.min,r.max);break;case"sort":t=Wi(t,r.order);break;case"aggregate":t=qi(t,r.every,r.method);break;case"bin":t=Zi(t,r).counts;break}return t}var Ui=100,Yi=2e3,As=32,Cs=28,Wr=e=>e.position==="right"||e.position==="top";function Ki(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((a,o)=>({...a,id:a.id??(o===0?"left":o===1?"right":String(o)),position:a.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(a=>a.id==="right"||Wr(a));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(a=>a.axis==="right")&&t.push({id:"right",position:"right"}),t}function Os(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(Wr))?.id:e.find(r=>r.id===n)?.id}var Gr=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function qt(e,n){let t=ae(e.format),{series:r,categories:a,issues:o,axes:s}=Qi(e,n,t),c=e.direction==="rtl",l=e.baseline??0,d=Math.max(a.length,...r.map(A=>Math.max(A.data.length,A.low.length))),m=r.every(A=>Ve(A.data).length===0&&Ve(A.high).length===0),h=le(e,m);if(h)return{...h,issues:o};let f=e.xAxis?.type??"category",M=f!=="category"&&a.length>0&&a.every(A=>typeof A!="string"||f==="time"&&P(qe(A))),$=M?a.map(qe):[],[g,w]=we($),R=e.xAxis?.format??(f==="time"?{style:w-g<2*864e5?"time":"date"}:void 0),k=Array.from({length:d},(A,se)=>{let pe=a[se];return pe===void 0?String(se+1):Qt(pe,R)}),T=Xi(e.zoom,d),D=Array.from({length:T.end-T.start},(A,se)=>T.start+se),v=e.orientation==="horizontal",O=r.map(A=>({...A,hidden:A.hidden||v&&!Gr(A)})).filter(A=>!A.hidden),E=O.some(A=>!Gr(A))?ws(O.filter(A=>!Gr(A)).map(A=>D.map(se=>(A.kind==="range"?A.high[se]:A.data[se])??null)),D.length,e.sampling):void 0,z=E?E.map(A=>D[A]):D,L=e.stacked==="percent"||e.stackOffset==="expand",H=e.stackOffset??"zero",b=new Map,x=new Map,C=new Map;for(let A of O)A.stack!==void 0&&A.kind!=="range"&&C.set(A.stack,[...C.get(A.stack)??[],A]);for(let A of C.values()){let se=new Array(d).fill(l),pe=new Array(d).fill(l),Le=new Array(d).fill(0);if(L)for(let Ie of A)Ie.data.forEach((Me,Oe)=>{P(Me)&&(Le[Oe]=Le[Oe]+Math.abs(Me))});for(let Ie of A){let Me=[],Oe=[];for(let $e=0;$e<d;$e++){let Ce=Ie.data[$e];if(!P(Ce)){Me.push(null),Oe.push(null);continue}let ve=Le[$e],ge=L?ve>0?Ce/ve:0:Ce,Se=ge>=0?se:pe;Me.push(Se[$e]),Se[$e]=Se[$e]+ge,Oe.push(Se[$e])}b.set(Ie,Me),x.set(Ie,Oe)}if(H==="silhouette"||H==="wiggle"){let Ie=new Array(d).fill(0);if(H==="silhouette")for(let Me=0;Me<d;Me++)Ie[Me]=-(se[Me]-l)/2;else{let Me=0;for(let Oe=0;Oe<d;Oe++){let $e=A.length,Ce=0;for(let ge=0;ge<$e;ge++){let Se=A[ge],Ee=Se.data[Oe],Pe=Se.data[Oe-1],ut=Oe>0&&P(Ee)&&P(Pe)?Ee-Pe:0;Ce+=($e-ge-.5)*ut}let ve=se[Oe]-l;Me=Oe===0?-ve/2:Me-(ve>0?Ce/Math.max(1,$e):0),Ie[Oe]=Me}}for(let Me of A){let Oe=b.get(Me),$e=x.get(Me);for(let Ce=0;Ce<d;Ce++){let ve=Oe[Ce],ge=$e[Ce];P(ve)&&(Oe[Ce]=ve+Ie[Ce]),P(ge)&&($e[Ce]=ge+Ie[Ce])}}}}let y=A=>A.kind==="range"?{from:A.low,to:A.high}:{from:b.get(A)??new Array(d).fill(l),to:x.get(A)??A.data},B=A=>{let se=[],pe=!1;for(let Me of O){if(Me.axis!==A)continue;let{from:Oe,to:$e}=y(Me);for(let Ce of z){let ve=$e[Ce];if(P(ve)&&se.push(ve),Me.kind==="range"||Me.stack!==void 0){let ge=Oe[Ce];P(ge)&&se.push(ge)}}if(Me.errors)for(let Ce of z){let ve=Ls(Me.data[Ce],Me.errors[Ce]);ve&&se.push(ve[0],ve[1])}(Me.kind==="bar"||Me.kind==="area")&&H==="zero"&&(pe=!0)}let[Le,Ie]=we(se);return pe?[Math.min(l,Le),Math.max(l,Ie)]:[Le,Ie]},{width:U,height:Y}=de(e),j=e.brush?As+Cs:0,I=z.reduce((A,se)=>Math.max(A,k[se].length),0)*ie,G=L?{style:"percent"}:void 0,V=A=>{if(A.scale==="log")return fe.left;let[se,pe]=B(A.id),Le=ae(A.format??G??e.format);return jr([A.min??se,A.max??pe],Le)+(A.showTicks?A.tickSize??4:0)},Q=A=>v?Wr(A)?"top":"bottom":Wr(A)!==c?"right":"left",p=A=>v?24+(A.showTicks?A.tickSize??4:0):V(A),q=new Set(O.map(A=>A.axis)),N=s.filter(A=>q.has(A.id)||s.length>1),F=new Map,_={left:0,right:0,top:0,bottom:0};for(let A of N){let se=Q(A);F.set(A.id,_[se]),_[se]+=p(A)}let W=N.find(A=>Q(A)==="bottom"),ee=r.map(A=>({name:A.name,color:A.color})),te={top:fe.top+ue(e,ee,U)+(s.some(A=>A.label)?12:0)+_.top,right:v?c?Math.max(fe.left,I+16):fe.right:Math.max(fe.right,_.right),bottom:fe.bottom+j+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+_.bottom-(W?p(W):0),left:v?c?fe.right:Math.max(fe.left,I+16):Math.max(fe.left,_.left)},re=Te(U,Y,te),me=v?c?[re.x+re.width,re.x]:[re.x,re.x+re.width]:[re.y+re.height,re.y],be=v?[re.y,re.y+re.height]:c?[re.x+re.width,re.x]:[re.x,re.x+re.width],Z=new Map(s.map(A=>[A.id,{...Ge(B(A.id),me,{format:G,...A},e.format),position:Q(A),offset:F.get(A.id)??0}])),oe=s[0]?.id,ke=Z.get(oe),Be=A=>Z.get(Os(s,A)??oe)??ke,Fe=(A,se)=>Be(se).scale(A),Mt=A=>i(A.scale(Math.min(Math.max(l,Math.min(...A.domain)),Math.max(...A.domain)))),wt=je(z.length,be,e.barGap),An=z.map(A=>$[A]),Nn=[...An].sort((A,se)=>A-se),un=1/0;for(let A=1;A<Nn.length;A++)un=Math.min(un,Nn[A]-Nn[A-1]);let[Mn,mt]=we(An),kt=un===1/0?Math.max(1,Math.abs(mt)*.05||1):un/2,hn=st([Mn-kt,mt+kt],be),Wn=A=>i(M?hn(An[A]):wt.center(A)),Ko=M?Math.abs(hn(Mn+(un===1/0?kt:un))-hn(Mn))*.8:wt.bandwidth,Xo=A=>M?Wn(A)-Ko/2:wt.start(A),di=M?(f==="time"?Qn(Mn-kt,mt+kt):ht(Mn-kt,mt+kt)).filter(A=>A>=Mn-kt&&A<=mt+kt).map(A=>({pos:i(hn(A)),label:Qt(A,R)})):Ne(z.map((A,se)=>({pos:Wn(se),label:k[A]})),v?1/0:re.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),ta={...he(e,U,Y,ee),plot:re,xTicks:di,yTicks:v?Ne(ke.ticks,re.width):ke.ticks,baseline:Mt(ke)},mi=s[0],Qo=Ze(ta,{horizontal:v,rtl:c,axes:N.map(A=>{let se=Z.get(A.id);return{ticks:v?Ne(se.ticks,re.width):se.ticks,position:se.position,offset:se.offset??0,label:A.label,showLine:A.showLine,showTicks:A.showTicks,tickSize:A.tickSize}}),xLabel:e.xAxis?.label,grid:En(mi),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),ui=A=>{if(typeof A=="number"&&a.every(pe=>typeof pe=="string"))return A;let se=typeof A=="string"?A:qe(A);for(let pe=0;pe<d;pe++){let Le=a[pe];if(Le!==void 0&&(typeof se=="string"?Le===se||k[pe]===se:qe(Le)===se))return pe}},Jo={plot:re,horizontal:v,x:A=>{if(M&&(typeof A!="string"||P(qe(A))))return hn(qe(A));let se=ui(A),pe=se===void 0?-1:z.indexOf(se);return pe<0?void 0:wt.center(pe)},y:(A,se)=>Fe(A,se)},es=Wt(e.references,Jo);Qo.push(...es.filter(A=>A.part!=="reference-label"));let hi=ft(es.filter(A=>A.part==="reference-label")),na=[],ra=new Map;for(let A of O){if(!Gr(A))continue;let se=A.stack??A,pe=na.indexOf(se);pe<0&&(pe=na.push(se)-1),ra.set(A,pe)}let Rr=Ko/Math.max(1,na.length),Rn=Math.min(Rr,e.barWidth??1/0),ts=(Rr-Rn)/2,aa=[],Er=[],oa=[],sa=[],ia=[],ns=[],Dr=[],Br=A=>Be(A.axis).format,la=Math.max(0,e.minBarSize??0),fi=(A,se,pe)=>{let Le=Math.abs(se-A);if(Le>=la)return[Math.min(A,se),Le];let Me=A+(v?pe?1:-1:pe?-1:1)*la;return[Math.min(A,Me),la]},fr=(A,se,pe,Le)=>({label:Le,series:A.name,seriesId:A.id??A.name,category:k[se],index:se,value:pe}),rs=(A,se,pe,Le)=>{let Ie=Ls(Le,A.errors?.[se]);if(!Ie)return;let Me=i(Fe(Ie[0],A.axis)),Oe=i(Fe(Ie[1],A.axis)),$e=4,Ce="var(--skdx-color-text-default)",ve=`${A.name}, ${k[se]}: ${Br(A)(Ie[0])} \u2013 ${Br(A)(Ie[1])}`;ns.push(v?{kind:"line",part:"error-bar",x1:Me,x2:Oe,y1:pe,y2:pe,stroke:Ce,title:ve}:{kind:"line",part:"error-bar",x1:pe,x2:pe,y1:Me,y2:Oe,stroke:Ce,title:ve},v?{kind:"line",part:"error-cap",x1:Me,x2:Me,y1:i(pe-$e),y2:i(pe+$e),stroke:Ce}:{kind:"line",part:"error-cap",x1:i(pe-$e),x2:i(pe+$e),y1:Me,y2:Me,stroke:Ce},v?{kind:"line",part:"error-cap",x1:Oe,x2:Oe,y1:i(pe-$e),y2:i(pe+$e),stroke:Ce}:{kind:"line",part:"error-cap",x1:i(pe-$e),x2:i(pe+$e),y1:Oe,y2:Oe,stroke:Ce})};for(let A of O){let{from:se,to:pe}=y(A),Le=Br(A),Ie=z.length<=Yi;if(A.kind==="bar"){let ve="";z.forEach((ge,Se)=>{let Ee=A.data[ge],Pe=se[ge],ut=pe[ge];if(!P(Ee)||!P(Pe)||!P(ut))return;let Xn=Fe(Pe,A.axis),qn=Fe(ut,A.axis),[pr,br]=fi(Xn,qn,ut>=Pe),gr=Xo(Se)+ra.get(A)*Rr+ts,os=i(v?pr:gr),ss=i(v?gr:pr),ca=i(v?br:Rn),is=i(v?Rn:br);if(!Ie){ve+=`M${os} ${ss}h${ca}v${is}h${-ca}Z`;return}let ls=wr(A.name,k[ge],L?ut-Pe:Ee,Le);if(Er.push({kind:"rect",part:"bar",x:os,y:ss,width:ca,height:is,fill:A.color,rx:e.radius,title:ls,item:fr(A,ge,Ee,ls)}),rs(A,ge,i(gr+Rn/2),Ee),e.labels){let cs=Le(L?ut-Pe:Ee);ia.push(v?J(i(Math.max(Xn,qn)+4),i(gr+Rn/2),cs,{baseline:"middle"}):J(i(gr+Rn/2),i(Math.min(Xn,qn)-4),cs,{anchor:"middle"}))}}),ve&&Er.push({kind:"path",part:"bars",d:ve,fill:A.color,title:A.name});continue}if(A.kind==="range"&&A.style==="bar"){z.forEach((ve,ge)=>{let Se=se[ve],Ee=pe[ve];if(!P(Se)||!P(Ee))return;let Pe=Fe(Math.min(Se,Ee),A.axis),ut=Fe(Math.max(Se,Ee),A.axis),Xn=Xo(ge)+ra.get(A)*Rr+ts,qn=`${A.name}, ${k[ve]}: ${Le(Math.min(Se,Ee))} \u2013 ${Le(Math.max(Se,Ee))}`,pr=fr(A,ve,Ee,qn),br=Math.max(1,Math.abs(ut-Pe));Er.push(v?{kind:"rect",part:"range",x:i(Math.min(Pe,ut)),y:i(Xn),width:i(br),height:i(Rn),fill:A.color,rx:e.radius,title:Ie?qn:void 0,item:pr}:{kind:"rect",part:"range",x:i(Xn),y:i(Math.min(Pe,ut)),width:i(Rn),height:i(br),fill:A.color,rx:e.radius,title:Ie?qn:void 0,item:pr})});continue}let Me=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,Oe=[],$e=[];z.forEach((ve,ge)=>{let Se=se[ve],Ee=pe[ve];if(!P(Ee)||!P(Se)){!Me&&$e.length&&(Oe.push($e),$e=[]);return}$e.push({x:Wn(ge),y:i(Fe(Ee,A.axis)),y0:i(Fe(Se,A.axis)),i:ve})}),$e.length&&Oe.push($e);let Ce=A.markers??z.length<=Ui;for(let ve of Oe){let ge=it(ve,A.curve);if(A.kind==="range"&&A.style==="line"){oa.push({kind:"path",part:"range-high",d:ge,stroke:A.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:it(ve.map(Se=>({x:Se.x,y:Se.y0})),A.curve),stroke:A.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(A.kind==="range"){let Se=it([...ve].reverse().map(Ee=>({x:Ee.x,y:Ee.y0})),A.curve);aa.push({kind:"path",part:"range",d:`${ge}L${Se.slice(1)}Z`,fill:A.color,fillOpacity:.2,title:A.name});continue}if(A.kind==="area"){let Se=Mt(Be(A.axis)),Ee=A.stack!==void 0?it([...ve].reverse().map(ut=>({x:ut.x,y:ut.y0})),A.curve).slice(1):`${ve[ve.length-1]?.x} ${Se}L${ve[0]?.x} ${Se}`,Pe=`skdx-g-${A.index}`;A.gradient&&!Dr.some(ut=>ut.id===Pe)&&Dr.push({id:Pe,vertical:!0,stops:[{offset:0,color:A.color,opacity:A.fillOpacity},{offset:1,color:A.color,opacity:0}]}),aa.push({kind:"path",part:"area",d:`${ge}L${Ee}Z`,fill:A.gradient?`url(#${Pe})`:A.color,fillOpacity:A.gradient?void 0:A.fillOpacity})}oa.push({kind:"path",part:"line",d:ge,stroke:A.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:A.dash})}if(A.kind==="range"&&Ie)for(let ve of Oe)for(let ge of ve){let Se=A.low[ge.i],Ee=A.high[ge.i],Pe=`${A.name}, ${k[ge.i]}: ${Le(Math.min(Se,Ee))} \u2013 ${Le(Math.max(Se,Ee))}`;sa.push({...Ft(ge.x,ge.y,.01,A.color,Pe,fr(A,ge.i,Ee,Pe)),part:"anchor"})}if(A.kind!=="range")for(let ve of Oe)for(let ge of ve){if(!Ce&&!Ie&&!e.labels&&!A.errors)continue;let Se=A.data[ge.i],Ee=L?pe[ge.i]-se[ge.i]:Se,Pe=wr(A.name,k[ge.i],Ee,Le);(Ce||Ie)&&sa.push(Ce&&A.symbol!=="circle"?xa(ge.x,ge.y,A.markerSize,A.symbol,A.color,Ie?Pe:void 0,fr(A,ge.i,Se,Pe),"point"):{...Ft(ge.x,ge.y,Ce?A.markerSize:.01,A.color,Ie?Pe:void 0,fr(A,ge.i,Se,Pe)),part:Ce?"point":"anchor"}),Ie&&rs(A,ge.i,v?ge.y:ge.x,pe[ge.i]),e.labels&&ia.push(J(ge.x,ge.y-8,Le(Ee),{anchor:"middle"}))}}let as={plot:re,xs:v?[]:z.map((A,se)=>Wn(se)),rows:z.map(A=>[k[A],...O.map(se=>{let pe=Br(se);if(se.kind==="range"){let Ie=se.low[A],Me=se.high[A];return`${se.name}: ${P(Ie)&&P(Me)?`${pe(Ie)} \u2013 ${pe(Me)}`:"\u2014"}`}let Le=se.data[A];return`${se.name}: ${P(Le)?pe(L?(x.get(se)?.[A]??0)-(b.get(se)?.[A]??0):Le):"\u2014"}`})]),count:d,zoom:T,crosshair:Hr(e)},Fr=[];if(e.brush&&!v){let A={x:re.x,y:re.y+re.height+Cs,width:re.width,height:As},se=O.find(Le=>Le.kind!=="range"),pe={x:i(A.x+T.start/Math.max(1,d)*A.width),y:A.y,width:i((T.end-T.start)/Math.max(1,d)*A.width),height:A.height};if(Fr.push({kind:"rect",part:"brush",x:A.x,y:A.y,width:A.width,height:A.height,fill:"var(--skdx-color-surface-sunken)",stroke:K.grid}),se){let Le=Ve(se.data),[Ie,Me]=we(Le),Oe=d>1?A.width/(d-1):0,$e=se.data.flatMap((ve,ge)=>P(ve)?[{x:i(A.x+ge*Oe),y:i(A.y+A.height-(Me===Ie?.5:(ve-Ie)/(Me-Ie))*(A.height-4)-2)}]:[]),Ce=it($e);$e.length>1&&Fr.push({kind:"path",part:"brush-series",d:`${Ce}L${$e[$e.length-1]?.x} ${A.y+A.height}L${$e[0]?.x} ${A.y+A.height}Z`,fill:se.color,fillOpacity:.3})}Fr.push({kind:"rect",part:"brush-window",...pe,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:K.axis},{kind:"rect",part:"brush-handle",x:i(pe.x-3),y:A.y+8,width:6,height:A.height-16,fill:K.axis,rx:8},{kind:"rect",part:"brush-handle",x:i(pe.x+pe.width-3),y:A.y+8,width:6,height:A.height-16,fill:K.axis,rx:8}),as.brush={box:A,window:pe}}return{...ta,shapes:[...Qo,...aa,...Er,...oa,...ns,...sa,...ia,...hi,...Dn(e.annotations,Jo),...Fr,...ta.shapes],hit:as,issues:o,defs:Dr.length?Dr:void 0}}function Ls(e,n){if(!(!P(e)||n===null||n===void 0))return typeof n=="number"?P(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:P(n[0])&&P(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function Xi(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function Qi(e,n,t){let r=k=>k.type??n,a=[],o=Ki(e),s=e.categories??[],c=(e.transforms??[]).filter(k=>k.type==="sort"||k.type==="bin"||k.type==="aggregate"),l=(e.transforms??[]).filter(k=>!c.includes(k)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",m=(k,T,D)=>{let v=D.filter(S=>S!==null&&!(typeof S=="number"&&Number.isFinite(S))).length;v&&a.push({code:"invalid-value",severity:"warning",message:`Series "${k}" has ${v} value${v===1?"":"s"} that ${v===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:T??k}),s.length&&D.length!==s.length&&!e.transform&&a.push({code:"length-mismatch",severity:"warning",message:`Series "${k}" has ${D.length} values for ${s.length} categories.`,itemId:T??k})},h=e.series.map((k,T)=>{let D=r(k),v=d?!0:void 0,S=k.type==="range"?void 0:k.stack,O=S===!1?void 0:S===!0||S===void 0&&v?`${D}`:S;k.type==="range"?(m(k.name,k.id,k.low),m(k.name,k.id,k.high)):m(k.name,k.id,k.data);let E=L=>e.nulls==="zero"?L.map(H=>P(H)?H:0):L,z=Os(o,k.axis);return z===void 0&&a.push({code:"unknown-axis",severity:"warning",message:`Series "${k.name}" names axis "${String(k.axis)}", which is not defined; drawn on the first axis.`,itemId:k.id??k.name}),{name:k.name,id:k.id,color:ne(e,T,k.color),axis:z??o[0]?.id,hidden:xe(e,k.name),index:T,kind:D,data:k.type==="range"?[]:E(wa(wa(k.data,l),k.transforms)),low:k.type==="range"?k.low:[],high:k.type==="range"?k.high:[],curve:k.curve??e.curve??"linear",dash:k.type==="range"?void 0:k.dash,markers:k.type==="range"?void 0:k.markers,symbol:k.type==="range"?"circle":k.symbol??"circle",markerSize:k.type==="range"?3:k.markerSize??3,errors:k.type==="range"?void 0:k.errors,stack:D==="range"||D==="line"?void 0:O,style:k.type==="range"?k.style??"area":"area",fillOpacity:(k.type==="range"?void 0:k.fillOpacity)??e.fillOpacity??.25,gradient:k.type!=="range"&&k.gradient===!0}}),f=()=>Math.max(s.length,...h.map(k=>Math.max(k.data.length,k.low.length))),M=k=>{let T=v=>v.length?k.map(S=>v[S]??null):v,D=Array.from({length:f()},(v,S)=>s[S]??String(S+1));s=k.map(v=>D[v]),h=h.map(v=>({...v,data:T(v.data),low:T(v.low),high:T(v.high)}))},$=(k,T)=>{let D=(T!==void 0?h.find(S=>S.name===T):void 0)??h.find(S=>!S.hidden&&S.kind!=="range")??h[0];T!==void 0&&!h.some(S=>S.name===T)&&a.push({code:"unknown-series",severity:"warning",message:`sort.by names "${T}", which is not a series; sorted by the first series.`});let v=Array.from({length:f()},(S,O)=>O).sort((S,O)=>{let E=D?.data[S]??D?.high[S],z=D?.data[O]??D?.high[O],L=P(E)?E:-1/0,H=P(z)?z:-1/0;return k==="asc"?L-H:H-L});M(v)},g=k=>{let T=h.flatMap(v=>Ve(v.data)),D=Jn(T,k);s=D.slice(1).map((v,S)=>`${t(D[S])}\u2013${t(v)}`),h=h.map(v=>{let S=Ve(v.data),O=0,E=er(S,D).map(z=>e.binMode==="density"?S.length?z.count/(S.length*(z.x1-z.x0)):0:e.binMode==="cumulative"?O+=z.count:z.count);return{...v,data:E}})},w=(k,T)=>{let D=Math.max(1,Math.floor(k)),v=f(),S=E=>{if(!E.length)return E;let z=[];for(let L=0;L<v;L+=D){let H=Ve(E.slice(L,L+D));z.push(H.length===0?null:T==="sum"?H.reduce((b,x)=>b+x,0):T==="mean"?H.reduce((b,x)=>b+x,0)/H.length:T==="min"?Math.min(...H):Math.max(...H))}return z};s=Array.from({length:v},(E,z)=>s[z]??String(z+1)).filter((E,z)=>z%D===0),h=h.map(E=>({...E,data:S(E.data),low:S(E.low),high:S(E.high)}))};e.transform==="histogram"?g({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(k=>{let T=0;return{...k,data:k.data.map(D=>P(D)?T+=D:T)}}));for(let k of c)k.type==="sort"?$(k.order??"desc"):k.type==="bin"?g(k):k.type==="aggregate"&&w(k.every,k.method??"sum");typeof e.sort=="string"?$(e.sort):e.sort&&$(e.sort.order,e.sort.by);let R=e.xAxis?.domain;if(R){let k=f(),T=Array.from({length:k},(O,E)=>s[E]??String(E+1)),D=O=>{let E=typeof O=="string"?O:qe(O);return T.findIndex(z=>typeof E=="string"?z===E||Qt(z)===E:qe(z)===E)},v=R.map(D),S=O=>O.length?v.map(E=>E<0?null:O[E]??null):O;s=[...R],h=h.map(O=>({...O,data:S(O.data),low:S(O.low),high:S(O.high)}))}return{series:h,categories:s,issues:a,axes:o}}var ka=e=>qt(e,"bar");var $a=e=>qt(e,"line"),Ia=e=>qt(e,"area");function Fn(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ta=e=>e.id??e.name??e.series,Ss=e=>e.seriesId??e.series;function wn(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ta(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ss(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}var Aa=(e,n,t=Fn(n))=>t.some(r=>wn(e,r)),Yn=e=>Fn(e).flatMap(n=>n.id!==void 0?[n.id]:[]);function Pn(e){let n={},t=Ta(e);t!==void 0&&(n.id=t);let r=Ss(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ca=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function La(e,n,t){let r=Fn(e),a=Pn(n),o=r.some(s=>wn(n,s));return t==="single"?o?[]:[a]:o?r.filter(s=>!wn(n,s)):[...r,a]}var Ji=.2;function el(e){let n=K.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var tl=(e,n)=>e.kind==="text"?{...e,fill:K.grid}:{...e,opacity:(e.opacity??1)*n};function Oa(e,n){let t=Fn(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:Fn(n.highlighted),a=r[0];if(t.length===0&&!a)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],c=m=>!a||r.some(h=>wn(m,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&wn(m,{series:h.series})):!1,l=m=>{if(!a||o.faded==="none"||c(m))return!1;if(o.faded==="series"){let h=a.series;return h!==void 0&&wn(m,{series:h})}return!0},d=e.shapes.map(m=>{let h=m.item;if(!h||h.legend)return m;if(t.some(f=>wn(h,f))){let f=el(m);f&&s.push(f)}return l(h)?tl(m,Ji):m});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}var $r=2*Math.PI;function Ke(e,n,t,r,a,o){let s=(d,m)=>`${i(e+d*Math.sin(m))} ${i(n-d*Math.cos(m))}`;if(o-a>=$r-1e-9){let d=a+$r/2;return`${Ke(e,n,t,r,a,d)}${Ke(e,n,t,r,d,o)}`}let c=o-a>Math.PI?1:0,l=`M${s(t,a)}A${t} ${t} 0 ${c} 1 ${s(t,o)}`;return r>0?`${l}L${s(r,o)}A${r} ${r} 0 ${c} 0 ${s(r,a)}Z`:`${l}L${i(e)} ${i(n)}Z`}function nl(e,n,t,r,a,o,s){let c=o-a;if(s<=0||c>=$r-1e-9)return Ke(e,n,t,r,a,o);let l=Math.sin(Math.min(Math.PI/2,c/2)),d=Math.min(s,r>0?(t-r)/2:t/2,t*l/(1+l));if(r>0&&l<1&&(d=Math.min(d,r*l/(1-l))),d<=.25)return Ke(e,n,t,r,a,o);let m=(w,R)=>`${i(e+w*Math.sin(R))} ${i(n-w*Math.cos(R))}`,h=w=>`A${i(d)} ${i(d)} 0 0 1 ${w}`,f=Math.asin(d/(t-d)),M=Math.sqrt((t-d)**2-d*d),$=o-a-2*f>Math.PI?1:0,g=`M${m(M,a)}${h(m(t,a+f))}A${t} ${t} 0 ${$} 1 ${m(t,o-f)}${h(m(M,o))}`;if(r>0){let w=Math.asin(d/(r+d)),R=Math.sqrt((r+d)**2-d*d),k=o-a-2*w>Math.PI?1:0;g+=`L${m(R,o)}${h(m(r,o-w))}A${r} ${r} 0 ${k} 0 ${m(r,a+w)}${h(m(R,a))}Z`}else g+=`L${i(e)} ${i(n)}Z`;return g}function Sa(e){let n=[];for(let V of e.data)P(V.value)&&V.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${V.name}" is negative (${V.value}); a share of a whole cannot be, so it is drawn as zero.`,itemId:V.id??V.name});let t=le(e,!e.data.some(V=>P(V.value)&&V.value>0),300,300);if(t)return{...t,issues:n};let r=ae(e.format),a=e.percentFormat?ae(e.percentFormat):V=>`${Math.round(V*100)}%`,o=Math.max(0,e.cornerRadius??0),{width:s,height:c}=de(e,300,300),l=e.data.map((V,Q)=>({name:V.name,color:ne(e,Q,V.color)})),d=ue(e,l,s),m=(e.startAngle??0)*Math.PI/180,h=(e.endAngle??(e.startAngle??0)+360)*Math.PI/180,f=Math.max(0,Math.min($r,h-m)),M=f<=Math.PI+1e-9&&Math.abs(Math.sin(m))>.99,$=e.labels&&e.labelPosition==="outside",g=s/2,w=Math.max(.2,Math.min(1,e.outerRadius??1)),R=$?40:8,k=(M?Math.max(0,Math.min(s/2,c-d)-R):Math.max(0,Math.min(s,c-d)/2-R))*w,T=M?m<0||m>Math.PI?c-R:d+R:d+(c-d)/2,D=k*Math.min(.95,Math.max(0,e.innerRadius??(e.variant==="donut"?.6:0))),v=e.data.map((V,Q)=>({...V,i:Q,value:P(V.value)&&!xe(e,V.name)?Math.max(0,V.value):0})),S=e.sort?[...v].sort((V,Q)=>e.sort==="asc"?V.value-Q.value:Q.value-V.value):v,O=S.reduce((V,Q)=>V+Q.value,0),E=S.filter(V=>V.value>0).length,z=Math.max(0,Math.min((e.padAngle??0)*Math.PI/180,f/Math.max(1,E)/2)),L=f>=$r-1e-9,H=E>1?L?E:E-1:0,b=f-H*z,x=Math.min((e.minAngle??0)*Math.PI/180,b/Math.max(1,E)),C=S.map(V=>O>0?V.value/O*b:0);if(x>0)for(let V=0;V<S.length;V++){let Q=S.map((N,F)=>N.value>0&&C[F]<x);if(!Q.some(Boolean))break;let p=Q.filter(Boolean).length*x,q=S.reduce((N,F,_)=>N+(Q[_]||F.value<=0?0:F.value),0);if(S.forEach((N,F)=>{C[F]=Q[F]?x:q>0?N.value/q*(b-p):0}),!S.some((N,F)=>N.value>0&&!Q[F]&&C[F]<x))break}let y=Fn(e.selected),B=m+(L&&H?z/2:0),U=[],Y=[],j=[],I=S.map((V,Q)=>{let p=O>0?V.value/O:0,q=B,N=B+C[Q];p>0&&(B=N+z);let F=a(p),_=`${V.name}: ${r(V.value)} (${F})`,W={label:_,id:V.id??V.name,name:V.name,index:V.i,value:V.value},ee=(q+N)/2;if(e.labels&&p>0){let re=`${V.name} ${F}`;if($){let me=Math.sin(ee),be=i(T-(k+14)*Math.cos(ee));j.some(Z=>Math.abs(Z-be)<12)||(j.push(be),Y.push({kind:"line",part:"label-connector",x1:i(g+k*me),y1:i(T-k*Math.cos(ee)),x2:i(g+(k+12)*me),y2:i(T-(k+12)*Math.cos(ee)),stroke:K.axis}),U.push(Un(i(g+(k+16)*me),be,re,s,{part:"slice-label",anchor:me>.1?"start":me<-.1?"end":"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"})))}else if(p>.03){let me=(k+D)/2;U.push(Un(i(g+me*Math.sin(ee)),i(T-me*Math.cos(ee)),re,s,{part:"slice-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}let te=Aa(W,void 0,y)?Math.max(4,k*.06):0;return{kind:"path",part:"slice",d:p>0?nl(g+te*Math.sin(ee),T-te*Math.cos(ee),k,D,q,N,o):"",fill:ne(e,V.i,V.color),title:_,item:p>0?W:void 0}});e.centerLabel&&U.push(J(i(g),i(M?T-12:T),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let G=he(e,s,c,l);return{...G,shapes:ft([...I,...Y,...G.shapes,...U]),issues:n}}var $t=2;function za(e){let n=Ve(e.data),t=le(e,n.length===0,120,32);if(t)return t;let r=ae(e.format),{width:a,height:o}=de(e,120,32),s=e.data.length,c=n[0],l=n[n.length-1],d=e.lastValue?r(l):"",m=a-$t-(d?d.length*ie+6:0),h=e.variant??"area",f=h==="winloss",M=[...n,...e.band??[],...e.target!==void 0?[e.target]:[]],$=st(f?[-1,1]:Gt(M,h==="bar"),[o-$t,$t]),g=e.x&&e.x.length>=s?e.x.map(qe):void 0,[w,R]=g?we(g):[0,1],k=st([w,R],[$t,m]),T=E=>s<2?($t+m)/2:g?R===w?($t+m)/2:k(g[E]):$t+E/(s-1)*(m-$t),D=e.trend?l>=c?K.positive:K.negative:ne(e,0,e.color),v=[];if(e.band&&!f){let[E,z]=e.band,L=Math.min($(E),$(z));v.push({kind:"rect",part:"band",x:$t,y:i(L),width:i(Math.max(0,m-$t)),height:i(Math.abs($(z)-$(E))),fill:K.axis,opacity:.12,title:`${r(Math.min(E,z))} \u2013 ${r(Math.max(E,z))}`})}e.target!==void 0&&P(e.target)&&!f&&v.push({kind:"line",part:"target",x1:$t,x2:i(m),y1:i($(e.target)),y2:i($(e.target)),stroke:K.axis,dash:"3 2",title:`Target: ${r(e.target)}`});let S=e.data.flatMap((E,z)=>P(E)?[{x:i(T(z)),y:i($(E)),v:E,i:z}]:[]),O=S[S.length-1];if(h==="bar"||f){let E=s>0?(m-$t)/s:0,z=i($(0));e.data.forEach((L,H)=>{if(!P(L))return;let b=i($(f?Math.sign(L):L));v.push({kind:"rect",part:"bar",x:i($t+H*E+E*.1),y:Math.min(b,z),width:i(Math.max(1,E*.8)),height:i(Math.max(1,Math.abs(z-b))),fill:f?L<0?K.negative:K.positive:L<0&&e.trend?K.negative:D,title:e.tooltip===!1?void 0:r(L)})})}else{let E=it(S,e.curve),z=S[0];h==="area"&&v.push({kind:"path",part:"area",d:E&&z&&O?`${E}L${O.x} ${o-$t}L${z.x} ${o-$t}Z`:"",fill:D,fillOpacity:.15}),v.push({kind:"path",part:"line",d:E,stroke:D,strokeWidth:1.5});let L=e.markers??["last"];O&&L.includes("last")&&v.push(Ft(O.x,O.y,2,D,void 0)),z&&L.includes("first")&&v.push({...Ft(z.x,z.y,2,D,void 0),part:"first"})}if(e.extremes&&S.length>1){let E=S.reduce((L,H)=>H.v<L.v?H:L),z=S.reduce((L,H)=>H.v>L.v?H:L);v.push({...Ft(E.x,E.y,2.5,K.negative,r(E.v)),part:"min"},{...Ft(z.x,z.y,2.5,K.positive,r(z.v)),part:"max"})}return d&&O&&v.push(J(i(m+4),O.y,d,{part:"last-value",baseline:"middle",fill:"var(--skdx-color-text-default)"})),{...he(e,a,o),shapes:v}}function Na(e){let n=e.metrics??(e.categories??[]).map(I=>({label:I})),t=le(e,n.length===0||e.series.every(I=>Ve(I.data).length===0),300,300);if(t)return t;let r=[],a=ae(e.format),{width:o,height:s}=de(e,300,300),c=e.series.map((I,G)=>({name:I.name,color:ne(e,G,I.color)})),l=ue(e,c,o),d=o/2,m=l+(s-l)/2,h=Math.max(0,Math.min(o,s-l)/2-36),f=n.length,M=(e.startAngle??0)*Math.PI/180-Math.PI/2,$=I=>M+I*2*Math.PI/Math.max(1,f),g=e.series.filter(I=>!xe(e,I.name)),w=e.normalize===!0?"series":e.normalize===!1||e.normalize===void 0?e.metrics?"metric":"none":e.normalize;w==="series"&&g.length>1&&r.push({code:"misleading-scale",severity:"warning",message:"normalize: 'series' scales each series to its own maximum, so polygons cannot be compared in magnitude; prefer 'metric' or 'none'."});let R=Math.max(1,Math.round(e.levels??4)),k=e.max??Math.max(0,we(g.flatMap(I=>I.data))[1]),T=w==="none"?ht(0,k,R):Array.from({length:R+1},(I,G)=>100*G/R),D=w==="none"?e.max??T[T.length-1]:100,v=n.map((I,G)=>{let V=g.map(F=>F.data[G]),[Q,p]=we(V),q=I.min??Math.min(0,Q),N=ht(q,I.max??p,R);return{min:q,max:I.max??N[N.length-1]}}),S=e.series.map(I=>Math.max(0,we(I.data)[1])),O=(I,G,V)=>{if(w==="series")return S[I]>0?V/S[I]*100:0;if(w==="metric"){let Q=v[G];return Q.max>Q.min?(V-Q.min)/(Q.max-Q.min)*100:0}return V},E=(I,G)=>{let V=D>0?Math.max(0,Math.min(G,D))/D*h:0;return{x:i(d+V*Math.cos($(I))),y:i(m+V*Math.sin($(I)))}},z=I=>f===0?"":`M${n.map((G,V)=>{let Q=E(V,I(V));return`${Q.x} ${Q.y}`}).join("L")}Z`,L=I=>{if(e.gridShape==="circle"){let G=D>0?I/D*h:0;return{kind:"circle",part:"grid",cx:i(d),cy:i(m),r:i(G),fill:"none",stroke:K.grid}}return{kind:"path",part:"grid",d:z(()=>I),stroke:K.grid}},H=T.filter(I=>I>0&&I<=D),b=I=>w==="none"?a(I):w==="series"?`${I}%`:(()=>{let G=v[0];return ae(n[0]?.format??e.format)(G.min+(G.max-G.min)*I/100)})(),x=[...H.map(L),...n.map((I,G)=>{let V=E(G,D);return{kind:"line",part:"grid",x1:i(d),y1:i(m),x2:V.x,y2:V.y,stroke:K.grid}}),...H.map(I=>J(i(d+4),E(0,I).y,b(I),{part:"y-label",baseline:"middle"})),...n.map((I,G)=>{let V=Math.cos($(G)),Q=h+14;return J(i(d+Q*V),i(m+Q*Math.sin($(G))),I.label,{part:"x-label",anchor:V>.1?"start":V<-.1?"end":"middle",baseline:"middle"})})],C=[],y=[],B=[],U=e.markers??!0,Y=e.markerSize??3;e.series.forEach((I,G)=>{if(xe(e,I.name))return;let V=ne(e,G,I.color),Q=p=>{let q=I.data[p];return P(q)?O(G,p,q):0};n.forEach((p,q)=>{let N=I.data[q];if(!P(N))return;let F=ae(p.format??e.format),_=E(q,O(G,q,N)),W=wr(I.name,p.label,N,F);C.push({...Ft(_.x,_.y,U?Y:.01,V,W,{label:W,id:p.id,series:I.name,seriesId:I.id,category:p.label,index:q,value:N}),part:U?"point":"anchor"}),e.labels&&B.push(J(_.x,i(_.y-7),F(N),{part:"value-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}),y.push({kind:"path",part:"area",d:z(Q),fill:e.fill??!0?V:void 0,fillOpacity:.25,stroke:V,strokeWidth:2,title:I.name,item:{label:I.name,series:I.name,seriesId:I.id}})});let j=he(e,o,s,c);return{...j,shapes:[...x,...y,...C,...B,...j.shapes],issues:r}}var qr={top:24,right:8,bottom:8,left:64},Ra=864e5,Ea=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function rl(e,n="monday"){let t=n==="sunday"?[Ea[6],...Ea.slice(0,6)]:Ea,r=e.map(g=>({day:Math.floor(new Date(g.date).getTime()/Ra),value:g.value})).filter(g=>Number.isFinite(g.day));if(r.length===0)return{rows:t,columns:[],data:t.map(()=>[]),dates:t.map(()=>[])};let[a,o]=we(r.map(g=>g.day)),s=n==="sunday"?4:3,c=g=>((g+s)%7+7)%7,l=a-c(a),d=Math.floor((o-l)/7)+1,m=t.map(()=>new Array(d).fill(null)),h=t.map(()=>new Array(d).fill(void 0));for(let g of r){let w=Math.floor((g.day-l)/7);m[c(g.day)][w]=g.value,h[c(g.day)][w]=new Date(g.day*Ra).toISOString().slice(0,10)}let f=new Intl.DateTimeFormat(void 0,{month:"short"}),M=-1,$=Array.from({length:d},(g,w)=>{let R=new Date((l+w*7+6)*Ra),k=R.getUTCMonth();return k===M?"":(M=k,f.format(R))});return{rows:t,columns:$,data:m,dates:h}}var al=e=>e.colorScale??(e.diverging?{type:"diverging",steps:e.steps}:{type:"sequential",domain:e.domain,steps:e.steps}),zs=(e,n)=>{let t=e.map((r,a)=>a);return n&&t.sort((r,a)=>(n==="asc"?1:-1)*(e[r]-e[a])),t};function Da(e){let n=[],t=e.calendar?rl(e.calendar,e.weekStart):void 0,r=t?.rows??e.rows??[],a=t?.columns??e.columns??[],o=t?.data??e.data??[];!t&&(o.length!==r.length||o.some(b=>b.length!==a.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${o.length} \xD7 ${o[0]?.length??0} but there are ${r.length} rows and ${a.length} columns; missing cells are blank.`});let s=o.flat().filter(b=>b!=null&&!P(b)).length;s&&n.push({code:"invalid-value",severity:"warning",message:`${s} cell${s===1?" is":"s are"} neither a number nor null; drawn as blank.`});let c=o.flat(),l=le(e,r.length===0||a.length===0||!c.some(P));if(l)return{...l,issues:n};let d=ae(e.format),{width:m,height:h}=de(e),f=Bn(e.colorLegend),M=Te(m,h,{...qr,left:t?40:qr.left,right:qr.right+f.right,bottom:qr.bottom+f.bottom}),$=b=>b.reduce((x,C)=>x+(P(C)?C:0),0),g=zs(r.map((b,x)=>$(o[x]??[])),e.rowOrder),w=zs(a.map((b,x)=>$(o.map(C=>C[x]))),e.columnOrder),R=g.map(b=>r[b]),k=w.map(b=>a[b]),T=M.width/Math.max(1,k.length),D=M.height/Math.max(1,R.length),v=Pt(al(e),c,ne(e,0,e.color),e.negativeColor,d),S=[],O=[],E=e.cellGap??(t?1:0),z=e.cellRadius??(t?2:0);R.forEach((b,x)=>{k.forEach((C,y)=>{let B=o[g[x]]?.[w[y]],U=t?.dates[g[x]]?.[w[y]],Y=t?U??b:`${b}, ${C}`,j=i(M.x+y*T+E),I=i(M.y+x*D+E),G={x:j,y:I,width:i(Math.max(0,T-2*E)),height:i(Math.max(0,D-2*E)),rx:z||void 0};if(!P(B)){e.missingColor&&(!t||U)&&S.push({kind:"rect",part:"missing",...G,fill:e.missingColor,title:`${Y}: \u2014`});return}let V=v.color(B),Q=`${Y}: ${d(B)}`;S.push({kind:"rect",part:"cell",...G,fill:V.fill,opacity:V.opacity,title:Q,item:{label:Q,id:t?U:`${b}:${C}`,category:C,name:b,index:y,value:B}}),e.labels&&T>24&&D>12&&O.push(J(i(M.x+(y+.5)*T),i(M.y+(x+.5)*D),d(B),{part:"cell-label",anchor:"middle",baseline:"middle",fill:V.opacity>=.5?"var(--skdx-color-text-on-accent)":"var(--skdx-color-text-default)"}))})});let L=he(e,m,h),H=e.colorLegend?nr(v,f.right?{x:M.x+M.width+12,y:M.y,width:f.right,height:M.height}:{x:M.x,y:M.y+M.height+8,width:M.width,height:f.bottom},f.options):[];return{...L,shapes:[...R.map((b,x)=>J(M.x-8,i(M.y+(x+.5)*D),b,{part:"y-label",anchor:"end",baseline:"middle"})),...k.flatMap((b,x)=>b?[J(i(M.x+(x+.5)*T),M.y-8,b,{part:"x-label",anchor:t?"start":"middle"})]:[]),...S,...O,...H,...L.shapes],issues:n}}var Zr=8;function Ba(e){let n=e.variant==="pyramid",t=[],r=e.sort??(n?"asc":void 0),a=e.data.filter(x=>P(x.value)?!0:(t.push({code:"invalid-value",severity:"warning",message:`Stage "${x.name}" has no valid value and was dropped.`,itemId:x.id??x.name}),!1)).sort((x,C)=>r==="asc"?x.value-C.value:r==="desc"?C.value-x.value:0),o=le(e,a.length===0,400,300);if(o)return{...o,issues:t};let s=ae(e.format),{width:c,height:l}=de(e,400,300),d=a.length,m=e.orientation==="horizontal",h=Math.max(0,e.gap??4),f=e.labelPosition??"inside",M=Math.max(0,...a.map(x=>x.value)),$=a.reduce((x,C)=>x+Math.max(0,C.value),0),g=a[0]?.value??0,w=a.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),R=ue(e,w,c),k=m?c:l-R,T=m?l-R:c,D=f==="outside",v=Math.max(0,(D?T*2/3:T)-2*Zr),S=d===0?0:(k-2*Zr)/d,O=Math.max(0,Math.min(1,e.neckWidth??0)),E=x=>M>0?(O+(1-O)*(Math.max(0,x)/M))*v:0,z=e.percentFormat?ae(e.percentFormat):x=>`${Math.round(x*100)}%`,L=(m?R+(l-R)/2:c/2)-(D?T/6:0),H=a.flatMap((x,C)=>{let y=E(x.value),B=E(a[C+1]?.value??x.value),U=Zr+C*S+(m?0:R),Y=U+S-h,j=n?$>0?x.value/$:0:g>0?x.value/g:0,I=a[C-1]?.value,G=I!==void 0&&I>0?x.value/I-1:0,V=!n&&I!==void 0&&I>0?` \xB7 ${G<0?"\u2212":G>0?"+":""}${z(Math.abs(G))} from ${a[C-1]?.name}`:"",Q=`${x.name}: ${s(x.value)} (${z(j)})${V}`,q={kind:"path",part:"stage",d:m?`M${i(U)} ${i(L-y/2)}L${i(U)} ${i(L+y/2)}L${i(Y)} ${i(L+B/2)}L${i(Y)} ${i(L-B/2)}Z`:`M${i(L-y/2)} ${i(U)}L${i(L+y/2)} ${i(U)}L${i(L+B/2)} ${i(Y)}L${i(L-B/2)} ${i(Y)}Z`,fill:ne(e,C,x.color),title:Q,item:{label:Q,id:x.id??x.name,name:x.name,index:C,value:x.value}};if(f==="none")return[q];let N=`${x.name} \xB7 ${s(x.value)}`,F=(U+Y)/2;if(D){let W=L+v/2+Zr;return[q,Un(i(m?F:W),i(m?W:F),N,c,{part:"stage-label",anchor:m?"middle":"start",baseline:m?"hanging":"middle",fill:"var(--skdx-color-text-default)"})]}let _=Un(i(m?F:L),i(m?L:F),N,c,{part:"stage-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"});return[q,{kind:"rect",part:"stage-label-background",x:i(_.x-(_.text.length*ie+8)/2),y:i((m?L:F)-9),width:_.text.length*ie+8,height:18,rx:8,fill:"var(--skdx-color-surface-default)"},_]}),b=he(e,c,l,w);return{...b,shapes:[...H,...b.shapes],issues:t}}var Ns=e=>e*Math.PI/180;function Fa(e){let n=e.data.filter(O=>P(O.value)),t=le(e,n.length===0,300,300);if(t)return t;let r=ae(e.format),{width:a,height:o}=de(e,300,300),s=n.map((O,E)=>({name:O.name,color:ne(e,E,O.color)})),c=ue(e,s,a),l=a/2,d=c+(o-c)/2,m=Math.max(0,Math.min(a,o-c)/2-(e.bands?20:8)),h=m*Math.min(.95,Math.max(0,e.innerRadius??.3)),f=Ns(e.startAngle??0),M=Ns(e.endAngle??(e.startAngle??0)+360),$=Math.max(0,Math.min(2*Math.PI,M-f)),g=e.max??Math.max(0,...n.map(O=>O.value)),w=n.length,R=Math.max(0,e.gap??.25),k=w===0?0:(m-h)/(w+R*(w-1)),T=e.rounded??!0,D=O=>g>0?Math.max(0,Math.min(1,O/g)):0,v=[];for(let O of e.bands??[]){let E=f+D(O.from)*$,z=f+D(O.to)*$;z<=E||v.push({kind:"path",part:"band",d:Ke(l,d,m+14,m+6,E,z),fill:Bt(O.variant),opacity:.6,title:`${r(O.from)} \u2013 ${r(O.to)}`})}if(n.forEach((O,E)=>{if(xe(e,O.name))return;let z=m-E*k*(1+R),L=z-k,H=ne(e,E,O.color),b=f+D(O.value)*$,x=`${O.name}: ${r(O.value)} (${Math.round(D(O.value)*100)}%)`;if((e.track??!0)&&v.push({kind:"path",part:"track",d:Ke(l,d,z,L,f,f+$),fill:K.grid,opacity:.6}),b>f&&(v.push({kind:"path",part:"bar",d:Ke(l,d,z,L,f,b),fill:H,title:x,item:{label:x,id:O.id,name:O.name,index:E,value:O.value}}),T&&$<2*Math.PI-1e-9)){let C=(L+z)/2;for(let y of[f,b])v.push({kind:"circle",part:"bar-cap",cx:i(l+C*Math.sin(y)),cy:i(d-C*Math.cos(y)),r:i(k/2),fill:H})}if(e.labels){let C=(L+z)/2;v.push(J(i(l+C*Math.sin(f)-6*Math.cos(f)),i(d-C*Math.cos(f)-6*Math.sin(f)),`${O.name} ${r(O.value)}`,{part:"bar-label",anchor:Math.cos(f)>=0?"end":"start",baseline:"middle"}))}}),e.target!==void 0&&P(e.target)){let O=f+D(e.target)*$,E=m-w*k*(1+R)+k*R;v.push({kind:"line",part:"target",x1:i(l+E*Math.sin(O)),y1:i(d-E*Math.cos(O)),x2:i(l+(m+4)*Math.sin(O)),y2:i(d-(m+4)*Math.cos(O)),stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${r(e.target)}`})}e.centerLabel&&v.push(J(i(l),i(d),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"}));let S=he(e,a,o,s);return{...S,shapes:[...v,...S.shapes]}}var Rs=e=>e*Math.PI/180;function ol(e,n){let t=[0],r=[0],a=o=>{t.push(Math.sin(o)),r.push(-Math.cos(o))};a(e),a(n);for(let o=Math.ceil(e/(Math.PI/2));o*(Math.PI/2)<=n;o++)a(o*(Math.PI/2));return{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)}}function Pa(e){let n=le(e,!P(e.value),300,300);if(n)return n;let t=ae(e.format),{width:r,height:a}=de(e,300,300),o=ue(e),s=P(e.min)?e.min:0,c=P(e.max)?e.max:100,l=e.startAngle??-120,d=e.endAngle??120,m=Rs(l),h=Rs(Math.max(l,Math.min(l+360,d))),f=h-m,M=_=>c>s?Math.max(0,Math.min(1,(_-s)/(c-s))):0,$=_=>m+M(_)*f,g=e.variant==="solid",w=e.ticks===!1?0:e.ticks===!0||e.ticks===void 0?5:e.ticks,R=e.tickLabels??!0,k=Array.from({length:w},(_,W)=>w===1?s:s+(c-s)*W/(w-1)),T=w>0&&R,D=T?Math.max(...k.map(_=>t(_).length))*ie:0,v=T?14+D:10,S=T?26:10,O=ol(m,h),E=Math.max(O.x1-O.x0,.2),z=Math.max(O.y1-O.y0,.2),L=Math.max(0,Math.min((r-2*v)/E,(a-o-2*S)/z)),H=r/2-(O.x0+O.x1)/2*L,b=o+(a-o)/2-(O.y0+O.y1)/2*L,x=L*Math.max(.04,Math.min(.6,e.thickness??.18)),C=L-x,y=(_,W)=>({x:i(H+_*Math.sin(W)),y:i(b-_*Math.cos(W))}),B=[],U=`${t(s)} \u2013 ${t(c)}`,Y=(e.bands??[]).filter(_=>P(_.from)&&P(_.to)),j=_=>Y.find(W=>_>=W.from&&_<=W.to),I=_=>_.color??Bt(_.variant);B.push({kind:"path",part:"track",d:Ke(H,b,L,C,m,h),fill:K.grid,opacity:.6});for(let _ of Y){let W=$(Math.min(_.from,_.to)),ee=$(Math.max(_.from,_.to));if(ee<=W)continue;let te=`${_.label?`${_.label}: `:""}${t(_.from)} \u2013 ${t(_.to)}`;B.push(g?{kind:"path",part:"band",d:Ke(H,b,L+6,L+2,W,ee),fill:I(_),opacity:.7,title:te}:{kind:"path",part:"band",d:Ke(H,b,L,C,W,ee),fill:I(_),opacity:.75,title:te})}let G=`${e.caption??"Value"}: ${t(e.value)} (${U})`,V={label:G,name:e.caption,value:e.value},Q=$(e.value);if(g){let _=j(e.value),W=_?I(_):ne(e,0);Q>m+1e-6?B.push({kind:"path",part:"value",d:Ke(H,b,L,C,m,Q),fill:W,title:G,item:V}):B.push({...sl(H,b),title:G,item:V})}else{let _=y(C-4,Q),W=4,ee=y(W,Q-Math.PI/2),te=y(W,Q+Math.PI/2);B.push({kind:"path",part:"needle",d:`M${ee.x} ${ee.y}L${_.x} ${_.y}L${te.x} ${te.y}Z`,fill:"var(--skdx-color-text-default)",title:G,item:V},{kind:"circle",part:"hub",cx:i(H),cy:i(b),r:5,fill:"var(--skdx-color-text-default)"})}for(let _ of k){let W=$(_),ee=y(L+2,W),te=y(L+7,W);if(B.push({kind:"line",part:"tick",x1:ee.x,y1:ee.y,x2:te.x,y2:te.y,stroke:K.axis}),R){let re=y(L+12,W),me=Math.sin(W);B.push(J(re.x,re.y,t(_),{part:"tick-label",anchor:me>.3?"start":me<-.3?"end":"middle",baseline:"middle"}))}}if(P(e.target)){let _=$(e.target),W=y(C-2,_),ee=y(L+4,_);B.push({kind:"line",part:"target",x1:W.x,y1:W.y,x2:ee.x,y2:ee.y,stroke:"var(--skdx-color-text-default)",strokeWidth:2,title:`Target: ${t(e.target)}`})}let q=f<2*Math.PI-1e-6?O.y1<.2?b-C*.4:b+C*.45:b;B.push(J(i(H),i(q),e.centerLabel??t(e.value),{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),e.caption&&B.push(J(i(H),i(q+16),e.caption,{part:"caption",anchor:"middle",baseline:"middle"}));let N=he(e,r,a),F=P(e.target)?`, target ${t(e.target)}`:"";return{...N,description:e.description??`${e.caption??"Value"} ${t(e.value)} on a scale from ${t(s)} to ${t(c)}${F}.`,shapes:[...B,...N.shapes]}}var sl=(e,n)=>({kind:"circle",part:"anchor",cx:i(e),cy:i(n),r:.01,fill:"none"});function Ha(e){let[n,t]=e.sizeRange??[4,24],r=ae(e.zAxis?.format??e.format),a=e.zAxis?.label,o=e.xAxis?.label,s=e.yAxis?.label,c=(l,d)=>l?`${l} ${d}`:d;return ya({...e,series:e.series.map(l=>({name:l.name,id:l.id,color:l.color,data:l.data.filter(d=>P(d.x)&&P(d.y)).map(d=>({x:d.x,y:d.y,size:P(d.z)?Math.max(0,d.z):0,label:d.label,id:d.id,color:d.color,value:d.value??d.z}))}))},{part:"bubble",opacity:.7,radius:(l,[,d])=>d>0&&P(l)?Math.max(n,Math.sqrt(l/d)*t):n,describe:(l,d,m,h)=>`${l}${d.label?` ${d.label}`:""}: ${c(o,m.format(d.x))}, ${c(s,h.format(d.y))}, ${c(a,r(d.size??0))}`})}function Va(e){let n=Ve(e.data),t=le(e,n.length===0);if(t)return t;let r=Jn(n,{bins:e.bins,binWidth:e.binWidth,domain:e.domain,thresholds:e.thresholds}),a=er(n,r),o=a.reduce((g,w)=>g+w.count,0),s=e.mode??"count",c=ae(e.xAxis?.format??e.format),l=ae(s==="percent"?{style:"percent",digits:1}:s==="density"?{style:"decimal",digits:3}:e.format),d=e.name??(s==="density"?"Density":s==="percent"?"Share":"Count"),m=g=>s==="density"?o>0&&g.x1>g.x0?g.count/(o*(g.x1-g.x0)):0:s==="percent"?o>0?g.count/o:0:g.count,h=a.map(g=>`${c(g.x0)}\u2013${c(g.x1)}`),f=qt({...e,format:l,series:[{name:d,data:a.map(m),color:e.color}],categories:h,xAxis:e.xAxis?.label?{label:e.xAxis.label}:void 0,barGap:e.barGap??.05,transform:void 0},"bar"),M=f.shapes.map((g,w)=>{if(g.part!=="bar"||!g.item||g.item.index===void 0)return g;let R=a[g.item.index];if(!R)return g;let k=o>0?` (${Math.round(R.count/o*1e3)/10}%)`:"",T=`${h[g.item.index]??String(w)}: ${R.count}${k}${s==="count"?"":` \xB7 ${d} ${l(m(R))}`}`;return{...g,title:g.title===void 0?void 0:T,item:{...g.item,label:T}}}),$=f.hit?.rows.map((g,w)=>{let R=a[w];return R?[g[0],`${d}: ${l(m(R))}`,`Observations: ${R.count}`]:g});return{...f,shapes:M,hit:f.hit&&$?{...f.hit,rows:$}:f.hit}}function il(e,n){let t=[],r=n;for(let a of e??[]){let o=typeof a=="number"?{from:r,to:a}:a;P(o.to)&&(t.push(o),r=o.to)}return t}function Ir(e){let n=e.data.filter(v=>P(v.value)),t=le(e,n.length===0,600,40+44*Math.max(1,e.data.length));if(t)return t;let r=ae(e.format),a=e.orientation==="vertical",{width:o,height:s}=de(e,600,a?300:40+44*n.length),c=v=>v.ranges??e.ranges,l=n.flatMap(v=>[v.value,v.target,...(c(v)??[]).map(S=>typeof S=="number"?S:S.to)]),[d,m]=we(l),h=e.min??Math.min(0,d),f=Math.max(0,...n.map(v=>v.name.length))*ie,M=Te(o,s,{top:fe.top+ue(e),right:e.labels&&!a?56:fe.right,bottom:fe.bottom,left:a?fe.left:Math.max(fe.left,f+16)}),$=a?[M.y+M.height,M.y]:[M.x,M.x+M.width],g=Ge([h,Math.max(h,m)],$,{min:h,max:e.max,ticks:e.ticks},e.format),w=je(n.length,a?[M.x,M.x+M.width]:[M.y,M.y+M.height],.3),R=he(e,o,s),k=n.map((v,S)=>({pos:i(w.center(S)),label:v.name})),T=Ze({...R,plot:M,xTicks:a?Ne(k,M.width):k,yTicks:a?g.ticks:Ne(g.ticks,M.width),baseline:g.zero},{horizontal:!a}),D=(v,S,O,E,z)=>{let L=g.scale(v),H=g.scale(S),b=Math.max(1,Math.abs(H-L));return a?{kind:"rect",x:i(O-E/2),y:i(Math.min(L,H)),width:i(E),height:i(b),...z}:{kind:"rect",x:i(Math.min(L,H)),y:i(O-E/2),width:i(b),height:i(E),...z}};return n.forEach((v,S)=>{if(xe(e,v.name))return;let O=w.center(S),E=w.bandwidth,z=il(c(v),h);z.forEach((x,C)=>{let y=`${v.name} ${x.label??`range ${C+1}`}: ${r(x.from)} \u2013 ${r(x.to)}`;T.push(D(x.from,x.to,O,E,{part:"range",fill:x.color??(x.variant?Bt(x.variant):K.axis),opacity:x.variant||x.color?.25:Math.max(.1,.4-C*.1),title:y}))});let L=P(v.target)?` \xB7 target ${r(v.target)}`:"",H=z.find(x=>v.value>=x.from&&v.value<=x.to),b=`${v.name}: ${r(v.value)}${L}${H?.label?` (${H.label})`:""}`;if(T.push(D(Math.min(h,v.value),v.value,O,E/3,{part:"measure",fill:ne(e,S,v.color),title:b,item:{label:b,id:v.id,name:v.name,index:S,value:v.value}})),P(v.target)){let x=i(g.scale(v.target));T.push({kind:"line",part:"target",x1:a?i(O-E/2.5):x,x2:a?i(O+E/2.5):x,y1:a?x:i(O-E/2.5),y2:a?x:i(O+E/2.5),stroke:"var(--skdx-color-text-default)",strokeWidth:3,title:`${v.name} target: ${r(v.target)}`})}if(e.labels){let x=g.scale(P(v.target)?Math.max(v.value,v.target):v.value);T.push(a?J(i(O),i(x-6),r(v.value),{part:"value-label",anchor:"middle"}):J(i(x+6),i(O),r(v.value),{part:"value-label",baseline:"middle"}))}}),{...R,shapes:[...T,...R.shapes]}}var _a=e=>qt(e,"bar");function ja(e){let n=e.variant??"area";return qt({...e,series:e.series.map(t=>({type:"range",name:t.name,low:t.low,high:t.high,color:t.color,axis:t.axis,curve:t.curve,style:n}))},"bar")}var Ur=e=>Math.round(e*1e6)/1e6,Es=60,ll=500;function Ga(e){let n=[],t=new Map;for(let Z of e.nodes)t.has(Z.id)?n.push({code:"duplicate-id",severity:"warning",message:`Node id "${Z.id}" is duplicated; the first definition is kept.`,itemId:Z.id}):t.set(Z.id,Z);let r=Z=>Z.group,a=[...t.values()].filter(Z=>!(Z.group!==void 0&&xe(e,Z.group))),o=new Set(a.map(Z=>Z.id)),s=e.edges.filter(Z=>{let oe=o.has(Z.source)&&o.has(Z.target);return!oe&&!(t.has(Z.source)&&t.has(Z.target))&&n.push({code:"unknown-node",severity:"warning",message:`Edge ${Z.source} \u2192 ${Z.target} names a node that does not exist and was dropped.`,itemId:Z.id}),oe}),c=le(e,a.length===0);if(c)return{...c,issues:n};let l=ae(e.format),{width:d,height:m}=de(e),[h,f]=e.nodeRange??[5,16],M=e.labels??a.length<=Es,$=[...new Set(e.nodes.map(r).filter(Z=>Z!==void 0))],g=$.map((Z,oe)=>({name:Z,color:ne(e,oe)})),w=Te(d,m,{top:ue(e,g,d)+f+8,right:f+(M?48:8),bottom:f+8,left:f+8}),R=(Z,oe)=>Z.color??ne(e,Z.group!==void 0?$.indexOf(Z.group):oe),[,k]=we(a.map(Z=>Z.value)),T=Z=>P(Z)&&k>0?h+Math.sqrt(Math.max(0,Z)/k)*(f-h):h,D=new Map;for(let Z of s)D.set(Z.source,(D.get(Z.source)??0)+1),Z.target!==Z.source&&D.set(Z.target,(D.get(Z.target)??0)+1);let v=a.length,S=new Map(a.map((Z,oe)=>[Z.id,oe])),O,E,z=e.arrange??"force";z==="manual"&&a.every(Z=>P(Z.x)&&P(Z.y))?(O=a.map(Z=>Z.x),E=a.map(Z=>Z.y)):z==="circular"||z==="manual"||v<3?(O=a.map((Z,oe)=>Ur(Math.cos(2*Math.PI*oe/v-Math.PI/2))),E=a.map((Z,oe)=>Ur(Math.sin(2*Math.PI*oe/v-Math.PI/2)))):{xs:O,ys:E}=cl(v,s.map(Z=>[S.get(Z.source),S.get(Z.target)]),e.iterations??Math.max(50,Math.min(300,Math.floor(3e4/v))));let[L,H]=we(O),[b,x]=we(E),C=Math.max(H-L,x-b)||1,y=Math.min(w.width/C,w.height/C),B=w.x+(w.width-(H-L)*y)/2,U=w.y+(w.height-(x-b)*y)/2,Y=a.map((Z,oe)=>({node:Z,index:oe,x:i(B+(O[oe]-L)*y),y:i(U+(E[oe]-b)*y),r:i(T(Z.value)),color:R(Z,oe),degree:D.get(Z.id)??0})),j=new Map(Y.map(Z=>[Z.node.id,Z])),I=Yn(e.selected)[0],G=I!==void 0?j.get(String(I)):void 0,V=new Set;if(G){V.add(G.node.id);for(let Z of s)Z.source===G.node.id&&V.add(Z.target),Z.target===G.node.id&&V.add(Z.source)}let Q=(Z,oe=Z)=>G&&!(V.has(Z)&&V.has(oe))?.15:void 0,p=Z=>!G||Z.source===G.node.id||Z.target===G.node.id,[,q]=we(s.map(Z=>Z.value)),N=s.length<=ll,F=[],_=(Z,oe,ke)=>F.some(Be=>Math.abs(Be.y-oe)<12&&Z<Be.x+Be.w+4&&Z+ke+4>Be.x)?!1:(F.push({x:Z,y:oe,w:ke}),!0),W=[],ee=[],te=s.map(Z=>{let oe=j.get(Z.source),ke=j.get(Z.target),Be=P(Z.value)&&q>0?1+3*Math.sqrt(Math.max(0,Z.value)/q):1,Fe=`${oe.node.label??oe.node.id} \u2192 ${ke.node.label??ke.node.id}${Z.label?` ${Z.label}`:""}${P(Z.value)?`: ${l(Z.value)}`:""}`,Mt=p(Z)?Q(Z.source,Z.target):.15,wt=N?{label:Fe,id:Z.id,name:Z.source,category:Z.target,value:Z.value}:void 0;if(oe===ke){let mt=oe.r*2.5;return{kind:"path",part:"edge",d:`M${i(oe.x)} ${i(oe.y-oe.r)}C${i(oe.x-mt)} ${i(oe.y-mt*1.5)} ${i(oe.x+mt)} ${i(oe.y-mt*1.5)} ${i(oe.x)} ${i(oe.y-oe.r)}`,stroke:K.axis,strokeWidth:Be,opacity:Mt??.7,title:N?Fe:void 0,item:wt}}let An=Math.sqrt((ke.x-oe.x)*(ke.x-oe.x)+(ke.y-oe.y)*(ke.y-oe.y))||1,Nn=(ke.x-oe.x)/An,un=(ke.y-oe.y)/An;if(e.directed){let mt=ke.x-Nn*ke.r,kt=ke.y-un*ke.r,hn=mt-Nn*6,Wn=kt-un*6;W.push({kind:"path",part:"arrow",d:`M${i(mt)} ${i(kt)}L${i(hn-un*3)} ${i(Wn+Nn*3)}L${i(hn+un*3)} ${i(Wn-Nn*3)}Z`,fill:K.axis,opacity:Mt??.7})}let Mn=`${Z.label??""}${P(Z.value)?`${Z.label?": ":""}${l(Z.value)}`:""}`;if(e.edgeLabels&&Mn){let mt=(oe.x+ke.x)/2,kt=(oe.y+ke.y)/2,hn=Mn.length*ie;_(mt-hn/2,kt,hn)&&ee.push(J(i(mt),i(kt),Mn,{part:"edge-label",anchor:"middle",baseline:"middle"}))}return{kind:"path",part:"edge",d:`M${i(oe.x)} ${i(oe.y)}L${i(ke.x)} ${i(ke.y)}`,stroke:K.axis,strokeWidth:Be,opacity:Mt??.7,title:N?Fe:void 0,item:wt}}),re=[],me=[];for(let Z of Y){let oe=Z.node.label??Z.node.id,ke=P(Z.node.value)?`: ${l(Z.node.value)}`:"",Be=Z.node.group!==void 0?` \xB7 ${Z.node.group}`:"",Fe=`${oe}${ke}${Be} \xB7 ${Z.degree} connection${Z.degree===1?"":"s"}`;if(re.push({kind:"circle",part:"node",cx:Z.x,cy:Z.y,r:Z.r,fill:Z.color,stroke:G?.node.id===Z.node.id?"var(--skdx-color-text-default)":"var(--skdx-color-surface-default)",opacity:Q(Z.node.id),title:Fe,item:{label:Fe,name:Z.node.id,category:Z.node.group,index:Z.index,value:Z.node.value}}),!M)continue;let Mt=oe.length*ie,wt=Z.x+Z.r+4,An=Z.y;_(wt,An,Mt)&&me.push(J(i(wt),i(An),oe,{part:"node-label",baseline:"middle",fill:Q(Z.node.id)===void 0?"var(--skdx-color-text-default)":K.grid}))}let be=he(e,d,m,g);return{...be,shapes:[...te,...W,...re,...ee,...me,...be.shapes],issues:n}}function cl(e,n,t){let r=Array.from({length:e},(l,d)=>Ur(Math.cos(2*Math.PI*d/e))),a=Array.from({length:e},(l,d)=>Ur(Math.sin(2*Math.PI*d/e))),o=Math.sqrt(4/e),s=new Array(e).fill(0),c=new Array(e).fill(0);for(let l=0;l<t;l++){let d=.1*(1-l/t)+.005;s.fill(0),c.fill(0);for(let m=0;m<e;m++)for(let h=m+1;h<e;h++){let f=r[m]-r[h],M=a[m]-a[h];f===0&&M===0&&(f=.001*(m%7+1),M=.001*(h%5+1));let $=f*f+M*M,g=o*o/$;s[m]=s[m]+f*g,c[m]=c[m]+M*g,s[h]=s[h]-f*g,c[h]=c[h]-M*g}for(let[m,h]of n){if(m===h)continue;let f=r[m]-r[h],M=a[m]-a[h],$=Math.sqrt(f*f+M*M)||1e-6,g=$*$/o/$;s[m]=s[m]-f*g,c[m]=c[m]-M*g,s[h]=s[h]+f*g,c[h]=c[h]+M*g}for(let m=0;m<e;m++){let h=Math.sqrt(s[m]*s[m]+c[m]*c[m])||1e-6,f=Math.min(h,d);r[m]=r[m]+s[m]/h*f,a[m]=a[m]+c[m]/h*f}}return{xs:r,ys:a}}var Wa=14;function qa(e){let n=[],t=e.events.map((C,y)=>({event:C,index:y,time:new Date(C.date).getTime()})).filter(C=>Number.isFinite(C.time)?!(C.event.group!==void 0&&xe(e,C.event.group)):(n.push({code:"invalid-value",severity:"warning",message:`Event "${C.event.label}" has an unparseable date and was dropped.`,itemId:C.event.id??C.event.label}),!1)).sort((C,y)=>C.time-y.time||C.index-y.index),r=le(e,t.length===0);if(r)return{...r,issues:n};let{width:a,height:o}=de(e),s=e.orientation==="vertical",c=[...new Set(e.events.map(C=>C.group).filter(C=>C!==void 0))],l=c.length?c:[""],[d,m]=we(t.map(C=>C.time)),h=e.xAxis?.format??{style:m-d<2*864e5?"time":"date"},f=C=>Qt(C,h),M=e.labels??!0,$=t.map(C=>{let y=C.event.group,B=C.event.color??(C.event.variant?Bt(C.event.variant):ne(e,y===void 0?0:c.indexOf(y))),U=C.event.description?` \u2014 ${C.event.description}`:"";return{...C,lane:y===void 0?0:c.indexOf(y),color:B,text:`${C.event.label} \xB7 ${f(C.time)}${U}`}}),g=c.map((C,y)=>({name:C,color:ne(e,y)})),w=he(e,a,o,g),R=C=>({label:C.text,id:C.event.id,name:C.event.label,category:C.event.group,index:C.index,value:C.time}),k=[];if(s){let C=Math.max(...$.map(Y=>f(Y.time).length))*ie+16,y=Te(a,o,{top:8+ue(e,g,a),right:8,bottom:8,left:C+12}),B=je($.length,[y.y,y.y+y.height],0),U=i(y.x);return k.push({kind:"line",part:"axis",x1:U,x2:U,y1:y.y,y2:y.y+y.height,stroke:K.axis}),$.forEach((Y,j)=>{let I=i(B.center(j));if(k.push(J(i(y.x-12),I,f(Y.time),{part:"x-label",anchor:"end",baseline:"middle"}),{kind:"circle",part:"event",cx:U,cy:I,r:5,fill:Y.color,stroke:"var(--skdx-color-surface-default)",title:Y.text,item:R(Y)}),M){let G=Y.event.description,V=B.step>=2*Wa&&G;k.push(J(i(y.x+12),V?i(I-7):I,Y.event.label,{part:"event-label",baseline:"middle",fill:"var(--skdx-color-text-default)"})),V&&k.push(J(i(y.x+12),i(I+7),G,{part:"event-description",baseline:"middle"}))}}),{...w,shapes:[...k,...w.shapes],issues:n}}let T=c.length?Math.max(...c.map(C=>C.length))*ie+16:8,D=Math.max(f(d).length,f(m).length)*ie/2+4,v=Te(a,o,{top:8+ue(e,g,a),right:Math.max(16,D),bottom:32+(e.xAxis?.label?14:0),left:Math.max(16,T,D)}),S=(m-d)*.04||36e5,O=st([d-S,m+S],[v.x,v.x+v.width]),E=Qn(d-S,m+S).filter(C=>C>=d-S&&C<=m+S).map(C=>({pos:i(O(C)),label:f(C)}));for(let C of Ne(E,v.width))k.push({kind:"line",part:"grid",x1:C.pos,x2:C.pos,y1:v.y,y2:v.y+v.height,stroke:K.grid},J(C.pos,v.y+v.height+20,C.label,{part:"x-label",anchor:"middle"}));e.xAxis?.label&&k.push(J(i(v.x+v.width/2),o-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let z=je(l.length,[v.y,v.y+v.height],0),L=Math.max(0,Math.floor((z.step/2-14)/Wa));l.forEach((C,y)=>{let B=i(z.center(y));k.push({kind:"line",part:"axis",x1:v.x,x2:v.x+v.width,y1:B,y2:B,stroke:K.axis}),C&&k.push(J(v.x-8,B,C,{part:"y-label",anchor:"end",baseline:"middle"}))});let H=l.map(()=>[]),b=[],x=[];for(let C of $){let y=i(O(C.time)),B=i(z.center(C.lane));if(x.push({kind:"circle",part:"event",cx:y,cy:B,r:5,fill:C.color,stroke:"var(--skdx-color-surface-default)",title:C.text,item:R(C)}),!M)continue;let U=C.event.label.length*ie,Y=y-U/2,j=H[C.lane],I=0;for(;I<=L&&(j[I]??-1/0)>Y-6;)I++;if(I>L)continue;j[I]=Y+U;let G=i(B-12-I*Wa),V=i(Math.max(U/2+2,Math.min(a-U/2-2,y)));I>0&&b.push({kind:"line",part:"connector",x1:y,x2:y,y1:i(B-6),y2:i(G+4),stroke:K.grid}),b.push(J(V,G,C.event.label,{part:"event-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}))}return{...w,shapes:[...k,...b,...x,...w.shapes],issues:n}}var Ds="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function Yr(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Ds:void 0}function or(e,n,t,r,a){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*a/o.height:t}}var Za=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Bs(e,n){let t=0,r=1/0;return e.xs.forEach((a,o)=>{let s=Math.abs(a-n);s<r&&(r=s,t=o)}),t}function Tr(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Bs(t,n),a=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(a,r)??a}}function Ua(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Bs(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:K.axis,dash:"3 3"}}function Ya(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Za(r.plot,n,t))return[];let a=Ua(e,n),{rows:o}=Tr(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[a,..._r(a.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ka(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let a=t.xs[r];return Ya(e,a,t.plot.y+8)}function Xa(e,n,t,r,a){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:d}=or(t,r,a,e.width,e.height);if(Za(e.hit.plot,l,d)){let m=Tr(e,l),h=Ua(e,l);if(m&&h)return{lines:m.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?Hn(e,n)?.item:void 0,c=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return c?{lines:Array.isArray(c)?c:[c],shapes:[]}:{lines:[],shapes:[]}}function Fs(e,n,t,r,a,o,s){let c=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?Hn(s,e)?.item:void 0,d=l&&s?.tooltipFormatter?.(l)||c&&Array.from(c.children).find($=>$.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let m=s?.tooltipAnchored?Hn(s,e):void 0,h=m?s?.shapes[m.index]:void 0,{x:f,y:M}=h?Ar(h):or(n,t,r,a,o);return _r(f,M,d,a,o,s?.tooltipPlacement)}function Qa(e,n,t,r,a){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=or(t,r,a,e.width,e.height),c=Ya(e,o,s);if(c.length>0)return c}return Fs(n,t,r,a,e.width,e.height,e)}function Ja(e,n){let t=Hn(e,n);return t&&!t.item.legend?Pn(t.item):null}var dl=(e,n)=>{let{x:t,y:r}=Ar(e),a=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&a>=n.y&&a<=n.y+n.height};function eo(e,n){let t=new Set,r=[];for(let a of e.shapes){if(!a.item||a.item.legend||a.part==="anchor"||!dl(a,n))continue;let o=Pn(a.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var to=e=>({kind:"rect",part:"selection-box",x:i(e.x),y:i(e.y),width:i(e.width),height:i(e.height),fill:K.focus,opacity:.12,stroke:K.focus}),Xr=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function Ps(e,n,t){let r=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){let s=e[a],c=e[o];s.y>t!=c.y>t&&n<(c.x-s.x)*(t-s.y)/(c.y-s.y)+s.x&&(r=!r)}return r}function no(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let a of e.shapes){if(!a.item||a.item.legend||a.part==="anchor")continue;let{x:o,y:s}=Ar(a),c=a.kind==="circle"?a.cy:a.kind==="rect"?a.y+a.height/2:s;if(!Ps(n,o,c))continue;let l=Pn(a.item),d=JSON.stringify(l);t.has(d)||(t.add(d),r.push(l))}return r}var ro=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${i(n.x)} ${i(n.y)}`).join("L")}`:"",fill:K.focus,fillOpacity:.12,stroke:K.focus,dash:"4 3"}),Kr=6;function ao(e,n,t){let r=e.edit;if(r){for(let a of r.bars)if(!(t<a.y||t>a.y+a.height||n<a.x0-Kr||n>a.x1+Kr))return Math.abs(n-a.x0)<=Kr?{bar:a,mode:"start"}:Math.abs(n-a.x1)<=Kr?{bar:a,mode:"end"}:{bar:a,mode:"move"}}}function oo(e,n,t){let r=e.edit;return Hs(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function so(e,n,t){let r=e.edit,a=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!a||!(t.shiftKey||t.altKey))return;let o=r.bars.find(l=>l.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",c=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Hs(r,{bar:o,mode:s},a*c)}function Hs(e,{bar:n,mode:t},r){let a=c=>e.snap?Math.round(c/e.snap)*e.snap:c,o=n.start,s=n.end;return t==="move"?(o=a(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(a(n.start+r),n.end):s=Math.max(a(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function io(e,n,t){let r=e.edit,a=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:i(Math.min(a,o)),y:i(n.bar.y),width:i(Math.max(1,Math.abs(o-a))),height:i(n.bar.height),fill:K.focus,opacity:.25,stroke:K.focus,rx:2}}var ml=64,ul=e=>Math.max(1,Math.min(ml,e));function lo(e,n,t,r){let a=n>0?.8:1.25,o=ul(e.view.zoom*a);if(o===e.view.zoom)return e.view;let{plot:s,scale:c}=e,[l,d]=e.view.center,m=(t-(s.x+s.width/2))/c,h=(r-(s.y+s.height/2))/c,f=e.view.zoom/o;return{center:[l+m*(1-f),e.fromY(e.toY(d)-h*(1-f))],zoom:o}}function co(e,n,t,r){let{scale:a}=e;return{center:[n.center[0]-t/a,e.fromY(e.toY(n.center[1])+r/a)],zoom:n.zoom}}function Hn(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),a=Number.isInteger(r)?e.shapes[r]?.item:void 0;return a?{index:r,item:a}:void 0}var Qr=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function Ar(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function mo(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=K.focus,a;switch(t.kind){case"rect":a={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":a={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":a={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":a={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ie+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":a={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=Ar(t),c=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[a,...c?_r(i(o),i(s),c,e.width,e.height):[]]}function uo(e,n,t){let r=Qr(e);if(r.length===0)return;let a=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,a+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,a<=0?0:a-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var rr=2,ar=(e,n,t)=>{let r=Math.max(rr,Math.min(t,Math.round(n))),a=Math.max(0,Math.min(t-r,Math.round(e)));return{start:a,end:a+r}},Vs=(e,n)=>!e||e.start<=0&&e.end>=n;function ho(e,n,t){if(e.count<=rr||!e.plot.width)return;let{start:r,end:a}=e.zoom,o=a-r,s=n>0?1.25:.8,c=Math.max(rr,Math.min(e.count,Math.round(o*s)));if(c===o)return n>0&&!Vs(e.zoom,e.count)?ar(r,c,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+l*o;return ar(d-l*c,c,e.count)}function fo(e,n,t,r){let a=n.end-n.start,o=Math.max(rr,Math.min(e.count,Math.round(a/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return ar(n.start+s*a-s*o,o,e.count)}function po(e,n,t){let r=n.end-n.start,a=e.plot.width/Math.max(1,r);return ar(n.start-t/a,r,e.count)}function bo(e,n,t){let r=e.brush;if(!r||!Za(r.box,n,t))return;let a=r.window;if(Math.abs(n-a.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(a.x+a.width))<=6)return{grab:"right",zoom:e.zoom};if(n>a.x&&n<a.x+a.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:ar(s-o/2,o,e.count)}}function go(e,n,t,r){let a=e.brush;if(!a)return t;let o=r/Math.max(1,a.box.width)*e.count;if(n==="move")return ar(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-rr,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+rr,Math.round(t.end+o)));return{start:t.start,end:s}}function Or(e,n){switch(n.type){case"svg":return Promise.resolve(Lr(e,n.label,n.resolve));case"csv":return Promise.resolve(Sr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Lr(e,n.label,n.resolve);return Gs(t,e.width,e.height,n.scale,n.background)}}}var Cn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),Cr=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${Cn(String(t))}"`).join("");function _s(e){let n=e.title?`<title>${Cn(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Cr([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${Cr([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${Cr([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${Cr([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Cr([t,["aria-label",e.title],["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${Cn(e.text)}</text>`}}function js(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${Cn(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${Cn(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Lr(e,n,t){let r=js(e)+e.shapes.map(_s).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(a,o)=>t(o).trim()||a)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${Cn(n)}" font-family="${Cn(K.fontFamily)}" font-size="${Cn(K.fontSize)}"><title>${Cn(n)}</title>${r}</svg>`}function Gs(e,n,t,r=2,a){return new Promise((o,s)=>{let c=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(c);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let m=d.getContext("2d");if(!m)return s(new Error("canvas 2d context unavailable"));a&&(m.fillStyle=a,m.fillRect(0,0,d.width,d.height)),m.drawImage(l,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(c),s(new Error("svg could not be decoded"))},l.src=c})}function Sr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
|
|
3
|
+
`)}function xo(e,n=[]){let t=Math.max(n.length,...e.map(a=>a.data.length)),r=[["",...e.map(a=>a.name)]];for(let a=0;a<t;a++){let o=n[a];r.push([o instanceof Date?o.toISOString():o??a+1,...e.map(s=>s.data[a])])}return Sr(r)}var De=e=>P(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+De(t),0),yo=e=>P(e.value)||(e.children??[]).some(yo),zr=e=>e.length===0?0:1+Math.max(...e.map(n=>zr(n.children??[]))),tt=e=>e.id??e.name;function Ws(e,n){for(let t of e){if(tt(t)===n||t.name===n)return[t];let r=Ws(t.children??[],n);if(r)return[t,...r]}}var sr=(e,n)=>n==="asc"||n==="desc"?[...e].sort((t,r)=>n==="asc"?De(t)-De(r):De(r)-De(t)):[...e];function fn(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:De(r),children:void 0}:{...r,children:r.children?fn(r.children,n,t+1):void 0})}function kn(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Ws(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function vo(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let c=r.rows[0];if(r.rows.length>t)return;let l=["",...c.slice(1).map(m=>m.replace(/:\s[^:]*$/,""))],d=r.rows.map(m=>[m[0],...m.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[l,...d]}let a=e.shapes.flatMap(c=>c.item&&!c.item.legend&&!(c.part==="anchor"&&!c.title)?[c.item]:[]);if(a.length===0||a.length>t)return;let o=["series","name","category","value"].filter(c=>a.some(l=>l[c]!==void 0)),s=(c,l)=>c[l]===void 0?"":String(c[l]);return[o.map(c=>c[0]?.toUpperCase()+c.slice(1)),...a.map(c=>o.map(l=>s(c,l)))]}var Mo=new Map;function ir(e){let n=Mo.get(e);if(n)return n.group;let t=new Set,r={},a={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&Mo.delete(e)}},publish(o,s){Object.assign(r,o);for(let c of t)c(o,s)}};return Mo.set(e,{group:a,listeners:t}),a}var qs='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',wo=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${qs}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${qs}{animation:none;transition:none}}`;function ko(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function $o(e){let n=[],t=e.nodes?new Set(e.nodes.map(b=>b.id)):void 0,r=e.links.filter(b=>!P(b.value)||b.value<=0?(n.push({code:"invalid-value",severity:"warning",message:`Link ${b.source} \u2192 ${b.target} has no positive value and was dropped.`,itemId:b.id}),!1):b.source===b.target?(n.push({code:"self-link",severity:"warning",message:`Link ${b.source} \u2192 ${b.target} points at its own node and was dropped.`,itemId:b.id}),!1):t&&!(t.has(b.source)&&t.has(b.target))?(n.push({code:"unknown-node",severity:"warning",message:`Link ${b.source} \u2192 ${b.target} names a node not in \`nodes\` and was dropped.`,itemId:b.id}),!1):!0),{links:a,back:o}=hl(r),s=e.cyclePolicy??"drop";for(let b of o)n.push({code:"cycle",severity:s==="error"?"error":"warning",message:`Link ${b.source} \u2192 ${b.target} closes a cycle and was ${s==="error"?"rejected":"dropped"}.`,itemId:b.id});let c=le(s==="error"&&o.length>0?{...e,error:e.error??`${o.length} link${o.length===1?"":"s"} close a cycle`}:e,a.length===0);if(c)return{...c,issues:n};let l=ae(e.format),d=Math.max(0,e.nodePadding??8),m=Math.max(1,e.nodeWidth??16),{width:h,height:f}=de(e),M=Te(h,f,{top:8+ue(e),right:96,bottom:8,left:8}),$=new Map,g=new Map((e.nodes??[]).map(b=>[b.id,b])),w=b=>{let x=$.get(b);if(!x){let C=g.get(b);x={id:b,name:C?.label??b,depth:0,value:0,color:ne(e,$.size,C?.color),x:0,y:0,height:0,outY:0,inY:0},$.set(b,x)}return x};for(let b of e.nodes??[])w(b.id);for(let b of a)w(b.source),w(b.target);for(let b=0,x=!0;x&&b<=$.size;b++){x=!1;for(let C of a){let y=w(C.source).depth+1;y>w(C.target).depth&&(w(C.target).depth=y,x=!0)}}let R=new Map,k=new Map;for(let b of a)R.set(b.source,(R.get(b.source)??0)+b.value),k.set(b.target,(k.get(b.target)??0)+b.value);if(e.align==="justify"){let b=Math.max(0,...[...$.values()].map(x=>x.depth));for(let x of $.values())R.has(x.id)||(x.depth=b)}let T=Yn(e.selected).map(String),D=b=>T.includes(b),v=b=>T.length===0||D(b)||a.some(x=>D(x.source)&&x.target===b||D(x.target)&&x.source===b);for(let b of $.values())b.value=Math.max(R.get(b.id)??0,k.get(b.id)??0);let S=new Map;for(let b of $.values())S.set(b.depth,[...S.get(b.depth)??[],b]);if(e.nodeSort)for(let b of S.values())b.sort((x,C)=>e.nodeSort==="asc"?x.value-C.value:C.value-x.value);let O=Math.max(0,...S.keys()),E=Math.min(...[...S.values()].map(b=>(M.height-d*(b.length-1))/b.reduce((x,C)=>x+C.value,0)));for(let[b,x]of S){let C=M.y;for(let y of x)y.x=M.x+(O===0?0:b*(M.width-m)/O),y.y=C,y.height=y.value*E,y.outY=y.inY=C,C+=y.height+d}let z=[...a];e.linkSort&&z.sort((b,x)=>e.linkSort==="asc"?b.value-x.value:x.value-b.value);let L=[],H=[];for(let b of z){let x=w(b.source),C=w(b.target),y=b.value*E,B=T.length===0||D(b.source)||D(b.target),U=x.x+m,Y=C.x,j=(U+Y)/2,I=x.outY,G=C.inY;x.outY+=y,C.inY+=y;let V=`${x.name} \u2192 ${C.name}: ${l(b.value)}`;L.push({kind:"path",part:"link",d:`M${i(U)} ${i(I)}C${i(j)} ${i(I)} ${i(j)} ${i(G)} ${i(Y)} ${i(G)}L${i(Y)} ${i(G+y)}C${i(j)} ${i(G+y)} ${i(j)} ${i(I+y)} ${i(U)} ${i(I+y)}Z`,fill:x.color,opacity:B?.4:.08,title:V,item:{label:V,id:b.id??`${b.source}\u2192${b.target}`,name:b.source,category:b.target,value:b.value}});let Q=Y-U>(x.name.length+l(b.value).length)*ie+24;e.linkLabels&&y>=12&&B&&Q&&H.push(J(i(j),i((I+G+y)/2),l(b.value),{part:"link-label",anchor:"middle",baseline:"middle"}))}for(let b of $.values()){let x=`${b.name}: ${l(b.value)}`;L.push({kind:"rect",part:"node",x:i(b.x),y:i(b.y),width:m,height:i(b.height),fill:b.color,opacity:v(b.id)?void 0:.3,title:x,item:{label:x,id:b.id,name:b.name,value:b.value}});let C=b.depth===O;(e.nodeLabels??!0)&&L.push(J(i(C?b.x-6:b.x+m+6),i(b.y+b.height/2),b.name,{anchor:C?"end":"start",baseline:"middle"}))}return{...he(e,h,f),shapes:[...L,...H],issues:n}}function hl(e){let n=new Map;for(let o of e)n.set(o.source,[...n.get(o.source)??[],o]);let t=new Map,r=new Set,a=o=>{t.set(o,"active");for(let s of n.get(o)??[]){let c=t.get(s.target);c==="active"?r.add(s):c===void 0&&a(s.target)}t.set(o,"done")};for(let o of e)t.has(o.source)||a(o.source);return{links:e.filter(o=>!r.has(o)),back:[...r]}}function Io(e,n,t,r,a,o){if(e.length===0)return;let s=(h,f)=>{let M=h.reduce((w,R)=>w+R.area,0),$=Math.max(...h.map(w=>w.area)),g=Math.min(...h.map(w=>w.area));return Math.max(f*f*$/(M*M),M*M/(f*f*g))},c=Math.min(r,a),l=[],d=0;for(;d<e.length;){let h=[...l,e[d]];if(l.length===0||s(h,c)<=s(l,c))l=h,d++;else break}let m=l.reduce((h,f)=>h+f.area,0);if(r>=a){let h=m/a,f=t;for(let M of l){let $=M.area/h;o(M,[n,f,h,$]),f+=$}Io(e.slice(d),n+h,t,r-h,a,o)}else{let h=m/r,f=n;for(let M of l){let $=M.area/h;o(M,[f,t,$,h]),f+=$}Io(e.slice(d),n,t+h,r,a-h,o)}}function fl(e,n,t,r,a,o,s){let c=e.reduce((d,m)=>d+m.area,0),l=s?t:n;for(let d of e){let m=c>0?d.area/c:0;if(s){let h=a*m;o(d,[n,l,r,h]),l+=h}else{let h=r*m;o(d,[l,t,h,a]),l+=h}}}function To(e){let{nodes:n,path:t}=kn(e.data,e.rootId),r=fn(n,e.maxDepth),a=le(e,!r.some(v=>De(v)>0));if(a)return a;let o=ae(e.format),{width:s,height:c}=de(e),l=e.breadcrumbs&&t.length>0,d=r.map((v,S)=>({name:v.name,color:ne(e,S,v.color)})),m=ue(e,d,s)+(l?20:0),h=Math.max(0,e.padding??2),f=e.sort??"desc",M=e.tiling??"squarify",$=e.labels??!0,g=[],w=[],R=v=>{for(let S of v)S.children?.length?R(S.children):w.push(De(S))};R(r);let k=e.colorScale?Pt(e.colorScale,w,ne(e,0),void 0,o):void 0,T=(v,S,O,E,z,L,H)=>{let b=v.reduce((y,B)=>y+Math.max(0,De(B)),0),x=sr(v,f).map(y=>{let B=De(y),Y=!((y.children?.length??0)>0)&&k?k.color(B):void 0;return{node:y,value:B,color:Y?.fill??y.color??L??ne(e,v.indexOf(y)),opacity:Y?.opacity,area:b>0?Math.max(0,B)/b*E*z:0}}).filter(y=>y.area>0&&!(L===void 0&&xe(e,y.node.name))),C=(y,[B,U,Y,j])=>{let I=`${y.node.name}: ${o(y.value)}`,G=(y.node.children?.length??0)>0;if(g.push({kind:"rect",part:G?"branch":"tile",x:i(B),y:i(U),width:i(Y),height:i(j),fill:y.color,opacity:G?.15:y.opacity,stroke:"var(--skdx-color-surface-default)",title:I,item:{label:I,id:tt(y.node),name:y.node.name,value:y.value}}),G)T(y.node.children,B+h,U+h,Math.max(0,Y-2*h),Math.max(0,j-2*h),y.color,H+1);else if($&&Y>40&&j>20){let V=Math.max(1,Math.floor((Y-12)/ie)),Q=y.node.name.length>V?`${y.node.name.slice(0,V-1)}\u2026`:y.node.name;g.push(J(i(B+6),i(U+6),Q,{baseline:"hanging",fill:"var(--skdx-color-text-on-accent)"}))}};M==="squarify"?Io(x,S,O,E,z,C):fl(x,S,O,E,z,C,M==="slice"||M==="sliceDice"&&H%2===0)};T(r,0,m,s,c-m,void 0,0),l&&g.push(...lr(t,8,ue(e,d,s)+10));let D=he(e,s,c,d);return{...D,shapes:ft([...g,...D.shapes])}}function lr(e,n,t){let r=[],a=n;return e.forEach((o,s)=>{s>0&&(r.push(J(i(a),t,"\u203A",{part:"breadcrumb-separator",baseline:"middle"})),a+=ie+6),r.push(J(i(a),t,o.name,{part:"breadcrumb",baseline:"middle",fill:"var(--skdx-color-text-default)",title:o.name,item:{label:o.name,id:tt(o),name:o.name}})),a+=o.name.length*ie+6}),r}var pl=.22,bl=20,Zs=32,Us=28,gl=e=>P(e.open)&&P(e.high)&&P(e.low)&&P(e.close);function Ao(e){let n=[],t=e.data.filter(N=>gl(N)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Candle "${String(N.label)}" has a non-finite open/high/low/close and was dropped.`,itemId:N.id}),!1)),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=e.upColor??K.positive,o=e.downColor??K.negative,s=ae(e.format),c=ae(e.volumeFormat??{style:"integer"}),l=t.length,d=Math.max(0,Math.min(l-2,Math.floor(e.zoom?.start??0))),m=e.zoom?Math.max(d+2,Math.min(l,Math.ceil(e.zoom.end))):l,h={start:d,end:m},f=t.slice(d,m),M=t.some(N=>P(N.volume)),{width:$,height:g}=de(e),w=e.brush?Zs+Us:0,R=e.rangeSelector??[],k=e.compare?f[0].close:void 0,T=N=>k!==void 0&&k!==0?N/k-1:N,D=k!==void 0?{style:"percent",digits:1}:void 0,v=ae({style:"percent",digits:1}),S=t.map(N=>N.close),O=(e.overlays??[]).map((N,F)=>{let _=N.name??`${N.type.toUpperCase()} ${N.period}`,W=N.type==="ema"?Ts(S,N.period):Ma(S,N.period);return{name:_,color:N.color??ne(e,F+2),values:W.slice(d,m),hidden:xe(e,_)}}),E=Gt([...f.flatMap(N=>[T(N.low),T(N.high)]),...O.filter(N=>!N.hidden).flatMap(N=>N.values.map(F=>P(F)?T(F):F))],!1),z=[{name:"Up",color:a},{name:"Down",color:o},...O.map(N=>({name:N.name,color:N.color}))],L=Te($,g,{...fe,top:fe.top+ue(e,z,$)+(R.length?bl:0),bottom:fe.bottom+w,left:e.scale==="log"?fe.left:jr(E,ae(D??e.yAxis?.format??e.format))}),H=M?L.height*pl:0,b={...L,height:Math.max(0,L.height-H-(M?8:0))},x=Ge(E,[b.y+b.height,b.y],{scale:e.scale==="log"?"log":"linear",format:D??e.yAxis?.format},e.format),C=f.map(N=>qe(N.label)),y=e.xAxis?.type==="time"&&C.every(N=>Number.isFinite(N)),B=je(f.length,[b.x,b.x+b.width]),U;if(y){let N=[...C].sort((be,Z)=>be-Z),F=1/0;for(let be=1;be<N.length;be++)F=Math.min(F,N[be]-N[be-1]);let[_,W]=we(C),ee=F===1/0?Math.max(1,Math.abs(W)*.05||1):F/2,te=st([_-ee,W+ee],[b.x,b.x+b.width]),re=Math.abs(te(_+(F===1/0?ee:F))-te(_))*.8;B={step:re,bandwidth:re,start:be=>te(C[be])-re/2,center:be=>te(C[be])};let me=e.xAxis?.format??{style:"date"};U=Qn(_-ee,W+ee).filter(be=>be>=_-ee&&be<=W+ee).map(be=>({pos:i(te(be)),label:Qt(be,me)}))}let Y=f.map(N=>Qt(N.label,e.xAxis?.format)),j=he(e,$,g,z),I={...j,plot:b,xTicks:Ne(U??f.map((N,F)=>({pos:i(B.center(F)),label:Y[F]})),b.width),yTicks:x.ticks,baseline:b.y+b.height},G=Ze(I),V={plot:b,x:N=>{let F=typeof N=="string"?N:qe(N),_=f.findIndex((W,ee)=>typeof F=="string"?Y[ee]===F||W.label===F:qe(W.label)===F);return _<0?void 0:B.center(_)},y:N=>x.scale(T(N))};G.push(...Wt(e.references,V)),R.forEach((N,F)=>{let _=N.candles>0?{start:Math.max(0,l-N.candles),end:l}:{start:0,end:l},W=_.start===d&&_.end===m;G.push(J(i(b.x+F*40),i(L.y-8),N.label,{part:"range-button",baseline:"middle",fill:W?"var(--skdx-color-text-default)":K.label,weight:W?"bold":void 0,title:`${N.label}: last ${N.candles>0?Math.min(N.candles,l):l} candles`,item:{label:N.label,name:N.label,range:_}}))});let Q=e.variant==="ohlc",p=[];if(f.forEach((N,F)=>{let W=N.close>=N.open?a:o,ee=i(B.center(F)),te=k!==void 0?` (${v(T(N.close))})`:"",re=`${Y[F]}: O ${s(N.open)} H ${s(N.high)} L ${s(N.low)} C ${s(N.close)}${te}${P(N.volume)?` V ${c(N.volume)}`:""}`,me={label:re,id:N.id,category:Y[F],index:d+F,value:N.close};p.push([Y[F],`Open: ${s(N.open)}`,`High: ${s(N.high)}`,`Low: ${s(N.low)}`,`Close: ${s(N.close)}${te}`,...P(N.volume)?[`Volume: ${c(N.volume)}`]:[],...O.filter(oe=>!oe.hidden).map(oe=>`${oe.name}: ${P(oe.values[F])?s(oe.values[F]):"\u2014"}`)]);let be=x.scale(T(Math.max(N.open,N.close))),Z=x.scale(T(Math.min(N.open,N.close)));if(Q){let oe=B.bandwidth/2;G.push({kind:"line",part:"wick",x1:ee,x2:ee,y1:i(x.scale(T(N.high))),y2:i(x.scale(T(N.low))),stroke:W,strokeWidth:1.5,title:re,item:me},{kind:"line",part:"open",x1:i(ee-oe),x2:ee,y1:i(x.scale(T(N.open))),y2:i(x.scale(T(N.open))),stroke:W,strokeWidth:1.5},{kind:"line",part:"close",x1:ee,x2:i(ee+oe),y1:i(x.scale(T(N.close))),y2:i(x.scale(T(N.close))),stroke:W,strokeWidth:1.5})}else G.push({kind:"line",part:"wick",x1:ee,x2:ee,y1:i(x.scale(T(N.high))),y2:i(x.scale(T(N.low))),stroke:W,title:re},{kind:"rect",part:"candle",x:i(B.start(F)),y:i(be),width:i(B.bandwidth),height:i(Math.max(1,Z-be)),fill:W,title:re,item:me})}),M){let N=b.y+b.height+8,[,F]=we(f.map(_=>_.volume));f.forEach((_,W)=>{if(!P(_.volume))return;let ee=F>0?_.volume/F*H:0;G.push({kind:"rect",part:"volume",x:i(B.start(W)),y:i(N+H-ee),width:i(B.bandwidth),height:i(Math.max(ee,0)),fill:_.close>=_.open?a:o,opacity:.4,title:`${Y[W]}: volume ${c(_.volume)}`})})}for(let N of O){if(N.hidden)continue;let F=N.values.flatMap((_,W)=>P(_)?[{x:i(B.center(W)),y:i(x.scale(T(_)))}]:[]);F.length<2||G.push({kind:"path",part:"overlay",d:it(F),stroke:N.color,strokeWidth:1.5,strokeLinejoin:"round",title:N.name,item:{label:N.name,series:N.name}})}for(let N of e.flags??[]){let F=V.x(N.label);if(F===void 0)continue;let _=f.findIndex((re,me)=>B.center(me)===F),W=f[_],ee=x.scale(T(W.high))-6,te=Bt(N.variant??"primary");G.push({kind:"path",part:"flag",d:`M${i(F)} ${i(ee)}V${i(ee-10)}H${i(F+8)}L${i(F+5)} ${i(ee-7)}L${i(F+8)} ${i(ee-4)}H${i(F)}Z`,fill:te,stroke:te,title:N.text,item:{label:N.text,name:N.text,category:Y[_],index:d+_}})}G.push(...Dn(e.annotations,V));let q={plot:L,xs:f.map((N,F)=>i(B.center(F))),rows:p,count:l,zoom:h,crosshair:Hr(e)};if(e.brush){let N={x:L.x,y:L.y+L.height+Us,width:L.width,height:Zs},F=t.map(me=>me.close),[_,W]=we(F),ee=l>1?N.width/(l-1):0,te=F.map((me,be)=>({x:i(N.x+be*ee),y:i(N.y+N.height-(W===_?.5:(me-_)/(W-_))*(N.height-4)-2)})),re={x:i(N.x+d/l*N.width),y:N.y,width:i((m-d)/l*N.width),height:N.height};G.push({kind:"rect",part:"brush",...N,fill:"var(--skdx-color-surface-sunken)",stroke:K.grid},{kind:"path",part:"brush-series",d:te.length>1?`${it(te)}L${te[te.length-1]?.x} ${N.y+N.height}L${te[0]?.x} ${N.y+N.height}Z`:"",fill:"var(--skdx-color-primary-500)",fillOpacity:.3},{kind:"rect",part:"brush-window",...re,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:K.axis},{kind:"rect",part:"brush-handle",x:i(re.x-3),y:N.y+8,width:6,height:N.height-16,fill:K.axis,rx:8},{kind:"rect",part:"brush-handle",x:i(re.x+re.width-3),y:N.y+8,width:6,height:N.height-16,fill:K.axis,rx:8}),q.brush={box:N,window:re}}return{...j,shapes:[...G,...j.shapes],hit:q,issues:n}}var xl="var(--skdx-color-success-500)",yl="var(--skdx-color-danger-500)";function Co(e){let n=[],t=e.data.filter(O=>O.type==="subtotal"||O.type==="total"||O.subtotal||P(O.value)?!0:(n.push({code:"invalid-value",severity:"warning",message:`Row "${O.name}" has no valid value and was dropped.`,itemId:O.id??O.name}),!1)),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=ae(e.format),{width:o,height:s}=de(e),c=e.orientation==="horizontal",l=e.positiveColor??xl,d=e.negativeColor??yl,m=e.totalColor??ne(e,0),h=[],f=P(e.start)?e.start:0,M=O=>`${O>=0?"+":""}${a(O)}`;P(e.start)&&e.startLabel!==void 0&&h.push({id:void 0,name:e.startLabel,from:0,to:f,color:m,title:`${e.startLabel}: ${a(f)}`,flat:!0});for(let O of t){if((O.type??(O.subtotal?"subtotal":"change"))!=="change"){h.push({id:O.id,name:O.name,from:0,to:f,color:O.color??m,title:`${O.name}: ${a(f)}`,flat:!0});continue}let z=f;f+=O.value,h.push({id:O.id,name:O.name,from:z,to:f,color:O.color??(O.value>=0?l:d),title:`${O.name}: ${M(O.value)}`,flat:!1})}e.total!==void 0&&h.push({id:void 0,name:e.total,from:0,to:f,color:m,title:`${e.total}: ${a(f)}`,flat:!0});let $=c?Math.max(0,...h.map(O=>O.name.length))*ie+16:0,g=[{name:"Increase",color:l},{name:"Decrease",color:d}],w=Te(o,s,{...fe,top:fe.top+ue(e,g,o),left:Math.max(fe.left,$),right:e.labels&&c?56:fe.right}),R=h.flatMap(O=>[O.from,O.to]),k=Ge([Math.min(0,...R),Math.max(0,...R)],c?[w.x,w.x+w.width]:[w.y+w.height,w.y],{},e.format),T=je(h.length,c?[w.y,w.y+w.height]:[w.x,w.x+w.width]),D=he(e,o,s,g),v=h.map((O,E)=>({pos:i(T.center(E)),label:O.name})),S=Ze({...D,plot:w,xTicks:c?v:Ne(v,w.width),yTicks:c?Ne(k.ticks,w.width):k.ticks,baseline:k.zero},{horizontal:c});return h.forEach((O,E)=>{let z=k.scale(O.from),L=k.scale(O.to),H=Math.min(z,L),b=Math.max(1,Math.abs(L-z));if(S.push({kind:"rect",part:"bar",x:i(c?H:T.start(E)),y:i(c?T.start(E):H),width:i(c?b:T.bandwidth),height:i(c?T.bandwidth:b),fill:O.color,title:O.title,item:{label:O.title,id:O.id??O.name,name:O.name,index:E,value:O.flat?O.to:O.to-O.from}}),e.labels){let C=O.flat?a(O.to):M(O.to-O.from),y=Math.max(z,L);S.push(c?J(i(y+6),i(T.center(E)),C,{part:"value-label",baseline:"middle"}):J(i(T.center(E)),i(H-4),C,{part:"value-label",anchor:"middle"}))}let x=h[E+1];if(x&&(e.connectors??!0)){let C=i(L),y=i(k.scale(x.flat?x.to:x.from));S.push(c?{kind:"line",part:"connector",x1:C,x2:y,y1:i(T.start(E)+T.bandwidth),y2:i(T.start(E+1)),stroke:K.axis,dash:"4 3"}:{kind:"line",part:"connector",x1:i(T.start(E)+T.bandwidth),x2:i(T.start(E+1)),y1:C,y2:y,stroke:K.axis,dash:"4 3"})}}),{...D,shapes:[...S,...D.shapes],issues:n}}function vl(e){let n=new Map;for(let l of e)l.id!==void 0&&!n.has(l.id)&&n.set(l.id,l),n.has(l.name)||n.set(l.name,l);let t=new Map,r=new Set,a=l=>{let d=t.get(l);if(d)return d;if(r.has(l))return{length:0,next:void 0};r.add(l);let m={length:0,next:void 0};for(let f of l.dependsOn??[]){let M=n.get(f);if(!M||M===l)continue;let $=a(M);$.length>m.length&&(m={length:$.length,next:M})}r.delete(l);let h={length:m.length+Math.max(0,l.end-l.start),next:m.next};return t.set(l,h),h},o,s=-1;for(let l of e){let d=a(l);d.length>s&&(s=d.length,o=l)}let c=new Set;for(let l=o;l&&!c.has(l);l=t.get(l)?.next)c.add(l);return c}function Lo(e){let n=[],t=e.tasks.filter(p=>{let q=P(p.start)&&(p.milestone?!0:P(p.end));return q?!p.milestone&&p.end<p.start&&n.push({code:"inverted-range",severity:"warning",message:`Task "${p.name}" ends before it starts; the interval was normalized.`,itemId:p.id??p.name}):n.push({code:"invalid-value",severity:"warning",message:`Task "${p.name}" has no valid start/end and was dropped.`,itemId:p.id??p.name}),q}),r=le(e,t.length===0);if(r)return{...r,issues:n};let{width:a,height:o}=de(e),s=e.criticalPath?vl(t):void 0,c=p=>p.id??p.name,l=new Map;for(let p of t)p.id!==void 0&&!l.has(p.id)&&l.set(p.id,p),l.has(p.name)||l.set(p.name,p);let d=new Map,m=[];for(let p of t){let q=p.parent===void 0?void 0:l.get(p.parent);q&&q!==p?d.set(q,[...d.get(q)??[],p]):m.push(p)}let h=new Set(e.collapsed??[]),f=p=>h.has(c(p))||h.has(p.name),M=[],$=(p,q,N)=>{if(!N.has(p)&&(N.add(p),M.push({task:p,depth:q}),!f(p)))for(let F of d.get(p)??[])$(F,q+1,N)},g=new Set;for(let p of m)$(p,0,g);let w=M.map(p=>p.task),R=new Map(M.map(p=>[p.task,p.depth])),k=p=>{let q=d.get(p)??[];if(q.length===0||P(p.end)&&p.end!==p.start)return{start:p.start,end:p.end};let N=q.map(k);return{start:Math.min(...N.map(F=>F.start)),end:Math.max(...N.map(F=>F.end))}},T=[...new Set(w.map(p=>p.group??p.name))],D=new Map;for(let p of w){let q=p.group??p.name;D.has(q)||D.set(q,R.get(p)??0)}let v=p=>w.some(q=>(q.group??q.name)===p&&f(q)&&(d.get(q)?.length??0)>0)?" +":"",S=Math.max(0,...T.map(p=>p.length+v(p).length))*ie+Math.max(0,...T.map(p=>(D.get(p)??0)*12)),O=e.tasks.map((p,q)=>({name:p.name,color:ne(e,q,p.color)})),E=Te(a,o,{top:8+ue(e,O,a),right:16,bottom:32+(e.xAxis?.label?14:0),left:Math.min(a/2,Math.max(64,S+16))}),z=ae(e.xAxis?.format??e.format),L=e.today===void 0?void 0:qe(e.today),[H,b]=we([...w.flatMap(p=>{let q=k(p);return[...p.milestone?[p.start]:[q.start,q.end],...p.baseline?[p.baseline.start,p.baseline.end]:[]]}),...L!==void 0?[L]:[]]),x=Ge([H,b],[E.x,E.x+E.width],{ticks:e.xAxis?.ticks,format:e.xAxis?.format},e.format),C=je(T.length,[E.y,E.y+E.height]),y=[],B=[],U=p=>x.domain[0]+(p-E.x)/Math.max(1,E.width)*(x.domain[1]-x.domain[0]);for(let p of Ne(x.ticks,E.width))y.push({kind:"line",part:"grid",x1:p.pos,x2:p.pos,y1:E.y,y2:E.y+E.height,stroke:K.grid}),y.push(J(p.pos,E.y+E.height+20,p.label,{part:"x-label",anchor:tr(p.pos,p.label,a)}));T.forEach((p,q)=>{let N=w.find(F=>(F.group??F.name)===p);y.push(J(E.x-8,i(C.center(q)),`${p}${v(p)}`,{part:"y-label",anchor:"end",baseline:"middle",item:N&&(d.get(N)?.length??0)>0?{label:p,id:c(N),name:N.name}:void 0}))});for(let p of y){if(p.kind!=="text"||p.part!=="y-label")continue;let q=D.get(p.text.replace(/ \+$/,""))??0;q&&(p.x=i(p.x+q*12))}let Y=864e5;if(e.nonWorkingDays?.length&&b-H<=400*Y&&b>H){let p=new Set(e.nonWorkingDays);for(let q=Math.floor(H/Y)*Y;q<b;q+=Y){if(!p.has(new Date(q).getUTCDay()))continue;let N=Math.max(H,q),F=Math.min(b,q+Y);F<=N||y.push({kind:"rect",part:"non-working",x:i(x.scale(N)),y:E.y,width:i(Math.max(0,x.scale(F)-x.scale(N))),height:E.height,fill:K.grid,opacity:.12})}}e.xAxis?.label&&y.push(J(i(E.x+E.width/2),o-4,e.xAxis.label,{part:"axis-title",anchor:"middle"}));let j={plot:E,x:p=>x.scale(qe(p)),y:p=>C.center(p)};y.push(...Wt([...e.references??[],...L!==void 0?[{x:L,label:"Today",variant:"primary"}]:[]],j));let I=new Map,G=[];w.forEach(p=>{if(xe(e,p.name))return;let q=t.indexOf(p),N=T.indexOf(p.group??p.name),F=k(p),_=x.scale(Math.min(F.start,F.end)),W=p.milestone?_:x.scale(Math.max(F.start,F.end)),ee=(d.get(p)?.length??0)>0;if(p.baseline&&!p.milestone){let ke=x.scale(Math.min(p.baseline.start,p.baseline.end)),Be=x.scale(Math.max(p.baseline.start,p.baseline.end));y.push({kind:"rect",part:"baseline",x:i(ke),y:i(C.start(N)+C.bandwidth*.75),width:i(Math.max(1,Be-ke)),height:i(C.bandwidth/4),fill:K.axis,opacity:.6,rx:1,title:`${p.name} planned: ${z(p.baseline.start)} \u2013 ${z(p.baseline.end)}`})}let te=C.center(N),re=ne(e,q,p.color),me=s&&!s.has(p)?.35:void 0;if(I.has(p.name)||I.set(p.name,{x0:_,x1:W,mid:te}),p.id!==void 0&&!I.has(p.id)&&I.set(p.id,{x0:_,x1:W,mid:te}),p.milestone){let ke=C.bandwidth/2,Be=`${p.name}: ${z(p.start)}`;y.push({kind:"path",part:"milestone",d:`M${i(_)} ${i(te-ke)}L${i(_+ke)} ${i(te)}L${i(_)} ${i(te+ke)}L${i(_-ke)} ${i(te)}Z`,fill:re,opacity:me,title:Be,item:{label:Be,id:p.id,name:p.name,category:p.group,index:q,value:p.start}});return}let be=P(p.progress)?Math.max(0,Math.min(1,p.progress)):void 0,Z=`${p.name}: ${z(F.start)} \u2013 ${z(F.end)}${be!==void 0?` \xB7 ${Math.round(be*100)}% done`:""}`;ee||B.push({index:y.length,id:p.id??p.name,name:p.name,start:Math.min(p.start,p.end),end:Math.max(p.start,p.end),x0:i(_),x1:i(W),y:i(C.start(N)),height:i(C.bandwidth)});let oe=p.baseline?C.bandwidth*.7:C.bandwidth;y.push({kind:"rect",part:ee?"summary":"bar",x:i(_),y:i(C.start(N)),width:i(Math.max(1,W-_)),height:i(ee?C.bandwidth/3:oe),fill:re,rx:2,opacity:me,title:Z,item:{label:Z,id:p.id,name:p.name,category:p.group,index:q,value:Math.abs(p.end-p.start)}}),be!==void 0&&be>0&&G.push({kind:"rect",part:"progress",x:i(_),y:i(te-C.bandwidth/4),width:i(Math.max(1,(W-_)*be)),height:i(C.bandwidth/2),fill:"var(--skdx-color-text-default)",opacity:.35,rx:1})});let V=new Map;for(let p of t)p.id!==void 0&&!V.has(p.id)&&V.set(p.id,p),V.has(p.name)||V.set(p.name,p);for(let p of t)for(let q of p.dependsOn??[]){let N=I.get(q),F=I.get(p.id??p.name);if(!N){n.push({code:"unknown-node",severity:"warning",message:`Task "${p.name}" depends on "${String(q)}", which does not exist.`,itemId:p.id??p.name});continue}if(!F||N===F)continue;let _=Math.max(N.x1+6,F.x0-6),W=V.get(q),ee=s&&W&&s.has(W)&&s.has(p),te=`${W?.name??String(q)} \u2192 ${p.name}`;G.push({kind:"path",part:"dependency",d:`M${i(N.x1)} ${i(N.mid)}H${i(_)}V${i(F.mid)}H${i(F.x0)}`,stroke:ee?"var(--skdx-color-danger-500)":K.axis,strokeWidth:ee?2.5:1.5,opacity:s&&!ee?.35:void 0,title:te,item:{label:te,name:W?.name??String(q),category:p.name}})}y.push(...G,...Dn(e.annotations,j));let Q=he(e,a,o,O);return{...Q,shapes:[...y,...Q.shapes],issues:n,edit:{scale:p=>x.scale(p),invert:U,bars:B}}}var Oo=e=>{let n=e.length;return n===0?0:n%2?e[(n-1)/2]:(e[n/2-1]+e[n/2])/2},Ml=(e,n)=>{if(e.length===0)return 0;let t=(e.length-1)*n,r=Math.floor(t),a=Math.ceil(t),o=e[r],s=e[a];return o+(s-o)*(t-r)},wl=(e,n)=>{let t=e.length;if(t===0)return 0;let r=(t+1)*n-1;if(r<=0)return e[0];if(r>=t-1)return e[t-1];let a=Math.floor(r),o=e[a],s=e[a+1];return o+(s-o)*(r-a)};function kl(e,n="linear"){let t=Oo(e),r=e.length;if(r===0)return{q1:0,median:0,q3:0};if(n==="tukey"){let o=Math.floor(r/2),s=e.slice(0,r%2?o+1:o),c=e.slice((r%2,o));return{q1:Oo(s),median:t,q3:Oo(c)}}let a=n==="exclusive"?wl:Ml;return{q1:a(e,.25),median:t,q3:a(e,.75)}}function $l(e,n="linear",t=1.5){let r=Ve(e).sort(($,g)=>$-g),{q1:a,median:o,q3:s}=kl(r,n),c=s-a,l=a-t*c,d=s+t*c,m=r.filter($=>$>=l&&$<=d),h=r.length?r.reduce(($,g)=>$+g,0)/r.length:0,f=m[0]??a,M=m[m.length-1]??s;return{name:"",q1:a,median:o,q3:s,min:f,max:M,low:f,high:M,mean:h,outliers:r.filter($=>$<l||$>d),count:r.length}}var Ys=e=>"median"in e&&!("data"in e),Ks=e=>"data"in e&&Array.isArray(e.data[0]);function So(e){let n=e.quartileMethod??"linear",t=e.whisker??1.5,r=[],a=e.categories,o=a!==void 0,s=(y,B)=>r.push({code:"invalid-value",severity:"warning",message:B,itemId:y.id??y.name}),c=[];e.series.forEach((y,B)=>{let U=ne(e,B,y.color),Y=(j,I,G)=>{let V=G??(I&&Ve(I).length?$l(I,n,t):void 0);return!V||![V.min,V.q1,V.median,V.q3,V.max].every(P)?!1:(V.count!==void 0&&V.count<5&&r.push({code:"small-sample",severity:"warning",message:`Series "${y.name}"${o?` at "${a[j]??j}"`:""} has ${V.count} observation${V.count===1?"":"s"}; quartiles are not meaningful below 5.`,itemId:y.id??y.name}),c.push({si:B,ci:j,name:y.name,id:y.id,color:U,st:{...V,name:y.name},raw:I}),!0)};if(!o){(Ys(y)?Y(0,void 0,y):Ks(y)?Y(0,y.data.flat()):Y(0,y.data))||s(y,`Series "${y.name}" has no valid observations or summary and was skipped.`);return}if(Ys(y)){s(y,`Series "${y.name}" is a summary, which cannot be grouped by categories; it was skipped.`);return}if(!Ks(y)){s(y,`Series "${y.name}" is not grouped (its data is one sample, not one per category); it was drawn in the first category.`),Y(0,y.data);return}a.forEach((j,I)=>Y(I,y.data[I]))});let l=le(e,c.length===0);if(l)return{...l,issues:r};let d=ae(e.yAxis?.format??e.format),{width:m,height:h}=de(e),f=e.orientation==="horizontal",M=o?a:e.series.map(y=>y.name),$=Math.max(0,...M.map(y=>y.length))*ie,g=e.series.map((y,B)=>({name:y.name,color:ne(e,B,y.color)})),w=Te(m,h,{...fe,top:fe.top+ue(e,g,m)+(e.yAxis?.label?12:0),left:f?Math.max(fe.left,$+16):fe.left,bottom:fe.bottom+(f&&e.yAxis?.label?14:0)}),R=c.filter(y=>!xe(e,y.name)),k=R.flatMap(y=>[y.st.min,y.st.max,...y.st.outliers??[],...P(y.st.mean)?[y.st.mean]:[]]),T=Ge(Gt(k,!1),f?[w.x,w.x+w.width]:[w.y+w.height,w.y],e.yAxis??{},e.format),D=je(M.length,f?[w.y,w.y+w.height]:[w.x,w.x+w.width]),v=o?[...new Set(R.map(y=>y.si))]:[],S=o?D.bandwidth/Math.max(1,v.length):D.bandwidth,O=y=>o?D.start(y.ci)+(v.indexOf(y.si)+.5)*S:D.center(y.si),E=he(e,m,h,g),z=M.map((y,B)=>({pos:i(D.center(B)),label:y})),L=Ze({...E,plot:w,xTicks:f?z:Ne(z,w.width),yTicks:f?Ne(T.ticks,w.width):T.ticks,baseline:f?w.x:w.y+w.height},{horizontal:f,grid:En(e.yAxis),...f?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}}),H=(y,B,U)=>{let Y=i(T.scale(y)),j=i(T.scale(B));return f?{x1:Y,x2:j,y1:U,y2:U}:{x1:U,x2:U,y1:Y,y2:j}},b=(y,B,U,Y)=>{let j=T.scale(y),I=T.scale(B),G=Math.max(1,Math.abs(I-j));return f?{x:i(Math.min(j,I)),y:i(U-Y/2),width:i(G),height:i(Y)}:{x:i(U-Y/2),y:i(Math.min(j,I)),width:i(Y),height:i(G)}},x=(y,B)=>f?`${i(T.scale(y))} ${i(B)}`:`${i(B)} ${i(T.scale(y))}`,C=(y,B,U,Y,j,I,G)=>({kind:"circle",part:j,cx:f?i(T.scale(y)):i(B),cy:f?i(B):i(T.scale(y)),r:U,fill:Y,opacity:G,title:I});for(let y of R){let{st:B,color:U,name:Y,raw:j}=y,I=i(O(y)),G=o?a[y.ci]:void 0,V=G!==void 0?`${Y}, ${G}`:Y,Q=`${V}: min ${d(B.min)} Q1 ${d(B.q1)} median ${d(B.median)} Q3 ${d(B.q3)} max ${d(B.max)}${e.mean&&P(B.mean)?` mean ${d(B.mean)}`:""}`,p={label:Q,id:y.id,series:Y,seriesId:y.id??Y,category:G,index:o?y.ci:y.si,value:B.median},q=S*.6,N=q/2,F=f?{x1:i(T.scale(B.median)),x2:i(T.scale(B.median)),y1:i(I-N),y2:i(I+N)}:{x1:i(I-N),x2:i(I+N),y1:i(T.scale(B.median)),y2:i(T.scale(B.median))},_=B.count,W=e.notched&&_?Math.min(1.58*(B.q3-B.q1)/Math.sqrt(_),(B.q3-B.q1)/2):0,ee=W?{kind:"path",part:"box",d:`M${[x(B.q1,I-N),x(B.median-W,I-N),x(B.median,I-N+q/4),x(B.median+W,I-N),x(B.q3,I-N),x(B.q3,I+N),x(B.median+W,I+N),x(B.median,I+N-q/4),x(B.median-W,I+N),x(B.q1,I+N)].join("L")}Z`,fill:U,stroke:U,fillOpacity:.5,title:Q,item:p}:{kind:"rect",part:"box",...b(B.q1,B.q3,I,q),fill:U,stroke:U,opacity:.5,title:Q,item:p};if(L.push({kind:"line",part:"whisker",...H(B.max,B.min,I),stroke:U,title:Q},ee,{kind:"line",part:"median",...F,stroke:U,title:Q},...(B.outliers??[]).map(te=>C(te,I,3,U,"outlier",`${V}: ${d(te)}`))),e.mean&&P(B.mean)){let te=f?i(T.scale(B.mean)):I,re=f?I:i(T.scale(B.mean));L.push({kind:"path",part:"mean",d:`M${te} ${i(re-4)}L${i(te+4)} ${re}L${te} ${i(re+4)}L${i(te-4)} ${re}Z`,fill:"var(--skdx-color-text-default)",title:`${V} mean: ${d(B.mean)}`})}e.points&&j&&Ve(j).forEach((te,re)=>{let me=(re*7919%97/96-.5)*q*.8;L.push(C(te,I+me,2,U,"observation",`${V}: ${d(te)}`,.6))})}return{...E,shapes:[...L,...E.shapes],issues:r}}var zo=e=>e*Math.PI/180;function No(e){let{nodes:n,path:t}=kn(e.data,e.rootId),r=fn(n,e.maxDepth),a=le(e,!r.some(x=>De(x)>0),300,300);if(a)return a;let o=ae(e.format),{width:s,height:c}=de(e,300,300),l=Math.min(.9,Math.max(0,e.innerRadius??0)),d=e.breadcrumbs&&t.length>0,m=d&&l===0,h=r.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),f=ue(e,h,s)+(m?20:0),M=s/2,$=f+(c-f)/2,g=Math.max(0,Math.min(s,c-f)/2-8),w=g*l,R=(g-w)/Math.max(1,zr(r)),k=zo(e.startAngle??0),T=zo(e.endAngle??(e.startAngle??0)+360),D=Math.max(0,zo(e.padAngle??0)),v=e.sort??"none",S=[],O=x=>{for(let C of x)C.children?.length?O(C.children):S.push(De(C))};O(r);let E=e.colorScale?Pt(e.colorScale,S,ne(e,0),void 0,o):void 0,z=[],L=[],H=(x,C,y,B,U)=>{let Y=p=>C===0&&xe(e,p.name)?0:Math.max(0,De(p)),j=sr(x,v),I=j.reduce((p,q)=>p+Y(q),0),G=Math.max(0,j.filter(p=>Y(p)>0).length-1),V=Math.max(0,B-G*D),Q=y;j.forEach(p=>{let q=Y(p),N=I>0?q/I*V:0,_=!((p.children?.length??0)>0)&&E?E.color(q):void 0,W=_?.fill??p.color??U??ne(e,x.indexOf(p));if(N>0){let ee=w+R*C,te=ee+R;if(e.labels&&N*((ee+te)/2)>p.name.length*ie+4){let me=Q+N/2,be=(ee+te)/2;L.push(J(i(M+be*Math.sin(me)),i($-be*Math.cos(me)),p.name,{part:"arc-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}let re=`${p.name}: ${o(q)}`;z.push({kind:"path",part:"arc",d:Ke(M,$,te,ee,Q,Q+N),fill:W,opacity:_?_.opacity:1-C*.2,stroke:"var(--skdx-color-surface-default)",title:re,item:{label:re,id:tt(p),name:p.name,value:q}}),H(p.children??[],C+1,Q,N,W),Q+=N+D}})};if(H(r,0,k,Math.max(0,Math.min(2*Math.PI,T-k)),void 0),e.centerLabel&&L.push(J(i(M),i(d&&!m?$-8:$),e.centerLabel,{part:"center-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)",weight:"bold"})),d){let x=t.reduce((C,y)=>C+y.name.length*ie+6,0)+(t.length-1)*(ie+6);L.push(...m?lr(t,8,ue(e,h,s)+10):lr(t,M-x/2,e.centerLabel?$+8:$))}let b=he(e,s,c,h);return{...b,shapes:ft([...z,...L,...b.shapes])}}var Il=2*Math.PI,Tl=12,Nr=5;function Al(e){let n=[];if(e.links){let a=[...e.names??[]],o=new Set(a);for(let l of e.links)for(let d of[l.source,l.target])o.has(d)||(e.names&&n.push({code:"unknown-node",severity:"warning",message:`Link ${l.source} \u2192 ${l.target} names "${d}", which is not in \`names\`; it was added.`,itemId:l.id}),o.add(d),a.push(d));let s=new Map(a.map((l,d)=>[l,d])),c=a.map(()=>a.map(()=>0));for(let l of e.links){if(!P(l.value)||l.value<0){n.push({code:"invalid-value",severity:"warning",message:`Link ${l.source} \u2192 ${l.target} has no valid value and was dropped.`,itemId:l.id});continue}let d=c[s.get(l.source)];d[s.get(l.target)]=d[s.get(l.target)]+l.value}return{names:a,matrix:c,issues:n}}let t=e.names??[],r=e.matrix??[];return(r.length!==t.length||r.some(a=>a.length!==t.length))&&n.push({code:"ragged-matrix",severity:"warning",message:`The matrix is ${r.length} \xD7 ${r[0]?.length??0} but there are ${t.length} names; missing cells count as zero.`}),{names:t,matrix:r,issues:n}}function Ro(e){let{names:n,matrix:t,issues:r}=Al(e),a=le(e,n.length===0||!t.some(j=>j.some(I=>P(I)&&I>0)),300,300);if(a)return{...a,issues:r};let o=ae(e.format),{width:s,height:c}=de(e,300,300),l=(j,I)=>{let G=t[j]?.[I];return P(G)?Math.max(0,G):0},d=j=>n.reduce((I,G,V)=>I+l(j,V)+l(V,j),0),m=n.map((j,I)=>I);e.sort&&m.sort((j,I)=>e.sort==="asc"?d(j)-d(I):d(I)-d(j));let h=m.map(j=>n[j]),f=j=>ne(e,m[j]),M=h.map((j,I)=>({name:j,color:f(I)})),$=ue(e,M,s),g=s/2,w=$+(c-$)/2,R=e.ticks?8+Nr+14:8,k=R+Math.max(0,...n.map(j=>j.length))*ie+4,T=Math.max(0,Math.min(s/2-k,(c-$)/2-36)),D=Math.max(0,T-Tl),v=(e.padding??2.3)*Math.PI/180,S=h.length,O=Yn(e.selected)[0],E=O===void 0?-1:h.indexOf(String(O)),z=(j,I)=>xe(e,h[j])||xe(e,h[I])?0:l(m[j],m[I]),L=h.map((j,I)=>h.reduce((G,V,Q)=>G+z(I,Q),0)),H=L.reduce((j,I)=>j+I,0),b=H>0?(Il-v*S)/H:0,x=(j,I)=>`${i(g+I*Math.sin(j))} ${i(w-I*Math.cos(j))}`,C=[],y=0;for(let j=0;j<S;j++){let I=y,G=h.map((V,Q)=>{let p=y;return y+=z(j,Q)*b,{a0:p,a1:y}});C.push({a0:I,a1:y,sub:G}),y+=v}let B=[],U=[];for(let j=0;j<S;j++)for(let I=j;I<S;I++){let G=z(j,I),V=z(I,j);if(G+V===0)continue;let Q=C[j].sub[I],p=C[I].sub[j],q=ee=>ee.a1-ee.a0>Math.PI?1:0,N=j===I?`M${x(Q.a0,D)}A${D} ${D} 0 ${q(Q)} 1 ${x(Q.a1,D)}Q${i(g)} ${i(w)} ${x(Q.a0,D)}Z`:`M${x(Q.a0,D)}A${D} ${D} 0 ${q(Q)} 1 ${x(Q.a1,D)}Q${i(g)} ${i(w)} ${x(p.a0,D)}A${D} ${D} 0 ${q(p)} 1 ${x(p.a1,D)}Q${i(g)} ${i(w)} ${x(Q.a0,D)}Z`,F=G>=V?j:I,_=E<0||j===E||I===E,W=j===I?`${h[j]}: ${o(G)}`:`${h[j]} \u2192 ${h[I]}: ${o(G)} \xB7 ${h[I]} \u2192 ${h[j]}: ${o(V)}`;B.push({kind:"path",part:"chord",d:N,fill:f(F),opacity:_?.5:.08,title:W,item:{label:W,id:`${h[j]}\u2192${h[I]}`,name:h[j],category:h[I],value:G+V}})}C.forEach((j,I)=>{if(j.a1<=j.a0)return;let G=`${h[I]}: ${o(L[I])}`;B.push({kind:"path",part:"group",d:Ke(g,w,T,D,j.a0,j.a1),fill:f(I),opacity:E<0||I===E||z(I,E)+z(E,I)>0?void 0:.3,title:G,item:{label:G,id:h[I],name:h[I],index:I,value:L[I]}});let V=(j.a0+j.a1)/2,Q=Math.sin(V),p=T+R;if(B.push(J(i(g+p*Q),i(w-p*Math.cos(V)),h[I],{anchor:Q>.1?"start":Q<-.1?"end":"middle",baseline:"middle"})),!e.ticks)return;let q=L[I];ht(0,q,4).filter(N=>N<=q).forEach((N,F)=>{let _=j.a0+N*b,W=Math.sin(_),ee=Math.cos(_);if(B.push({kind:"line",part:"tick",x1:i(g+T*W),y1:i(w-T*ee),x2:i(g+(T+Nr)*W),y2:i(w-(T+Nr)*ee),stroke:K.axis}),F%2)return;let te=i(g+(T+Nr+3)*W),re=i(w-(T+Nr+3)*ee);U.some(me=>Math.abs(me.x-te)<12&&Math.abs(me.y-re)<12)||(U.push({x:te,y:re}),B.push(J(te,re,o(N),{part:"tick-label",anchor:W>.1?"start":W<-.1?"end":"middle",baseline:"middle"})))})});let Y=he(e,s,c,M);return{...Y,shapes:[...B,...Y.shapes],issues:r}}var Vn=8,Eo=e=>e.geometry.type==="Polygon"?e.geometry.coordinates:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.flat():[],Qs=e=>e.geometry.type==="Point"?[e.geometry.coordinates]:e.geometry.type==="MultiPoint"?e.geometry.coordinates:[],Js=e=>e.geometry.type==="LineString"?[e.geometry.coordinates]:e.geometry.type==="MultiLineString"?e.geometry.coordinates:[],Xs=e=>[...Eo(e).flat(),...Qs(e),...Js(e).flat()],Cl=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),cr=e=>e!==void 0&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function Do(e){let n=[],t=e.features.filter(p=>{let q=Xs(p).some(cr);return q||n.push({code:"invalid-geometry",severity:"warning",message:`Feature "${p.name}" has no valid coordinates and was dropped.`,itemId:p.id??p.name}),q}),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=ae(e.format),{width:o,height:s}=de(e),c=ue(e),l=Bn(e.colorLegend).bottom,d=Bn(e.colorLegend).right,m=e.projection==="mercator"?Cl:p=>p,h=t.filter(p=>Eo(p).length>0),f=(h.length?h:t).flatMap(p=>Xs(p).filter(cr)),[M,$]=f.length?we(f.map(p=>p[0])):[0,1],[g,w]=f.length?we(f.map(p=>m(p[1]))):[0,1],R=Math.min((o-d-2*Vn)/Math.max(1e-9,$-M),(s-c-l-2*Vn)/Math.max(1e-9,w-g)),k={x:Vn,y:c+Vn,width:o-d-2*Vn,height:s-c-l-2*Vn},T=Math.max(1,Math.min(64,e.view?.zoom??1)),D=R*T,v=e.view?.center?[e.view.center[0],m(e.view.center[1])]:[(M+$)/2,(g+w)/2],S=k.x+k.width/2-v[0]*D,O=k.y+k.height/2+v[1]*D,E=([p,q])=>({x:i(S+p*D),y:i(O-m(q)*D)}),z=p=>{let{x:q,y:N}=E(p);return`${q} ${N}`},L=ne(e,0,e.color),H=Pt(e.colorScale,t.map(p=>p.value),L,void 0,a),b=[],x=h.map(p=>{let q=Eo(p);if(e.labels&&q.length){let _=q.reduce((me,be)=>be.length>me.length?be:me),[W,ee]=we(_.map(me=>me[0])),[te,re]=we(_.map(me=>m(me[1])));b.push(J(i(S+((W+ee)/2-M)*D),i(O+(w-(te+re)/2)*D),p.name,{part:"region-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-default)"}))}let N=p.color!==void 0?{fill:p.color,opacity:1}:H.color(p.value),F=`${p.name}${P(p.value)?`: ${a(p.value)}`:""}`;return{kind:"path",part:"region",d:q.map(_=>`M${_.filter(cr).map(z).join("L")}Z`).join(""),fill:N?.fill??K.grid,opacity:N?.opacity??.6,stroke:"var(--skdx-color-surface-default)",title:F,item:{label:F,id:p.id??p.name,name:p.name,value:p.value}}}),C=[...e.lines??[],...t.flatMap(p=>Js(p).map(q=>({id:p.id,name:p.name,coordinates:q,value:p.value,color:p.color??(P(p.value)?H.color(p.value)?.fill:void 0),dash:void 0})))].filter(p=>p.coordinates.filter(cr).length>=2),[,y]=we(C.map(p=>p.value)),B=C.map((p,q)=>{let N=`${p.name}${P(p.value)?`: ${a(p.value)}`:""}`;return{kind:"path",part:"route",d:`M${p.coordinates.filter(cr).map(z).join("L")}`,stroke:p.color??ne(e,2),strokeWidth:P(p.value)&&y>0?1+3*Math.sqrt(Math.max(0,p.value)/y):1.5,strokeLinecap:"round",strokeLinejoin:"round",dash:p.dash,opacity:.85,title:N,item:{label:N,id:p.id??p.name,name:p.name,index:q,value:p.value}}}),U=[...e.points??[],...t.flatMap(p=>Qs(p).map(q=>({id:p.id,name:p.name,coordinates:q,value:p.value,color:p.color??(P(p.value)?H.color(p.value)?.fill:void 0)})))].filter(p=>cr(p.coordinates)),[Y,j]=e.sizeRange??[3,14],[,I]=we(U.map(p=>p.value)),G=U.map((p,q)=>{let{x:N,y:F}=E(p.coordinates),_=Number.isFinite(p.value)&&I>0,W=`${p.name}${_?`: ${a(p.value)}`:""}`;return{kind:"circle",part:_?"bubble":"point",cx:N,cy:F,r:i(_?Math.max(Y,Math.sqrt(Math.max(0,p.value)/I)*j):Y),fill:p.color??ne(e,1),stroke:"var(--skdx-color-surface-default)",opacity:.85,title:W,item:{label:W,id:p.id??p.name,name:p.name,index:q,value:p.value}}}),V=e.colorLegend?nr(H,d?{x:k.x+k.width+12,y:k.y,width:d,height:k.height}:{x:Vn,y:s-l+8,width:o-2*Vn,height:l},Bn(e.colorLegend).options):[],Q=e.projection==="mercator"?p=>Math.atan(Math.exp(p))*360/Math.PI-90:p=>p;return{...he(e,o,s),shapes:[...x,...B,...b,...G,...V],issues:n,map:{view:{center:[v[0],Q(v[1])],zoom:T},bounds:{minLon:M,maxLon:$,minLat:g,maxLat:w},plot:k,scale:D,toY:m,fromY:Q}}}function Bo(e){let n=[],t=e.segments.map((z,L)=>typeof z=="string"?{name:z,id:z,color:ne(e,L)}:{name:z.name,id:z.id??z.name,color:ne(e,L,z.color)}),r=t.map(z=>!xe(e,z.name)),a=(z,L)=>{let H=z.values[L];return H==null?0:!P(H)||H<0?(n.push({code:P(H)?"negative-value":"invalid-value",severity:"warning",message:`"${t[L]?.name}" in "${z.name}" is ${P(H)?"negative":"not a number"}; drawn as zero.`,itemId:z.id??z.name}),0):H},o=e.data.map((z,L)=>{let H=t.map((C,y)=>r[y]?a(z,y):0),b=H.reduce((C,y)=>C+y,0),x=P(z.total)&&z.total>=0?z.total:b;return{c:z,ci:L,values:H,sum:b,total:x}}),s=o.reduce((z,L)=>z+L.total,0),c=le(e,s<=0);if(c)return{...c,issues:n};let l=ae(e.format),d=ae(e.xAxis?.format??e.format),{width:m,height:h}=de(e),f=t.map(z=>({name:z.name,color:z.color})),M=Te(m,h,{...fe,top:fe.top+ue(e,f,m),bottom:fe.bottom+(e.xAxis?.label?14:0)+(e.xAxis?.format?14:0)}),$=Math.max(0,Math.min(.2,e.gap??.01))*M.width,g=Math.max(0,o.length-1),w=Math.max(0,M.width-$*g),R=Ge([0,1],[M.y+M.height,M.y],{format:{style:"percent"}}),k=he(e,m,h,f),T=M.x,D=o.map(z=>{let L=z.total/s*w,H={x:T,w:L};return T+=L+$,{...z,...H}}),v=D.map(z=>({pos:i(z.x+z.w/2),label:z.c.name})),S=Ze({...k,plot:M,xTicks:Ne(v,M.width),yTicks:R.ticks,baseline:R.zero},{xLabel:e.xAxis?.label,yLabel:void 0});if(e.xAxis?.format)for(let z of D)z.w>24&&S.push(J(i(z.x+z.w/2),M.y+M.height+34,d(z.total),{part:"x-total",anchor:"middle"}));let O=[],E=[];for(let z of D){let L=0;z.values.forEach((H,b)=>{let x=t[b];if(H<=0||z.sum<=0)return;let C=H/z.sum,y=R.scale(L+C),B=R.scale(L);L+=C;let U=`${Math.round(C*100)}%`,Y=`${x.name}, ${z.c.name}: ${l(H)} (${U}) \xB7 column ${d(z.total)}`,j=Math.max(0,B-y);O.push({kind:"rect",part:"cell",x:i(z.x),y:i(y),width:i(z.w),height:i(j),fill:x.color,stroke:"var(--skdx-color-surface-default)",title:Y,item:{label:Y,id:`${z.c.id??z.c.name}:${x.name}`,series:x.name,seriesId:x.id,category:z.c.name,index:z.ci,value:H}}),e.labels&&j>14&&z.w>24&&E.push(J(i(z.x+z.w/2),i(y+j/2),U,{part:"cell-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))})}return{...k,shapes:ft([...S,...O,...E,...k.shapes]),issues:n}}var ei=500;function Fo(e){let n=[],t=e.dimensions,r=e.data.filter(v=>!(v.group!==void 0&&xe(e,v.group))),a=le(e,t.length===0||r.length===0);if(a)return{...a,issues:n};let{width:o,height:s}=de(e),c=[...new Set(e.data.map(v=>v.group).filter(v=>v!==void 0))],l=t[0],d=t[t.length-1],m=v=>(v.label??v.key).length*ie/2+8,h=c.map((v,S)=>({name:v,color:ne(e,S)})),f=Te(o,s,{top:28+ue(e,h,o),right:Math.max(16,m(d)),bottom:16,left:Math.max(48,m(l))}),M=(v,S)=>{let O=v.values[S];return O==null?null:P(O)?O:(n.push({code:"invalid-value",severity:"warning",message:`"${v.name}" has a value on "${S}" that is not a number; drawn as a gap.`,itemId:v.id??v.name}),null)},$=t.map((v,S)=>{let[O,E]=we(r.map(B=>M(B,v.key))),z=ht(v.min??O,v.max??E),L=v.min??z[0],H=v.max??z[z.length-1],b=v.reversed?[f.y,f.y+f.height]:[f.y+f.height,f.y],x=st([L,H],b),C=i(t.length===1?f.x+f.width/2:f.x+S*f.width/(t.length-1)),y=ae(v.format??e.format);return{d:v,x:C,scale:B=>i(x(Math.max(L,Math.min(H,B)))),format:y,ticks:z.filter(B=>B>=L-1e-9&&B<=H+1e-9)}}),g=[];$.forEach((v,S)=>{g.push({kind:"line",part:"axis",x1:v.x,x2:v.x,y1:f.y,y2:f.y+f.height,stroke:K.axis});let O=S===$.length-1&&$.length>1?"start":"end";for(let E of v.ticks)g.push(J(i(O==="end"?v.x-6:v.x+6),v.scale(E),v.format(E),{part:"y-label",anchor:O,baseline:"middle"}));g.push(J(v.x,f.y-12,v.d.label??v.d.key,{part:"axis-title",anchor:"middle"}))});let w=r.length<=ei,R=e.opacity??(r.length>200?.25:.6),k=v=>(e.filters??[]).every(S=>{let O=M(v,S.key);return O!==null&&O>=(S.min??-1/0)&&O<=(S.max??1/0)}),T=r.map((v,S)=>{let O=[],E=[];for(let L of $){let H=M(v,L.d.key);if(H===null){!e.connectNulls&&E.length&&(O.push(E),E=[]);continue}E.push({x:L.x,y:L.scale(H)})}E.length&&O.push(E);let z=`${v.name}: ${$.map(L=>{let H=M(v,L.d.key);return`${L.d.label??L.d.key} ${H===null?"\u2014":L.format(H)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:O.map(L=>it(L,e.curve)).join(""),stroke:v.color??(v.group!==void 0?ne(e,c.indexOf(v.group)):ne(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:k(v)?R:.08,title:w?z:void 0,item:w?{label:z,id:v.id??v.name,name:v.name,category:v.group,index:S}:void 0}}),D=he(e,o,s,h);return{...D,shapes:[...g,...T,...D.shapes],issues:n}}function Po(e){let n=e.orientation==="vertical",t=le(e,!P(e.value),600,n?300:64);if(t)return t;let r=ae(e.format),a=e.min??0,o=(e.bands??[]).filter(d=>P(d.from)&&P(d.to)),s=e.max??Math.max(100,e.value,e.target??-1/0,...o.map(d=>d.to)),c=P(e.target)?`, target ${r(e.target)}`:"";return{...Ir({...e,height:e.height??(n?300:64),data:[{id:"value",name:e.caption??"",value:e.value,target:e.target,ranges:o}],min:a,max:s,labels:e.labels??!0,ticks:e.ticks}),description:e.description??`${e.caption??"Value"} ${r(e.value)} on a scale from ${r(a)} to ${r(s)}${c}.`}}function Ho(e){let n=[],t=e.data.filter(b=>{let x=P(b.start)||P(b.end);return x||n.push({code:"invalid-value",severity:"warning",message:`"${b.name}" has neither a valid start nor end and was dropped.`,itemId:b.id??b.name}),x}),r=le(e,t.length===0);if(r)return{...r,issues:n};let a=ae(e.xAxis?.format??e.format),{width:o,height:s}=de(e),c=e.orientation==="vertical",l=e.startLabel??"Start",d=e.endLabel??"End",m=xe(e,l),h=xe(e,d),f=[...t];if(e.sort){let b=x=>e.sort==="change"?(P(x.end)?x.end:0)-(P(x.start)?x.start:0):P(x.end)?x.end:-1/0;f.sort((x,C)=>e.sort==="asc"?b(x)-b(C):b(C)-b(x))}let M=Math.max(0,...f.map(b=>b.name.length))*ie,$=ne(e,0),g=ne(e,1),w=[{name:l,color:$},{name:d,color:g}],R=Te(o,s,{...fe,top:fe.top+ue(e,w,o)+(c&&e.xAxis?.label?12:0),right:e.labels&&!c?56:fe.right,bottom:fe.bottom+(!c&&e.xAxis?.label?14:0),left:c?fe.left:Math.max(fe.left,M+16)}),k=Ge(Gt(f.flatMap(b=>[m?void 0:b.start,h?void 0:b.end]),!1),c?[R.y+R.height,R.y]:[R.x,R.x+R.width],e.xAxis??{},e.format),T=je(f.length,c?[R.x,R.x+R.width]:[R.y,R.y+R.height]),D=he(e,o,s,w),v=f.map((b,x)=>({pos:i(T.center(x)),label:b.name})),S=Ze({...D,plot:R,xTicks:c?Ne(v,R.width):v,yTicks:c?k.ticks:Ne(k.ticks,R.width),baseline:c?R.y+R.height:R.x},{horizontal:!c,grid:En(e.xAxis),...c?{yLabel:e.xAxis?.label}:{xLabel:e.xAxis?.label}});S.push(...Wt(e.references,{plot:R,horizontal:!c,x:b=>{let x=f.findIndex(C=>C.name===b);return x<0?void 0:T.center(x)},y:b=>k.scale(b)}));let O=e.markerSize??5,E=(b,x)=>c?{x:i(x),y:i(k.scale(b))}:{x:i(k.scale(b)),y:i(x)},z=[],L=[],H=[];return f.forEach((b,x)=>{let C=T.center(x),y=P(b.start)?a(b.start):"\u2014",B=P(b.end)?a(b.end):"\u2014",U=`${b.name}: ${y} \u2192 ${B}`,Y={label:U,id:b.id??b.name,name:b.name,index:x,value:P(b.end)?b.end:void 0};if(!m&&!h&&P(b.start)&&P(b.end)){let j=E(b.start,C),I=E(b.end,C);z.push({kind:"line",part:"connector",x1:j.x,y1:j.y,x2:I.x,y2:I.y,stroke:b.color??K.axis,strokeWidth:3,title:U,item:Y})}for(let[j,I,G,V,Q]of[[b.start,"start",l,$,m],[b.end,"end",d,g,h]]){if(Q||!P(j))continue;let p=E(j,C),q=`${b.name} \xB7 ${G}: ${a(j)}`;L.push({kind:"circle",part:I,cx:p.x,cy:p.y,r:O,fill:V,stroke:"var(--skdx-color-surface-default)",title:q,item:{...Y,label:q,series:G}}),e.labels&&H.push(c?J(p.x,i(p.y+(I==="end"?-O-4:O+12)),a(j),{part:"value-label",anchor:"middle"}):J(i(p.x+(I==="end"?O+4:-O-4)),p.y,a(j),{part:"value-label",anchor:I==="end"?"start":"end",baseline:"middle"}))}}),{...D,shapes:[...S,...z,...L,...H,...D.shapes],issues:n}}function Vo(e){let n=[],r=e.data.filter(m=>{let h=P(m.value)&&m.value>=0;return h||n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has no valid non-negative value and was dropped.`,itemId:m.id??m.name}),h}).map((m,h)=>({d:m,i:h})).sort((m,h)=>h.d.value-m.d.value||m.i-h.i),a=r.reduce((m,{d:h})=>m+h.value,0),o=0,s=r.map(({d:m})=>a>0?(o+=m.value)/a:0),c=e.threshold,l=qt({...e,categories:r.map(({d:m})=>m.name),series:[{name:e.name??"Value",type:"bar",data:r.map(({d:m})=>m.value),color:r[0]?.d.color},{name:e.cumulativeLabel??"Cumulative",type:"line",axis:"right",data:s,curve:"linear"}],rightAxis:{min:0,max:1,format:{style:"percent"}},references:c!==void 0&&P(c)?[{y:c,axis:"right",label:`${Math.round(c*100)}%`,variant:"primary"}]:void 0},"bar"),d=l.shapes.map(m=>{if(m.part!=="bar"||m.kind!=="rect"||!m.item||m.item.index===void 0)return m;let h=r[m.item.index]?.d;return h?{...m,fill:h.color??m.fill,item:{...m.item,id:h.id??h.name,name:h.name}}:m});return{...l,shapes:d,issues:[...n,...l.issues??[]]}}function Jr(e){let{nodes:n,path:t}=kn(e.data,e.rootId),r=fn(n,e.maxDepth),a=le(e,r.length===0);if(a)return a;let o=ae(e.format),{width:s,height:c}=de(e),l=e.orientation!=="horizontal",d=e.nodeShape==="box",m=e.linkStyle??"curve",h=new Set(e.collapsed??[]),f=e.labels??!0,M=[],$=0,g=0,w=(I,G,V,Q)=>{let p=h.has(tt(I))||h.has(I.name),q=p?[]:I.children??[],N=I.color??V?.color??ne(e,Q),F={node:I,depth:G,slot:0,parent:V,collapsed:p,color:N};if(g=Math.max(g,G),q.length===0)F.slot=$++;else{let _=q.map((W,ee)=>w(W,G+1,F,ee));F.slot=(_[0].slot+_[_.length-1].slot)/2}return M.push(F),F};r.forEach((I,G)=>w(I,0,void 0,G));let R=I=>Math.max(I.name.length,I.subtitle?.length??0),k=Math.max(0,...M.map(I=>R(I.node)))*ie+16,T=e.nodeSize??36,D=e.nodeSize??5,v=d?k:2*D,S=d?T:2*D,O=!d&&f?k:0,E=Te(s,c,{top:ue(e)+S/2+4,bottom:S/2+4+(l&&!d?16:0),left:v/2+4,right:v/2+4+(l?0:O)}),z=Math.max(1,$),L=l?E.width:E.height,H=l?E.height:E.width,b=z===1?0:L/(z-1),x=g===0?0:H/g,C=I=>{let G=z===1?L/2:I.slot*b,V=I.depth*x;return l?{x:i(E.x+G),y:i(E.y+V)}:{x:i(E.x+V),y:i(E.y+G)}},y=[],B=[],U=[];for(let I of M){let{x:G,y:V}=C(I);if(I.parent){let N=C(I.parent),F=d?l?S/2:v/2:D,_=l?N.x:i(N.x+F),W=l?i(N.y+F):N.y,ee=l?G:i(G-F),te=l?i(V-F):V,re=i((_+ee)/2),me=i((W+te)/2),be=m==="straight"?`M${_} ${W}L${ee} ${te}`:m==="elbow"?l?`M${_} ${W}V${me}H${ee}V${te}`:`M${_} ${W}H${re}V${te}H${ee}`:l?`M${_} ${W}C${_} ${me} ${ee} ${me} ${ee} ${te}`:`M${_} ${W}C${re} ${W} ${re} ${te} ${ee} ${te}`;y.push({kind:"path",part:"link",d:be,stroke:K.axis,strokeWidth:1.5,title:`${I.parent.node.name} \u2192 ${I.node.name}`})}let Q=De(I.node),p=`${I.node.name}${I.node.subtitle?` \xB7 ${I.node.subtitle}`:""}${yo(I.node)?`: ${o(Q)}`:""}${I.collapsed?" (collapsed)":""}`,q={label:p,id:tt(I.node),name:I.node.name,value:Q};if(d){if(B.push({kind:"rect",part:"node",x:i(G-v/2),y:i(V-S/2),width:i(v),height:i(S),fill:I.color,rx:4,title:p,item:q}),f){let N=!!I.node.subtitle;U.push(J(G,i(N?V-7:V),I.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),N&&U.push(J(G,i(V+8),I.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else B.push({kind:"circle",part:"node",cx:G,cy:V,r:i(D),fill:I.color,stroke:"var(--skdx-color-surface-default)",title:p,item:q}),f&&U.push(l?J(G,i(V+D+12),I.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):J(i(G+D+4),V,I.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));I.collapsed&&U.push(J(i(d?G+v/2-8:G+D+(l?6:-2)),i(d?V-S/2+8:V-D-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:K.label,weight:"bold"}))}let Y=t.length?[J(8,ue(e)+10,t.map(I=>I.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],j=he(e,s,c);return{...j,shapes:ft([...y,...B,...U,...Y,...j.shapes])}}var _o=e=>Jr({...e,nodeShape:"box",linkStyle:"elbow"});function ti(e,n){let t=[],r=e.map((f,M)=>({r:f,i:M})).sort((f,M)=>M.r-f.r),a=new Array(e.length);for(let{r:f,i:M}of r){let $;if(t.length===0)$={x:0,y:0,r:f};else{let w=Math.max(1,f/4);e:for(let R=0;R<1e6;R+=w)for(let k=0;k<24;k++){let T=k/24*2*Math.PI+R*.05,D={x:R*Math.cos(T),y:R*Math.sin(T),r:f};if(t.every(v=>Math.hypot(v.x-D.x,v.y-D.y)>=v.r+D.r+n)){$=D;break e}}}let g=$??{x:0,y:0,r:f};t.push(g),a[M]=g}let o=1/0,s=-1/0,c=1/0,l=-1/0;for(let f of t)o=Math.min(o,f.x-f.r),s=Math.max(s,f.x+f.r),c=Math.min(c,f.y-f.r),l=Math.max(l,f.y+f.r);let d=(o+s)/2,m=(c+l)/2,h=0;for(let f of a)f.x-=d,f.y-=m,h=Math.max(h,Math.hypot(f.x,f.y)+f.r);return{circles:a,enclosing:h}}function jo(e){let n=[],{nodes:t}=kn(e.data,e.rootId),r=fn(t,e.maxDepth),a=new Map(r.map((S,O)=>[tt(S),ne(e,O,S.color)])),o=r.filter(S=>!xe(e,S.name)),s=le(e,!o.some(S=>De(S)>0),300,300);if(s)return{...s,issues:n};let c=ae(e.format),{width:l,height:d}=de(e,300,300),m=r.map(S=>({name:S.name,color:a.get(tt(S))})),h=ue(e,m,l),f=e.padding??2,M=e.labels??!0,$=[],g=S=>{S.children?.length?S.children.forEach(g):$.push(De(S))};o.forEach(g);let w=Pt(e.colorScale,$,ne(e,0),void 0,c),R=[],k=[],T=(S,O,E,z,L)=>{let H=S.filter(y=>{let B=De(y)>0;return B||n.push({code:"invalid-value",severity:"warning",message:`"${y.name}" has no positive value and was dropped.`,itemId:tt(y)}),B});if(H.length===0)return;let{circles:b,enclosing:x}=ti(H.map(y=>Math.sqrt(De(y))),0),C=x>0?(z-f)/x:0;H.forEach((y,B)=>{let U=b[B],Y=i(O+U.x*C),j=i(E+U.y*C),I=Math.max(0,U.r*C-f/2),G=De(y),V=(y.children?.length??0)>0,Q=y.color??L??a.get(tt(y))??ne(e,B),p=V?Q:e.colorScale?w.color(G)?.fill??Q:Q,q=`${y.name}: ${c(G)}`;R.push({kind:"circle",part:V?"branch":"leaf",cx:Y,cy:j,r:i(I),fill:p,opacity:V?.15:e.colorScale&&!V?w.color(G)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:q,item:{label:q,id:tt(y),name:y.name,value:G}}),M&&!V&&I*2>y.name.length*ie+4&&k.push(J(Y,j,y.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),M&&V&&I*2>y.name.length*ie+4&&k.push(J(Y,i(j-I+10),y.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),V&&T(y.children,Y,j,I,Q)})},D=Math.max(0,Math.min(l,d-h)/2-8);T(o,l/2,h+(d-h)/2,D,void 0);let v=he(e,l,d,m);return{...v,shapes:ft([...R,...k,...v.shapes]),issues:n}}function Go(e){let n=[],{nodes:t,path:r}=kn(e.data,e.rootId),a=fn(t,e.maxDepth).filter(z=>!xe(e,z.name)),o=le(e,!a.some(z=>De(z)>0));if(o)return{...o,issues:n};let s=ae(e.format),{width:c,height:l}=de(e),d=e.orientation==="horizontal",m=e.breadcrumbs&&r.length>0,h=a.map((z,L)=>({name:z.name,color:ne(e,L,z.color)})),f=ue(e,h,c)+(m?20:0),M=Te(c,l,{top:f,right:0,bottom:0,left:0}),$=e.padding??1,g=e.labels??!0,w=Math.max(1,zr(a)),R=(d?M.width:M.height)/w,k=[],T=z=>{z.children?.length?z.children.forEach(T):k.push(De(z))};a.forEach(T);let D=Pt(e.colorScale,k,ne(e,0),void 0,s),v=[],S=[],O=(z,L,H,b,x)=>{let C=sr(z,e.sort).filter(U=>{let Y=De(U)>0;return Y||n.push({code:"invalid-value",severity:"warning",message:`"${U.name}" has no positive value and was dropped.`,itemId:tt(U)}),Y}),y=C.reduce((U,Y)=>U+De(Y),0),B=H;C.forEach((U,Y)=>{let j=De(U),I=y>0?j/y*b:0,G=(U.children?.length??0)>0,V=U.color??x??ne(e,Y),Q=!G&&e.colorScale?D.color(j):void 0,p=L*R,q=d?{x:M.x+p+$/2,y:B+$/2,width:R-$,height:I-$}:{x:B+$/2,y:M.y+p+$/2,width:I-$,height:R-$},N=`${U.name}: ${s(j)}`;v.push({kind:"rect",part:"cell",x:i(q.x),y:i(q.y),width:i(Math.max(0,q.width)),height:i(Math.max(0,q.height)),fill:Q?.fill??V,opacity:Q?.opacity??(G?.7:void 0),title:N,item:{label:N,id:tt(U),name:U.name,value:j}}),g&&q.width>U.name.length*ie+6&&q.height>12&&S.push(J(i(q.x+4),i(q.y+q.height/2),U.name,{part:"cell-label",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),G&&O(U.children,L+1,B,I,V),B+=I})};O(a,0,d?M.y:M.x,d?M.height:M.width,void 0),m&&v.push(...lr(r,8,ue(e,h,c)+10));let E=he(e,c,l,h);return{...E,shapes:ft([...v,...S,...E.shapes]),issues:n}}function Wo(e){let n=[],t=e.series.map((L,H)=>({...L,index:H,hidden:xe(e,L.name)})),r=Math.max(e.categories?.length??0,...t.map(L=>L.data.length)),a=le(e,r===0||t.every(L=>L.hidden||Ve(L.data).length===0));if(a)return{...a,issues:n};for(let L of t){let H=L.data.filter(b=>b!==null&&!P(b)).length;H&&n.push({code:"invalid-value",severity:"warning",message:`Series "${L.name}" has ${H} value${H===1?"":"s"} that ${H===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:L.id??L.name})}let o=ae(e.format),{width:s,height:c}=de(e),l=t.filter(L=>!L.hidden),d=l.map(()=>new Array(r).fill(null));for(let L=0;L<r;L++){if(e.ranked){l.forEach((b,x)=>{let C=b.data[L];d[x][L]=P(C)?C:null});continue}l.map((b,x)=>({si:x,v:b.data[L]})).filter(b=>P(b.v)).sort((b,x)=>x.v-b.v||b.si-x.si).forEach((b,x)=>{d[b.si][L]=x+1})}let m=e.topRank??Math.max(1,l.length),h=Array.from({length:r},(L,H)=>{let b=e.categories?.[H];return b===void 0?String(H+1):Qt(b,e.xAxis?.format)}),f=e.labels??!0,M=f?Math.max(0,...l.map(L=>L.name.length))*ie+12:0,$=e.series.map((L,H)=>({name:L.name,color:ne(e,H,L.color)})),g=Te(s,c,{...fe,top:fe.top+ue(e,$,s),right:Math.max(fe.right,M),bottom:fe.bottom+(e.xAxis?.label?14:0)}),w=st([.5,m+.5],[g.y,g.y+g.height]),R=je(r,[g.x,g.x+g.width],0),k=he(e,s,c,$),T=Array.from({length:m},(L,H)=>({pos:i(w(H+1)),label:`#${H+1}`})),D=Ze({...k,plot:g,xTicks:Ne(h.map((L,H)=>({pos:i(R.center(H)),label:L})),g.width),yTicks:m>20?T.filter((L,H)=>H%Math.ceil(m/20)===0):T,baseline:g.y+g.height},{xLabel:e.xAxis?.label,grid:e.xAxis?.grid!==!1}),v=e.markerSize??5,S=[],O=[],E=[],z=[];return l.forEach((L,H)=>{let b=ne(e,L.index,L.color),x=[],C=[],y;for(let B=0;B<r;B++){let U=d[H][B];if(U==null||U>m||U<1){C.length&&x.push(C),C=[];continue}let Y={x:i(R.center(B)),y:i(w(U))};C.push(Y),y=Y;let j=L.data[B],I=`${L.name}, ${h[B]}: #${U}${e.ranked||!P(j)?"":` (${o(j)})`}`;O.push(Ft(Y.x,Y.y,v,b,I,{label:I,id:L.id??L.name,series:L.name,seriesId:L.id??L.name,category:h[B],index:B,value:U}))}C.length&&x.push(C);for(let B of x)S.push({kind:"path",part:"line",d:it(B,e.curve??"monotone"),stroke:b,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",title:L.name,item:{label:L.name,id:L.id??L.name,series:L.name,seriesId:L.id??L.name}});f&&y&&!z.some(B=>Math.abs(B-y.y)<12)&&(z.push(y.y),E.push(J(i(y.x+v+4),y.y,L.name,{part:"series-label",baseline:"middle",fill:K.label})))}),{...k,shapes:[...D,...S,...O,...E,...k.shapes],issues:n}}var qo=e=>e*Math.PI/180;function Zo(e){let n=[],t=e.data.map(x=>{let C=P(x.value);return C?x.value<0&&n.push({code:"negative-value",severity:"warning",message:`"${x.name}" is negative (${x.value}); a radius cannot be, so it is drawn as zero.`,itemId:x.id??x.name}):n.push({code:"invalid-value",severity:"warning",message:`"${x.name}" has no valid value and is drawn as zero.`,itemId:x.id??x.name}),{...x,value:C&&x.value>0?x.value:0}}),r=le(e,!t.some(x=>x.value>0),300,300);if(r)return{...r,issues:n};let a=ae(e.format),{width:o,height:s}=de(e,300,300),c=e.data.map((x,C)=>({name:x.name,color:ne(e,C,x.color)})),l=ue(e,c,o),d=o/2,m=l+(s-l)/2,h=Math.max(0,Math.min(o,s-l)/2-(e.labels?40:12)),f=h*Math.min(.9,Math.max(0,e.innerRadius??0)),M=Math.max(1,Math.round(e.levels??4)),$=Math.max(0,...t.map(x=>xe(e,x.name)?0:x.value)),g=ht(0,e.max??$,M).filter(x=>x>0),w=e.max??g[g.length-1],R=(e.scale??"sqrt")==="sqrt",k=x=>{let C=w>0?Math.max(0,Math.min(1,x/w)):0;return f+(h-f)*(R?Math.sqrt(C):C)},T=qo(e.startAngle??0),D=qo(e.endAngle??(e.startAngle??0)+360),v=Math.max(0,Math.min(2*Math.PI,D-T)),S=t.length,O=v/Math.max(1,S),E=Math.min(O*.9,qo(Math.max(0,e.padAngle??0))),z=g.filter(x=>x<=w).flatMap(x=>[{kind:"circle",part:"grid",cx:i(d),cy:i(m),r:i(k(x)),fill:"none",stroke:K.grid},J(i(d+4),i(m-k(x)),a(x),{part:"y-label",baseline:"middle"})]),L=[],H=[];t.forEach((x,C)=>{let y=T+C*O+E/2,B=y+O-E,U=xe(e,x.name),Y=`${x.name}: ${a(x.value)}`;if(!U&&x.value>0&&B>y&&L.push({kind:"path",part:"sector",d:Ke(d,m,k(x.value),f,y,B),fill:ne(e,C,x.color),stroke:"var(--skdx-color-surface-default)",title:Y,item:{label:Y,id:x.id??x.name,name:x.name,index:C,value:x.value}}),e.labels&&!U){let j=(y+B)/2,I=Math.sin(j);H.push(J(i(d+(h+8)*I),i(m-(h+8)*Math.cos(j)),x.name,{part:"sector-label",anchor:I>.1?"start":I<-.1?"end":"middle",baseline:"middle"}))}});let b=he(e,o,s,c);return{...b,shapes:[...z,...L,...H,...b.shapes],issues:n}}var ni=2e3;function ri(e,n,t){let r=[],a=[],o=(2*n)**2;for(let s of e){let c=[];for(let d=r.length-1;d>=0&&s-r[d].p<2*n;d--)c.push(r[d]);let l=0;for(let d=0;;d++){if(l=d===0?0:(d%2?1:-1)*Math.ceil(d/2),Math.abs(l)>t){l=Math.sign(l)*t;break}if(c.every(m=>(m.p-s)**2+(m.off-l)**2>=o))break}r.push({p:s,off:l}),a.push(l)}return a}function Uo(e){let n=[];for(let T of e.series){let D=T.data.filter(v=>v!==null&&!Number.isFinite(v)).length;D&&n.push({code:"invalid-value",severity:"warning",message:`Series "${T.name}" has ${D} value${D===1?"":"s"} that ${D===1?"is":"are"} neither a number nor null; skipped.`,itemId:T.id??T.name})}let t=e.series.map(T=>xe(e,T.name)?[]:Ve(T.data)),r=le(e,t.every(T=>T.length===0));if(r)return{...r,issues:n};let a=ae(e.yAxis?.format??e.format),{width:o,height:s}=de(e),c=e.orientation==="horizontal",l=Math.max(0,...e.series.map(T=>T.name.length))*ie,d=e.series.map((T,D)=>({name:T.name,color:ne(e,D,T.color)})),m=Te(o,s,{...fe,top:fe.top+ue(e,d,o)+(!c&&e.yAxis?.label?12:0),left:c?Math.max(fe.left,l+16):fe.left,bottom:fe.bottom+(c&&e.yAxis?.label?14:0)}),h=Ge(Gt(t.flat(),!1),c?[m.x,m.x+m.width]:[m.y+m.height,m.y],e.yAxis??{},e.format),f=je(e.series.length,c?[m.y,m.y+m.height]:[m.x,m.x+m.width]),M=he(e,o,s,d),$=e.series.map((T,D)=>({pos:i(f.center(D)),label:T.name})),g=Ze({...M,plot:m,xTicks:c?$:Ne($,m.width),yTicks:c?Ne(h.ticks,m.width):h.ticks,baseline:c?m.x:m.y+m.height},{horizontal:c,grid:En(e.yAxis),...c?{xLabel:e.yAxis?.label}:{yLabel:e.yAxis?.label}});g.push(...Wt(e.references,{plot:m,horizontal:c,x:T=>{let D=e.series.findIndex(v=>v.name===T);return D<0?void 0:f.center(D)},y:T=>h.scale(T)}));let w=e.markerSize??3,R=Math.max(0,f.bandwidth/2-w),k=[];return e.series.forEach((T,D)=>{let v=ne(e,D,T.color),S=f.center(D),O=(xe(e,T.name)?[]:T.data).map((L,H)=>({v:L,index:H})).filter(L=>P(L.v)).sort((L,H)=>h.scale(L.v)-h.scale(H.v)),E=ri(O.map(L=>h.scale(L.v)),w,R),z=O.length<=ni;O.forEach((L,H)=>{let b=h.scale(L.v),x=E[H],C=`${T.name}: ${a(L.v)}`;k.push({kind:"circle",part:"dot",cx:i(c?b:S+x),cy:i(c?S+x:b),r:w,fill:v,title:z?C:void 0,item:z?{label:C,id:T.id??T.name,series:T.name,seriesId:T.id??T.name,index:L.index,value:L.v}:void 0})})}),{...M,shapes:[...g,...k,...M.shapes],issues:n}}var ai=8;function oi(e){let n=e.map(a=>Math.floor(a)),t=Math.round(e.reduce((a,o)=>a+o,0))-n.reduce((a,o)=>a+o,0),r=e.map((a,o)=>({i:o,frac:a-Math.floor(a)})).sort((a,o)=>o.frac-a.frac||a.i-o.i);for(let{i:a}of r){if(t<=0)break;n[a]++,t--}return n}function Yo(e){let n=[],t=e.data.map(y=>{let B=P(y.value)&&y.value>=0;return B||n.push({code:P(y.value)?"negative-value":"invalid-value",severity:"warning",message:`"${y.name}" has no valid non-negative value and is drawn as zero.`,itemId:y.id??y.name}),{...y,value:B?y.value:0}}),r=t.reduce((y,B)=>y+(xe(e,B.name)?0:B.value),0),a=le(e,r<=0,300,300);if(a)return{...a,issues:n};let o=ae(e.format),s=P(e.total)&&e.total>0?e.total:r,c=Math.max(1,Math.round(e.rows??10)),l=Math.max(1,Math.round(e.columns??10)),d=c*l,m=y=>s>0?y/s:0,h=oi(t.map(y=>xe(e,y.name)?0:Math.min(1,m(y.value))*d)),{width:f,height:M}=de(e,300,300),$=new Map(t.map(y=>[y.name,`${Math.round(m(y.value)*100)}%`])),g=Zn(e),w=e.data.map((y,B)=>({name:y.name,color:ne(e,B,y.color)})),R=e.labels&&g?{...e,legend:{...g,formatter:y=>`${g.formatter?.(y)??y} ${$.get(y)??""}`}}:e,k=ue(R,w,f),T=Math.max(0,e.cellGap??2),D=Math.max(1,Math.min((f-2*ai)/l,(M-k-2*ai)/c)),v=(f-D*l)/2,S=k+(M-k-D*c)/2,O=e.orientation==="horizontal",E=y=>O?{x:v+y%l*D,y:S+Math.floor(y/l)*D}:{x:v+Math.floor(y/c)*D,y:S+(c-1-y%c)*D},z=(y,B,U,Y,j,I)=>{let{x:G,y:V}=E(y);return{kind:"rect",part:"cell",x:i(G+T/2),y:i(V+T/2),width:i(Math.max(.5,D-T)),height:i(Math.max(.5,D-T)),fill:B,stroke:I,opacity:j,rx:e.cellRadius??2,title:U,item:Y}},L=[],H=0;t.forEach((y,B)=>{let U=h[B],Y=`${y.name}: ${o(y.value)} (${Math.round(m(y.value)*100)}%)`,j={label:Y,id:y.id??y.name,name:y.name,index:B,value:y.value};for(let I=0;I<U&&H<d;I++,H++)L.push(z(H,ne(e,B,y.color),Y,j))});let b=s-r,x=b>0?`Other: ${o(b)} (${Math.round(m(b)*100)}%)`:"Empty";for(;H<d;H++)L.push(z(H,K.grid,x,void 0,.6,K.axis));let C=he(R,f,M,w);return{...C,shapes:[...L,...C.shapes],issues:n}}var ye=require("lit"),ce=require("lit/decorators.js"),ze=require("lit/directives/if-defined.js");var Re={fromAttribute:()=>!1},X=class extends ye.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let a=this.drag;if(a?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[to(Xr(a.x,a.y,o,s))];return}if(a?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);a.points=[...a.points??[],{x:o,y:s}],this.overlay=[ro(a.points)];return}if(a?.grab==="edit"){if(!a.gantt)return;let{x:o}=this.viewBox(t,r);a.change=oo(r,a.gantt,o-a.x),this.overlay=[io(r,a.gantt,a.change)];return}if(a?.grab==="map"){if(!r.map||!a.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(co(r.map,a.view,o-a.x,s-a.y));return}if(a&&r.hit){if(a.grab==="pinch"){let[s,c]=[...this.pointers.values()];if(s===void 0||c===void 0||!a.distance)return;this.setZoom(fo(r.hit,a.zoom,Math.abs(s-c)/a.distance,(s+c)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(a.grab==="pan"?po(r.hit,a.zoom,o-a.x):go(r.hit,a.grab,a.zoom,o-a.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Xa(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=Qa(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ja(r,t.target)),this.syncId&&r.hit?.crosshair){let o=Tr(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:a,y:o}=this.viewBox(t,r),s=Hn(r,t.target)?.item.legend,c=this.canEdit(r)?ao(r,a,o):void 0;if(c){this.drag={x:a,y:o,zoom:{start:0,end:0},grab:"edit",gantt:c},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:a,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:a,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let d=r.map.plot;if(a<d.x||a>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:a,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,a),this.pointers.size===2){let[d,m]=[...this.pointers.values()];this.drag={x:(d+m)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(d-m)||1}}else{let d=bo(l,a,o);if(d)this.drag={x:a,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==l.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&a>=l.plot.x&&a<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:a,y:o,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let a=this.drag,o=this.layout;if(o&&(a?.grab==="select"||a?.grab==="lasso"||a?.grab==="edit"||a?.grab==="map")){this.overlay=[];let{x:s,y:c}=this.viewBox(t,o);if(Math.abs(s-a.x)>2||Math.abs(c-a.y)>2){a.grab==="select"?this.setSelected(eo(o,Xr(a.x,a.y,s,c))):a.grab==="lasso"?this.setSelected(no(o,a.points??[])):a.grab==="edit"&&a.change&&this.emit("skdx-task-change",a.change),this.drag={...a,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:a,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(a<l.x||a>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(lo(r.map,t.deltaY,a,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let c=ho(s,t.deltaY,a);c&&(t.preventDefault(),this.setZoom(c))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=Hn(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{if(t.key==="Escape"){t.preventDefault(),this.focused=null,this.clearTip(),this.crossState=null,this.highlight(null);return}let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let c=r.shapes[this.focused]?.item;c&&(t.preventDefault(),this.select(c),this.emit("skdx-item-click",c));return}let a=this.canEdit(r)?so(r,this.focused,t):void 0;if(a){t.preventDefault(),this.emit("skdx-task-change",a);return}let o=uo(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let s=o===null?void 0:r.shapes[o]?.item;this.highlight(s?Pn(s):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:a,tooltip:o,format:s,palette:c,loading:l,error:d,emptyMessage:m,description:h,decorative:f,animated:M,responsive:$,highlighted:g,highlightScope:w,accessibleTable:R}=this;return{...typeof $=="object"&&this.measured!==void 0&&this.measured<($.breakpoint??480)?$.compact:void 0,width:$&&this.measured?this.measured:t,height:r,animate:M,responsive:$,legend:a,tooltip:o,format:s,palette:c,loading:l,error:d,emptyMessage:m,description:h,decorative:f,highlighted:g===void 0?this.highlightState:g,highlightScope:w,accessibleTable:R,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&ir(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=ir(this.syncId),r=a=>{"highlighted"in a&&(this.highlightState=a.highlighted??null),a.selected&&(this.selectedState=a.selected,this.crossFilter&&(this.highlightState=a.selected.length?a.selected:null)),"zoom"in a&&(this.zoomState=a.zoom),a.hiddenSeries&&(this.hiddenState=a.hiddenSeries),"crosshair"in a&&(this.crossState=a.crosshair??null)};r(t.current),this.leave=t.subscribe((a,o)=>{o!==this.token&&r(a)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,a=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=a,this.emit("skdx-hidden-series-change",a),this.publish({hiddenSeries:a})}highlight(t){let r=this.hover;r===t||r&&t&&Ca(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.highlightState=t,this.syncId&&this.publish({highlighted:t}))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(La(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return or(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let a=r.shapes.findIndex(o=>o.item&&!o.item.legend&&wn(o.item,t));return a<0?!1:(this.getSvgElement()?.focus(),this.focused=a,!0)}export(t){let r=this.layout;return r?Or(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,a){this.join();let o=Oa(ba(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let w of o.issues??[])this.emit("skdx-data-issue",w)}let s=this.canZoom(o),c=this.canPan(o),l=this.canEdit(o),d=this.brushing(),m=s||c||l||d,h=!o.decorative&&Qr(o).length>0,f=ko(o),M=vo(o,this.accessibleTable),$=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||a,g=this.portal;return ye.html`<svg
|
|
3
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
4
5
|
viewBox="0 0 ${o.width} ${o.height}"
|
|
5
6
|
width=${o.width}
|
|
6
7
|
height=${o.height}
|
|
7
8
|
role=${o.decorative?"presentation":"img"}
|
|
8
|
-
aria-hidden=${o.decorative?"true":
|
|
9
|
-
aria-label=${o.decorative?
|
|
10
|
-
aria-
|
|
11
|
-
tabindex=${h?0:
|
|
9
|
+
aria-hidden=${o.decorative?"true":ye.nothing}
|
|
10
|
+
aria-label=${o.decorative?ye.nothing:a}
|
|
11
|
+
aria-description=${(0,ze.ifDefined)(o.description)}
|
|
12
|
+
tabindex=${h?0:ye.nothing}
|
|
12
13
|
data-skdx-chart=${r}
|
|
13
|
-
data-zoomable=${s||c?"":
|
|
14
|
-
data-brushing=${d&&!(s||c)?"":
|
|
15
|
-
data-editable=${l?"":
|
|
16
|
-
style=${
|
|
17
|
-
font-family=${
|
|
18
|
-
font-size=${
|
|
19
|
-
@pointermove=${o.tooltip||
|
|
14
|
+
data-zoomable=${s||c?"":ye.nothing}
|
|
15
|
+
data-brushing=${d&&!(s||c)?"":ye.nothing}
|
|
16
|
+
data-editable=${l?"":ye.nothing}
|
|
17
|
+
style=${f?`--skdx-chart-duration:${f}`:ye.nothing}
|
|
18
|
+
font-family=${K.fontFamily}
|
|
19
|
+
font-size=${K.fontSize}
|
|
20
|
+
@pointermove=${o.tooltip||m?this.onPointerMove:ye.nothing}
|
|
20
21
|
@pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
|
|
21
|
-
@pointerdown=${
|
|
22
|
-
@pointerup=${
|
|
23
|
-
@pointercancel=${
|
|
24
|
-
@wheel=${s||c?this.onWheel:
|
|
25
|
-
@dblclick=${s||c?()=>c?this.setView(void 0):this.setZoom(void 0):
|
|
22
|
+
@pointerdown=${m?this.onPointerDown:ye.nothing}
|
|
23
|
+
@pointerup=${m?this.onPointerUp:ye.nothing}
|
|
24
|
+
@pointercancel=${m?this.onPointerUp:ye.nothing}
|
|
25
|
+
@wheel=${s||c?this.onWheel:ye.nothing}
|
|
26
|
+
@dblclick=${s||c?()=>c?this.setView(void 0):this.setZoom(void 0):ye.nothing}
|
|
26
27
|
@click=${this.onClick}
|
|
27
|
-
@keydown=${h?this.onKeyDown:
|
|
28
|
+
@keydown=${h?this.onKeyDown:ye.nothing}
|
|
28
29
|
@blur=${()=>{this.focused=null,this.highlight(null)}}
|
|
29
30
|
>
|
|
30
31
|
<title>${a}</title>
|
|
31
|
-
${o.description?
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
32
|
+
${o.description?ye.svg`<desc>${o.description}</desc>`:ye.nothing}
|
|
33
|
+
${f?ye.svg`<style>${wo}</style>`:ye.nothing} ${Ll(o)}
|
|
34
|
+
${ea(o.shapes)}
|
|
35
|
+
${ea(this.tip.length||!this.crossState?this.tip:Ka(o,this.crossState))}
|
|
36
|
+
${ea(mo(o,this.focused))} ${ea(this.overlay)}
|
|
36
37
|
</svg>
|
|
37
|
-
${
|
|
38
|
+
${g?ye.html`<div
|
|
38
39
|
role="tooltip"
|
|
39
40
|
data-skdx-tooltip=${r}
|
|
40
|
-
style="left:${
|
|
41
|
+
style="left:${g.x+12}px;top:${g.y+12}px"
|
|
41
42
|
>
|
|
42
|
-
${
|
|
43
|
-
</div>`:
|
|
44
|
-
${
|
|
43
|
+
${g.lines.map(w=>ye.html`<div>${w}</div>`)}
|
|
44
|
+
</div>`:ye.nothing}
|
|
45
|
+
${M?ye.html`<table data-skdx-table=${r}>
|
|
45
46
|
<caption>
|
|
46
|
-
${
|
|
47
|
+
${$}
|
|
47
48
|
</caption>
|
|
48
49
|
<thead>
|
|
49
50
|
<tr>
|
|
50
|
-
${(
|
|
51
|
+
${(M[0]??[]).map(w=>ye.html`<th scope="col">${w}</th>`)}
|
|
51
52
|
</tr>
|
|
52
53
|
</thead>
|
|
53
54
|
<tbody>
|
|
54
|
-
${
|
|
55
|
-
${
|
|
55
|
+
${M.slice(1).map(w=>ye.html`<tr>
|
|
56
|
+
${w.map((R,k)=>k===0?ye.html`<th scope="row">${R}</th>`:ye.html`<td>${R}</td>`)}
|
|
56
57
|
</tr>`)}
|
|
57
58
|
</tbody>
|
|
58
|
-
</table>`:
|
|
59
|
+
</table>`:ye.nothing}`}};X.styles=ye.css`
|
|
59
60
|
:host {
|
|
60
61
|
display: inline-block;
|
|
61
62
|
}
|
|
@@ -63,7 +64,6 @@
|
|
|
63
64
|
display: block;
|
|
64
65
|
max-width: 100%;
|
|
65
66
|
height: auto;
|
|
66
|
-
outline: none;
|
|
67
67
|
}
|
|
68
68
|
svg[data-zoomable] {
|
|
69
69
|
cursor: grab;
|
|
@@ -78,6 +78,9 @@
|
|
|
78
78
|
}
|
|
79
79
|
:host([responsive]) {
|
|
80
80
|
display: block;
|
|
81
|
+
/* Keep centered flex/grid hosts independent of the previous SVG's intrinsic width. */
|
|
82
|
+
width: 100%;
|
|
83
|
+
min-width: 0;
|
|
81
84
|
}
|
|
82
85
|
table {
|
|
83
86
|
position: absolute;
|
|
@@ -97,7 +100,7 @@
|
|
|
97
100
|
background: var(--skdx-color-surface-raised);
|
|
98
101
|
color: var(--skdx-color-text-default);
|
|
99
102
|
border: 1px solid var(--skdx-color-border-strong);
|
|
100
|
-
border-radius:
|
|
103
|
+
border-radius: var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem));
|
|
101
104
|
padding: 4px 8px;
|
|
102
105
|
font-family: var(--skdx-font-family);
|
|
103
106
|
font-size: var(--skdx-font-size-xs);
|
|
@@ -106,4 +109,4 @@
|
|
|
106
109
|
[role='tooltip'] > :first-child:not(:only-child) {
|
|
107
110
|
font-weight: bold;
|
|
108
111
|
}
|
|
109
|
-
`,m([(0,se.property)({type:Number})],Q.prototype,"width",2),m([(0,se.property)({type:Number})],Q.prototype,"height",2),m([(0,se.property)()],Q.prototype,"label",2),m([(0,se.property)({type:Boolean,reflect:!0})],Q.prototype,"legend",2),m([(0,se.property)({type:Boolean,attribute:"no-tooltip",converter:Se})],Q.prototype,"tooltip",2),m([(0,se.property)({attribute:!1})],Q.prototype,"format",2),m([(0,se.property)({attribute:!1})],Q.prototype,"palette",2),m([(0,se.property)({attribute:!1})],Q.prototype,"hiddenSeries",2),m([(0,se.property)({attribute:!1})],Q.prototype,"selected",2),m([(0,se.property)({attribute:"selection-mode"})],Q.prototype,"selectionMode",2),m([(0,se.property)({attribute:!1})],Q.prototype,"highlighted",2),m([(0,se.property)({attribute:!1})],Q.prototype,"highlightScope",2),m([(0,se.property)({type:Boolean,reflect:!0})],Q.prototype,"loading",2),m([(0,se.property)()],Q.prototype,"error",2),m([(0,se.property)({attribute:"empty-message"})],Q.prototype,"emptyMessage",2),m([(0,se.property)()],Q.prototype,"description",2),m([(0,se.property)({type:Boolean,reflect:!0})],Q.prototype,"decorative",2),m([(0,se.property)({type:Boolean,attribute:"accessible-table"})],Q.prototype,"accessibleTable",2),m([(0,se.property)({attribute:!1})],Q.prototype,"zoom",2),m([(0,se.property)({attribute:!1})],Q.prototype,"view",2),m([(0,se.property)({type:Boolean,reflect:!0})],Q.prototype,"zoomable",2),m([(0,se.property)({type:Boolean,reflect:!0})],Q.prototype,"editable",2),m([(0,se.property)({attribute:"sync-id"})],Q.prototype,"syncId",2),m([(0,se.property)({type:Boolean,attribute:"cross-filter"})],Q.prototype,"crossFilter",2),m([(0,se.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],Q.prototype,"animated",2),m([(0,se.property)({type:Boolean,reflect:!0})],Q.prototype,"responsive",2),m([(0,se.state)()],Q.prototype,"tip",2),m([(0,se.state)()],Q.prototype,"overlay",2),m([(0,se.state)()],Q.prototype,"portal",2),m([(0,se.state)()],Q.prototype,"measured",2),m([(0,se.state)()],Q.prototype,"viewState",2),m([(0,se.state)()],Q.prototype,"highlightState",2),m([(0,se.state)()],Q.prototype,"crossState",2),m([(0,se.state)()],Q.prototype,"focused",2),m([(0,se.state)()],Q.prototype,"hiddenState",2),m([(0,se.state)()],Q.prototype,"zoomState",2),m([(0,se.state)()],Q.prototype,"selectedState",2);var Ie=class extends Q{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:a,yAxis:o,rightAxis:s,references:c,annotations:l,labels:d,curve:u,connectNulls:h,nulls:f,stacked:x,stackOffset:v,orientation:g,radius:A,barGap:E,barWidth:b,sort:N,transform:L,transforms:w,bins:M,binWidth:R,binDomain:C,binMode:I,sampling:D,brush:F,crosshair:p}=this;return{...this.sized(),series:t,categories:r,xAxis:a,yAxis:o,rightAxis:s,references:c,annotations:l,labels:d,curve:u,connectNulls:h,nulls:f,stacked:x,stackOffset:v,orientation:g,radius:A,barGap:E,barWidth:b,sort:N,transform:L,transforms:w,bins:M,binWidth:R,binDomain:C,binMode:I,sampling:D,brush:F,crosshair:p}}};m([(0,se.property)({attribute:!1})],Ie.prototype,"series",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"categories",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"xAxis",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"yAxis",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"rightAxis",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"references",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"annotations",2),m([(0,se.property)({type:Boolean,reflect:!0})],Ie.prototype,"labels",2),m([(0,se.property)()],Ie.prototype,"curve",2),m([(0,se.property)({type:Boolean,attribute:"connect-nulls"})],Ie.prototype,"connectNulls",2),m([(0,se.property)()],Ie.prototype,"nulls",2),m([(0,se.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],Ie.prototype,"stacked",2),m([(0,se.property)({attribute:"stack-offset"})],Ie.prototype,"stackOffset",2),m([(0,se.property)()],Ie.prototype,"orientation",2),m([(0,se.property)({type:Number})],Ie.prototype,"radius",2),m([(0,se.property)({type:Number,attribute:"bar-gap"})],Ie.prototype,"barGap",2),m([(0,se.property)({type:Number,attribute:"bar-width"})],Ie.prototype,"barWidth",2),m([(0,se.property)()],Ie.prototype,"sort",2),m([(0,se.property)()],Ie.prototype,"transform",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"transforms",2),m([(0,se.property)({type:Number})],Ie.prototype,"bins",2),m([(0,se.property)({type:Number,attribute:"bin-width"})],Ie.prototype,"binWidth",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"binDomain",2),m([(0,se.property)({attribute:"bin-mode"})],Ie.prototype,"binMode",2),m([(0,se.property)({attribute:!1})],Ie.prototype,"sampling",2),m([(0,se.property)({type:Boolean,reflect:!0})],Ie.prototype,"brush",2),m([(0,se.property)({type:Boolean,reflect:!0})],Ie.prototype,"crosshair",2);var Ml=e=>e.defs&&e.defs.length?ge.svg`<defs>${e.defs.map(n=>ge.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>ge.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,Ne.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:ge.nothing,Xr=e=>ge.svg`${e.map((n,t)=>{let r=n.title?ge.svg`<title>${n.title}</title>`:ge.nothing,a=n.item?t:void 0;switch(n.kind){case"path":return ge.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,Ne.ifDefined)(a)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,Ne.ifDefined)(n.stroke)} stroke-width=${(0,Ne.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,Ne.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,Ne.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,Ne.ifDefined)(n.dash)} opacity=${(0,Ne.ifDefined)(n.opacity)} fill-opacity=${(0,Ne.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return ge.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,Ne.ifDefined)(a)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,Ne.ifDefined)(n.rx)} fill=${n.fill} stroke=${(0,Ne.ifDefined)(n.stroke)} fill-opacity=${(0,Ne.ifDefined)(n.opacity)}>${r}</rect>`;case"line":return ge.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,Ne.ifDefined)(a)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,Ne.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,Ne.ifDefined)(n.dash)} opacity=${(0,Ne.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return ge.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,Ne.ifDefined)(a)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,Ne.ifDefined)(n.stroke)} opacity=${(0,Ne.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return ge.svg`<text data-skdx-part=${n.part} data-skdx-i=${(0,Ne.ifDefined)(a)} x=${n.x} y=${n.y} text-anchor=${(0,Ne.ifDefined)(n.anchor)} dominant-baseline=${(0,Ne.ifDefined)(n.baseline)} fill=${(0,Ne.ifDefined)(n.fill)} font-weight=${(0,Ne.ifDefined)(n.weight)} pointer-events=${(0,Ne.ifDefined)(a===void 0?"none":void 0)} transform=${(0,Ne.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var sr=class extends Ie{render(){return this.root(ya(this.input()),"bar",this.label??"Bar chart")}};sr=m([(0,Js.customElement)("skdx-bar-chart")],sr);var ei=require("lit/decorators.js");var ir=class extends Ie{render(){return this.root(va(this.input()),"line",this.label??"Line chart")}};ir=m([(0,ei.customElement)("skdx-line-chart")],ir);var ti=require("lit/decorators.js");var lr=class extends Ie{render(){return this.root(Ma(this.input()),"area",this.label??"Area chart")}};lr=m([(0,ti.customElement)("skdx-area-chart")],lr);var Rt=require("lit/decorators.js");var it=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,variant:r,innerRadius:a,outerRadius:o,labels:s,labelPosition:c,padAngle:l,sort:d,startAngle:u,endAngle:h,centerLabel:f}=this;return this.root(Aa({...this.sized(),data:t,variant:r,innerRadius:a,outerRadius:o,labels:s,labelPosition:c,padAngle:l,sort:d,startAngle:u,endAngle:h,centerLabel:f}),"pie",this.label??"Pie chart")}};m([(0,Rt.property)({attribute:!1})],it.prototype,"data",2),m([(0,Rt.property)()],it.prototype,"variant",2),m([(0,Rt.property)({type:Number,attribute:"inner-radius"})],it.prototype,"innerRadius",2),m([(0,Rt.property)({type:Number,attribute:"outer-radius"})],it.prototype,"outerRadius",2),m([(0,Rt.property)({type:Boolean,reflect:!0})],it.prototype,"labels",2),m([(0,Rt.property)({attribute:"label-position"})],it.prototype,"labelPosition",2),m([(0,Rt.property)({type:Number,attribute:"pad-angle"})],it.prototype,"padAngle",2),m([(0,Rt.property)()],it.prototype,"sort",2),m([(0,Rt.property)({type:Number,attribute:"start-angle"})],it.prototype,"startAngle",2),m([(0,Rt.property)({type:Number,attribute:"end-angle"})],it.prototype,"endAngle",2),m([(0,Rt.property)({attribute:"center-label"})],it.prototype,"centerLabel",2),it=m([(0,Rt.customElement)("skdx-pie-chart")],it);var ht=require("lit/decorators.js");var Xe=class extends Q{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,references:c,annotations:l,colorScale:d,colorLegend:u,hitRadius:h,jitter:f,trendline:x,sampling:v}=this;return this.root(ba({...this.sized(),series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,references:c,annotations:l,colorScale:d,colorLegend:u,hitRadius:h,jitter:f,trendline:x,sampling:v}),"scatter",this.label??"Scatter chart")}};m([(0,ht.property)({attribute:!1})],Xe.prototype,"series",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"sizeRange",2),m([(0,ht.property)({type:Boolean,reflect:!0})],Xe.prototype,"labels",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"xAxis",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"yAxis",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"references",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"annotations",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"colorScale",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"colorLegend",2),m([(0,ht.property)({type:Number,attribute:"hit-radius"})],Xe.prototype,"hitRadius",2),m([(0,ht.property)({type:Number})],Xe.prototype,"jitter",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"trendline",2),m([(0,ht.property)({attribute:!1})],Xe.prototype,"sampling",2),Xe=m([(0,ht.customElement)("skdx-scatter-chart")],Xe);var _t=require("lit/decorators.js");var ft=class extends Q{constructor(){super(...arguments);this.data=[];this.trend=!1;this.extremes=!1;this.lastValue=!1}render(){let{data:t,color:r,curve:a,variant:o,trend:s,extremes:c,lastValue:l,target:d,band:u,markers:h}=this;return this.root(Ca({...this.sized(),data:t,color:r,curve:a,variant:o,trend:s,extremes:c,lastValue:l,target:d,band:u,markers:h}),"sparkline",this.label??"Sparkline")}};m([(0,_t.property)({attribute:!1})],ft.prototype,"data",2),m([(0,_t.property)()],ft.prototype,"color",2),m([(0,_t.property)()],ft.prototype,"curve",2),m([(0,_t.property)()],ft.prototype,"variant",2),m([(0,_t.property)({type:Boolean,reflect:!0})],ft.prototype,"trend",2),m([(0,_t.property)({type:Boolean,reflect:!0})],ft.prototype,"extremes",2),m([(0,_t.property)({type:Boolean,reflect:!0,attribute:"last-value"})],ft.prototype,"lastValue",2),m([(0,_t.property)({type:Number})],ft.prototype,"target",2),m([(0,_t.property)({attribute:!1})],ft.prototype,"band",2),m([(0,_t.property)({attribute:!1})],ft.prototype,"markers",2),ft=m([(0,_t.customElement)("skdx-sparkline")],ft);var yt=require("lit/decorators.js");var tt=class extends Q{constructor(){super(...arguments);this.series=[];this.fill=!0;this.markers=!0;this.labels=!1}render(){let{series:t,categories:r,metrics:a,normalized:o,max:s,fill:c,levels:l,markers:d,markerSize:u,labels:h,startAngle:f,gridShape:x}=this;return this.root(La({...this.sized(),series:t,categories:r,metrics:a,normalize:o,max:s,fill:c,levels:l,markers:d,markerSize:u,labels:h,startAngle:f,gridShape:x}),"radar",this.label??"Radar chart")}};m([(0,yt.property)({attribute:!1})],tt.prototype,"series",2),m([(0,yt.property)({attribute:!1})],tt.prototype,"categories",2),m([(0,yt.property)({attribute:!1})],tt.prototype,"metrics",2),m([(0,yt.property)({attribute:!1})],tt.prototype,"normalized",2),m([(0,yt.property)({type:Number})],tt.prototype,"max",2),m([(0,yt.property)({type:Boolean,attribute:"no-fill",converter:Se})],tt.prototype,"fill",2),m([(0,yt.property)({type:Number})],tt.prototype,"levels",2),m([(0,yt.property)({type:Boolean,attribute:"no-markers",converter:Se})],tt.prototype,"markers",2),m([(0,yt.property)({type:Number,attribute:"marker-size"})],tt.prototype,"markerSize",2),m([(0,yt.property)({type:Boolean,reflect:!0})],tt.prototype,"labels",2),m([(0,yt.property)({type:Number,attribute:"start-angle"})],tt.prototype,"startAngle",2),m([(0,yt.property)({attribute:"grid-shape"})],tt.prototype,"gridShape",2),tt=m([(0,yt.customElement)("skdx-radar-chart")],tt);var _e=require("lit/decorators.js");var Be=class extends Q{constructor(){super(...arguments);this.diverging=!1;this.labels=!1}render(){let{rows:t,columns:r,data:a,calendar:o,color:s,diverging:c,negativeColor:l,labels:d,domain:u,steps:h,weekStart:f,colorScale:x,colorLegend:v,missingColor:g,cellGap:A,cellRadius:E,rowOrder:b,columnOrder:N}=this;return this.root(za({...this.sized(),rows:t,columns:r,data:a,calendar:o,color:s,diverging:c,negativeColor:l,labels:d,domain:u,steps:h,weekStart:f,colorScale:x,colorLegend:v,missingColor:g,cellGap:A,cellRadius:E,rowOrder:b,columnOrder:N}),"heatmap",this.label??"Heatmap")}};m([(0,_e.property)({attribute:!1})],Be.prototype,"rows",2),m([(0,_e.property)({attribute:!1})],Be.prototype,"columns",2),m([(0,_e.property)({attribute:!1})],Be.prototype,"data",2),m([(0,_e.property)({attribute:!1})],Be.prototype,"calendar",2),m([(0,_e.property)()],Be.prototype,"color",2),m([(0,_e.property)({type:Boolean,reflect:!0})],Be.prototype,"diverging",2),m([(0,_e.property)({attribute:"negative-color"})],Be.prototype,"negativeColor",2),m([(0,_e.property)({type:Boolean,reflect:!0})],Be.prototype,"labels",2),m([(0,_e.property)({attribute:!1})],Be.prototype,"domain",2),m([(0,_e.property)({type:Number})],Be.prototype,"steps",2),m([(0,_e.property)({attribute:"week-start"})],Be.prototype,"weekStart",2),m([(0,_e.property)({attribute:!1})],Be.prototype,"colorScale",2),m([(0,_e.property)({attribute:!1})],Be.prototype,"colorLegend",2),m([(0,_e.property)({attribute:"missing-color"})],Be.prototype,"missingColor",2),m([(0,_e.property)({type:Number,attribute:"cell-gap"})],Be.prototype,"cellGap",2),m([(0,_e.property)({type:Number,attribute:"cell-radius"})],Be.prototype,"cellRadius",2),m([(0,_e.property)({attribute:"row-order"})],Be.prototype,"rowOrder",2),m([(0,_e.property)({attribute:"column-order"})],Be.prototype,"columnOrder",2),Be=m([(0,_e.customElement)("skdx-heatmap")],Be);var Ln=require("lit/decorators.js");var Ut=class extends Q{constructor(){super(...arguments);this.data=[]}render(){let{data:t,orientation:r,variant:a,gap:o,labelPosition:s,sort:c}=this;return this.root(Na({...this.sized(),data:t,orientation:r,variant:a,gap:o,labelPosition:s,sort:c}),"funnel",this.label??"Funnel chart")}};m([(0,Ln.property)({attribute:!1})],Ut.prototype,"data",2),m([(0,Ln.property)()],Ut.prototype,"orientation",2),m([(0,Ln.property)()],Ut.prototype,"variant",2),m([(0,Ln.property)({type:Number})],Ut.prototype,"gap",2),m([(0,Ln.property)({attribute:"label-position"})],Ut.prototype,"labelPosition",2),m([(0,Ln.property)()],Ut.prototype,"sort",2),Ut=m([(0,Ln.customElement)("skdx-funnel-chart")],Ut);var jt=require("lit/decorators.js");var pt=class extends Q{constructor(){super(...arguments);this.links=[];this.nodeLabels=!0;this.linkLabels=!1}render(){let{links:t,nodes:r,align:a,nodeWidth:o,nodePadding:s,nodeSort:c,linkSort:l,nodeLabels:d,linkLabels:u,cyclePolicy:h}=this;return this.root(vo({...this.sized(),links:t,nodes:r,align:a,nodeWidth:o,nodePadding:s,nodeSort:c,linkSort:l,nodeLabels:d,linkLabels:u,cyclePolicy:h}),"sankey",this.label??"Sankey chart")}};m([(0,jt.property)({attribute:!1})],pt.prototype,"links",2),m([(0,jt.property)({attribute:!1})],pt.prototype,"nodes",2),m([(0,jt.property)()],pt.prototype,"align",2),m([(0,jt.property)({type:Number,attribute:"node-width"})],pt.prototype,"nodeWidth",2),m([(0,jt.property)({type:Number,attribute:"node-padding"})],pt.prototype,"nodePadding",2),m([(0,jt.property)({attribute:"node-sort"})],pt.prototype,"nodeSort",2),m([(0,jt.property)({attribute:"link-sort"})],pt.prototype,"linkSort",2),m([(0,jt.property)({type:Boolean,attribute:"no-node-labels",converter:Se})],pt.prototype,"nodeLabels",2),m([(0,jt.property)({type:Boolean,reflect:!0,attribute:"link-labels"})],pt.prototype,"linkLabels",2),m([(0,jt.property)({attribute:"cycle-policy"})],pt.prototype,"cyclePolicy",2),pt=m([(0,jt.customElement)("skdx-sankey-chart")],pt);var Yt=require("lit/decorators.js");var vt=class extends Q{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,rootId:r,breadcrumbs:a,maxDepth:o,sort:s,padding:c,tiling:l,colorScale:d,labels:u}=this;return this.root(wo({...this.sized(),data:t,rootId:r,breadcrumbs:a,maxDepth:o,sort:s,padding:c,tiling:l,colorScale:d,labels:u}),"treemap",this.label??"Treemap")}};m([(0,Yt.property)({attribute:!1})],vt.prototype,"data",2),m([(0,Yt.property)({attribute:!1})],vt.prototype,"rootId",2),m([(0,Yt.property)({type:Boolean,reflect:!0})],vt.prototype,"breadcrumbs",2),m([(0,Yt.property)({type:Number,attribute:"max-depth"})],vt.prototype,"maxDepth",2),m([(0,Yt.property)()],vt.prototype,"sort",2),m([(0,Yt.property)({type:Number})],vt.prototype,"padding",2),m([(0,Yt.property)()],vt.prototype,"tiling",2),m([(0,Yt.property)({attribute:!1})],vt.prototype,"colorScale",2),m([(0,Yt.property)({type:Boolean,attribute:"no-labels",converter:Se})],vt.prototype,"labels",2),vt=m([(0,Yt.customElement)("skdx-treemap")],vt);var Et=require("lit/decorators.js");var lt=class extends Q{constructor(){super(...arguments);this.data=[];this.brush=!1;this.crosshair=!1}render(){let{data:t,scale:r,variant:a,xAxis:o,references:s,annotations:c,overlays:l,upColor:d,downColor:u,brush:h,crosshair:f}=this;return this.root($o({...this.sized(),data:t,scale:r,variant:a,xAxis:o,references:s,annotations:c,overlays:l,upColor:d,downColor:u,brush:h,crosshair:f}),"candlestick",this.label??"Candlestick chart")}};m([(0,Et.property)({attribute:!1})],lt.prototype,"data",2),m([(0,Et.property)()],lt.prototype,"scale",2),m([(0,Et.property)()],lt.prototype,"variant",2),m([(0,Et.property)({attribute:!1})],lt.prototype,"xAxis",2),m([(0,Et.property)({attribute:!1})],lt.prototype,"references",2),m([(0,Et.property)({attribute:!1})],lt.prototype,"annotations",2),m([(0,Et.property)({attribute:!1})],lt.prototype,"overlays",2),m([(0,Et.property)({attribute:"up-color"})],lt.prototype,"upColor",2),m([(0,Et.property)({attribute:"down-color"})],lt.prototype,"downColor",2),m([(0,Et.property)({type:Boolean,reflect:!0})],lt.prototype,"brush",2),m([(0,Et.property)({type:Boolean,reflect:!0})],lt.prototype,"crosshair",2),lt=m([(0,Et.customElement)("skdx-candlestick-chart")],lt);var Gt=require("lit/decorators.js");var bt=class extends Q{constructor(){super(...arguments);this.data=[];this.connectors=!0;this.labels=!1}render(){let{data:t,total:r,start:a,startLabel:o,orientation:s,connectors:c,labels:l,positiveColor:d,negativeColor:u,totalColor:h}=this;return this.root(ko({...this.sized(),data:t,total:r,start:a,startLabel:o,orientation:s,connectors:c,labels:l,positiveColor:d,negativeColor:u,totalColor:h}),"waterfall",this.label??"Waterfall chart")}};m([(0,Gt.property)({attribute:!1})],bt.prototype,"data",2),m([(0,Gt.property)()],bt.prototype,"total",2),m([(0,Gt.property)({type:Number})],bt.prototype,"start",2),m([(0,Gt.property)({attribute:"start-label"})],bt.prototype,"startLabel",2),m([(0,Gt.property)()],bt.prototype,"orientation",2),m([(0,Gt.property)({type:Boolean,attribute:"no-connectors",converter:Se})],bt.prototype,"connectors",2),m([(0,Gt.property)({type:Boolean,reflect:!0})],bt.prototype,"labels",2),m([(0,Gt.property)({attribute:"positive-color"})],bt.prototype,"positiveColor",2),m([(0,Gt.property)({attribute:"negative-color"})],bt.prototype,"negativeColor",2),m([(0,Gt.property)({attribute:"total-color"})],bt.prototype,"totalColor",2),bt=m([(0,Gt.customElement)("skdx-waterfall-chart")],bt);var On=require("lit/decorators.js");var Kt=class extends Q{constructor(){super(...arguments);this.tasks=[];this.criticalPath=!1}render(){let{tasks:t,references:r,annotations:a,today:o,criticalPath:s,xAxis:c}=this;return this.root(Io({...this.sized(),tasks:t,references:r,annotations:a,today:o,criticalPath:s,xAxis:c}),"gantt",this.label??"Gantt chart")}};m([(0,On.property)({attribute:!1})],Kt.prototype,"tasks",2),m([(0,On.property)({attribute:!1})],Kt.prototype,"references",2),m([(0,On.property)({attribute:!1})],Kt.prototype,"annotations",2),m([(0,On.property)({attribute:!1})],Kt.prototype,"today",2),m([(0,On.property)({type:Boolean,reflect:!0,attribute:"critical-path"})],Kt.prototype,"criticalPath",2),m([(0,On.property)({attribute:!1})],Kt.prototype,"xAxis",2),Kt=m([(0,On.customElement)("skdx-gantt-chart")],Kt);var Xt=require("lit/decorators.js");var Mt=class extends Q{constructor(){super(...arguments);this.series=[];this.mean=!1;this.points=!1;this.notched=!1}render(){let{series:t,orientation:r,quartileMethod:a,whisker:o,mean:s,points:c,notched:l,categories:d,yAxis:u}=this;return this.root(Ao({...this.sized(),series:t,orientation:r,quartileMethod:a,whisker:o,mean:s,points:c,notched:l,categories:d,yAxis:u}),"boxplot",this.label??"Box plot")}};m([(0,Xt.property)({attribute:!1})],Mt.prototype,"series",2),m([(0,Xt.property)()],Mt.prototype,"orientation",2),m([(0,Xt.property)({attribute:"quartile-method"})],Mt.prototype,"quartileMethod",2),m([(0,Xt.property)({type:Number})],Mt.prototype,"whisker",2),m([(0,Xt.property)({type:Boolean,reflect:!0})],Mt.prototype,"mean",2),m([(0,Xt.property)({type:Boolean,reflect:!0})],Mt.prototype,"points",2),m([(0,Xt.property)({type:Boolean,reflect:!0})],Mt.prototype,"notched",2),m([(0,Xt.property)({attribute:!1})],Mt.prototype,"categories",2),m([(0,Xt.property)({attribute:!1})],Mt.prototype,"yAxis",2),Mt=m([(0,Xt.customElement)("skdx-boxplot")],Mt);var wt=require("lit/decorators.js");var nt=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1;this.breadcrumbs=!1}render(){let{data:t,innerRadius:r,centerLabel:a,labels:o,rootId:s,breadcrumbs:c,maxDepth:l,sort:d,startAngle:u,endAngle:h,padAngle:f,colorScale:x}=this;return this.root(Lo({...this.sized(),data:t,innerRadius:r,centerLabel:a,labels:o,rootId:s,breadcrumbs:c,maxDepth:l,sort:d,startAngle:u,endAngle:h,padAngle:f,colorScale:x}),"sunburst",this.label??"Sunburst chart")}};m([(0,wt.property)({attribute:!1})],nt.prototype,"data",2),m([(0,wt.property)({type:Number,attribute:"inner-radius"})],nt.prototype,"innerRadius",2),m([(0,wt.property)({attribute:"center-label"})],nt.prototype,"centerLabel",2),m([(0,wt.property)({type:Boolean,reflect:!0})],nt.prototype,"labels",2),m([(0,wt.property)({attribute:!1})],nt.prototype,"rootId",2),m([(0,wt.property)({type:Boolean,reflect:!0})],nt.prototype,"breadcrumbs",2),m([(0,wt.property)({type:Number,attribute:"max-depth"})],nt.prototype,"maxDepth",2),m([(0,wt.property)()],nt.prototype,"sort",2),m([(0,wt.property)({type:Number,attribute:"start-angle"})],nt.prototype,"startAngle",2),m([(0,wt.property)({type:Number,attribute:"end-angle"})],nt.prototype,"endAngle",2),m([(0,wt.property)({type:Number,attribute:"pad-angle"})],nt.prototype,"padAngle",2),m([(0,wt.property)({attribute:!1})],nt.prototype,"colorScale",2),nt=m([(0,wt.customElement)("skdx-sunburst-chart")],nt);var Hn=require("lit/decorators.js");var mn=class extends Q{render(){let{names:n,matrix:t,links:r,padding:a,sort:o}=this;return this.root(Oo({...this.sized(),names:n,matrix:t,links:r,padding:a,sort:o}),"chord",this.label??"Chord chart")}};m([(0,Hn.property)({attribute:!1})],mn.prototype,"names",2),m([(0,Hn.property)({attribute:!1})],mn.prototype,"matrix",2),m([(0,Hn.property)({attribute:!1})],mn.prototype,"links",2),m([(0,Hn.property)({type:Number})],mn.prototype,"padding",2),m([(0,Hn.property)()],mn.prototype,"sort",2),mn=m([(0,Hn.customElement)("skdx-chord-chart")],mn);var Qt=require("lit/decorators.js");var $t=class extends Q{constructor(){super(...arguments);this.features=[];this.labels=!1}render(){let{features:t,color:r,colorScale:a,colorLegend:o,projection:s,points:c,lines:l,sizeRange:d,labels:u}=this;return this.root(zo({...this.sized(),features:t,color:r,colorScale:a,colorLegend:o,projection:s,points:c,lines:l,sizeRange:d,labels:u}),"map",this.label??"Map")}};m([(0,Qt.property)({attribute:!1})],$t.prototype,"features",2),m([(0,Qt.property)()],$t.prototype,"color",2),m([(0,Qt.property)({attribute:!1})],$t.prototype,"colorScale",2),m([(0,Qt.property)({attribute:!1})],$t.prototype,"colorLegend",2),m([(0,Qt.property)()],$t.prototype,"projection",2),m([(0,Qt.property)({attribute:!1})],$t.prototype,"points",2),m([(0,Qt.property)({attribute:!1})],$t.prototype,"lines",2),m([(0,Qt.property)({attribute:!1})],$t.prototype,"sizeRange",2),m([(0,Qt.property)({type:Boolean,reflect:!0})],$t.prototype,"labels",2),$t=m([(0,Qt.customElement)("skdx-map-chart")],$t);var kt=require("lit/decorators.js");var rt=class extends Q{constructor(){super(...arguments);this.data=[];this.track=!0;this.rounded=!0;this.labels=!1}render(){let{data:t,max:r,startAngle:a,endAngle:o,innerRadius:s,gap:c,track:l,rounded:d,labels:u,bands:h,target:f,centerLabel:x}=this;return this.root(Ra({...this.sized(),data:t,max:r,startAngle:a,endAngle:o,innerRadius:s,gap:c,track:l,rounded:d,labels:u,bands:h,target:f,centerLabel:x}),"radial",this.label??"Radial bar chart")}};m([(0,kt.property)({attribute:!1})],rt.prototype,"data",2),m([(0,kt.property)({type:Number})],rt.prototype,"max",2),m([(0,kt.property)({type:Number,attribute:"start-angle"})],rt.prototype,"startAngle",2),m([(0,kt.property)({type:Number,attribute:"end-angle"})],rt.prototype,"endAngle",2),m([(0,kt.property)({type:Number,attribute:"inner-radius"})],rt.prototype,"innerRadius",2),m([(0,kt.property)({type:Number})],rt.prototype,"gap",2),m([(0,kt.property)({type:Boolean,attribute:"no-track",converter:Se})],rt.prototype,"track",2),m([(0,kt.property)({type:Boolean,attribute:"no-rounded",converter:Se})],rt.prototype,"rounded",2),m([(0,kt.property)({type:Boolean,reflect:!0})],rt.prototype,"labels",2),m([(0,kt.property)({attribute:!1})],rt.prototype,"bands",2),m([(0,kt.property)({type:Number})],rt.prototype,"target",2),m([(0,kt.property)({attribute:"center-label"})],rt.prototype,"centerLabel",2),rt=m([(0,kt.customElement)("skdx-radial-bar-chart")],rt);var gt=require("lit/decorators.js");var Qe=class extends Q{constructor(){super(...arguments);this.value=Number.NaN;this.tickLabels=!0}render(){let{value:t,min:r,max:a,variant:o,startAngle:s,endAngle:c,thickness:l,bands:d,target:u,ticks:h,tickLabels:f,centerLabel:x,caption:v}=this;return this.root(Ea({...this.sized(),value:t,min:r,max:a,variant:o,startAngle:s,endAngle:c,thickness:l,bands:d,target:u,ticks:h,tickLabels:f,centerLabel:x,caption:v}),"gauge",this.label??"Gauge chart")}};m([(0,gt.property)({type:Number})],Qe.prototype,"value",2),m([(0,gt.property)({type:Number})],Qe.prototype,"min",2),m([(0,gt.property)({type:Number})],Qe.prototype,"max",2),m([(0,gt.property)()],Qe.prototype,"variant",2),m([(0,gt.property)({type:Number,attribute:"start-angle"})],Qe.prototype,"startAngle",2),m([(0,gt.property)({type:Number,attribute:"end-angle"})],Qe.prototype,"endAngle",2),m([(0,gt.property)({type:Number})],Qe.prototype,"thickness",2),m([(0,gt.property)({attribute:!1})],Qe.prototype,"bands",2),m([(0,gt.property)({type:Number})],Qe.prototype,"target",2),m([(0,gt.property)({attribute:!1})],Qe.prototype,"ticks",2),m([(0,gt.property)({type:Boolean,attribute:"no-tick-labels",converter:Se})],Qe.prototype,"tickLabels",2),m([(0,gt.property)({attribute:"center-label"})],Qe.prototype,"centerLabel",2),m([(0,gt.property)()],Qe.prototype,"caption",2),Qe=m([(0,gt.customElement)("skdx-gauge-chart")],Qe);var ct=require("lit/decorators.js");var qe=class extends Q{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,zAxis:c,references:l,annotations:d,colorScale:u,colorLegend:h,hitRadius:f,jitter:x,trendline:v,sampling:g}=this;return this.root(Da({...this.sized(),series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,zAxis:c,references:l,annotations:d,colorScale:u,colorLegend:h,hitRadius:f,jitter:x,trendline:v,sampling:g}),"bubble",this.label??"Bubble chart")}};m([(0,ct.property)({attribute:!1})],qe.prototype,"series",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"sizeRange",2),m([(0,ct.property)({type:Boolean,reflect:!0})],qe.prototype,"labels",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"xAxis",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"yAxis",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"zAxis",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"references",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"annotations",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"colorScale",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"colorLegend",2),m([(0,ct.property)({type:Number,attribute:"hit-radius"})],qe.prototype,"hitRadius",2),m([(0,ct.property)({type:Number})],qe.prototype,"jitter",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"trendline",2),m([(0,ct.property)({attribute:!1})],qe.prototype,"sampling",2),qe=m([(0,ct.customElement)("skdx-bubble-chart")],qe);var dt=require("lit/decorators.js");var Ue=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,name:r,color:a,bins:o,binWidth:s,thresholds:c,domain:l,mode:d,xAxis:u,yAxis:h,references:f,annotations:x,labels:v,barGap:g}=this;return this.root(Ba({...this.sized(),data:t,name:r,color:a,bins:o,binWidth:s,thresholds:c,domain:l,mode:d,xAxis:u,yAxis:h,references:f,annotations:x,labels:v,barGap:g}),"histogram",this.label??"Histogram")}};m([(0,dt.property)({attribute:!1})],Ue.prototype,"data",2),m([(0,dt.property)()],Ue.prototype,"name",2),m([(0,dt.property)()],Ue.prototype,"color",2),m([(0,dt.property)({type:Number})],Ue.prototype,"bins",2),m([(0,dt.property)({type:Number,attribute:"bin-width"})],Ue.prototype,"binWidth",2),m([(0,dt.property)({attribute:!1})],Ue.prototype,"thresholds",2),m([(0,dt.property)({attribute:!1})],Ue.prototype,"domain",2),m([(0,dt.property)()],Ue.prototype,"mode",2),m([(0,dt.property)({attribute:!1})],Ue.prototype,"xAxis",2),m([(0,dt.property)({attribute:!1})],Ue.prototype,"yAxis",2),m([(0,dt.property)({attribute:!1})],Ue.prototype,"references",2),m([(0,dt.property)({attribute:!1})],Ue.prototype,"annotations",2),m([(0,dt.property)({type:Boolean,reflect:!0})],Ue.prototype,"labels",2),m([(0,dt.property)({type:Number,attribute:"bar-gap"})],Ue.prototype,"barGap",2),Ue=m([(0,dt.customElement)("skdx-histogram")],Ue);var Mn=require("lit/decorators.js");var Wt=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,orientation:r,ranges:a,min:o,max:s,labels:c,ticks:l}=this;return this.root(wr({...this.sized(),data:t,orientation:r,ranges:a,min:o,max:s,labels:c,ticks:l}),"bullet",this.label??"Bullet chart")}};m([(0,Mn.property)({attribute:!1})],Wt.prototype,"data",2),m([(0,Mn.property)()],Wt.prototype,"orientation",2),m([(0,Mn.property)({attribute:!1})],Wt.prototype,"ranges",2),m([(0,Mn.property)({type:Number})],Wt.prototype,"min",2),m([(0,Mn.property)({type:Number})],Wt.prototype,"max",2),m([(0,Mn.property)({type:Boolean,reflect:!0})],Wt.prototype,"labels",2),m([(0,Mn.property)({type:Number})],Wt.prototype,"ticks",2),Wt=m([(0,Mn.customElement)("skdx-bullet-chart")],Wt);var ni=require("lit/decorators.js");var cr=class extends Ie{render(){return this.root(Fa(this.input()),"combo",this.label??"Combo chart")}};cr=m([(0,ni.customElement)("skdx-combo-chart")],cr);var Je=require("lit/decorators.js");var Pe=class extends Q{constructor(){super(...arguments);this.series=[];this.connectNulls=!1;this.brush=!1;this.crosshair=!1}render(){let{series:t,variant:r,categories:a,xAxis:o,yAxis:s,rightAxis:c,references:l,annotations:d,curve:u,connectNulls:h,orientation:f,radius:x,barGap:v,barWidth:g,brush:A,crosshair:E}=this;return this.root(Pa({...this.sized(),series:t,variant:r,categories:a,xAxis:o,yAxis:s,rightAxis:c,references:l,annotations:d,curve:u,connectNulls:h,orientation:f,radius:x,barGap:v,barWidth:g,brush:A,crosshair:E}),"range",this.label??"Range chart")}};m([(0,Je.property)({attribute:!1})],Pe.prototype,"series",2),m([(0,Je.property)()],Pe.prototype,"variant",2),m([(0,Je.property)({attribute:!1})],Pe.prototype,"categories",2),m([(0,Je.property)({attribute:!1})],Pe.prototype,"xAxis",2),m([(0,Je.property)({attribute:!1})],Pe.prototype,"yAxis",2),m([(0,Je.property)({attribute:!1})],Pe.prototype,"rightAxis",2),m([(0,Je.property)({attribute:!1})],Pe.prototype,"references",2),m([(0,Je.property)({attribute:!1})],Pe.prototype,"annotations",2),m([(0,Je.property)()],Pe.prototype,"curve",2),m([(0,Je.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],Pe.prototype,"connectNulls",2),m([(0,Je.property)()],Pe.prototype,"orientation",2),m([(0,Je.property)({type:Number})],Pe.prototype,"radius",2),m([(0,Je.property)({type:Number,attribute:"bar-gap"})],Pe.prototype,"barGap",2),m([(0,Je.property)({type:Number,attribute:"bar-width"})],Pe.prototype,"barWidth",2),m([(0,Je.property)({type:Boolean,reflect:!0})],Pe.prototype,"brush",2),m([(0,Je.property)({type:Boolean,reflect:!0})],Pe.prototype,"crosshair",2),Pe=m([(0,Je.customElement)("skdx-range-chart")],Pe);var un=require("lit/decorators.js");var Dt=class extends Q{constructor(){super(...arguments);this.nodes=[];this.edges=[];this.labels=!0;this.directed=!1;this.edgeLabels=!1}render(){let{nodes:t,edges:r,arrange:a,labels:o,nodeRange:s,iterations:c,directed:l,edgeLabels:d}=this;return this.root(Va({...this.sized(),nodes:t,edges:r,arrange:a,labels:o,nodeRange:s,iterations:c,directed:l,edgeLabels:d}),"network",this.label??"Network chart")}};m([(0,un.property)({attribute:!1})],Dt.prototype,"nodes",2),m([(0,un.property)({attribute:!1})],Dt.prototype,"edges",2),m([(0,un.property)()],Dt.prototype,"arrange",2),m([(0,un.property)({type:Boolean,attribute:"no-labels",converter:Se})],Dt.prototype,"labels",2),m([(0,un.property)({attribute:!1})],Dt.prototype,"nodeRange",2),m([(0,un.property)({type:Number})],Dt.prototype,"iterations",2),m([(0,un.property)({type:Boolean,reflect:!0})],Dt.prototype,"directed",2),m([(0,un.property)({type:Boolean,reflect:!0,attribute:"edge-labels"})],Dt.prototype,"edgeLabels",2),Dt=m([(0,un.customElement)("skdx-network-chart")],Dt);var qn=require("lit/decorators.js");var wn=class extends Q{constructor(){super(...arguments);this.events=[];this.labels=!0}render(){let{events:t,orientation:r,xAxis:a,labels:o}=this;return this.root(_a({...this.sized(),events:t,orientation:r,xAxis:a,labels:o}),"timeline",this.label??"Timeline chart")}};m([(0,qn.property)({attribute:!1})],wn.prototype,"events",2),m([(0,qn.property)()],wn.prototype,"orientation",2),m([(0,qn.property)({attribute:!1})],wn.prototype,"xAxis",2),m([(0,qn.property)({type:Boolean,attribute:"no-labels",converter:Se})],wn.prototype,"labels",2),wn=m([(0,qn.customElement)("skdx-timeline-chart")],wn);var _n=require("lit/decorators.js");var hn=class extends Q{constructor(){super(...arguments);this.segments=[];this.data=[];this.labels=!1}render(){let{segments:t,data:r,labels:a,gap:o,xAxis:s}=this;return this.root(No({...this.sized(),segments:t,data:r,labels:a,gap:o,xAxis:s}),"marimekko",this.label??"Marimekko chart")}};m([(0,_n.property)({attribute:!1})],hn.prototype,"segments",2),m([(0,_n.property)({attribute:!1})],hn.prototype,"data",2),m([(0,_n.property)({type:Boolean,reflect:!0})],hn.prototype,"labels",2),m([(0,_n.property)({type:Number})],hn.prototype,"gap",2),m([(0,_n.property)({attribute:!1})],hn.prototype,"xAxis",2),hn=m([(0,_n.customElement)("skdx-marimekko-chart")],hn);var Sn=require("lit/decorators.js");var Jt=class extends Q{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:a,curve:o,connectNulls:s,filters:c}=this;return this.root(Ro({...this.sized(),dimensions:t,data:r,opacity:a,curve:o,connectNulls:s,filters:c}),"parallel",this.label??"Parallel coordinates chart")}};m([(0,Sn.property)({attribute:!1})],Jt.prototype,"dimensions",2),m([(0,Sn.property)({attribute:!1})],Jt.prototype,"data",2),m([(0,Sn.property)({type:Number})],Jt.prototype,"opacity",2),m([(0,Sn.property)()],Jt.prototype,"curve",2),m([(0,Sn.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],Jt.prototype,"connectNulls",2),m([(0,Sn.property)({attribute:!1})],Jt.prototype,"filters",2),Jt=m([(0,Sn.customElement)("skdx-parallel-coordinates-chart")],Jt);var en=require("lit/decorators.js");var It=class extends Q{constructor(){super(...arguments);this.value=Number.NaN;this.labels=!0}render(){let{value:t,min:r,max:a,target:o,bands:s,orientation:c,caption:l,labels:d,ticks:u}=this;return this.root(Eo({...this.sized(),value:t,min:r,max:a,target:o,bands:s,orientation:c,caption:l,labels:d,ticks:u}),"linear-gauge",this.label??"Linear gauge")}};m([(0,en.property)({type:Number})],It.prototype,"value",2),m([(0,en.property)({type:Number})],It.prototype,"min",2),m([(0,en.property)({type:Number})],It.prototype,"max",2),m([(0,en.property)({type:Number})],It.prototype,"target",2),m([(0,en.property)({attribute:!1})],It.prototype,"bands",2),m([(0,en.property)()],It.prototype,"orientation",2),m([(0,en.property)()],It.prototype,"caption",2),m([(0,en.property)({type:Boolean,attribute:"no-labels",converter:Se})],It.prototype,"labels",2),m([(0,en.property)({type:Number})],It.prototype,"ticks",2),It=m([(0,en.customElement)("skdx-linear-gauge")],It);var tn=require("lit/decorators.js");var Tt=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,startLabel:r,endLabel:a,orientation:o,labels:s,sort:c,markerSize:l,xAxis:d,references:u}=this;return this.root(Do({...this.sized(),data:t,startLabel:r,endLabel:a,orientation:o,labels:s,sort:c,markerSize:l,xAxis:d,references:u}),"dumbbell",this.label??"Dumbbell chart")}};m([(0,tn.property)({attribute:!1})],Tt.prototype,"data",2),m([(0,tn.property)({attribute:"start-label"})],Tt.prototype,"startLabel",2),m([(0,tn.property)({attribute:"end-label"})],Tt.prototype,"endLabel",2),m([(0,tn.property)()],Tt.prototype,"orientation",2),m([(0,tn.property)({type:Boolean,reflect:!0})],Tt.prototype,"labels",2),m([(0,tn.property)()],Tt.prototype,"sort",2),m([(0,tn.property)({type:Number,attribute:"marker-size"})],Tt.prototype,"markerSize",2),m([(0,tn.property)({attribute:!1})],Tt.prototype,"xAxis",2),m([(0,tn.property)({attribute:!1})],Tt.prototype,"references",2),Tt=m([(0,tn.customElement)("skdx-dumbbell-chart")],Tt);var At=require("lit/decorators.js");var at=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1;this.brush=!1;this.crosshair=!1}render(){let{data:t,threshold:r,cumulativeLabel:a,name:o,labels:s,radius:c,barGap:l,barWidth:d,xAxis:u,yAxis:h,brush:f,crosshair:x}=this;return this.root(Bo({...this.sized(),data:t,threshold:r,cumulativeLabel:a,name:o,labels:s,radius:c,barGap:l,barWidth:d,xAxis:u,yAxis:h,brush:f,crosshair:x}),"pareto",this.label??"Pareto chart")}};m([(0,At.property)({attribute:!1})],at.prototype,"data",2),m([(0,At.property)({type:Number})],at.prototype,"threshold",2),m([(0,At.property)({attribute:"cumulative-label"})],at.prototype,"cumulativeLabel",2),m([(0,At.property)()],at.prototype,"name",2),m([(0,At.property)({type:Boolean,reflect:!0})],at.prototype,"labels",2),m([(0,At.property)({type:Number})],at.prototype,"radius",2),m([(0,At.property)({type:Number,attribute:"bar-gap"})],at.prototype,"barGap",2),m([(0,At.property)({type:Number,attribute:"bar-width"})],at.prototype,"barWidth",2),m([(0,At.property)({attribute:!1})],at.prototype,"xAxis",2),m([(0,At.property)({attribute:!1})],at.prototype,"yAxis",2),m([(0,At.property)({type:Boolean,reflect:!0})],at.prototype,"brush",2),m([(0,At.property)({type:Boolean,reflect:!0})],at.prototype,"crosshair",2),at=m([(0,At.customElement)("skdx-pareto-chart")],at);var fn=require("lit/decorators.js");var Bt=class extends Q{constructor(){super(...arguments);this.series=[];this.ranked=!1;this.labels=!0}render(){let{series:t,categories:r,ranked:a,topRank:o,curve:s,labels:c,markerSize:l,xAxis:d}=this;return this.root(Ho({...this.sized(),series:t,categories:r,ranked:a,topRank:o,curve:s,labels:c,markerSize:l,xAxis:d}),"bump",this.label??"Bump chart")}};m([(0,fn.property)({attribute:!1})],Bt.prototype,"series",2),m([(0,fn.property)({attribute:!1})],Bt.prototype,"categories",2),m([(0,fn.property)({type:Boolean,reflect:!0})],Bt.prototype,"ranked",2),m([(0,fn.property)({type:Number,attribute:"top-rank"})],Bt.prototype,"topRank",2),m([(0,fn.property)()],Bt.prototype,"curve",2),m([(0,fn.property)({type:Boolean,attribute:"no-labels",converter:Se})],Bt.prototype,"labels",2),m([(0,fn.property)({type:Number,attribute:"marker-size"})],Bt.prototype,"markerSize",2),m([(0,fn.property)({attribute:!1})],Bt.prototype,"xAxis",2),Bt=m([(0,fn.customElement)("skdx-bump-chart")],Bt);var nn=require("lit/decorators.js");var Ct=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,scale:r,max:a,startAngle:o,endAngle:s,padAngle:c,innerRadius:l,levels:d,labels:u}=this;return this.root(jo({...this.sized(),data:t,scale:r,max:a,startAngle:o,endAngle:s,padAngle:c,innerRadius:l,levels:d,labels:u}),"polar-area",this.label??"Polar area chart")}};m([(0,nn.property)({attribute:!1})],Ct.prototype,"data",2),m([(0,nn.property)()],Ct.prototype,"scale",2),m([(0,nn.property)({type:Number})],Ct.prototype,"max",2),m([(0,nn.property)({type:Number,attribute:"start-angle"})],Ct.prototype,"startAngle",2),m([(0,nn.property)({type:Number,attribute:"end-angle"})],Ct.prototype,"endAngle",2),m([(0,nn.property)({type:Number,attribute:"pad-angle"})],Ct.prototype,"padAngle",2),m([(0,nn.property)({type:Number,attribute:"inner-radius"})],Ct.prototype,"innerRadius",2),m([(0,nn.property)({type:Number})],Ct.prototype,"levels",2),m([(0,nn.property)({type:Boolean,reflect:!0})],Ct.prototype,"labels",2),Ct=m([(0,nn.customElement)("skdx-polar-area-chart")],Ct);var jn=require("lit/decorators.js");var pn=class extends Q{constructor(){super(...arguments);this.series=[]}render(){let{series:t,orientation:r,markerSize:a,yAxis:o,references:s}=this;return this.root(Go({...this.sized(),series:t,orientation:r,markerSize:a,yAxis:o,references:s}),"swarm",this.label??"Swarm plot")}};m([(0,jn.property)({attribute:!1})],pn.prototype,"series",2),m([(0,jn.property)()],pn.prototype,"orientation",2),m([(0,jn.property)({type:Number,attribute:"marker-size"})],pn.prototype,"markerSize",2),m([(0,jn.property)({attribute:!1})],pn.prototype,"yAxis",2),m([(0,jn.property)({attribute:!1})],pn.prototype,"references",2),pn=m([(0,jn.customElement)("skdx-swarm-plot")],pn);var bn=require("lit/decorators.js");var Ft=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,total:r,rows:a,columns:o,orientation:s,cellGap:c,cellRadius:l,labels:d}=this;return this.root(Wo({...this.sized(),data:t,total:r,rows:a,columns:o,orientation:s,cellGap:c,cellRadius:l,labels:d}),"waffle",this.label??"Waffle chart")}};m([(0,bn.property)({attribute:!1})],Ft.prototype,"data",2),m([(0,bn.property)({type:Number})],Ft.prototype,"total",2),m([(0,bn.property)({type:Number})],Ft.prototype,"rows",2),m([(0,bn.property)({type:Number})],Ft.prototype,"columns",2),m([(0,bn.property)()],Ft.prototype,"orientation",2),m([(0,bn.property)({type:Number,attribute:"cell-gap"})],Ft.prototype,"cellGap",2),m([(0,bn.property)({type:Number,attribute:"cell-radius"})],Ft.prototype,"cellRadius",2),m([(0,bn.property)({type:Boolean,reflect:!0})],Ft.prototype,"labels",2),Ft=m([(0,bn.customElement)("skdx-waffle-chart")],Ft);var rn=require("lit/decorators.js");var Lt=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,nodeShape:a,linkStyle:o,rootId:s,collapsed:c,maxDepth:l,labels:d,nodeSize:u}=this;return this.root(Kr({...this.sized(),data:t,orientation:r,nodeShape:a,linkStyle:o,rootId:s,collapsed:c,maxDepth:l,labels:d,nodeSize:u}),"tree",this.label??"Tree chart")}};m([(0,rn.property)({attribute:!1})],Lt.prototype,"data",2),m([(0,rn.property)()],Lt.prototype,"orientation",2),m([(0,rn.property)({attribute:"node-shape"})],Lt.prototype,"nodeShape",2),m([(0,rn.property)({attribute:"link-style"})],Lt.prototype,"linkStyle",2),m([(0,rn.property)({attribute:!1})],Lt.prototype,"rootId",2),m([(0,rn.property)({attribute:!1})],Lt.prototype,"collapsed",2),m([(0,rn.property)({type:Number,attribute:"max-depth"})],Lt.prototype,"maxDepth",2),m([(0,rn.property)({type:Boolean,attribute:"no-labels",converter:Se})],Lt.prototype,"labels",2),m([(0,rn.property)({type:Number,attribute:"node-size"})],Lt.prototype,"nodeSize",2),Lt=m([(0,rn.customElement)("skdx-tree-chart")],Lt);var $n=require("lit/decorators.js");var Zt=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,rootId:a,collapsed:o,maxDepth:s,labels:c,nodeSize:l}=this;return this.root(Fo({...this.sized(),data:t,orientation:r,rootId:a,collapsed:o,maxDepth:s,labels:c,nodeSize:l}),"organization",this.label??"Organization chart")}};m([(0,$n.property)({attribute:!1})],Zt.prototype,"data",2),m([(0,$n.property)()],Zt.prototype,"orientation",2),m([(0,$n.property)({attribute:!1})],Zt.prototype,"rootId",2),m([(0,$n.property)({attribute:!1})],Zt.prototype,"collapsed",2),m([(0,$n.property)({type:Number,attribute:"max-depth"})],Zt.prototype,"maxDepth",2),m([(0,$n.property)({type:Boolean,attribute:"no-labels",converter:Se})],Zt.prototype,"labels",2),m([(0,$n.property)({type:Number,attribute:"node-size"})],Zt.prototype,"nodeSize",2),Zt=m([(0,$n.customElement)("skdx-organization-chart")],Zt);var zn=require("lit/decorators.js");var an=class extends Q{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:a,labels:o,padding:s,colorScale:c}=this;return this.root(Po({...this.sized(),data:t,rootId:r,maxDepth:a,labels:o,padding:s,colorScale:c}),"circle-packing",this.label??"Circle packing chart")}};m([(0,zn.property)({attribute:!1})],an.prototype,"data",2),m([(0,zn.property)({attribute:!1})],an.prototype,"rootId",2),m([(0,zn.property)({type:Number,attribute:"max-depth"})],an.prototype,"maxDepth",2),m([(0,zn.property)({type:Boolean,attribute:"no-labels",converter:Se})],an.prototype,"labels",2),m([(0,zn.property)({type:Number})],an.prototype,"padding",2),m([(0,zn.property)({attribute:!1})],an.prototype,"colorScale",2),an=m([(0,zn.customElement)("skdx-circle-packing-chart")],an);var on=require("lit/decorators.js");var Ot=class extends Q{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,orientation:r,rootId:a,breadcrumbs:o,maxDepth:s,sort:c,labels:l,padding:d,colorScale:u}=this;return this.root(Vo({...this.sized(),data:t,orientation:r,rootId:a,breadcrumbs:o,maxDepth:s,sort:c,labels:l,padding:d,colorScale:u}),"icicle",this.label??"Icicle chart")}};m([(0,on.property)({attribute:!1})],Ot.prototype,"data",2),m([(0,on.property)()],Ot.prototype,"orientation",2),m([(0,on.property)({attribute:!1})],Ot.prototype,"rootId",2),m([(0,on.property)({type:Boolean,reflect:!0})],Ot.prototype,"breadcrumbs",2),m([(0,on.property)({type:Number,attribute:"max-depth"})],Ot.prototype,"maxDepth",2),m([(0,on.property)()],Ot.prototype,"sort",2),m([(0,on.property)({type:Boolean,attribute:"no-labels",converter:Se})],Ot.prototype,"labels",2),m([(0,on.property)({type:Number})],Ot.prototype,"padding",2),m([(0,on.property)({attribute:!1})],Ot.prototype,"colorScale",2),Ot=m([(0,on.customElement)("skdx-icicle-chart")],Ot);0&&(module.exports={SkdxAreaChart,SkdxBarChart,SkdxBoxplot,SkdxBubbleChart,SkdxBulletChart,SkdxBumpChart,SkdxCandlestickChart,SkdxChordChart,SkdxCirclePackingChart,SkdxComboChart,SkdxDumbbellChart,SkdxFunnelChart,SkdxGanttChart,SkdxGaugeChart,SkdxHeatmap,SkdxHistogram,SkdxIcicleChart,SkdxLineChart,SkdxLinearGauge,SkdxMapChart,SkdxMarimekkoChart,SkdxNetworkChart,SkdxOrganizationChart,SkdxParallelCoordinatesChart,SkdxParetoChart,SkdxPieChart,SkdxPolarAreaChart,SkdxRadarChart,SkdxRadialBarChart,SkdxRangeChart,SkdxSankeyChart,SkdxScatterChart,SkdxSparkline,SkdxSunburstChart,SkdxSwarmPlot,SkdxTimelineChart,SkdxTreeChart,SkdxTreemap,SkdxWaffleChart,SkdxWaterfallChart,csv,exportChart,makeFormatter,seriesCsv,svgMarkup,syncGroup});
|
|
112
|
+
`,u([(0,ce.property)({type:Number})],X.prototype,"width",2),u([(0,ce.property)({type:Number})],X.prototype,"height",2),u([(0,ce.property)()],X.prototype,"label",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"legend",2),u([(0,ce.property)({type:Boolean,attribute:"no-tooltip",converter:Re})],X.prototype,"tooltip",2),u([(0,ce.property)({attribute:!1})],X.prototype,"format",2),u([(0,ce.property)({attribute:!1})],X.prototype,"palette",2),u([(0,ce.property)({attribute:!1})],X.prototype,"hiddenSeries",2),u([(0,ce.property)({attribute:!1})],X.prototype,"selected",2),u([(0,ce.property)({attribute:"selection-mode"})],X.prototype,"selectionMode",2),u([(0,ce.property)({attribute:!1})],X.prototype,"highlighted",2),u([(0,ce.property)({attribute:!1})],X.prototype,"highlightScope",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"loading",2),u([(0,ce.property)()],X.prototype,"error",2),u([(0,ce.property)({attribute:"empty-message"})],X.prototype,"emptyMessage",2),u([(0,ce.property)()],X.prototype,"description",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"decorative",2),u([(0,ce.property)({type:Boolean,attribute:"accessible-table"})],X.prototype,"accessibleTable",2),u([(0,ce.property)({attribute:!1})],X.prototype,"zoom",2),u([(0,ce.property)({attribute:!1})],X.prototype,"view",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"zoomable",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"editable",2),u([(0,ce.property)({attribute:"sync-id"})],X.prototype,"syncId",2),u([(0,ce.property)({type:Boolean,attribute:"cross-filter"})],X.prototype,"crossFilter",2),u([(0,ce.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],X.prototype,"animated",2),u([(0,ce.property)({type:Boolean,reflect:!0})],X.prototype,"responsive",2),u([(0,ce.state)()],X.prototype,"tip",2),u([(0,ce.state)()],X.prototype,"overlay",2),u([(0,ce.state)()],X.prototype,"portal",2),u([(0,ce.state)()],X.prototype,"measured",2),u([(0,ce.state)()],X.prototype,"viewState",2),u([(0,ce.state)()],X.prototype,"highlightState",2),u([(0,ce.state)()],X.prototype,"crossState",2),u([(0,ce.state)()],X.prototype,"focused",2),u([(0,ce.state)()],X.prototype,"hiddenState",2),u([(0,ce.state)()],X.prototype,"zoomState",2),u([(0,ce.state)()],X.prototype,"selectedState",2);var Ae=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:a,yAxis:o,rightAxis:s,references:c,annotations:l,labels:d,curve:m,connectNulls:h,nulls:f,stacked:M,stackOffset:$,orientation:g,radius:w,barGap:R,barWidth:k,sort:T,transform:D,transforms:v,bins:S,binWidth:O,binDomain:E,binMode:z,sampling:L,brush:H,crosshair:b}=this;return{...this.sized(),series:t,categories:r,xAxis:a,yAxis:o,rightAxis:s,references:c,annotations:l,labels:d,curve:m,connectNulls:h,nulls:f,stacked:M,stackOffset:$,orientation:g,radius:w,barGap:R,barWidth:k,sort:T,transform:D,transforms:v,bins:S,binWidth:O,binDomain:E,binMode:z,sampling:L,brush:H,crosshair:b}}};u([(0,ce.property)({attribute:!1})],Ae.prototype,"series",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"categories",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"xAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"yAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"rightAxis",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"references",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"annotations",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"labels",2),u([(0,ce.property)()],Ae.prototype,"curve",2),u([(0,ce.property)({type:Boolean,attribute:"connect-nulls"})],Ae.prototype,"connectNulls",2),u([(0,ce.property)()],Ae.prototype,"nulls",2),u([(0,ce.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],Ae.prototype,"stacked",2),u([(0,ce.property)({attribute:"stack-offset"})],Ae.prototype,"stackOffset",2),u([(0,ce.property)()],Ae.prototype,"orientation",2),u([(0,ce.property)({type:Number})],Ae.prototype,"radius",2),u([(0,ce.property)({type:Number,attribute:"bar-gap"})],Ae.prototype,"barGap",2),u([(0,ce.property)({type:Number,attribute:"bar-width"})],Ae.prototype,"barWidth",2),u([(0,ce.property)()],Ae.prototype,"sort",2),u([(0,ce.property)()],Ae.prototype,"transform",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"transforms",2),u([(0,ce.property)({type:Number})],Ae.prototype,"bins",2),u([(0,ce.property)({type:Number,attribute:"bin-width"})],Ae.prototype,"binWidth",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"binDomain",2),u([(0,ce.property)({attribute:"bin-mode"})],Ae.prototype,"binMode",2),u([(0,ce.property)({attribute:!1})],Ae.prototype,"sampling",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"brush",2),u([(0,ce.property)({type:Boolean,reflect:!0})],Ae.prototype,"crosshair",2);var Ll=e=>e.defs&&e.defs.length?ye.svg`<defs>${e.defs.map(n=>ye.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>ye.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,ze.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:ye.nothing,ea=e=>ye.svg`${e.map((n,t)=>{let r=n.title?ye.svg`<title>${n.title}</title>`:ye.nothing,a=n.item?t:void 0;switch(n.kind){case"path":return ye.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,ze.ifDefined)(n.stroke)} stroke-width=${(0,ze.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,ze.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,ze.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,ze.ifDefined)(n.dash)} opacity=${(0,ze.ifDefined)(n.opacity)} fill-opacity=${(0,ze.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return ye.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,ze.ifDefined)(n.rx)} style=${(0,ze.ifDefined)(Yr(n.part)?`rx:${Yr(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,ze.ifDefined)(n.stroke)} fill-opacity=${(0,ze.ifDefined)(n.opacity)} pointer-events=${(0,ze.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return ye.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,ze.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,ze.ifDefined)(n.dash)} opacity=${(0,ze.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return ye.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,ze.ifDefined)(n.stroke)} opacity=${(0,ze.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return ye.svg`<text aria-label=${(0,ze.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,ze.ifDefined)(a)} x=${n.x} y=${n.y} text-anchor=${(0,ze.ifDefined)(n.anchor)} dominant-baseline=${(0,ze.ifDefined)(n.baseline)} fill=${(0,ze.ifDefined)(n.fill)} font-weight=${(0,ze.ifDefined)(n.weight)} pointer-events=${(0,ze.ifDefined)(a===void 0?"none":void 0)} transform=${(0,ze.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var dr=class extends Ae{render(){return this.root(ka(this.input()),"bar",this.label??"Bar chart")}};dr=u([(0,si.customElement)("skdx-bar-chart")],dr);var ii=require("lit/decorators.js");var mr=class extends Ae{render(){return this.root($a(this.input()),"line",this.label??"Line chart")}};mr=u([(0,ii.customElement)("skdx-line-chart")],mr);var li=require("lit/decorators.js");var ur=class extends Ae{render(){return this.root(Ia(this.input()),"area",this.label??"Area chart")}};ur=u([(0,li.customElement)("skdx-area-chart")],ur);var Ht=require("lit/decorators.js");var lt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,variant:r,innerRadius:a,outerRadius:o,labels:s,labelPosition:c,padAngle:l,sort:d,startAngle:m,endAngle:h,centerLabel:f}=this;return this.root(Sa({...this.sized(),data:t,variant:r,innerRadius:a,outerRadius:o,labels:s,labelPosition:c,padAngle:l,sort:d,startAngle:m,endAngle:h,centerLabel:f}),"pie",this.label??"Pie chart")}};u([(0,Ht.property)({attribute:!1})],lt.prototype,"data",2),u([(0,Ht.property)()],lt.prototype,"variant",2),u([(0,Ht.property)({type:Number,attribute:"inner-radius"})],lt.prototype,"innerRadius",2),u([(0,Ht.property)({type:Number,attribute:"outer-radius"})],lt.prototype,"outerRadius",2),u([(0,Ht.property)({type:Boolean,reflect:!0})],lt.prototype,"labels",2),u([(0,Ht.property)({attribute:"label-position"})],lt.prototype,"labelPosition",2),u([(0,Ht.property)({type:Number,attribute:"pad-angle"})],lt.prototype,"padAngle",2),u([(0,Ht.property)()],lt.prototype,"sort",2),u([(0,Ht.property)({type:Number,attribute:"start-angle"})],lt.prototype,"startAngle",2),u([(0,Ht.property)({type:Number,attribute:"end-angle"})],lt.prototype,"endAngle",2),u([(0,Ht.property)({attribute:"center-label"})],lt.prototype,"centerLabel",2),lt=u([(0,Ht.customElement)("skdx-pie-chart")],lt);var pt=require("lit/decorators.js");var Xe=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,references:c,annotations:l,colorScale:d,colorLegend:m,hitRadius:h,jitter:f,trendline:M,sampling:$}=this;return this.root(va({...this.sized(),series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,references:c,annotations:l,colorScale:d,colorLegend:m,hitRadius:h,jitter:f,trendline:M,sampling:$}),"scatter",this.label??"Scatter chart")}};u([(0,pt.property)({attribute:!1})],Xe.prototype,"series",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"sizeRange",2),u([(0,pt.property)({type:Boolean,reflect:!0})],Xe.prototype,"labels",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"xAxis",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"yAxis",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"references",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"annotations",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"colorScale",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"colorLegend",2),u([(0,pt.property)({type:Number,attribute:"hit-radius"})],Xe.prototype,"hitRadius",2),u([(0,pt.property)({type:Number})],Xe.prototype,"jitter",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"trendline",2),u([(0,pt.property)({attribute:!1})],Xe.prototype,"sampling",2),Xe=u([(0,pt.customElement)("skdx-scatter-chart")],Xe);var Zt=require("lit/decorators.js");var bt=class extends X{constructor(){super(...arguments);this.data=[];this.trend=!1;this.extremes=!1;this.lastValue=!1}render(){let{data:t,color:r,curve:a,variant:o,trend:s,extremes:c,lastValue:l,target:d,band:m,markers:h}=this;return this.root(za({...this.sized(),data:t,color:r,curve:a,variant:o,trend:s,extremes:c,lastValue:l,target:d,band:m,markers:h}),"sparkline",this.label??"Sparkline")}};u([(0,Zt.property)({attribute:!1})],bt.prototype,"data",2),u([(0,Zt.property)()],bt.prototype,"color",2),u([(0,Zt.property)()],bt.prototype,"curve",2),u([(0,Zt.property)()],bt.prototype,"variant",2),u([(0,Zt.property)({type:Boolean,reflect:!0})],bt.prototype,"trend",2),u([(0,Zt.property)({type:Boolean,reflect:!0})],bt.prototype,"extremes",2),u([(0,Zt.property)({type:Boolean,reflect:!0,attribute:"last-value"})],bt.prototype,"lastValue",2),u([(0,Zt.property)({type:Number})],bt.prototype,"target",2),u([(0,Zt.property)({attribute:!1})],bt.prototype,"band",2),u([(0,Zt.property)({attribute:!1})],bt.prototype,"markers",2),bt=u([(0,Zt.customElement)("skdx-sparkline")],bt);var It=require("lit/decorators.js");var nt=class extends X{constructor(){super(...arguments);this.series=[];this.fill=!0;this.markers=!0;this.labels=!1}render(){let{series:t,categories:r,metrics:a,normalized:o,max:s,fill:c,levels:l,markers:d,markerSize:m,labels:h,startAngle:f,gridShape:M}=this;return this.root(Na({...this.sized(),series:t,categories:r,metrics:a,normalize:o,max:s,fill:c,levels:l,markers:d,markerSize:m,labels:h,startAngle:f,gridShape:M}),"radar",this.label??"Radar chart")}};u([(0,It.property)({attribute:!1})],nt.prototype,"series",2),u([(0,It.property)({attribute:!1})],nt.prototype,"categories",2),u([(0,It.property)({attribute:!1})],nt.prototype,"metrics",2),u([(0,It.property)({attribute:!1})],nt.prototype,"normalized",2),u([(0,It.property)({type:Number})],nt.prototype,"max",2),u([(0,It.property)({type:Boolean,attribute:"no-fill",converter:Re})],nt.prototype,"fill",2),u([(0,It.property)({type:Number})],nt.prototype,"levels",2),u([(0,It.property)({type:Boolean,attribute:"no-markers",converter:Re})],nt.prototype,"markers",2),u([(0,It.property)({type:Number,attribute:"marker-size"})],nt.prototype,"markerSize",2),u([(0,It.property)({type:Boolean,reflect:!0})],nt.prototype,"labels",2),u([(0,It.property)({type:Number,attribute:"start-angle"})],nt.prototype,"startAngle",2),u([(0,It.property)({attribute:"grid-shape"})],nt.prototype,"gridShape",2),nt=u([(0,It.customElement)("skdx-radar-chart")],nt);var We=require("lit/decorators.js");var He=class extends X{constructor(){super(...arguments);this.diverging=!1;this.labels=!1}render(){let{rows:t,columns:r,data:a,calendar:o,color:s,diverging:c,negativeColor:l,labels:d,domain:m,steps:h,weekStart:f,colorScale:M,colorLegend:$,missingColor:g,cellGap:w,cellRadius:R,rowOrder:k,columnOrder:T}=this;return this.root(Da({...this.sized(),rows:t,columns:r,data:a,calendar:o,color:s,diverging:c,negativeColor:l,labels:d,domain:m,steps:h,weekStart:f,colorScale:M,colorLegend:$,missingColor:g,cellGap:w,cellRadius:R,rowOrder:k,columnOrder:T}),"heatmap",this.label??"Heatmap")}};u([(0,We.property)({attribute:!1})],He.prototype,"rows",2),u([(0,We.property)({attribute:!1})],He.prototype,"columns",2),u([(0,We.property)({attribute:!1})],He.prototype,"data",2),u([(0,We.property)({attribute:!1})],He.prototype,"calendar",2),u([(0,We.property)()],He.prototype,"color",2),u([(0,We.property)({type:Boolean,reflect:!0})],He.prototype,"diverging",2),u([(0,We.property)({attribute:"negative-color"})],He.prototype,"negativeColor",2),u([(0,We.property)({type:Boolean,reflect:!0})],He.prototype,"labels",2),u([(0,We.property)({attribute:!1})],He.prototype,"domain",2),u([(0,We.property)({type:Number})],He.prototype,"steps",2),u([(0,We.property)({attribute:"week-start"})],He.prototype,"weekStart",2),u([(0,We.property)({attribute:!1})],He.prototype,"colorScale",2),u([(0,We.property)({attribute:!1})],He.prototype,"colorLegend",2),u([(0,We.property)({attribute:"missing-color"})],He.prototype,"missingColor",2),u([(0,We.property)({type:Number,attribute:"cell-gap"})],He.prototype,"cellGap",2),u([(0,We.property)({type:Number,attribute:"cell-radius"})],He.prototype,"cellRadius",2),u([(0,We.property)({attribute:"row-order"})],He.prototype,"rowOrder",2),u([(0,We.property)({attribute:"column-order"})],He.prototype,"columnOrder",2),He=u([(0,We.customElement)("skdx-heatmap")],He);var Ln=require("lit/decorators.js");var Jt=class extends X{constructor(){super(...arguments);this.data=[]}render(){let{data:t,orientation:r,variant:a,gap:o,labelPosition:s,sort:c}=this;return this.root(Ba({...this.sized(),data:t,orientation:r,variant:a,gap:o,labelPosition:s,sort:c}),"funnel",this.label??"Funnel chart")}};u([(0,Ln.property)({attribute:!1})],Jt.prototype,"data",2),u([(0,Ln.property)()],Jt.prototype,"orientation",2),u([(0,Ln.property)()],Jt.prototype,"variant",2),u([(0,Ln.property)({type:Number})],Jt.prototype,"gap",2),u([(0,Ln.property)({attribute:"label-position"})],Jt.prototype,"labelPosition",2),u([(0,Ln.property)()],Jt.prototype,"sort",2),Jt=u([(0,Ln.customElement)("skdx-funnel-chart")],Jt);var Ut=require("lit/decorators.js");var gt=class extends X{constructor(){super(...arguments);this.links=[];this.nodeLabels=!0;this.linkLabels=!1}render(){let{links:t,nodes:r,align:a,nodeWidth:o,nodePadding:s,nodeSort:c,linkSort:l,nodeLabels:d,linkLabels:m,cyclePolicy:h}=this;return this.root($o({...this.sized(),links:t,nodes:r,align:a,nodeWidth:o,nodePadding:s,nodeSort:c,linkSort:l,nodeLabels:d,linkLabels:m,cyclePolicy:h}),"sankey",this.label??"Sankey chart")}};u([(0,Ut.property)({attribute:!1})],gt.prototype,"links",2),u([(0,Ut.property)({attribute:!1})],gt.prototype,"nodes",2),u([(0,Ut.property)()],gt.prototype,"align",2),u([(0,Ut.property)({type:Number,attribute:"node-width"})],gt.prototype,"nodeWidth",2),u([(0,Ut.property)({type:Number,attribute:"node-padding"})],gt.prototype,"nodePadding",2),u([(0,Ut.property)({attribute:"node-sort"})],gt.prototype,"nodeSort",2),u([(0,Ut.property)({attribute:"link-sort"})],gt.prototype,"linkSort",2),u([(0,Ut.property)({type:Boolean,attribute:"no-node-labels",converter:Re})],gt.prototype,"nodeLabels",2),u([(0,Ut.property)({type:Boolean,reflect:!0,attribute:"link-labels"})],gt.prototype,"linkLabels",2),u([(0,Ut.property)({attribute:"cycle-policy"})],gt.prototype,"cyclePolicy",2),gt=u([(0,Ut.customElement)("skdx-sankey-chart")],gt);var en=require("lit/decorators.js");var Tt=class extends X{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,rootId:r,breadcrumbs:a,maxDepth:o,sort:s,padding:c,tiling:l,colorScale:d,labels:m}=this;return this.root(To({...this.sized(),data:t,rootId:r,breadcrumbs:a,maxDepth:o,sort:s,padding:c,tiling:l,colorScale:d,labels:m}),"treemap",this.label??"Treemap")}};u([(0,en.property)({attribute:!1})],Tt.prototype,"data",2),u([(0,en.property)({attribute:!1})],Tt.prototype,"rootId",2),u([(0,en.property)({type:Boolean,reflect:!0})],Tt.prototype,"breadcrumbs",2),u([(0,en.property)({type:Number,attribute:"max-depth"})],Tt.prototype,"maxDepth",2),u([(0,en.property)()],Tt.prototype,"sort",2),u([(0,en.property)({type:Number})],Tt.prototype,"padding",2),u([(0,en.property)()],Tt.prototype,"tiling",2),u([(0,en.property)({attribute:!1})],Tt.prototype,"colorScale",2),u([(0,en.property)({type:Boolean,attribute:"no-labels",converter:Re})],Tt.prototype,"labels",2),Tt=u([(0,en.customElement)("skdx-treemap")],Tt);var xt=require("lit/decorators.js");var Qe=class extends X{constructor(){super(...arguments);this.data=[];this.brush=!1;this.crosshair=!1}render(){let{data:t,scale:r,variant:a,xAxis:o,yAxis:s,volumeFormat:c,references:l,annotations:d,overlays:m,upColor:h,downColor:f,brush:M,crosshair:$}=this;return this.root(Ao({...this.sized(),data:t,scale:r,variant:a,xAxis:o,yAxis:s,volumeFormat:c,references:l,annotations:d,overlays:m,upColor:h,downColor:f,brush:M,crosshair:$}),"candlestick",this.label??"Candlestick chart")}};u([(0,xt.property)({attribute:!1})],Qe.prototype,"data",2),u([(0,xt.property)()],Qe.prototype,"scale",2),u([(0,xt.property)()],Qe.prototype,"variant",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"xAxis",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"yAxis",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"volumeFormat",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"references",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"annotations",2),u([(0,xt.property)({attribute:!1})],Qe.prototype,"overlays",2),u([(0,xt.property)({attribute:"up-color"})],Qe.prototype,"upColor",2),u([(0,xt.property)({attribute:"down-color"})],Qe.prototype,"downColor",2),u([(0,xt.property)({type:Boolean,reflect:!0})],Qe.prototype,"brush",2),u([(0,xt.property)({type:Boolean,reflect:!0})],Qe.prototype,"crosshair",2),Qe=u([(0,xt.customElement)("skdx-candlestick-chart")],Qe);var Yt=require("lit/decorators.js");var yt=class extends X{constructor(){super(...arguments);this.data=[];this.connectors=!0;this.labels=!1}render(){let{data:t,total:r,start:a,startLabel:o,orientation:s,connectors:c,labels:l,positiveColor:d,negativeColor:m,totalColor:h}=this;return this.root(Co({...this.sized(),data:t,total:r,start:a,startLabel:o,orientation:s,connectors:c,labels:l,positiveColor:d,negativeColor:m,totalColor:h}),"waterfall",this.label??"Waterfall chart")}};u([(0,Yt.property)({attribute:!1})],yt.prototype,"data",2),u([(0,Yt.property)()],yt.prototype,"total",2),u([(0,Yt.property)({type:Number})],yt.prototype,"start",2),u([(0,Yt.property)({attribute:"start-label"})],yt.prototype,"startLabel",2),u([(0,Yt.property)()],yt.prototype,"orientation",2),u([(0,Yt.property)({type:Boolean,attribute:"no-connectors",converter:Re})],yt.prototype,"connectors",2),u([(0,Yt.property)({type:Boolean,reflect:!0})],yt.prototype,"labels",2),u([(0,Yt.property)({attribute:"positive-color"})],yt.prototype,"positiveColor",2),u([(0,Yt.property)({attribute:"negative-color"})],yt.prototype,"negativeColor",2),u([(0,Yt.property)({attribute:"total-color"})],yt.prototype,"totalColor",2),yt=u([(0,Yt.customElement)("skdx-waterfall-chart")],yt);var On=require("lit/decorators.js");var tn=class extends X{constructor(){super(...arguments);this.tasks=[];this.criticalPath=!1}render(){let{tasks:t,references:r,annotations:a,today:o,criticalPath:s,xAxis:c}=this;return this.root(Lo({...this.sized(),tasks:t,references:r,annotations:a,today:o,criticalPath:s,xAxis:c}),"gantt",this.label??"Gantt chart")}};u([(0,On.property)({attribute:!1})],tn.prototype,"tasks",2),u([(0,On.property)({attribute:!1})],tn.prototype,"references",2),u([(0,On.property)({attribute:!1})],tn.prototype,"annotations",2),u([(0,On.property)({attribute:!1})],tn.prototype,"today",2),u([(0,On.property)({type:Boolean,reflect:!0,attribute:"critical-path"})],tn.prototype,"criticalPath",2),u([(0,On.property)({attribute:!1})],tn.prototype,"xAxis",2),tn=u([(0,On.customElement)("skdx-gantt-chart")],tn);var nn=require("lit/decorators.js");var At=class extends X{constructor(){super(...arguments);this.series=[];this.mean=!1;this.points=!1;this.notched=!1}render(){let{series:t,orientation:r,quartileMethod:a,whisker:o,mean:s,points:c,notched:l,categories:d,yAxis:m}=this;return this.root(So({...this.sized(),series:t,orientation:r,quartileMethod:a,whisker:o,mean:s,points:c,notched:l,categories:d,yAxis:m}),"boxplot",this.label??"Box plot")}};u([(0,nn.property)({attribute:!1})],At.prototype,"series",2),u([(0,nn.property)()],At.prototype,"orientation",2),u([(0,nn.property)({attribute:"quartile-method"})],At.prototype,"quartileMethod",2),u([(0,nn.property)({type:Number})],At.prototype,"whisker",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"mean",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"points",2),u([(0,nn.property)({type:Boolean,reflect:!0})],At.prototype,"notched",2),u([(0,nn.property)({attribute:!1})],At.prototype,"categories",2),u([(0,nn.property)({attribute:!1})],At.prototype,"yAxis",2),At=u([(0,nn.customElement)("skdx-boxplot")],At);var Ct=require("lit/decorators.js");var rt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1;this.breadcrumbs=!1}render(){let{data:t,innerRadius:r,centerLabel:a,labels:o,rootId:s,breadcrumbs:c,maxDepth:l,sort:d,startAngle:m,endAngle:h,padAngle:f,colorScale:M}=this;return this.root(No({...this.sized(),data:t,innerRadius:r,centerLabel:a,labels:o,rootId:s,breadcrumbs:c,maxDepth:l,sort:d,startAngle:m,endAngle:h,padAngle:f,colorScale:M}),"sunburst",this.label??"Sunburst chart")}};u([(0,Ct.property)({attribute:!1})],rt.prototype,"data",2),u([(0,Ct.property)({type:Number,attribute:"inner-radius"})],rt.prototype,"innerRadius",2),u([(0,Ct.property)({attribute:"center-label"})],rt.prototype,"centerLabel",2),u([(0,Ct.property)({type:Boolean,reflect:!0})],rt.prototype,"labels",2),u([(0,Ct.property)({attribute:!1})],rt.prototype,"rootId",2),u([(0,Ct.property)({type:Boolean,reflect:!0})],rt.prototype,"breadcrumbs",2),u([(0,Ct.property)({type:Number,attribute:"max-depth"})],rt.prototype,"maxDepth",2),u([(0,Ct.property)()],rt.prototype,"sort",2),u([(0,Ct.property)({type:Number,attribute:"start-angle"})],rt.prototype,"startAngle",2),u([(0,Ct.property)({type:Number,attribute:"end-angle"})],rt.prototype,"endAngle",2),u([(0,Ct.property)({type:Number,attribute:"pad-angle"})],rt.prototype,"padAngle",2),u([(0,Ct.property)({attribute:!1})],rt.prototype,"colorScale",2),rt=u([(0,Ct.customElement)("skdx-sunburst-chart")],rt);var _n=require("lit/decorators.js");var pn=class extends X{render(){let{names:n,matrix:t,links:r,padding:a,sort:o}=this;return this.root(Ro({...this.sized(),names:n,matrix:t,links:r,padding:a,sort:o}),"chord",this.label??"Chord chart")}};u([(0,_n.property)({attribute:!1})],pn.prototype,"names",2),u([(0,_n.property)({attribute:!1})],pn.prototype,"matrix",2),u([(0,_n.property)({attribute:!1})],pn.prototype,"links",2),u([(0,_n.property)({type:Number})],pn.prototype,"padding",2),u([(0,_n.property)()],pn.prototype,"sort",2),pn=u([(0,_n.customElement)("skdx-chord-chart")],pn);var rn=require("lit/decorators.js");var Lt=class extends X{constructor(){super(...arguments);this.features=[];this.labels=!1}render(){let{features:t,color:r,colorScale:a,colorLegend:o,projection:s,points:c,lines:l,sizeRange:d,labels:m}=this;return this.root(Do({...this.sized(),features:t,color:r,colorScale:a,colorLegend:o,projection:s,points:c,lines:l,sizeRange:d,labels:m}),"map",this.label??"Map")}};u([(0,rn.property)({attribute:!1})],Lt.prototype,"features",2),u([(0,rn.property)()],Lt.prototype,"color",2),u([(0,rn.property)({attribute:!1})],Lt.prototype,"colorScale",2),u([(0,rn.property)({attribute:!1})],Lt.prototype,"colorLegend",2),u([(0,rn.property)()],Lt.prototype,"projection",2),u([(0,rn.property)({attribute:!1})],Lt.prototype,"points",2),u([(0,rn.property)({attribute:!1})],Lt.prototype,"lines",2),u([(0,rn.property)({attribute:!1})],Lt.prototype,"sizeRange",2),u([(0,rn.property)({type:Boolean,reflect:!0})],Lt.prototype,"labels",2),Lt=u([(0,rn.customElement)("skdx-map-chart")],Lt);var Ot=require("lit/decorators.js");var at=class extends X{constructor(){super(...arguments);this.data=[];this.track=!0;this.rounded=!0;this.labels=!1}render(){let{data:t,max:r,startAngle:a,endAngle:o,innerRadius:s,gap:c,track:l,rounded:d,labels:m,bands:h,target:f,centerLabel:M}=this;return this.root(Fa({...this.sized(),data:t,max:r,startAngle:a,endAngle:o,innerRadius:s,gap:c,track:l,rounded:d,labels:m,bands:h,target:f,centerLabel:M}),"radial",this.label??"Radial bar chart")}};u([(0,Ot.property)({attribute:!1})],at.prototype,"data",2),u([(0,Ot.property)({type:Number})],at.prototype,"max",2),u([(0,Ot.property)({type:Number,attribute:"start-angle"})],at.prototype,"startAngle",2),u([(0,Ot.property)({type:Number,attribute:"end-angle"})],at.prototype,"endAngle",2),u([(0,Ot.property)({type:Number,attribute:"inner-radius"})],at.prototype,"innerRadius",2),u([(0,Ot.property)({type:Number})],at.prototype,"gap",2),u([(0,Ot.property)({type:Boolean,attribute:"no-track",converter:Re})],at.prototype,"track",2),u([(0,Ot.property)({type:Boolean,attribute:"no-rounded",converter:Re})],at.prototype,"rounded",2),u([(0,Ot.property)({type:Boolean,reflect:!0})],at.prototype,"labels",2),u([(0,Ot.property)({attribute:!1})],at.prototype,"bands",2),u([(0,Ot.property)({type:Number})],at.prototype,"target",2),u([(0,Ot.property)({attribute:"center-label"})],at.prototype,"centerLabel",2),at=u([(0,Ot.customElement)("skdx-radial-bar-chart")],at);var vt=require("lit/decorators.js");var Je=class extends X{constructor(){super(...arguments);this.value=Number.NaN;this.tickLabels=!0}render(){let{value:t,min:r,max:a,variant:o,startAngle:s,endAngle:c,thickness:l,bands:d,target:m,ticks:h,tickLabels:f,centerLabel:M,caption:$}=this;return this.root(Pa({...this.sized(),value:t,min:r,max:a,variant:o,startAngle:s,endAngle:c,thickness:l,bands:d,target:m,ticks:h,tickLabels:f,centerLabel:M,caption:$}),"gauge",this.label??"Gauge chart")}};u([(0,vt.property)({type:Number})],Je.prototype,"value",2),u([(0,vt.property)({type:Number})],Je.prototype,"min",2),u([(0,vt.property)({type:Number})],Je.prototype,"max",2),u([(0,vt.property)()],Je.prototype,"variant",2),u([(0,vt.property)({type:Number,attribute:"start-angle"})],Je.prototype,"startAngle",2),u([(0,vt.property)({type:Number,attribute:"end-angle"})],Je.prototype,"endAngle",2),u([(0,vt.property)({type:Number})],Je.prototype,"thickness",2),u([(0,vt.property)({attribute:!1})],Je.prototype,"bands",2),u([(0,vt.property)({type:Number})],Je.prototype,"target",2),u([(0,vt.property)({attribute:!1})],Je.prototype,"ticks",2),u([(0,vt.property)({type:Boolean,attribute:"no-tick-labels",converter:Re})],Je.prototype,"tickLabels",2),u([(0,vt.property)({attribute:"center-label"})],Je.prototype,"centerLabel",2),u([(0,vt.property)()],Je.prototype,"caption",2),Je=u([(0,vt.customElement)("skdx-gauge-chart")],Je);var ct=require("lit/decorators.js");var Ue=class extends X{constructor(){super(...arguments);this.series=[];this.labels=!1}render(){let{series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,zAxis:c,references:l,annotations:d,colorScale:m,colorLegend:h,hitRadius:f,jitter:M,trendline:$,sampling:g}=this;return this.root(Ha({...this.sized(),series:t,sizeRange:r,labels:a,xAxis:o,yAxis:s,zAxis:c,references:l,annotations:d,colorScale:m,colorLegend:h,hitRadius:f,jitter:M,trendline:$,sampling:g}),"bubble",this.label??"Bubble chart")}};u([(0,ct.property)({attribute:!1})],Ue.prototype,"series",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"sizeRange",2),u([(0,ct.property)({type:Boolean,reflect:!0})],Ue.prototype,"labels",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"xAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"yAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"zAxis",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"references",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"annotations",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"colorScale",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"colorLegend",2),u([(0,ct.property)({type:Number,attribute:"hit-radius"})],Ue.prototype,"hitRadius",2),u([(0,ct.property)({type:Number})],Ue.prototype,"jitter",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"trendline",2),u([(0,ct.property)({attribute:!1})],Ue.prototype,"sampling",2),Ue=u([(0,ct.customElement)("skdx-bubble-chart")],Ue);var dt=require("lit/decorators.js");var Ye=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,name:r,color:a,bins:o,binWidth:s,thresholds:c,domain:l,mode:d,xAxis:m,yAxis:h,references:f,annotations:M,labels:$,barGap:g}=this;return this.root(Va({...this.sized(),data:t,name:r,color:a,bins:o,binWidth:s,thresholds:c,domain:l,mode:d,xAxis:m,yAxis:h,references:f,annotations:M,labels:$,barGap:g}),"histogram",this.label??"Histogram")}};u([(0,dt.property)({attribute:!1})],Ye.prototype,"data",2),u([(0,dt.property)()],Ye.prototype,"name",2),u([(0,dt.property)()],Ye.prototype,"color",2),u([(0,dt.property)({type:Number})],Ye.prototype,"bins",2),u([(0,dt.property)({type:Number,attribute:"bin-width"})],Ye.prototype,"binWidth",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"thresholds",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"domain",2),u([(0,dt.property)()],Ye.prototype,"mode",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"xAxis",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"yAxis",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"references",2),u([(0,dt.property)({attribute:!1})],Ye.prototype,"annotations",2),u([(0,dt.property)({type:Boolean,reflect:!0})],Ye.prototype,"labels",2),u([(0,dt.property)({type:Number,attribute:"bar-gap"})],Ye.prototype,"barGap",2),Ye=u([(0,dt.customElement)("skdx-histogram")],Ye);var $n=require("lit/decorators.js");var Kt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,orientation:r,ranges:a,min:o,max:s,labels:c,ticks:l}=this;return this.root(Ir({...this.sized(),data:t,orientation:r,ranges:a,min:o,max:s,labels:c,ticks:l}),"bullet",this.label??"Bullet chart")}};u([(0,$n.property)({attribute:!1})],Kt.prototype,"data",2),u([(0,$n.property)()],Kt.prototype,"orientation",2),u([(0,$n.property)({attribute:!1})],Kt.prototype,"ranges",2),u([(0,$n.property)({type:Number})],Kt.prototype,"min",2),u([(0,$n.property)({type:Number})],Kt.prototype,"max",2),u([(0,$n.property)({type:Boolean,reflect:!0})],Kt.prototype,"labels",2),u([(0,$n.property)({type:Number})],Kt.prototype,"ticks",2),Kt=u([(0,$n.customElement)("skdx-bullet-chart")],Kt);var ci=require("lit/decorators.js");var hr=class extends Ae{render(){return this.root(_a(this.input()),"combo",this.label??"Combo chart")}};hr=u([(0,ci.customElement)("skdx-combo-chart")],hr);var et=require("lit/decorators.js");var _e=class extends X{constructor(){super(...arguments);this.series=[];this.connectNulls=!1;this.brush=!1;this.crosshair=!1}render(){let{series:t,variant:r,categories:a,xAxis:o,yAxis:s,rightAxis:c,references:l,annotations:d,curve:m,connectNulls:h,orientation:f,radius:M,barGap:$,barWidth:g,brush:w,crosshair:R}=this;return this.root(ja({...this.sized(),series:t,variant:r,categories:a,xAxis:o,yAxis:s,rightAxis:c,references:l,annotations:d,curve:m,connectNulls:h,orientation:f,radius:M,barGap:$,barWidth:g,brush:w,crosshair:R}),"range",this.label??"Range chart")}};u([(0,et.property)({attribute:!1})],_e.prototype,"series",2),u([(0,et.property)()],_e.prototype,"variant",2),u([(0,et.property)({attribute:!1})],_e.prototype,"categories",2),u([(0,et.property)({attribute:!1})],_e.prototype,"xAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"yAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"rightAxis",2),u([(0,et.property)({attribute:!1})],_e.prototype,"references",2),u([(0,et.property)({attribute:!1})],_e.prototype,"annotations",2),u([(0,et.property)()],_e.prototype,"curve",2),u([(0,et.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],_e.prototype,"connectNulls",2),u([(0,et.property)()],_e.prototype,"orientation",2),u([(0,et.property)({type:Number})],_e.prototype,"radius",2),u([(0,et.property)({type:Number,attribute:"bar-gap"})],_e.prototype,"barGap",2),u([(0,et.property)({type:Number,attribute:"bar-width"})],_e.prototype,"barWidth",2),u([(0,et.property)({type:Boolean,reflect:!0})],_e.prototype,"brush",2),u([(0,et.property)({type:Boolean,reflect:!0})],_e.prototype,"crosshair",2),_e=u([(0,et.customElement)("skdx-range-chart")],_e);var bn=require("lit/decorators.js");var Vt=class extends X{constructor(){super(...arguments);this.nodes=[];this.edges=[];this.labels=!0;this.directed=!1;this.edgeLabels=!1}render(){let{nodes:t,edges:r,arrange:a,labels:o,nodeRange:s,iterations:c,directed:l,edgeLabels:d}=this;return this.root(Ga({...this.sized(),nodes:t,edges:r,arrange:a,labels:o,nodeRange:s,iterations:c,directed:l,edgeLabels:d}),"network",this.label??"Network chart")}};u([(0,bn.property)({attribute:!1})],Vt.prototype,"nodes",2),u([(0,bn.property)({attribute:!1})],Vt.prototype,"edges",2),u([(0,bn.property)()],Vt.prototype,"arrange",2),u([(0,bn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Vt.prototype,"labels",2),u([(0,bn.property)({attribute:!1})],Vt.prototype,"nodeRange",2),u([(0,bn.property)({type:Number})],Vt.prototype,"iterations",2),u([(0,bn.property)({type:Boolean,reflect:!0})],Vt.prototype,"directed",2),u([(0,bn.property)({type:Boolean,reflect:!0,attribute:"edge-labels"})],Vt.prototype,"edgeLabels",2),Vt=u([(0,bn.customElement)("skdx-network-chart")],Vt);var Kn=require("lit/decorators.js");var In=class extends X{constructor(){super(...arguments);this.events=[];this.labels=!0}render(){let{events:t,orientation:r,xAxis:a,labels:o}=this;return this.root(qa({...this.sized(),events:t,orientation:r,xAxis:a,labels:o}),"timeline",this.label??"Timeline chart")}};u([(0,Kn.property)({attribute:!1})],In.prototype,"events",2),u([(0,Kn.property)()],In.prototype,"orientation",2),u([(0,Kn.property)({attribute:!1})],In.prototype,"xAxis",2),u([(0,Kn.property)({type:Boolean,attribute:"no-labels",converter:Re})],In.prototype,"labels",2),In=u([(0,Kn.customElement)("skdx-timeline-chart")],In);var jn=require("lit/decorators.js");var gn=class extends X{constructor(){super(...arguments);this.segments=[];this.data=[];this.labels=!1}render(){let{segments:t,data:r,labels:a,gap:o,xAxis:s}=this;return this.root(Bo({...this.sized(),segments:t,data:r,labels:a,gap:o,xAxis:s}),"marimekko",this.label??"Marimekko chart")}};u([(0,jn.property)({attribute:!1})],gn.prototype,"segments",2),u([(0,jn.property)({attribute:!1})],gn.prototype,"data",2),u([(0,jn.property)({type:Boolean,reflect:!0})],gn.prototype,"labels",2),u([(0,jn.property)({type:Number})],gn.prototype,"gap",2),u([(0,jn.property)({attribute:!1})],gn.prototype,"xAxis",2),gn=u([(0,jn.customElement)("skdx-marimekko-chart")],gn);var Sn=require("lit/decorators.js");var an=class extends X{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:a,curve:o,connectNulls:s,filters:c}=this;return this.root(Fo({...this.sized(),dimensions:t,data:r,opacity:a,curve:o,connectNulls:s,filters:c}),"parallel",this.label??"Parallel coordinates chart")}};u([(0,Sn.property)({attribute:!1})],an.prototype,"dimensions",2),u([(0,Sn.property)({attribute:!1})],an.prototype,"data",2),u([(0,Sn.property)({type:Number})],an.prototype,"opacity",2),u([(0,Sn.property)()],an.prototype,"curve",2),u([(0,Sn.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],an.prototype,"connectNulls",2),u([(0,Sn.property)({attribute:!1})],an.prototype,"filters",2),an=u([(0,Sn.customElement)("skdx-parallel-coordinates-chart")],an);var on=require("lit/decorators.js");var St=class extends X{constructor(){super(...arguments);this.value=Number.NaN;this.labels=!0}render(){let{value:t,min:r,max:a,target:o,bands:s,orientation:c,caption:l,labels:d,ticks:m}=this;return this.root(Po({...this.sized(),value:t,min:r,max:a,target:o,bands:s,orientation:c,caption:l,labels:d,ticks:m}),"linear-gauge",this.label??"Linear gauge")}};u([(0,on.property)({type:Number})],St.prototype,"value",2),u([(0,on.property)({type:Number})],St.prototype,"min",2),u([(0,on.property)({type:Number})],St.prototype,"max",2),u([(0,on.property)({type:Number})],St.prototype,"target",2),u([(0,on.property)({attribute:!1})],St.prototype,"bands",2),u([(0,on.property)()],St.prototype,"orientation",2),u([(0,on.property)()],St.prototype,"caption",2),u([(0,on.property)({type:Boolean,attribute:"no-labels",converter:Re})],St.prototype,"labels",2),u([(0,on.property)({type:Number})],St.prototype,"ticks",2),St=u([(0,on.customElement)("skdx-linear-gauge")],St);var sn=require("lit/decorators.js");var zt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,startLabel:r,endLabel:a,orientation:o,labels:s,sort:c,markerSize:l,xAxis:d,references:m}=this;return this.root(Ho({...this.sized(),data:t,startLabel:r,endLabel:a,orientation:o,labels:s,sort:c,markerSize:l,xAxis:d,references:m}),"dumbbell",this.label??"Dumbbell chart")}};u([(0,sn.property)({attribute:!1})],zt.prototype,"data",2),u([(0,sn.property)({attribute:"start-label"})],zt.prototype,"startLabel",2),u([(0,sn.property)({attribute:"end-label"})],zt.prototype,"endLabel",2),u([(0,sn.property)()],zt.prototype,"orientation",2),u([(0,sn.property)({type:Boolean,reflect:!0})],zt.prototype,"labels",2),u([(0,sn.property)()],zt.prototype,"sort",2),u([(0,sn.property)({type:Number,attribute:"marker-size"})],zt.prototype,"markerSize",2),u([(0,sn.property)({attribute:!1})],zt.prototype,"xAxis",2),u([(0,sn.property)({attribute:!1})],zt.prototype,"references",2),zt=u([(0,sn.customElement)("skdx-dumbbell-chart")],zt);var Nt=require("lit/decorators.js");var ot=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1;this.brush=!1;this.crosshair=!1}render(){let{data:t,threshold:r,cumulativeLabel:a,name:o,labels:s,radius:c,barGap:l,barWidth:d,xAxis:m,yAxis:h,brush:f,crosshair:M}=this;return this.root(Vo({...this.sized(),data:t,threshold:r,cumulativeLabel:a,name:o,labels:s,radius:c,barGap:l,barWidth:d,xAxis:m,yAxis:h,brush:f,crosshair:M}),"pareto",this.label??"Pareto chart")}};u([(0,Nt.property)({attribute:!1})],ot.prototype,"data",2),u([(0,Nt.property)({type:Number})],ot.prototype,"threshold",2),u([(0,Nt.property)({attribute:"cumulative-label"})],ot.prototype,"cumulativeLabel",2),u([(0,Nt.property)()],ot.prototype,"name",2),u([(0,Nt.property)({type:Boolean,reflect:!0})],ot.prototype,"labels",2),u([(0,Nt.property)({type:Number})],ot.prototype,"radius",2),u([(0,Nt.property)({type:Number,attribute:"bar-gap"})],ot.prototype,"barGap",2),u([(0,Nt.property)({type:Number,attribute:"bar-width"})],ot.prototype,"barWidth",2),u([(0,Nt.property)({attribute:!1})],ot.prototype,"xAxis",2),u([(0,Nt.property)({attribute:!1})],ot.prototype,"yAxis",2),u([(0,Nt.property)({type:Boolean,reflect:!0})],ot.prototype,"brush",2),u([(0,Nt.property)({type:Boolean,reflect:!0})],ot.prototype,"crosshair",2),ot=u([(0,Nt.customElement)("skdx-pareto-chart")],ot);var xn=require("lit/decorators.js");var _t=class extends X{constructor(){super(...arguments);this.series=[];this.ranked=!1;this.labels=!0}render(){let{series:t,categories:r,ranked:a,topRank:o,curve:s,labels:c,markerSize:l,xAxis:d}=this;return this.root(Wo({...this.sized(),series:t,categories:r,ranked:a,topRank:o,curve:s,labels:c,markerSize:l,xAxis:d}),"bump",this.label??"Bump chart")}};u([(0,xn.property)({attribute:!1})],_t.prototype,"series",2),u([(0,xn.property)({attribute:!1})],_t.prototype,"categories",2),u([(0,xn.property)({type:Boolean,reflect:!0})],_t.prototype,"ranked",2),u([(0,xn.property)({type:Number,attribute:"top-rank"})],_t.prototype,"topRank",2),u([(0,xn.property)()],_t.prototype,"curve",2),u([(0,xn.property)({type:Boolean,attribute:"no-labels",converter:Re})],_t.prototype,"labels",2),u([(0,xn.property)({type:Number,attribute:"marker-size"})],_t.prototype,"markerSize",2),u([(0,xn.property)({attribute:!1})],_t.prototype,"xAxis",2),_t=u([(0,xn.customElement)("skdx-bump-chart")],_t);var ln=require("lit/decorators.js");var Rt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,scale:r,max:a,startAngle:o,endAngle:s,padAngle:c,innerRadius:l,levels:d,labels:m}=this;return this.root(Zo({...this.sized(),data:t,scale:r,max:a,startAngle:o,endAngle:s,padAngle:c,innerRadius:l,levels:d,labels:m}),"polar-area",this.label??"Polar area chart")}};u([(0,ln.property)({attribute:!1})],Rt.prototype,"data",2),u([(0,ln.property)()],Rt.prototype,"scale",2),u([(0,ln.property)({type:Number})],Rt.prototype,"max",2),u([(0,ln.property)({type:Number,attribute:"start-angle"})],Rt.prototype,"startAngle",2),u([(0,ln.property)({type:Number,attribute:"end-angle"})],Rt.prototype,"endAngle",2),u([(0,ln.property)({type:Number,attribute:"pad-angle"})],Rt.prototype,"padAngle",2),u([(0,ln.property)({type:Number,attribute:"inner-radius"})],Rt.prototype,"innerRadius",2),u([(0,ln.property)({type:Number})],Rt.prototype,"levels",2),u([(0,ln.property)({type:Boolean,reflect:!0})],Rt.prototype,"labels",2),Rt=u([(0,ln.customElement)("skdx-polar-area-chart")],Rt);var Gn=require("lit/decorators.js");var yn=class extends X{constructor(){super(...arguments);this.series=[]}render(){let{series:t,orientation:r,markerSize:a,yAxis:o,references:s}=this;return this.root(Uo({...this.sized(),series:t,orientation:r,markerSize:a,yAxis:o,references:s}),"swarm",this.label??"Swarm plot")}};u([(0,Gn.property)({attribute:!1})],yn.prototype,"series",2),u([(0,Gn.property)()],yn.prototype,"orientation",2),u([(0,Gn.property)({type:Number,attribute:"marker-size"})],yn.prototype,"markerSize",2),u([(0,Gn.property)({attribute:!1})],yn.prototype,"yAxis",2),u([(0,Gn.property)({attribute:!1})],yn.prototype,"references",2),yn=u([(0,Gn.customElement)("skdx-swarm-plot")],yn);var vn=require("lit/decorators.js");var jt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!1}render(){let{data:t,total:r,rows:a,columns:o,orientation:s,cellGap:c,cellRadius:l,labels:d}=this;return this.root(Yo({...this.sized(),data:t,total:r,rows:a,columns:o,orientation:s,cellGap:c,cellRadius:l,labels:d}),"waffle",this.label??"Waffle chart")}};u([(0,vn.property)({attribute:!1})],jt.prototype,"data",2),u([(0,vn.property)({type:Number})],jt.prototype,"total",2),u([(0,vn.property)({type:Number})],jt.prototype,"rows",2),u([(0,vn.property)({type:Number})],jt.prototype,"columns",2),u([(0,vn.property)()],jt.prototype,"orientation",2),u([(0,vn.property)({type:Number,attribute:"cell-gap"})],jt.prototype,"cellGap",2),u([(0,vn.property)({type:Number,attribute:"cell-radius"})],jt.prototype,"cellRadius",2),u([(0,vn.property)({type:Boolean,reflect:!0})],jt.prototype,"labels",2),jt=u([(0,vn.customElement)("skdx-waffle-chart")],jt);var cn=require("lit/decorators.js");var Et=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,nodeShape:a,linkStyle:o,rootId:s,collapsed:c,maxDepth:l,labels:d,nodeSize:m}=this;return this.root(Jr({...this.sized(),data:t,orientation:r,nodeShape:a,linkStyle:o,rootId:s,collapsed:c,maxDepth:l,labels:d,nodeSize:m}),"tree",this.label??"Tree chart")}};u([(0,cn.property)({attribute:!1})],Et.prototype,"data",2),u([(0,cn.property)()],Et.prototype,"orientation",2),u([(0,cn.property)({attribute:"node-shape"})],Et.prototype,"nodeShape",2),u([(0,cn.property)({attribute:"link-style"})],Et.prototype,"linkStyle",2),u([(0,cn.property)({attribute:!1})],Et.prototype,"rootId",2),u([(0,cn.property)({attribute:!1})],Et.prototype,"collapsed",2),u([(0,cn.property)({type:Number,attribute:"max-depth"})],Et.prototype,"maxDepth",2),u([(0,cn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Et.prototype,"labels",2),u([(0,cn.property)({type:Number,attribute:"node-size"})],Et.prototype,"nodeSize",2),Et=u([(0,cn.customElement)("skdx-tree-chart")],Et);var Tn=require("lit/decorators.js");var Xt=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,rootId:a,collapsed:o,maxDepth:s,labels:c,nodeSize:l}=this;return this.root(_o({...this.sized(),data:t,orientation:r,rootId:a,collapsed:o,maxDepth:s,labels:c,nodeSize:l}),"organization",this.label??"Organization chart")}};u([(0,Tn.property)({attribute:!1})],Xt.prototype,"data",2),u([(0,Tn.property)()],Xt.prototype,"orientation",2),u([(0,Tn.property)({attribute:!1})],Xt.prototype,"rootId",2),u([(0,Tn.property)({attribute:!1})],Xt.prototype,"collapsed",2),u([(0,Tn.property)({type:Number,attribute:"max-depth"})],Xt.prototype,"maxDepth",2),u([(0,Tn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Xt.prototype,"labels",2),u([(0,Tn.property)({type:Number,attribute:"node-size"})],Xt.prototype,"nodeSize",2),Xt=u([(0,Tn.customElement)("skdx-organization-chart")],Xt);var zn=require("lit/decorators.js");var dn=class extends X{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:a,labels:o,padding:s,colorScale:c}=this;return this.root(jo({...this.sized(),data:t,rootId:r,maxDepth:a,labels:o,padding:s,colorScale:c}),"circle-packing",this.label??"Circle packing chart")}};u([(0,zn.property)({attribute:!1})],dn.prototype,"data",2),u([(0,zn.property)({attribute:!1})],dn.prototype,"rootId",2),u([(0,zn.property)({type:Number,attribute:"max-depth"})],dn.prototype,"maxDepth",2),u([(0,zn.property)({type:Boolean,attribute:"no-labels",converter:Re})],dn.prototype,"labels",2),u([(0,zn.property)({type:Number})],dn.prototype,"padding",2),u([(0,zn.property)({attribute:!1})],dn.prototype,"colorScale",2),dn=u([(0,zn.customElement)("skdx-circle-packing-chart")],dn);var mn=require("lit/decorators.js");var Dt=class extends X{constructor(){super(...arguments);this.data=[];this.breadcrumbs=!1;this.labels=!0}render(){let{data:t,orientation:r,rootId:a,breadcrumbs:o,maxDepth:s,sort:c,labels:l,padding:d,colorScale:m}=this;return this.root(Go({...this.sized(),data:t,orientation:r,rootId:a,breadcrumbs:o,maxDepth:s,sort:c,labels:l,padding:d,colorScale:m}),"icicle",this.label??"Icicle chart")}};u([(0,mn.property)({attribute:!1})],Dt.prototype,"data",2),u([(0,mn.property)()],Dt.prototype,"orientation",2),u([(0,mn.property)({attribute:!1})],Dt.prototype,"rootId",2),u([(0,mn.property)({type:Boolean,reflect:!0})],Dt.prototype,"breadcrumbs",2),u([(0,mn.property)({type:Number,attribute:"max-depth"})],Dt.prototype,"maxDepth",2),u([(0,mn.property)()],Dt.prototype,"sort",2),u([(0,mn.property)({type:Boolean,attribute:"no-labels",converter:Re})],Dt.prototype,"labels",2),u([(0,mn.property)({type:Number})],Dt.prototype,"padding",2),u([(0,mn.property)({attribute:!1})],Dt.prototype,"colorScale",2),Dt=u([(0,mn.customElement)("skdx-icicle-chart")],Dt);0&&(module.exports={SkdxAreaChart,SkdxBarChart,SkdxBoxplot,SkdxBubbleChart,SkdxBulletChart,SkdxBumpChart,SkdxCandlestickChart,SkdxChordChart,SkdxCirclePackingChart,SkdxComboChart,SkdxDumbbellChart,SkdxFunnelChart,SkdxGanttChart,SkdxGaugeChart,SkdxHeatmap,SkdxHistogram,SkdxIcicleChart,SkdxLineChart,SkdxLinearGauge,SkdxMapChart,SkdxMarimekkoChart,SkdxNetworkChart,SkdxOrganizationChart,SkdxParallelCoordinatesChart,SkdxParetoChart,SkdxPieChart,SkdxPolarAreaChart,SkdxRadarChart,SkdxRadialBarChart,SkdxRangeChart,SkdxSankeyChart,SkdxScatterChart,SkdxSparkline,SkdxSunburstChart,SkdxSwarmPlot,SkdxTimelineChart,SkdxTreeChart,SkdxTreemap,SkdxWaffleChart,SkdxWaterfallChart,csv,exportChart,makeFormatter,seriesCsv,svgMarkup,syncGroup});
|