@skdx/web-components-charts 0.44.0 → 0.48.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.
Files changed (174) hide show
  1. package/dist/area.cjs +9 -9
  2. package/dist/area.d.cts +2 -1
  3. package/dist/area.d.ts +2 -1
  4. package/dist/area.js +9 -9
  5. package/dist/bar.cjs +9 -9
  6. package/dist/bar.d.cts +2 -1
  7. package/dist/bar.d.ts +2 -1
  8. package/dist/bar.js +9 -9
  9. package/dist/boxplot.cjs +35 -35
  10. package/dist/boxplot.d.cts +2 -1
  11. package/dist/boxplot.d.ts +2 -1
  12. package/dist/boxplot.js +12 -12
  13. package/dist/bubble.cjs +10 -10
  14. package/dist/bubble.d.cts +2 -1
  15. package/dist/bubble.d.ts +2 -1
  16. package/dist/bubble.js +10 -10
  17. package/dist/bullet.cjs +12 -12
  18. package/dist/bullet.d.cts +2 -1
  19. package/dist/bullet.d.ts +2 -1
  20. package/dist/bullet.js +12 -12
  21. package/dist/bump.cjs +11 -11
  22. package/dist/bump.d.cts +2 -1
  23. package/dist/bump.d.ts +2 -1
  24. package/dist/bump.js +29 -29
  25. package/dist/candlestick.cjs +28 -28
  26. package/dist/candlestick.d.cts +2 -1
  27. package/dist/candlestick.d.ts +2 -1
  28. package/dist/candlestick.js +8 -8
  29. package/dist/chord.cjs +15 -15
  30. package/dist/chord.d.cts +2 -1
  31. package/dist/chord.d.ts +2 -1
  32. package/dist/chord.js +28 -28
  33. package/dist/circle-packing.cjs +5 -5
  34. package/dist/circle-packing.d.cts +2 -1
  35. package/dist/circle-packing.d.ts +2 -1
  36. package/dist/circle-packing.js +8 -8
  37. package/dist/combo.cjs +9 -9
  38. package/dist/combo.d.cts +2 -1
  39. package/dist/combo.d.ts +2 -1
  40. package/dist/combo.js +9 -9
  41. package/dist/dumbbell.cjs +7 -7
  42. package/dist/dumbbell.d.cts +2 -1
  43. package/dist/dumbbell.d.ts +2 -1
  44. package/dist/dumbbell.js +8 -8
  45. package/dist/funnel.cjs +12 -12
  46. package/dist/funnel.d.cts +2 -1
  47. package/dist/funnel.d.ts +2 -1
  48. package/dist/funnel.js +27 -27
  49. package/dist/gantt.cjs +15 -15
  50. package/dist/gantt.d.cts +2 -1
  51. package/dist/gantt.d.ts +2 -1
  52. package/dist/gantt.js +15 -15
  53. package/dist/gauge.cjs +13 -13
  54. package/dist/gauge.d.cts +2 -1
  55. package/dist/gauge.d.ts +2 -1
  56. package/dist/gauge.js +13 -13
  57. package/dist/heatmap.cjs +5 -5
  58. package/dist/heatmap.d.cts +2 -1
  59. package/dist/heatmap.d.ts +2 -1
  60. package/dist/heatmap.js +5 -5
  61. package/dist/histogram.cjs +13 -13
  62. package/dist/histogram.d.cts +2 -1
  63. package/dist/histogram.d.ts +2 -1
  64. package/dist/histogram.js +13 -13
  65. package/dist/icicle.cjs +10 -10
  66. package/dist/icicle.d.cts +2 -1
  67. package/dist/icicle.d.ts +2 -1
  68. package/dist/icicle.js +10 -10
  69. package/dist/{index-D44-61v7.d.cts → index-Hexgp_4S.d.cts} +5 -1070
  70. package/dist/{index-D44-61v7.d.ts → index-pqdWxinA.d.ts} +5 -1070
  71. package/dist/index.cjs +5 -5
  72. package/dist/index.d.cts +3 -2
  73. package/dist/index.d.ts +3 -2
  74. package/dist/index.js +3 -3
  75. package/dist/line.cjs +9 -9
  76. package/dist/line.d.cts +2 -1
  77. package/dist/line.d.ts +2 -1
  78. package/dist/line.js +9 -9
  79. package/dist/linear-gauge.cjs +8 -8
  80. package/dist/linear-gauge.d.cts +2 -1
  81. package/dist/linear-gauge.d.ts +2 -1
  82. package/dist/linear-gauge.js +8 -8
  83. package/dist/map.cjs +6 -6
  84. package/dist/map.d.cts +2 -1
  85. package/dist/map.d.ts +2 -1
  86. package/dist/map.js +6 -6
  87. package/dist/marimekko.cjs +8 -8
  88. package/dist/marimekko.d.cts +2 -1
  89. package/dist/marimekko.d.ts +2 -1
  90. package/dist/marimekko.js +5 -5
  91. package/dist/network.cjs +10 -10
  92. package/dist/network.d.cts +2 -1
  93. package/dist/network.d.ts +2 -1
  94. package/dist/network.js +9 -9
  95. package/dist/organization.cjs +6 -6
  96. package/dist/organization.d.cts +2 -1
  97. package/dist/organization.d.ts +2 -1
  98. package/dist/organization.js +24 -24
  99. package/dist/parallel.cjs +8 -8
  100. package/dist/parallel.d.cts +2 -1
  101. package/dist/parallel.d.ts +2 -1
  102. package/dist/parallel.js +8 -8
  103. package/dist/pareto.cjs +9 -9
  104. package/dist/pareto.d.cts +2 -1
  105. package/dist/pareto.d.ts +2 -1
  106. package/dist/pareto.js +9 -9
  107. package/dist/pie.cjs +11 -11
  108. package/dist/pie.d.cts +2 -1
  109. package/dist/pie.d.ts +2 -1
  110. package/dist/pie.js +26 -26
  111. package/dist/polar-area.cjs +19 -19
  112. package/dist/polar-area.d.cts +2 -1
  113. package/dist/polar-area.d.ts +2 -1
  114. package/dist/polar-area.js +27 -27
  115. package/dist/portable-runtime.js +1 -0
  116. package/dist/portable.cjs +1 -0
  117. package/dist/portable.d.cts +25 -0
  118. package/dist/portable.d.ts +25 -0
  119. package/dist/portable.js +1 -0
  120. package/dist/radar.cjs +9 -9
  121. package/dist/radar.d.cts +2 -1
  122. package/dist/radar.d.ts +2 -1
  123. package/dist/radar.js +29 -29
  124. package/dist/radial.cjs +10 -10
  125. package/dist/radial.d.cts +2 -1
  126. package/dist/radial.d.ts +2 -1
  127. package/dist/radial.js +10 -10
  128. package/dist/range.cjs +13 -13
  129. package/dist/range.d.cts +2 -1
  130. package/dist/range.d.ts +2 -1
  131. package/dist/range.js +13 -13
  132. package/dist/sankey.cjs +8 -8
  133. package/dist/sankey.d.cts +2 -1
  134. package/dist/sankey.d.ts +2 -1
  135. package/dist/sankey.js +27 -27
  136. package/dist/scatter.cjs +10 -10
  137. package/dist/scatter.d.cts +2 -1
  138. package/dist/scatter.d.ts +2 -1
  139. package/dist/scatter.js +11 -11
  140. package/dist/sparkline.cjs +11 -11
  141. package/dist/sparkline.d.cts +2 -1
  142. package/dist/sparkline.d.ts +2 -1
  143. package/dist/sparkline.js +11 -11
  144. package/dist/sunburst.cjs +14 -14
  145. package/dist/sunburst.d.cts +2 -1
  146. package/dist/sunburst.d.ts +2 -1
  147. package/dist/sunburst.js +10 -10
  148. package/dist/swarm.cjs +10 -10
  149. package/dist/swarm.d.cts +2 -1
  150. package/dist/swarm.d.ts +2 -1
  151. package/dist/swarm.js +11 -11
  152. package/dist/timeline.cjs +12 -12
  153. package/dist/timeline.d.cts +2 -1
  154. package/dist/timeline.d.ts +2 -1
  155. package/dist/timeline.js +30 -30
  156. package/dist/tree.cjs +6 -6
  157. package/dist/tree.d.cts +2 -1
  158. package/dist/tree.d.ts +2 -1
  159. package/dist/tree.js +24 -24
  160. package/dist/treemap.cjs +14 -14
  161. package/dist/treemap.d.cts +2 -1
  162. package/dist/treemap.d.ts +2 -1
  163. package/dist/treemap.js +15 -15
  164. package/dist/types-DPf3PUs2.d.cts +1168 -0
  165. package/dist/types-DPf3PUs2.d.ts +1168 -0
  166. package/dist/waffle.cjs +3 -3
  167. package/dist/waffle.d.cts +2 -1
  168. package/dist/waffle.d.ts +2 -1
  169. package/dist/waffle.js +23 -23
  170. package/dist/waterfall.cjs +11 -11
  171. package/dist/waterfall.d.cts +2 -1
  172. package/dist/waterfall.d.ts +2 -1
  173. package/dist/waterfall.js +13 -13
  174. package/package.json +6 -4
package/dist/network.js CHANGED
@@ -1,6 +1,6 @@
1
- var fn=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var p=(e,n,t,r)=>{for(var i=r>1?void 0:r?mn(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&fn(n,t,i),i};import{customElement as Fn,property as V}from"lit/decorators.js";var Gt=e=>Number(e.toPrecision(12)),bn,gn=e=>(bn??(bn=new Intl.NumberFormat)).format(Gt(e)),xn=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function _t(e){if(e===void 0)return gn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=d=>i?u=>d(u)+i:d,a=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},c=d=>{let u=new Intl.NumberFormat(t,d);return s(f=>u.format(Gt(f)))},h=d=>{let u=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return f=>u.format(f)};switch(n){case"integer":return c({maximumFractionDigits:0});case"decimal":return c(a(2));case"percent":return c({style:"percent",...a(0)});case"currency":return c({style:"currency",currency:e.currency??"USD",...a()});case"compact":return c({notation:"compact",...a(1)});case"scientific":return c({notation:"scientific",...a(2)});case"date":return h({dateStyle:"medium"});case"time":return h({timeStyle:"short"});case"datetime":return h({dateStyle:"medium",timeStyle:"short"});case"duration":return s(xn)}}var g=e=>Number(e.toFixed(2)),F=e=>typeof e=="number"&&Number.isFinite(e);function Y(e){let n=1/0,t=-1/0;for(let r of e)F(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}var ce=1e3,de=60*ce,ue=60*de,Me=24*ue,jn=[ce,5*ce,15*ce,30*ce,de,5*de,15*de,30*de,ue,3*ue,6*ue,12*ue,Me,2*Me,7*Me,14*Me];var yn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,vn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,wn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Mn(e,n,t){return e.replace(vn,(r,i,o)=>{let s=wn[i];if(s===void 0)return i+o;let c=(o.match(yn)??[]).map((h,d)=>{let u=Number(h);if(s===-1)return String(u+n);if(s===-2)return String(u+t);let f=d%s;return s===7?f===5?String(u+n):f===6?String(u+t):h:String(f%2===0?u+n:u+t)});return i+c.join(" ")})}var jt=(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:Mn(r.d,n,t)}}});var De=["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)"))),M={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)"};var Et=(e,n)=>n??De[e%De.length];var kn={top:16,right:16,bottom:32,left:48};function Ht(e,n,t=kn){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 he(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Vt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var ke=20,$n=120,Zt=e=>{let n=he(e);return n&&(n.position==="left"||n.position==="right")?n.width??$n:0},$e=(e,n=600,t=300)=>({width:(e.width??n)-Zt(e),height:(e.height??t)-(he(e)?.position==="bottom"?ke:0)}),Wt=(e,n,t)=>{let r=he(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Kt(n,t??$e(e).width,r)):1)*ke},B=6.5;function Sn(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/B));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var Ge=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Et(n)),Ut=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Fe(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],c=r.maxItems,h=c!==void 0&&c>=0&&e.length>c?e.slice(0,c):e,d=e.length-h.length,u=r.interactive??!0,f=o,v=i,S=(y,w,I,O)=>{let z=(w?18:4)+y.length*B;f>o&&(s||f+z>n-8)&&(f=o,v+=ke),w&&a.push({kind:"rect",part:"legend-swatch",x:f,y:v-5,width:10,height:10,fill:w,opacity:O?.3:void 0,item:I}),a.push({kind:"text",part:"legend-label",x:f+(w?14:0),y:v,text:y,baseline:"middle",fill:O?M.grid:M.label,item:I}),f+=z+12};for(let y of h){let w=t.includes(y.name),I=u?{label:y.name,series:y.name,legend:!0}:void 0;S(r.formatter?.(y.name)??y.name,y.color,I,w)}return d>0&&S(`+${d} more`,void 0,void 0,!1),r.align==="end"?Cn(a,n):a}function Cn(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(a=>a.kind==="rect"?a.x+a.width:a.x+a.text.length*B)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var Kt=(e,n,t={})=>new Set(Fe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function _e(e,n,t,r=[]){let i=he(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=Vt(e),a=o?.position==="bottom",c=Zt(e),h=e.hiddenSeries??[],d=o?c?Fe(r,1/0,h,o,10,(o.position==="right"?n:0)+8,!0):Fe(r,n,h,o,a?t+10:10):[],u=a?Kt(r,n,o):0;return{width:n+c,height:a?t+Math.max(1,u)*ke:t,legendOffset:o?.position==="left"?c: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:d}}function je(e){let n=e.legendOffset;if(!n)return e;let t=[...jt(e.shapes.filter(c=>!c.part.startsWith("legend-")),n,0),...e.shapes.filter(c=>c.part.startsWith("legend-"))],r=c=>({...c,x:c.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(c=>c+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:c=>o.scale(c)+n,invert:c=>o.invert(c-n),bars:o.bars.map(c=>({...c,x0:c.x0+n,x1:c.x1+n}))}:void 0,a=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:a,legendOffset:void 0}}function Se(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/B)),c=s.flatMap(w=>{let I=[],O=Array.from(w);for(;O.length>a;){let z=O.slice(0,a+1).lastIndexOf(" ");z<1&&(z=a),I.push(O.slice(0,z).join("")),O=O.slice(z),O[0]===" "&&O.shift()}return I.push(O.join("")),I}),h=Math.max(1,Math.floor((i-6)/16)),d=c.slice(0,h);c.length>h&&(d[h-1]=Sn(`${d[h-1]}\u2026`,r-12));let u=Math.min(r,Math.max(0,...d.map(w=>Array.from(w).length))*B+12),f=Math.min(i,6+d.length*16),v=o==="top"?{x:e-u/2,y:n-f-8}:o==="bottom"?{x:e-u/2,y:n+8}:o==="left"?{x:e-u-8,y:n-f/2}:o==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},S=Math.max(0,Math.min(r-u,v.x)),y=Math.max(0,Math.min(i-f,v.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
- `),x:g(S),y:g(y),width:g(u),height:f,fill:"var(--skdx-color-surface-raised)",stroke:M.axis,rx:8},...d.map((w,I)=>({kind:"text",part:"tooltip-label",x:g(S+6),y:g(y+11+I*16),text:w,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&I===0?"bold":void 0}))]}function qt(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=$e(e,t,r),a=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",c=[];return i==="loading"&&c.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:8}),c.push({kind:"text",part:`state-${i}`,x:g(o/2),y:g(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":M.label}),{..._e(e,o,s),shapes:c,tooltip:!1}}var Ee=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:M.label,...r});function pe(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var He=e=>e.id??e.name??e.series,Yt=e=>e.seriesId??e.series;function G(e,n){let t=!1;return n.id!==void 0&&(t=!0,He(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Yt(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 Ve=e=>pe(e).flatMap(n=>n.id!==void 0?[n.id]:[]);function j(e){let n={},t=He(e);t!==void 0&&(n.id=t);let r=Yt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ze=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function We(e,n,t){let r=pe(e),i=j(n),o=r.some(s=>G(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!G(n,s)):[...r,i]}var In=.2;function Tn(e){let n=M.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 On=(e,n)=>e.kind==="text"?{...e,fill:M.grid}:{...e,opacity:(e.opacity??1)*n};function Ue(e,n){let t=pe(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:pe(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=d=>!i||r.some(u=>G(d,u))?!0:o.highlighted==="series"?r.some(u=>u.series!==void 0&&G(d,{series:u.series})):!1,c=d=>{if(!i||o.faded==="none"||a(d))return!1;if(o.faded==="series"){let u=i.series;return u!==void 0&&G(d,{series:u})}return!0},h=e.shapes.map(d=>{let u=d.item;if(!u||u.legend)return d;if(t.some(f=>G(u,f))){let f=Tn(d);f&&s.push(f)}return c(u)?On(d,In):d});return s.length?{...e,shapes:[...h,...s]}:{...e,shapes:h}}var Ce=e=>Math.round(e*1e6)/1e6,Xt=60,An=500;function Ke(e){let n=[],t=new Map;for(let l of e.nodes)t.has(l.id)?n.push({code:"duplicate-id",severity:"warning",message:`Node id "${l.id}" is duplicated; the first definition is kept.`,itemId:l.id}):t.set(l.id,l);let r=l=>l.group,i=[...t.values()].filter(l=>!(l.group!==void 0&&Ut(e,l.group))),o=new Set(i.map(l=>l.id)),s=e.edges.filter(l=>{let b=o.has(l.source)&&o.has(l.target);return!b&&!(t.has(l.source)&&t.has(l.target))&&n.push({code:"unknown-node",severity:"warning",message:`Edge ${l.source} \u2192 ${l.target} names a node that does not exist and was dropped.`,itemId:l.id}),b}),a=qt(e,i.length===0);if(a)return{...a,issues:n};let c=_t(e.format),{width:h,height:d}=$e(e),[u,f]=e.nodeRange??[5,16],v=e.labels??i.length<=Xt,S=[...new Set(e.nodes.map(r).filter(l=>l!==void 0))],y=S.map((l,b)=>({name:l,color:Ge(e,b)})),w=Ht(h,d,{top:Wt(e,y,h)+f+8,right:f+(v?48:8),bottom:f+8,left:f+8}),I=(l,b)=>l.color??Ge(e,l.group!==void 0?S.indexOf(l.group):b),[,O]=Y(i.map(l=>l.value)),z=l=>F(l)&&O>0?u+Math.sqrt(Math.max(0,l)/O)*(f-u):u,Z=new Map;for(let l of s)Z.set(l.source,(Z.get(l.source)??0)+1),l.target!==l.source&&Z.set(l.target,(Z.get(l.target)??0)+1);let W=i.length,ge=new Map(i.map((l,b)=>[l.id,b])),U,K,ee=e.arrange??"force";ee==="manual"&&i.every(l=>F(l.x)&&F(l.y))?(U=i.map(l=>l.x),K=i.map(l=>l.y)):ee==="circular"||ee==="manual"||W<3?(U=i.map((l,b)=>Ce(Math.cos(2*Math.PI*b/W-Math.PI/2))),K=i.map((l,b)=>Ce(Math.sin(2*Math.PI*b/W-Math.PI/2)))):{xs:U,ys:K}=Ln(W,s.map(l=>[ge.get(l.source),ge.get(l.target)]),e.iterations??Math.max(50,Math.min(300,Math.floor(3e4/W))));let[te,xe]=Y(U),[ne,Ct]=Y(K),It=Math.max(xe-te,Ct-ne)||1,ye=Math.min(w.width/It,w.height/It),dn=w.x+(w.width-(xe-te)*ye)/2,un=w.y+(w.height-(Ct-ne)*ye)/2,Tt=i.map((l,b)=>({node:l,index:b,x:g(dn+(U[b]-te)*ye),y:g(un+(K[b]-ne)*ye),r:g(z(l.value)),color:I(l,b),degree:Z.get(l.id)??0})),Pe=new Map(Tt.map(l=>[l.node.id,l])),Ot=Ve(e.selected)[0],N=Ot!==void 0?Pe.get(String(Ot)):void 0,re=new Set;if(N){re.add(N.node.id);for(let l of s)l.source===N.node.id&&re.add(l.target),l.target===N.node.id&&re.add(l.source)}let Re=(l,b=l)=>N&&!(re.has(l)&&re.has(b))?.15:void 0,hn=l=>!N||l.source===N.node.id||l.target===N.node.id,[,At]=Y(s.map(l=>l.value)),Be=s.length<=An,Lt=[],zt=(l,b,C)=>Lt.some(D=>Math.abs(D.y-b)<12&&l<D.x+D.w+4&&l+C+4>D.x)?!1:(Lt.push({x:l,y:b,w:C}),!0),Pt=[],Rt=[],pn=s.map(l=>{let b=Pe.get(l.source),C=Pe.get(l.target),D=F(l.value)&&At>0?1+3*Math.sqrt(Math.max(0,l.value)/At):1,q=`${b.node.label??b.node.id} \u2192 ${C.node.label??C.node.id}${l.label?` ${l.label}`:""}${F(l.value)?`: ${c(l.value)}`:""}`,ie=hn(l)?Re(l.source,l.target):.15,oe=Be?{label:q,id:l.id,name:l.source,category:l.target,value:l.value}:void 0;if(b===C){let R=b.r*2.5;return{kind:"path",part:"edge",d:`M${g(b.x)} ${g(b.y-b.r)}C${g(b.x-R)} ${g(b.y-R*1.5)} ${g(b.x+R)} ${g(b.y-R*1.5)} ${g(b.x)} ${g(b.y-b.r)}`,stroke:M.axis,strokeWidth:D,opacity:ie??.7,title:Be?q:void 0,item:oe}}let se=Math.sqrt((C.x-b.x)*(C.x-b.x)+(C.y-b.y)*(C.y-b.y))||1,ve=(C.x-b.x)/se,we=(C.y-b.y)/se;if(e.directed){let R=C.x-ve*C.r,ae=C.y-we*C.r,le=R-ve*6,Ft=ae-we*6;Pt.push({kind:"path",part:"arrow",d:`M${g(R)} ${g(ae)}L${g(le-we*3)} ${g(Ft+ve*3)}L${g(le+we*3)} ${g(Ft-ve*3)}Z`,fill:M.axis,opacity:ie??.7})}let Ne=`${l.label??""}${F(l.value)?`${l.label?": ":""}${c(l.value)}`:""}`;if(e.edgeLabels&&Ne){let R=(b.x+C.x)/2,ae=(b.y+C.y)/2,le=Ne.length*B;zt(R-le/2,ae,le)&&Rt.push(Ee(g(R),g(ae),Ne,{part:"edge-label",anchor:"middle",baseline:"middle"}))}return{kind:"path",part:"edge",d:`M${g(b.x)} ${g(b.y)}L${g(C.x)} ${g(C.y)}`,stroke:M.axis,strokeWidth:D,opacity:ie??.7,title:Be?q:void 0,item:oe}}),Bt=[],Nt=[];for(let l of Tt){let b=l.node.label??l.node.id,C=F(l.node.value)?`: ${c(l.node.value)}`:"",D=l.node.group!==void 0?` \xB7 ${l.node.group}`:"",q=`${b}${C}${D} \xB7 ${l.degree} connection${l.degree===1?"":"s"}`;if(Bt.push({kind:"circle",part:"node",cx:l.x,cy:l.y,r:l.r,fill:l.color,stroke:N?.node.id===l.node.id?"var(--skdx-color-text-default)":"var(--skdx-color-surface-default)",opacity:Re(l.node.id),title:q,item:{label:q,name:l.node.id,category:l.node.group,index:l.index,value:l.node.value}}),!v)continue;let ie=b.length*B,oe=l.x+l.r+4,se=l.y;zt(oe,se,ie)&&Nt.push(Ee(g(oe),g(se),b,{part:"node-label",baseline:"middle",fill:Re(l.node.id)===void 0?"var(--skdx-color-text-default)":M.grid}))}let Dt=_e(e,h,d,y);return{...Dt,shapes:[...pn,...Pt,...Bt,...Rt,...Nt,...Dt.shapes],issues:n}}function Ln(e,n,t){let r=Array.from({length:e},(c,h)=>Ce(Math.cos(2*Math.PI*h/e))),i=Array.from({length:e},(c,h)=>Ce(Math.sin(2*Math.PI*h/e))),o=Math.sqrt(4/e),s=new Array(e).fill(0),a=new Array(e).fill(0);for(let c=0;c<t;c++){let h=.1*(1-c/t)+.005;s.fill(0),a.fill(0);for(let d=0;d<e;d++)for(let u=d+1;u<e;u++){let f=r[d]-r[u],v=i[d]-i[u];f===0&&v===0&&(f=.001*(d%7+1),v=.001*(u%5+1));let S=f*f+v*v,y=o*o/S;s[d]=s[d]+f*y,a[d]=a[d]+v*y,s[u]=s[u]-f*y,a[u]=a[u]-v*y}for(let[d,u]of n){if(d===u)continue;let f=r[d]-r[u],v=i[d]-i[u],S=Math.sqrt(f*f+v*v)||1e-6,y=S*S/o/S;s[d]=s[d]-f*y,a[d]=a[d]-v*y,s[u]=s[u]+f*y,a[u]=a[u]+v*y}for(let d=0;d<e;d++){let u=Math.sqrt(s[d]*s[d]+a[d]*a[d])||1e-6,f=Math.min(u,h);r[d]=r[d]+s[d]/u*f,i[d]=i[d]+a[d]/u*f}}return{xs:r,ys:i}}var Qt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function Ie(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Qt:void 0}function J(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var qe=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Jt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function fe(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Jt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ye(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Jt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:M.axis,dash:"3 3"}}function Xe(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!qe(r.plot,n,t))return[];let i=Ye(e,n),{rows:o}=fe(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...Se(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Qe(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 i=t.xs[r];return Xe(e,i,t.plot.y+8)}function Je(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:c,y:h}=J(t,r,i,e.width,e.height);if(qe(e.hit.plot,c,h)){let d=fe(e,c),u=Ye(e,c);if(d&&u)return{lines:d.rows,shapes:[u]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?E(e,n)?.item:void 0,a=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(c=>c.tagName.toLowerCase()==="title")?.textContent;return a?{lines:Array.isArray(a)?a:[a],shapes:[]}:{lines:[],shapes:[]}}function en(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),c=s&&s.tooltipFormatter?E(s,e)?.item:void 0,h=c&&s?.tooltipFormatter?.(c)||a&&Array.from(a.children).find(S=>S.tagName.toLowerCase()==="title")?.textContent;if(!h)return[];let d=s?.tooltipAnchored?E(s,e):void 0,u=d?s?.shapes[d.index]:void 0,{x:f,y:v}=u?me(u):J(n,t,r,i,o);return Se(f,v,h,i,o,s?.tooltipPlacement)}function et(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=J(t,r,i,e.width,e.height),a=Xe(e,o,s);if(a.length>0)return a}return en(n,t,r,i,e.width,e.height,e)}function tt(e,n){let t=E(e,n);return t&&!t.item.legend?j(t.item):null}var zn=(e,n)=>{let{x:t,y:r}=me(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function nt(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!zn(i,n))continue;let o=j(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var rt=e=>({kind:"rect",part:"selection-box",x:g(e.x),y:g(e.y),width:g(e.width),height:g(e.height),fill:M.focus,opacity:.12,stroke:M.focus}),Oe=(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 tn(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],a=e[o];s.y>t!=a.y>t&&n<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(r=!r)}return r}function it(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=me(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!tn(n,o,a))continue;let c=j(i.item),h=JSON.stringify(c);t.has(h)||(t.add(h),r.push(c))}return r}var ot=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${g(n.x)} ${g(n.y)}`).join("L")}`:"",fill:M.focus,fillOpacity:.12,stroke:M.focus,dash:"4 3"}),Te=6;function st(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-Te||n>i.x1+Te))return Math.abs(n-i.x0)<=Te?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=Te?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function at(e,n,t){let r=e.edit;return nn(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function lt(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(c=>c.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",a=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return nn(r,{bar:o,mode:s},i*a)}function nn(e,{bar:n,mode:t},r){let i=a=>e.snap?Math.round(a/e.snap)*e.snap:a,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function ct(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:g(Math.min(i,o)),y:g(n.bar.y),width:g(Math.max(1,Math.abs(o-i))),height:g(n.bar.height),fill:M.focus,opacity:.25,stroke:M.focus,rx:2}}var Pn=64,Rn=e=>Math.max(1,Math.min(Pn,e));function dt(e,n,t,r){let i=n>0?.8:1.25,o=Rn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[c,h]=e.view.center,d=(t-(s.x+s.width/2))/a,u=(r-(s.y+s.height/2))/a,f=e.view.zoom/o;return{center:[c+d*(1-f),e.fromY(e.toY(h)-u*(1-f))],zoom:o}}function ut(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function E(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var Ae=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function me(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 ht(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=M.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*B+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=me(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?Se(g(o),g(s),a,e.width,e.height):[]]}function pt(e,n,t){let r=Ae(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var X=2,Q=(e,n,t)=>{let r=Math.max(X,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},rn=(e,n)=>!e||e.start<=0&&e.end>=n;function ft(e,n,t){if(e.count<=X||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(X,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!rn(e.zoom,e.count)?Q(r,a,e.count):void 0;let c=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),h=r+c*o;return Q(h-c*a,a,e.count)}function mt(e,n,t,r){let i=n.end-n.start,o=Math.max(X,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return Q(n.start+s*i-s*o,o,e.count)}function bt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Q(n.start-t/i,r,e.count)}function gt(e,n,t){let r=e.brush;if(!r||!qe(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.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:Q(s-o/2,o,e.count)}}function xt(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return Q(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-X,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+X,Math.round(t.end+o)));return{start:t.start,end:s}}function vt(e,n){switch(n.type){case"svg":return Promise.resolve(yt(e,n.label,n.resolve));case"csv":return Promise.resolve(ln(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=yt(e,n.label,n.resolve);return an(t,e.width,e.height,n.scale,n.background)}}}var _=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),be=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${_(String(t))}"`).join("");function on(e){let n=e.title?`<title>${_(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${be([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${be([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${be([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${be([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${be([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]])}>${_(e.text)}</text>`}}function sn(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${_(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="${_(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function yt(e,n,t){let r=sn(e)+e.shapes.map(on).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<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="${_(n)}" font-family="${_(M.fontFamily)}" font-size="${_(M.fontSize)}"><title>${_(n)}</title>${r}</svg>`}function an(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),c=new Image;c.onload=()=>{URL.revokeObjectURL(a);let h=document.createElement("canvas");h.width=Math.round(n*r),h.height=Math.round(t*r);let d=h.getContext("2d");if(!d)return s(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,h.width,h.height)),d.drawImage(c,0,0,h.width,h.height),h.toBlob(u=>u?o(u):s(new Error("toBlob failed")),"image/png")},c.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},c.src=a})}function ln(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 wt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let c=["",...a.slice(1).map(d=>d.replace(/:\s[^:]*$/,""))],h=r.rows.map(d=>[d[0],...d.slice(1).map(u=>u.slice(u.lastIndexOf(": ")+2))]);return[c,...h]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(c=>c[a]!==void 0)),s=(a,c)=>a[c]===void 0?"":String(a[c]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(c=>s(a,c)))]}var Mt=new Map;function Le(e){let n=Mt.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&Mt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return Mt.set(e,{group:i,listeners:t}),i}var cn='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',kt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${cn}{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){${cn}{animation:none;transition:none}}`;function $t(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}import{css as Bn,html as H,LitElement as Nn,nothing as T,svg as A}from"lit";import{property as m,state as P}from"lit/decorators.js";import{ifDefined as k}from"lit/directives/if-defined.js";var St={fromAttribute:()=>!1},x=class extends Nn{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 i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[rt(Oe(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[ot(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=at(r,i.gantt,o-i.x),this.overlay=[ct(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(ut(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,a]=[...this.pointers.values()];if(s===void 0||a===void 0||!i.distance)return;this.setZoom(mt(r.hit,i.zoom,Math.abs(s-a)/i.distance,(s+a)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?bt(r.hit,i.zoom,o-i.x):xt(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Je(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=et(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(tt(r,t.target)),this.syncId&&r.hit?.crosshair){let o=fe(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:i,y:o}=this.viewBox(t,r),s=E(r,t.target)?.item.legend,a=this.canEdit(r)?st(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let h=r.map.plot;if(i<h.x||i>h.x+h.width||o<h.y||o>h.y+h.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let c=r.hit;if(!(!c||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[h,d]=[...this.pointers.values()];this.drag={x:(h+d)/2,y:o,zoom:c.zoom,grab:"pinch",distance:Math.abs(h-d)||1}}else{let h=gt(c,i,o);if(h)this.drag={x:i,y:o,zoom:h.zoom,grab:h.grab},h.zoom!==c.zoom&&this.setZoom(h.zoom);else if(this.zoomable&&i>=c.plot.x&&i<=c.plot.x+c.plot.width&&o>=c.plot.y&&o<=c.plot.y+c.plot.height)this.drag={x:i,y:o,zoom:c.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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(nt(o,Oe(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(it(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;t.preventDefault(),this.setView(dt(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let a=ft(s,t.deltaY,i);a&&(t.preventDefault(),this.setZoom(a))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=E(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 a=r.shapes[this.focused]?.item;a&&(t.preventDefault(),this.select(a),this.emit("skdx-item-click",a));return}let i=this.canEdit(r)?lt(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=pt(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?j(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:i,tooltip:o,format:s,palette:a,loading:c,error:h,emptyMessage:d,description:u,decorative:f,animated:v,responsive:S,highlighted:y,highlightScope:w,accessibleTable:I}=this;return{...typeof S=="object"&&this.measured!==void 0&&this.measured<(S.breakpoint??480)?S.compact:void 0,width:S&&this.measured?this.measured:t,height:r,animate:v,responsive:S,legend:i,tooltip:o,format:s,palette:a,loading:c,error:h,emptyMessage:d,description:u,decorative:f,highlighted:y===void 0?this.highlightState:y,highlightScope:w,accessibleTable:I,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&&Le(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=Le(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Ze(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(We(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 J(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&G(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?vt(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ue(je(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),a=this.canPan(o),c=this.canEdit(o),h=this.brushing(),d=s||a||c||h,u=!o.decorative&&Ae(o).length>0,f=$t(o),v=wt(o,this.accessibleTable),S=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,y=this.portal;return H`<svg
1
+ var fn=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var p=(e,n,t,r)=>{for(var i=r>1?void 0:r?mn(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&fn(n,t,i),i};import{customElement as Fn,property as V}from"lit/decorators.js";var Gt=e=>Number(e.toPrecision(12)),bn,gn=e=>(bn??(bn=new Intl.NumberFormat)).format(Gt(e)),xn=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function _t(e){if(e===void 0)return gn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=d=>i?u=>d(u)+i:d,a=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},l=d=>{let u=new Intl.NumberFormat(t,d);return s(f=>u.format(Gt(f)))},h=d=>{let u=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return f=>u.format(f)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(a(2));case"percent":return l({style:"percent",...a(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...a()});case"compact":return l({notation:"compact",...a(1)});case"scientific":return l({notation:"scientific",...a(2)});case"date":return h({dateStyle:"medium"});case"time":return h({timeStyle:"short"});case"datetime":return h({dateStyle:"medium",timeStyle:"short"});case"duration":return s(xn)}}var g=e=>Number(e.toFixed(2)),G=e=>typeof e=="number"&&Number.isFinite(e);function Y(e){let n=1/0,t=-1/0;for(let r of e)G(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}var le=1e3,de=60*le,ue=60*de,ke=24*ue,jn=[le,5*le,15*le,30*le,de,5*de,15*de,30*de,ue,3*ue,6*ue,12*ue,ke,2*ke,7*ke,14*ke];var yn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,vn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,wn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function kn(e,n,t){return e.replace(vn,(r,i,o)=>{let s=wn[i];if(s===void 0)return i+o;let l=(o.match(yn)??[]).map((h,d)=>{let u=Number(h);if(s===-1)return String(u+n);if(s===-2)return String(u+t);let f=d%s;return s===7?f===5?String(u+n):f===6?String(u+t):h:String(f%2===0?u+n:u+t)});return i+l.join(" ")})}var jt=(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:kn(r.d,n,t)}}});var De=["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)"};var Et=(e,n)=>n??De[e%De.length];var Mn={top:16,right:16,bottom:32,left:48};function Ht(e,n,t=Mn){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 he(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Vt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var Me=20,$n=120,Zt=e=>{let n=he(e);return n&&(n.position==="left"||n.position==="right")?n.width??$n:0},$e=(e,n=600,t=300)=>({width:(e.width??n)-Zt(e),height:(e.height??t)-(he(e)?.position==="bottom"?Me:0)}),Wt=(e,n,t)=>{let r=he(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Kt(n,t??$e(e).width,r)):1)*Me},B=6.5;function Sn(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/B));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var Ge=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Et(n)),Ut=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Fe(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],l=r.maxItems,h=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,d=e.length-h.length,u=r.interactive??!0,f=o,v=i,S=(y,w,I,O)=>{let z=(w?18:4)+y.length*B;f>o&&(s||f+z>n-8)&&(f=o,v+=Me),w&&a.push({kind:"rect",part:"legend-swatch",x:f,y:v-5,width:10,height:10,fill:w,opacity:O?.3:void 0,item:I}),a.push({kind:"text",part:"legend-label",x:f+(w?14:0),y:v,text:y,baseline:"middle",fill:O?k.grid:k.label,item:I}),f+=z+12};for(let y of h){let w=t.includes(y.name),I=u?{label:y.name,series:y.name,legend:!0}:void 0;S(r.formatter?.(y.name)??y.name,y.color,I,w)}return d>0&&S(`+${d} more`,void 0,void 0,!1),r.align==="end"?Cn(a,n):a}function Cn(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(a=>a.kind==="rect"?a.x+a.width:a.x+a.text.length*B)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var Kt=(e,n,t={})=>new Set(Fe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function _e(e,n,t,r=[]){let i=he(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=Vt(e),a=o?.position==="bottom",l=Zt(e),h=e.hiddenSeries??[],d=o?l?Fe(r,1/0,h,o,10,(o.position==="right"?n:0)+8,!0):Fe(r,n,h,o,a?t+10:10):[],u=a?Kt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,u)*Me: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:d}}function je(e){let n=e.legendOffset;if(!n)return e;let t=[...jt(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}),i=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,a=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:a,legendOffset:void 0}}function Se(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/B)),l=s.flatMap(w=>{let I=[],O=Array.from(w);for(;O.length>a;){let z=O.slice(0,a+1).lastIndexOf(" ");z<1&&(z=a),I.push(O.slice(0,z).join("")),O=O.slice(z),O[0]===" "&&O.shift()}return I.push(O.join("")),I}),h=Math.max(1,Math.floor((i-6)/16)),d=l.slice(0,h);l.length>h&&(d[h-1]=Sn(`${d[h-1]}\u2026`,r-12));let u=Math.min(r,Math.max(0,...d.map(w=>Array.from(w).length))*B+12),f=Math.min(i,6+d.length*16),v=o==="top"?{x:e-u/2,y:n-f-8}:o==="bottom"?{x:e-u/2,y:n+8}:o==="left"?{x:e-u-8,y:n-f/2}:o==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},S=Math.max(0,Math.min(r-u,v.x)),y=Math.max(0,Math.min(i-f,v.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
+ `),x:g(S),y:g(y),width:g(u),height:f,fill:"var(--skdx-color-surface-raised)",stroke:k.axis,rx:8},...d.map((w,I)=>({kind:"text",part:"tooltip-label",x:g(S+6),y:g(y+11+I*16),text:w,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&I===0?"bold":void 0}))]}function qt(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=$e(e,t,r),a=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return i==="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-${i}`,x:g(o/2),y:g(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":k.label}),{..._e(e,o,s),shapes:l,tooltip:!1}}var Ee=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:k.label,...r});function pe(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var He=e=>e.id??e.name??e.series,Yt=e=>e.seriesId??e.series;function _(e,n){let t=!1;return n.id!==void 0&&(t=!0,He(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Yt(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 Ve=e=>pe(e).flatMap(n=>n.id!==void 0?[n.id]:[]);function j(e){let n={},t=He(e);t!==void 0&&(n.id=t);let r=Yt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ze=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function We(e,n,t){let r=pe(e),i=j(n),o=r.some(s=>_(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!_(n,s)):[...r,i]}var In=.2;function Tn(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 On=(e,n)=>e.kind==="text"?{...e,fill:k.grid}:{...e,opacity:(e.opacity??1)*n};function Ue(e,n){let t=pe(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:pe(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=d=>!i||r.some(u=>_(d,u))?!0:o.highlighted==="series"?r.some(u=>u.series!==void 0&&_(d,{series:u.series})):!1,l=d=>{if(!i||o.faded==="none"||a(d))return!1;if(o.faded==="series"){let u=i.series;return u!==void 0&&_(d,{series:u})}return!0},h=e.shapes.map(d=>{let u=d.item;if(!u||u.legend)return d;if(t.some(f=>_(u,f))){let f=Tn(d);f&&s.push(f)}return l(u)?On(d,In):d});return s.length?{...e,shapes:[...h,...s]}:{...e,shapes:h}}var Ce=e=>Math.round(e*1e6)/1e6,Xt=60,An=500;function Ke(e){let n=[],t=new Map;for(let c of e.nodes)t.has(c.id)?n.push({code:"duplicate-id",severity:"warning",message:`Node id "${c.id}" is duplicated; the first definition is kept.`,itemId:c.id}):t.set(c.id,c);let r=c=>c.group,i=[...t.values()].filter(c=>!(c.group!==void 0&&Ut(e,c.group))),o=new Set(i.map(c=>c.id)),s=e.edges.filter(c=>{let b=o.has(c.source)&&o.has(c.target);return!b&&!(t.has(c.source)&&t.has(c.target))&&n.push({code:"unknown-node",severity:"warning",message:`Edge ${c.source} \u2192 ${c.target} names a node that does not exist and was dropped.`,itemId:c.id}),b}),a=qt(e,i.length===0);if(a)return{...a,issues:n};let l=_t(e.format),{width:h,height:d}=$e(e),[u,f]=e.nodeRange??[5,16],v=e.labels??i.length<=Xt,S=[...new Set(e.nodes.map(r).filter(c=>c!==void 0))],y=S.map((c,b)=>({name:c,color:Ge(e,b)})),w=Ht(h,d,{top:Wt(e,y,h)+f+8,right:f+(v?48:8),bottom:f+8,left:f+8}),I=(c,b)=>c.color??Ge(e,c.group!==void 0?S.indexOf(c.group):b),[,O]=Y(i.map(c=>c.value)),z=c=>G(c)&&O>0?u+Math.sqrt(Math.max(0,c)/O)*(f-u):u,Z=new Map;for(let c of s)Z.set(c.source,(Z.get(c.source)??0)+1),c.target!==c.source&&Z.set(c.target,(Z.get(c.target)??0)+1);let W=i.length,ge=new Map(i.map((c,b)=>[c.id,b])),U,K,ee=e.arrange??"force";ee==="manual"&&i.every(c=>G(c.x)&&G(c.y))?(U=i.map(c=>c.x),K=i.map(c=>c.y)):ee==="circular"||ee==="manual"||W<3?(U=i.map((c,b)=>Ce(Math.cos(2*Math.PI*b/W-Math.PI/2))),K=i.map((c,b)=>Ce(Math.sin(2*Math.PI*b/W-Math.PI/2)))):{xs:U,ys:K}=Ln(W,s.map(c=>[ge.get(c.source),ge.get(c.target)]),e.iterations??Math.max(50,Math.min(300,Math.floor(3e4/W))));let[te,xe]=Y(U),[ne,Ct]=Y(K),It=Math.max(xe-te,Ct-ne)||1,ye=Math.min(w.width/It,w.height/It),dn=w.x+(w.width-(xe-te)*ye)/2,un=w.y+(w.height-(Ct-ne)*ye)/2,Tt=i.map((c,b)=>({node:c,index:b,x:g(dn+(U[b]-te)*ye),y:g(un+(K[b]-ne)*ye),r:g(z(c.value)),color:I(c,b),degree:Z.get(c.id)??0})),Pe=new Map(Tt.map(c=>[c.node.id,c])),Ot=Ve(e.selected)[0],D=Ot!==void 0?Pe.get(String(Ot)):void 0,re=new Set;if(D){re.add(D.node.id);for(let c of s)c.source===D.node.id&&re.add(c.target),c.target===D.node.id&&re.add(c.source)}let Re=(c,b=c)=>D&&!(re.has(c)&&re.has(b))?.15:void 0,hn=c=>!D||c.source===D.node.id||c.target===D.node.id,[,At]=Y(s.map(c=>c.value)),Be=s.length<=An,Lt=[],zt=(c,b,C)=>Lt.some(F=>Math.abs(F.y-b)<12&&c<F.x+F.w+4&&c+C+4>F.x)?!1:(Lt.push({x:c,y:b,w:C}),!0),Pt=[],Rt=[],pn=s.map(c=>{let b=Pe.get(c.source),C=Pe.get(c.target),F=G(c.value)&&At>0?1+3*Math.sqrt(Math.max(0,c.value)/At):1,q=`${b.node.label??b.node.id} \u2192 ${C.node.label??C.node.id}${c.label?` ${c.label}`:""}${G(c.value)?`: ${l(c.value)}`:""}`,ie=hn(c)?Re(c.source,c.target):.15,oe=Be?{label:q,id:c.id,name:c.source,category:c.target,value:c.value}:void 0;if(b===C){let R=b.r*2.5;return{kind:"path",part:"edge",d:`M${g(b.x)} ${g(b.y-b.r)}C${g(b.x-R)} ${g(b.y-R*1.5)} ${g(b.x+R)} ${g(b.y-R*1.5)} ${g(b.x)} ${g(b.y-b.r)}`,stroke:k.axis,strokeWidth:F,opacity:ie??.7,title:Be?q:void 0,item:oe}}let se=Math.sqrt((C.x-b.x)*(C.x-b.x)+(C.y-b.y)*(C.y-b.y))||1,ve=(C.x-b.x)/se,we=(C.y-b.y)/se;if(e.directed){let R=C.x-ve*C.r,ae=C.y-we*C.r,ce=R-ve*6,Ft=ae-we*6;Pt.push({kind:"path",part:"arrow",d:`M${g(R)} ${g(ae)}L${g(ce-we*3)} ${g(Ft+ve*3)}L${g(ce+we*3)} ${g(Ft-ve*3)}Z`,fill:k.axis,opacity:ie??.7})}let Ne=`${c.label??""}${G(c.value)?`${c.label?": ":""}${l(c.value)}`:""}`;if(e.edgeLabels&&Ne){let R=(b.x+C.x)/2,ae=(b.y+C.y)/2,ce=Ne.length*B;zt(R-ce/2,ae,ce)&&Rt.push(Ee(g(R),g(ae),Ne,{part:"edge-label",anchor:"middle",baseline:"middle"}))}return{kind:"path",part:"edge",d:`M${g(b.x)} ${g(b.y)}L${g(C.x)} ${g(C.y)}`,stroke:k.axis,strokeWidth:F,opacity:ie??.7,title:Be?q:void 0,item:oe}}),Bt=[],Nt=[];for(let c of Tt){let b=c.node.label??c.node.id,C=G(c.node.value)?`: ${l(c.node.value)}`:"",F=c.node.group!==void 0?` \xB7 ${c.node.group}`:"",q=`${b}${C}${F} \xB7 ${c.degree} connection${c.degree===1?"":"s"}`;if(Bt.push({kind:"circle",part:"node",cx:c.x,cy:c.y,r:c.r,fill:c.color,stroke:D?.node.id===c.node.id?"var(--skdx-color-text-default)":"var(--skdx-color-surface-default)",opacity:Re(c.node.id),title:q,item:{label:q,name:c.node.id,category:c.node.group,index:c.index,value:c.node.value}}),!v)continue;let ie=b.length*B,oe=c.x+c.r+4,se=c.y;zt(oe,se,ie)&&Nt.push(Ee(g(oe),g(se),b,{part:"node-label",baseline:"middle",fill:Re(c.node.id)===void 0?"var(--skdx-color-text-default)":k.grid}))}let Dt=_e(e,h,d,y);return{...Dt,shapes:[...pn,...Pt,...Bt,...Rt,...Nt,...Dt.shapes],issues:n}}function Ln(e,n,t){let r=Array.from({length:e},(l,h)=>Ce(Math.cos(2*Math.PI*h/e))),i=Array.from({length:e},(l,h)=>Ce(Math.sin(2*Math.PI*h/e))),o=Math.sqrt(4/e),s=new Array(e).fill(0),a=new Array(e).fill(0);for(let l=0;l<t;l++){let h=.1*(1-l/t)+.005;s.fill(0),a.fill(0);for(let d=0;d<e;d++)for(let u=d+1;u<e;u++){let f=r[d]-r[u],v=i[d]-i[u];f===0&&v===0&&(f=.001*(d%7+1),v=.001*(u%5+1));let S=f*f+v*v,y=o*o/S;s[d]=s[d]+f*y,a[d]=a[d]+v*y,s[u]=s[u]-f*y,a[u]=a[u]-v*y}for(let[d,u]of n){if(d===u)continue;let f=r[d]-r[u],v=i[d]-i[u],S=Math.sqrt(f*f+v*v)||1e-6,y=S*S/o/S;s[d]=s[d]-f*y,a[d]=a[d]-v*y,s[u]=s[u]+f*y,a[u]=a[u]+v*y}for(let d=0;d<e;d++){let u=Math.sqrt(s[d]*s[d]+a[d]*a[d])||1e-6,f=Math.min(u,h);r[d]=r[d]+s[d]/u*f,i[d]=i[d]+a[d]/u*f}}return{xs:r,ys:i}}var Qt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function Ie(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Qt:void 0}function J(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var qe=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Jt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function fe(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Jt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ye(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Jt(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 Xe(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!qe(r.plot,n,t))return[];let i=Ye(e,n),{rows:o}=fe(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...Se(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Qe(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 i=t.xs[r];return Xe(e,i,t.plot.y+8)}function Je(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:h}=J(t,r,i,e.width,e.height);if(qe(e.hit.plot,l,h)){let d=fe(e,l),u=Ye(e,l);if(d&&u)return{lines:d.rows,shapes:[u]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?E(e,n)?.item:void 0,a=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return a?{lines:Array.isArray(a)?a:[a],shapes:[]}:{lines:[],shapes:[]}}function en(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?E(s,e)?.item:void 0,h=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(S=>S.tagName.toLowerCase()==="title")?.textContent;if(!h)return[];let d=s?.tooltipAnchored?E(s,e):void 0,u=d?s?.shapes[d.index]:void 0,{x:f,y:v}=u?me(u):J(n,t,r,i,o);return Se(f,v,h,i,o,s?.tooltipPlacement)}function et(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=J(t,r,i,e.width,e.height),a=Xe(e,o,s);if(a.length>0)return a}return en(n,t,r,i,e.width,e.height,e)}function tt(e,n){let t=E(e,n);return t&&!t.item.legend?j(t.item):null}var zn=(e,n)=>{let{x:t,y:r}=me(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function nt(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!zn(i,n))continue;let o=j(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var rt=e=>({kind:"rect",part:"selection-box",x:g(e.x),y:g(e.y),width:g(e.width),height:g(e.height),fill:k.focus,opacity:.12,stroke:k.focus}),Oe=(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 tn(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],a=e[o];s.y>t!=a.y>t&&n<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(r=!r)}return r}function it(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=me(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!tn(n,o,a))continue;let l=j(i.item),h=JSON.stringify(l);t.has(h)||(t.add(h),r.push(l))}return r}var ot=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${g(n.x)} ${g(n.y)}`).join("L")}`:"",fill:k.focus,fillOpacity:.12,stroke:k.focus,dash:"4 3"}),Te=6;function st(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-Te||n>i.x1+Te))return Math.abs(n-i.x0)<=Te?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=Te?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function at(e,n,t){let r=e.edit;return nn(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function ct(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(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",a=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return nn(r,{bar:o,mode:s},i*a)}function nn(e,{bar:n,mode:t},r){let i=a=>e.snap?Math.round(a/e.snap)*e.snap:a,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function lt(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:g(Math.min(i,o)),y:g(n.bar.y),width:g(Math.max(1,Math.abs(o-i))),height:g(n.bar.height),fill:k.focus,opacity:.25,stroke:k.focus,rx:2}}var Pn=64,Rn=e=>Math.max(1,Math.min(Pn,e));function dt(e,n,t,r){let i=n>0?.8:1.25,o=Rn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,h]=e.view.center,d=(t-(s.x+s.width/2))/a,u=(r-(s.y+s.height/2))/a,f=e.view.zoom/o;return{center:[l+d*(1-f),e.fromY(e.toY(h)-u*(1-f))],zoom:o}}function ut(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function E(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var Ae=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function me(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 ht(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=k.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*B+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=me(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?Se(g(o),g(s),a,e.width,e.height):[]]}function pt(e,n,t){let r=Ae(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var X=2,Q=(e,n,t)=>{let r=Math.max(X,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},rn=(e,n)=>!e||e.start<=0&&e.end>=n;function ft(e,n,t){if(e.count<=X||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(X,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!rn(e.zoom,e.count)?Q(r,a,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),h=r+l*o;return Q(h-l*a,a,e.count)}function mt(e,n,t,r){let i=n.end-n.start,o=Math.max(X,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return Q(n.start+s*i-s*o,o,e.count)}function bt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Q(n.start-t/i,r,e.count)}function gt(e,n,t){let r=e.brush;if(!r||!qe(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.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:Q(s-o/2,o,e.count)}}function xt(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return Q(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-X,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+X,Math.round(t.end+o)));return{start:t.start,end:s}}function vt(e,n){switch(n.type){case"svg":return Promise.resolve(yt(e,n.label,n.resolve));case"csv":return Promise.resolve(cn(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=yt(e,n.label,n.resolve);return an(t,e.width,e.height,n.scale,n.background)}}}var N=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),be=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${N(String(t))}"`).join("");function on(e){let n=e.title?`<title>${N(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${be([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${be([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${be([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${be([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${be([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]])}>${N(e.text)}</text>`}}function sn(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${N(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="${N(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function yt(e,n,t){let r=sn(e)+e.shapes.map(on).join("");t&&(r=r.replace(/var\((--[\w-]+)\)/g,(s,a)=>t(a).trim()||s));let i=e.decorative?'aria-hidden="true"':`role="img" aria-label="${N(n)}"`,o=e.description?`<desc>${N(e.description)}</desc>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" ${i} font-family="${N(k.fontFamily)}" font-size="${N(k.fontSize)}"><title>${N(n)}</title>${o}${r}</svg>`}function an(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(a);let h=document.createElement("canvas");h.width=Math.round(n*r),h.height=Math.round(t*r);let d=h.getContext("2d");if(!d)return s(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,h.width,h.height)),d.drawImage(l,0,0,h.width,h.height),h.toBlob(u=>u?o(u):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function cn(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 wt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let l=["",...a.slice(1).map(d=>d.replace(/:\s[^:]*$/,""))],h=r.rows.map(d=>[d[0],...d.slice(1).map(u=>u.slice(u.lastIndexOf(": ")+2))]);return[l,...h]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(l=>l[a]!==void 0)),s=(a,l)=>a[l]===void 0?"":String(a[l]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(l=>s(a,l)))]}var kt=new Map;function Le(e){let n=kt.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&kt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return kt.set(e,{group:i,listeners:t}),i}var ln='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',Mt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${ln}{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){${ln}{animation:none;transition:none}}`;function $t(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}import{css as Bn,html as H,LitElement as Nn,nothing as T,svg as A}from"lit";import{property as m,state as P}from"lit/decorators.js";import{ifDefined as M}from"lit/directives/if-defined.js";var St={fromAttribute:()=>!1},x=class extends Nn{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 i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[rt(Oe(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[ot(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=at(r,i.gantt,o-i.x),this.overlay=[lt(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(ut(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,a]=[...this.pointers.values()];if(s===void 0||a===void 0||!i.distance)return;this.setZoom(mt(r.hit,i.zoom,Math.abs(s-a)/i.distance,(s+a)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?bt(r.hit,i.zoom,o-i.x):xt(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Je(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=et(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(tt(r,t.target)),this.syncId&&r.hit?.crosshair){let o=fe(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:i,y:o}=this.viewBox(t,r),s=E(r,t.target)?.item.legend,a=this.canEdit(r)?st(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let h=r.map.plot;if(i<h.x||i>h.x+h.width||o<h.y||o>h.y+h.height)return;this.drag={x:i,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,i),this.pointers.size===2){let[h,d]=[...this.pointers.values()];this.drag={x:(h+d)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(h-d)||1}}else{let h=gt(l,i,o);if(h)this.drag={x:i,y:o,zoom:h.zoom,grab:h.grab},h.zoom!==l.zoom&&this.setZoom(h.zoom);else if(this.zoomable&&i>=l.plot.x&&i<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:i,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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(nt(o,Oe(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(it(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(i<l.x||i>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(dt(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let a=ft(s,t.deltaY,i);a&&(t.preventDefault(),this.setZoom(a))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=E(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 a=r.shapes[this.focused]?.item;a&&(t.preventDefault(),this.select(a),this.emit("skdx-item-click",a));return}let i=this.canEdit(r)?ct(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=pt(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?j(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:i,tooltip:o,format:s,palette:a,loading:l,error:h,emptyMessage:d,description:u,decorative:f,animated:v,responsive:S,highlighted:y,highlightScope:w,accessibleTable:I}=this;return{width:S&&this.measured?this.measured:t,height:r,animate:v,responsive:S,legend:i,tooltip:o,format:s,palette:a,loading:l,error:h,emptyMessage:d,description:u,decorative:f,highlighted:y===void 0?this.highlightState:y,highlightScope:w,accessibleTable:I,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}compactOverrides(){let t=this.responsive;return typeof t=="object"&&this.measured!==void 0&&this.measured<(t.breakpoint??480)?{...t.compact,width:this.measured}:void 0}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&Le(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=Le(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Ze(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(We(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 J(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&_(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?vt(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ue(je(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),a=this.canPan(o),l=this.canEdit(o),h=this.brushing(),d=s||a||l||h,u=!o.decorative&&Ae(o).length>0,f=$t(o),v=wt(o,this.accessibleTable),S=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,y=this.portal;return H`<svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
5
  viewBox="0 0 ${o.width} ${o.height}"
6
6
  width=${o.width}
@@ -8,15 +8,15 @@ var fn=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var p=(e,n,t
8
8
  role=${o.decorative?"presentation":"img"}
9
9
  aria-hidden=${o.decorative?"true":T}
10
10
  aria-label=${o.decorative?T:i}
11
- aria-description=${k(o.description)}
11
+ aria-description=${M(o.description)}
12
12
  tabindex=${u?0:T}
13
13
  data-skdx-chart=${r}
14
14
  data-zoomable=${s||a?"":T}
15
15
  data-brushing=${h&&!(s||a)?"":T}
16
- data-editable=${c?"":T}
16
+ data-editable=${l?"":T}
17
17
  style=${f?`--skdx-chart-duration:${f}`:T}
18
- font-family=${M.fontFamily}
19
- font-size=${M.fontSize}
18
+ font-family=${k.fontFamily}
19
+ font-size=${k.fontSize}
20
20
  @pointermove=${o.tooltip||d?this.onPointerMove:T}
21
21
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
22
22
  @pointerdown=${d?this.onPointerDown:T}
@@ -30,7 +30,7 @@ var fn=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var p=(e,n,t
30
30
  >
31
31
  <title>${i}</title>
32
32
  ${o.description?A`<desc>${o.description}</desc>`:T}
33
- ${f?A`<style>${kt}</style>`:T} ${Dn(o)}
33
+ ${f?A`<style>${Mt}</style>`:T} ${Dn(o)}
34
34
  ${ze(o.shapes)}
35
35
  ${ze(this.tip.length||!this.crossState?this.tip:Qe(o,this.crossState))}
36
36
  ${ze(ht(o,this.focused))} ${ze(this.overlay)}
@@ -109,4 +109,4 @@ var fn=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var p=(e,n,t
109
109
  [role='tooltip'] > :first-child:not(:only-child) {
110
110
  font-weight: bold;
111
111
  }
112
- `,p([m({type:Number})],x.prototype,"width",2),p([m({type:Number})],x.prototype,"height",2),p([m()],x.prototype,"label",2),p([m({type:Boolean,reflect:!0})],x.prototype,"legend",2),p([m({type:Boolean,attribute:"no-tooltip",converter:St})],x.prototype,"tooltip",2),p([m({attribute:!1})],x.prototype,"format",2),p([m({attribute:!1})],x.prototype,"palette",2),p([m({attribute:!1})],x.prototype,"hiddenSeries",2),p([m({attribute:!1})],x.prototype,"selected",2),p([m({attribute:"selection-mode"})],x.prototype,"selectionMode",2),p([m({attribute:!1})],x.prototype,"highlighted",2),p([m({attribute:!1})],x.prototype,"highlightScope",2),p([m({type:Boolean,reflect:!0})],x.prototype,"loading",2),p([m()],x.prototype,"error",2),p([m({attribute:"empty-message"})],x.prototype,"emptyMessage",2),p([m()],x.prototype,"description",2),p([m({type:Boolean,reflect:!0})],x.prototype,"decorative",2),p([m({type:Boolean,attribute:"accessible-table"})],x.prototype,"accessibleTable",2),p([m({attribute:!1})],x.prototype,"zoom",2),p([m({attribute:!1})],x.prototype,"view",2),p([m({type:Boolean,reflect:!0})],x.prototype,"zoomable",2),p([m({type:Boolean,reflect:!0})],x.prototype,"editable",2),p([m({attribute:"sync-id"})],x.prototype,"syncId",2),p([m({type:Boolean,attribute:"cross-filter"})],x.prototype,"crossFilter",2),p([m({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],x.prototype,"animated",2),p([m({type:Boolean,reflect:!0})],x.prototype,"responsive",2),p([P()],x.prototype,"tip",2),p([P()],x.prototype,"overlay",2),p([P()],x.prototype,"portal",2),p([P()],x.prototype,"measured",2),p([P()],x.prototype,"viewState",2),p([P()],x.prototype,"highlightState",2),p([P()],x.prototype,"crossState",2),p([P()],x.prototype,"focused",2),p([P()],x.prototype,"hiddenState",2),p([P()],x.prototype,"zoomState",2),p([P()],x.prototype,"selectedState",2);var $=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:i,yAxis:o,rightAxis:s,references:a,annotations:c,labels:h,curve:d,connectNulls:u,nulls:f,stacked:v,stackOffset:S,orientation:y,radius:w,barGap:I,barWidth:O,sort:z,transform:Z,transforms:W,bins:ge,binWidth:U,binDomain:K,binMode:ee,sampling:te,brush:xe,crosshair:ne}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:c,labels:h,curve:d,connectNulls:u,nulls:f,stacked:v,stackOffset:S,orientation:y,radius:w,barGap:I,barWidth:O,sort:z,transform:Z,transforms:W,bins:ge,binWidth:U,binDomain:K,binMode:ee,sampling:te,brush:xe,crosshair:ne}}};p([m({attribute:!1})],$.prototype,"series",2),p([m({attribute:!1})],$.prototype,"categories",2),p([m({attribute:!1})],$.prototype,"xAxis",2),p([m({attribute:!1})],$.prototype,"yAxis",2),p([m({attribute:!1})],$.prototype,"rightAxis",2),p([m({attribute:!1})],$.prototype,"references",2),p([m({attribute:!1})],$.prototype,"annotations",2),p([m({type:Boolean,reflect:!0})],$.prototype,"labels",2),p([m()],$.prototype,"curve",2),p([m({type:Boolean,attribute:"connect-nulls"})],$.prototype,"connectNulls",2),p([m()],$.prototype,"nulls",2),p([m({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],$.prototype,"stacked",2),p([m({attribute:"stack-offset"})],$.prototype,"stackOffset",2),p([m()],$.prototype,"orientation",2),p([m({type:Number})],$.prototype,"radius",2),p([m({type:Number,attribute:"bar-gap"})],$.prototype,"barGap",2),p([m({type:Number,attribute:"bar-width"})],$.prototype,"barWidth",2),p([m()],$.prototype,"sort",2),p([m()],$.prototype,"transform",2),p([m({attribute:!1})],$.prototype,"transforms",2),p([m({type:Number})],$.prototype,"bins",2),p([m({type:Number,attribute:"bin-width"})],$.prototype,"binWidth",2),p([m({attribute:!1})],$.prototype,"binDomain",2),p([m({attribute:"bin-mode"})],$.prototype,"binMode",2),p([m({attribute:!1})],$.prototype,"sampling",2),p([m({type:Boolean,reflect:!0})],$.prototype,"brush",2),p([m({type:Boolean,reflect:!0})],$.prototype,"crosshair",2);var Dn=e=>e.defs&&e.defs.length?A`<defs>${e.defs.map(n=>A`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>A`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${k(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:T,ze=e=>A`${e.map((n,t)=>{let r=n.title?A`<title>${n.title}</title>`:T,i=n.item?t:void 0;switch(n.kind){case"path":return A`<path data-skdx-part=${n.part} data-skdx-i=${k(i)} d=${n.d} fill=${n.fill??"none"} stroke=${k(n.stroke)} stroke-width=${k(n.strokeWidth)} stroke-linecap=${k(n.strokeLinecap)} stroke-linejoin=${k(n.strokeLinejoin)} stroke-dasharray=${k(n.dash)} opacity=${k(n.opacity)} fill-opacity=${k(n.fillOpacity)}>${r}</path>`;case"rect":return A`<rect data-skdx-part=${n.part} data-skdx-i=${k(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${k(n.rx)} style=${k(Ie(n.part)?`rx:${Ie(n.part)}`:void 0)} fill=${n.fill} stroke=${k(n.stroke)} fill-opacity=${k(n.opacity)} pointer-events=${k(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return A`<line data-skdx-part=${n.part} data-skdx-i=${k(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${k(n.strokeWidth)} stroke-dasharray=${k(n.dash)} opacity=${k(n.opacity)}>${r}</line>`;case"circle":return A`<circle data-skdx-part=${n.part} data-skdx-i=${k(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${k(n.stroke)} opacity=${k(n.opacity)}>${r}</circle>`;case"text":return A`<text aria-label=${k(n.title)} data-skdx-part=${n.part} data-skdx-i=${k(i)} x=${n.x} y=${n.y} text-anchor=${k(n.anchor)} dominant-baseline=${k(n.baseline)} fill=${k(n.fill)} font-weight=${k(n.weight)} pointer-events=${k(i===void 0?"none":void 0)} transform=${k(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var L=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:i,labels:o,nodeRange:s,iterations:a,directed:c,edgeLabels:h}=this;return this.root(Ke({...this.sized(),nodes:t,edges:r,arrange:i,labels:o,nodeRange:s,iterations:a,directed:c,edgeLabels:h}),"network",this.label??"Network chart")}};p([V({attribute:!1})],L.prototype,"nodes",2),p([V({attribute:!1})],L.prototype,"edges",2),p([V()],L.prototype,"arrange",2),p([V({type:Boolean,attribute:"no-labels",converter:St})],L.prototype,"labels",2),p([V({attribute:!1})],L.prototype,"nodeRange",2),p([V({type:Number})],L.prototype,"iterations",2),p([V({type:Boolean,reflect:!0})],L.prototype,"directed",2),p([V({type:Boolean,reflect:!0,attribute:"edge-labels"})],L.prototype,"edgeLabels",2),L=p([Fn("skdx-network-chart")],L);export{L as SkdxNetworkChart};
112
+ `,p([m({type:Number})],x.prototype,"width",2),p([m({type:Number})],x.prototype,"height",2),p([m()],x.prototype,"label",2),p([m({type:Boolean,reflect:!0})],x.prototype,"legend",2),p([m({type:Boolean,attribute:"no-tooltip",converter:St})],x.prototype,"tooltip",2),p([m({attribute:!1})],x.prototype,"format",2),p([m({attribute:!1})],x.prototype,"palette",2),p([m({attribute:!1})],x.prototype,"hiddenSeries",2),p([m({attribute:!1})],x.prototype,"selected",2),p([m({attribute:"selection-mode"})],x.prototype,"selectionMode",2),p([m({attribute:!1})],x.prototype,"highlighted",2),p([m({attribute:!1})],x.prototype,"highlightScope",2),p([m({type:Boolean,reflect:!0})],x.prototype,"loading",2),p([m()],x.prototype,"error",2),p([m({attribute:"empty-message"})],x.prototype,"emptyMessage",2),p([m()],x.prototype,"description",2),p([m({type:Boolean,reflect:!0})],x.prototype,"decorative",2),p([m({type:Boolean,attribute:"accessible-table"})],x.prototype,"accessibleTable",2),p([m({attribute:!1})],x.prototype,"zoom",2),p([m({attribute:!1})],x.prototype,"view",2),p([m({type:Boolean,reflect:!0})],x.prototype,"zoomable",2),p([m({type:Boolean,reflect:!0})],x.prototype,"editable",2),p([m({attribute:"sync-id"})],x.prototype,"syncId",2),p([m({type:Boolean,attribute:"cross-filter"})],x.prototype,"crossFilter",2),p([m({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],x.prototype,"animated",2),p([m({type:Boolean,reflect:!0})],x.prototype,"responsive",2),p([P()],x.prototype,"tip",2),p([P()],x.prototype,"overlay",2),p([P()],x.prototype,"portal",2),p([P()],x.prototype,"measured",2),p([P()],x.prototype,"viewState",2),p([P()],x.prototype,"highlightState",2),p([P()],x.prototype,"crossState",2),p([P()],x.prototype,"focused",2),p([P()],x.prototype,"hiddenState",2),p([P()],x.prototype,"zoomState",2),p([P()],x.prototype,"selectedState",2);var $=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:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:h,curve:d,connectNulls:u,nulls:f,stacked:v,stackOffset:S,orientation:y,radius:w,barGap:I,barWidth:O,sort:z,transform:Z,transforms:W,bins:ge,binWidth:U,binDomain:K,binMode:ee,sampling:te,brush:xe,crosshair:ne}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:h,curve:d,connectNulls:u,nulls:f,stacked:v,stackOffset:S,orientation:y,radius:w,barGap:I,barWidth:O,sort:z,transform:Z,transforms:W,bins:ge,binWidth:U,binDomain:K,binMode:ee,sampling:te,brush:xe,crosshair:ne,...this.compactOverrides()}}};p([m({attribute:!1})],$.prototype,"series",2),p([m({attribute:!1})],$.prototype,"categories",2),p([m({attribute:!1})],$.prototype,"xAxis",2),p([m({attribute:!1})],$.prototype,"yAxis",2),p([m({attribute:!1})],$.prototype,"rightAxis",2),p([m({attribute:!1})],$.prototype,"references",2),p([m({attribute:!1})],$.prototype,"annotations",2),p([m({type:Boolean,reflect:!0})],$.prototype,"labels",2),p([m()],$.prototype,"curve",2),p([m({type:Boolean,attribute:"connect-nulls"})],$.prototype,"connectNulls",2),p([m()],$.prototype,"nulls",2),p([m({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],$.prototype,"stacked",2),p([m({attribute:"stack-offset"})],$.prototype,"stackOffset",2),p([m()],$.prototype,"orientation",2),p([m({type:Number})],$.prototype,"radius",2),p([m({type:Number,attribute:"bar-gap"})],$.prototype,"barGap",2),p([m({type:Number,attribute:"bar-width"})],$.prototype,"barWidth",2),p([m()],$.prototype,"sort",2),p([m()],$.prototype,"transform",2),p([m({attribute:!1})],$.prototype,"transforms",2),p([m({type:Number})],$.prototype,"bins",2),p([m({type:Number,attribute:"bin-width"})],$.prototype,"binWidth",2),p([m({attribute:!1})],$.prototype,"binDomain",2),p([m({attribute:"bin-mode"})],$.prototype,"binMode",2),p([m({attribute:!1})],$.prototype,"sampling",2),p([m({type:Boolean,reflect:!0})],$.prototype,"brush",2),p([m({type:Boolean,reflect:!0})],$.prototype,"crosshair",2);var Dn=e=>e.defs&&e.defs.length?A`<defs>${e.defs.map(n=>A`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>A`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${M(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:T,ze=e=>A`${e.map((n,t)=>{let r=n.title?A`<title>${n.title}</title>`:T,i=n.item?t:void 0;switch(n.kind){case"path":return A`<path data-skdx-part=${n.part} data-skdx-i=${M(i)} d=${n.d} fill=${n.fill??"none"} stroke=${M(n.stroke)} stroke-width=${M(n.strokeWidth)} stroke-linecap=${M(n.strokeLinecap)} stroke-linejoin=${M(n.strokeLinejoin)} stroke-dasharray=${M(n.dash)} opacity=${M(n.opacity)} fill-opacity=${M(n.fillOpacity)}>${r}</path>`;case"rect":return A`<rect data-skdx-part=${n.part} data-skdx-i=${M(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${M(n.rx)} style=${M(Ie(n.part)?`rx:${Ie(n.part)}`:void 0)} fill=${n.fill} stroke=${M(n.stroke)} fill-opacity=${M(n.opacity)} pointer-events=${M(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return A`<line data-skdx-part=${n.part} data-skdx-i=${M(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${M(n.strokeWidth)} stroke-dasharray=${M(n.dash)} opacity=${M(n.opacity)}>${r}</line>`;case"circle":return A`<circle data-skdx-part=${n.part} data-skdx-i=${M(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${M(n.stroke)} opacity=${M(n.opacity)}>${r}</circle>`;case"text":return A`<text aria-label=${M(n.title)} data-skdx-part=${n.part} data-skdx-i=${M(i)} x=${n.x} y=${n.y} text-anchor=${M(n.anchor)} dominant-baseline=${M(n.baseline)} fill=${M(n.fill)} font-weight=${M(n.weight)} pointer-events=${M(i===void 0?"none":void 0)} transform=${M(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var L=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:i,labels:o,nodeRange:s,iterations:a,directed:l,edgeLabels:h}=this;return this.root(Ke({...this.sized(),nodes:t,edges:r,arrange:i,labels:o,nodeRange:s,iterations:a,directed:l,edgeLabels:h,...this.compactOverrides()}),"network",this.label??"Network chart")}};p([V({attribute:!1})],L.prototype,"nodes",2),p([V({attribute:!1})],L.prototype,"edges",2),p([V()],L.prototype,"arrange",2),p([V({type:Boolean,attribute:"no-labels",converter:St})],L.prototype,"labels",2),p([V({attribute:!1})],L.prototype,"nodeRange",2),p([V({type:Number})],L.prototype,"iterations",2),p([V({type:Boolean,reflect:!0})],L.prototype,"directed",2),p([V({type:Boolean,reflect:!0,attribute:"edge-labels"})],L.prototype,"edgeLabels",2),L=p([Fn("skdx-network-chart")],L);export{L as SkdxNetworkChart};
@@ -1,6 +1,6 @@
1
- "use strict";var ue=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var tn=Object.getOwnPropertyNames;var nn=Object.prototype.hasOwnProperty;var rn=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},on=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of tn(n))!nn.call(e,i)&&i!==t&&ue(e,i,{get:()=>n[i],enumerable:!(r=St(n,i))||r.enumerable});return e};var sn=e=>on(ue({},"__esModule",{value:!0}),e),d=(e,n,t,r)=>{for(var i=r>1?void 0:r?St(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&ue(n,t,i),i};var Sn={};rn(Sn,{SkdxOrganizationChart:()=>z});module.exports=sn(Sn);var D=require("lit/decorators.js");var Mt=e=>Number(e.toPrecision(12)),an,ln=e=>(an??(an=new Intl.NumberFormat)).format(Mt(e)),cn=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function Ct(e){if(e===void 0)return ln;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?p=>u(p)+i:u,a=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let p=new Intl.NumberFormat(t,u);return s(m=>p.format(Mt(m)))},c=u=>{let p=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return m=>p.format(m)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(a(2));case"percent":return l({style:"percent",...a(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...a()});case"compact":return l({notation:"compact",...a(1)});case"scientific":return l({notation:"scientific",...a(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return s(cn)}}var b=e=>Number(e.toFixed(2)),Ae=e=>typeof e=="number"&&Number.isFinite(e);var ne=1e3,re=60*ne,ie=60*re,he=24*ie,In=[ne,5*ne,15*ne,30*ne,re,5*re,15*re,30*re,ie,3*ie,6*ie,12*ie,he,2*he,7*he,14*he];var dn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,un=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,hn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function pn(e,n,t){return e.replace(un,(r,i,o)=>{let s=hn[i];if(s===void 0)return i+o;let l=(o.match(dn)??[]).map((c,u)=>{let p=Number(c);if(s===-1)return String(p+n);if(s===-2)return String(p+t);let m=u%s;return s===7?m===5?String(p+n):m===6?String(p+t):c:String(m%2===0?p+n:p+t)});return i+l.join(" ")})}var It=(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:pn(r.d,n,t)}}});var Le=["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)"))),v={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)"};var Tt=(e,n)=>n??Le[e%Le.length];var fn={top:16,right:16,bottom:32,left:48};function Ot(e,n,t=fn){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 oe(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function zt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var pe=20,mn=120,At=e=>{let n=oe(e);return n&&(n.position==="left"||n.position==="right")?n.width??mn:0},fe=(e,n=600,t=300)=>({width:(e.width??n)-At(e),height:(e.height??t)-(oe(e)?.position==="bottom"?pe:0)}),Ne=(e,n,t)=>{let r=oe(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Nt(n,t??fe(e).width,r)):1)*pe},P=6.5;function Lt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/P));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var Pt=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Tt(n));function Pe(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,u=e.length-c.length,p=r.interactive??!0,m=o,S=i,M=(k,$,C,I)=>{let A=($?18:4)+k.length*P;m>o&&(s||m+A>n-8)&&(m=o,S+=pe),$&&a.push({kind:"rect",part:"legend-swatch",x:m,y:S-5,width:10,height:10,fill:$,opacity:I?.3:void 0,item:C}),a.push({kind:"text",part:"legend-label",x:m+($?14:0),y:S,text:k,baseline:"middle",fill:I?v.grid:v.label,item:C}),m+=A+12};for(let k of c){let $=t.includes(k.name),C=p?{label:k.name,series:k.name,legend:!0}:void 0;M(r.formatter?.(k.name)??k.name,k.color,C,$)}return u>0&&M(`+${u} more`,void 0,void 0,!1),r.align==="end"?bn(a,n):a}function bn(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(a=>a.kind==="rect"?a.x+a.width:a.x+a.text.length*P)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var Nt=(e,n,t={})=>new Set(Pe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Re(e,n,t,r=[]){let i=oe(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=zt(e),a=o?.position==="bottom",l=At(e),c=e.hiddenSeries??[],u=o?l?Pe(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Pe(r,n,c,o,a?t+10:10):[],p=a?Nt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,p)*pe: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 Be(e){let n=e.legendOffset;if(!n)return e;let t=[...It(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}),i=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,a=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:a,legendOffset:void 0}}function me(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/P)),l=s.flatMap($=>{let C=[],I=Array.from($);for(;I.length>a;){let A=I.slice(0,a+1).lastIndexOf(" ");A<1&&(A=a),C.push(I.slice(0,A).join("")),I=I.slice(A),I[0]===" "&&I.shift()}return C.push(I.join("")),C}),c=Math.max(1,Math.floor((i-6)/16)),u=l.slice(0,c);l.length>c&&(u[c-1]=Lt(`${u[c-1]}\u2026`,r-12));let p=Math.min(r,Math.max(0,...u.map($=>Array.from($).length))*P+12),m=Math.min(i,6+u.length*16),S=o==="top"?{x:e-p/2,y:n-m-8}:o==="bottom"?{x:e-p/2,y:n+8}:o==="left"?{x:e-p-8,y:n-m/2}:o==="right"?{x:e+8,y:n-m/2}:{x:e+12,y:n-m-6},M=Math.max(0,Math.min(r-p,S.x)),k=Math.max(0,Math.min(i-m,S.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
- `),x:b(M),y:b(k),width:b(p),height:m,fill:"var(--skdx-color-surface-raised)",stroke:v.axis,rx:8},...u.map(($,C)=>({kind:"text",part:"tooltip-label",x:b(M+6),y:b(k+11+C*16),text:$,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:u.length>1&&C===0?"bold":void 0}))]}function Rt(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=fe(e,t,r),a=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return i==="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-${i}`,x:b(o/2),y:b(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":v.label}),{...Re(e,o,s),shapes:l,tooltip:!1}}var K=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:v.label,...r});function Bt(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*P+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),i=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:i,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)"}]})}function be(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var De=e=>e.id??e.name??e.series,Dt=e=>e.seriesId??e.series;function H(e,n){let t=!1;return n.id!==void 0&&(t=!0,De(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Dt(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}function Z(e){let n={},t=De(e);t!==void 0&&(n.id=t);let r=Dt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Fe=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ge(e,n,t){let r=be(e),i=Z(n),o=r.some(s=>H(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!H(n,s)):[...r,i]}var xn=.2;function gn(e){let n=v.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 yn=(e,n)=>e.kind==="text"?{...e,fill:v.grid}:{...e,opacity:(e.opacity??1)*n};function je(e,n){let t=be(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:be(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=u=>!i||r.some(p=>H(u,p))?!0:o.highlighted==="series"?r.some(p=>p.series!==void 0&&H(u,{series:p.series})):!1,l=u=>{if(!i||o.faded==="none"||a(u))return!1;if(o.faded==="series"){let p=i.series;return p!==void 0&&H(u,{series:p})}return!0},c=e.shapes.map(u=>{let p=u.item;if(!p||p.legend)return u;if(t.some(m=>H(p,m))){let m=gn(u);m&&s.push(m)}return l(p)?yn(u,xn):u});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Ft="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function xe(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Ft:void 0}function Q(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var He=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Gt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function se(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Gt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ve(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Gt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:v.axis,dash:"3 3"}}function _e(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!He(r.plot,n,t))return[];let i=Ve(e,n),{rows:o}=se(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...me(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ee(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 i=t.xs[r];return _e(e,i,t.plot.y+8)}function Ze(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=Q(t,r,i,e.width,e.height);if(He(e.hit.plot,l,c)){let u=se(e,l),p=Ve(e,l);if(u&&p)return{lines:u.rows,shapes:[p]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?W(e,n)?.item:void 0,a=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return a?{lines:Array.isArray(a)?a:[a],shapes:[]}:{lines:[],shapes:[]}}function jt(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?W(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(M=>M.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=s?.tooltipAnchored?W(s,e):void 0,p=u?s?.shapes[u.index]:void 0,{x:m,y:S}=p?ae(p):Q(n,t,r,i,o);return me(m,S,c,i,o,s?.tooltipPlacement)}function We(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Q(t,r,i,e.width,e.height),a=_e(e,o,s);if(a.length>0)return a}return jt(n,t,r,i,e.width,e.height,e)}function Ue(e,n){let t=W(e,n);return t&&!t.item.legend?Z(t.item):null}var vn=(e,n)=>{let{x:t,y:r}=ae(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function Ke(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!vn(i,n))continue;let o=Z(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Ye=e=>({kind:"rect",part:"selection-box",x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height),fill:v.focus,opacity:.12,stroke:v.focus}),ye=(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 Ht(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],a=e[o];s.y>t!=a.y>t&&n<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(r=!r)}return r}function qe(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=ae(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Ht(n,o,a))continue;let l=Z(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Xe=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${b(n.x)} ${b(n.y)}`).join("L")}`:"",fill:v.focus,fillOpacity:.12,stroke:v.focus,dash:"4 3"}),ge=6;function Qe(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-ge||n>i.x1+ge))return Math.abs(n-i.x0)<=ge?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ge?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Je(e,n,t){let r=e.edit;return Vt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function et(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(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",a=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Vt(r,{bar:o,mode:s},i*a)}function Vt(e,{bar:n,mode:t},r){let i=a=>e.snap?Math.round(a/e.snap)*e.snap:a,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function tt(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:b(Math.min(i,o)),y:b(n.bar.y),width:b(Math.max(1,Math.abs(o-i))),height:b(n.bar.height),fill:v.focus,opacity:.25,stroke:v.focus,rx:2}}var wn=64,kn=e=>Math.max(1,Math.min(wn,e));function nt(e,n,t,r){let i=n>0?.8:1.25,o=kn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,c]=e.view.center,u=(t-(s.x+s.width/2))/a,p=(r-(s.y+s.height/2))/a,m=e.view.zoom/o;return{center:[l+u*(1-m),e.fromY(e.toY(c)-p*(1-m))],zoom:o}}function rt(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function W(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var ve=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function ae(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 it(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=v.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*P+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=ae(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?me(b(o),b(s),a,e.width,e.height):[]]}function ot(e,n,t){let r=ve(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var q=2,X=(e,n,t)=>{let r=Math.max(q,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},_t=(e,n)=>!e||e.start<=0&&e.end>=n;function st(e,n,t){if(e.count<=q||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(q,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!_t(e.zoom,e.count)?X(r,a,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*o;return X(c-l*a,a,e.count)}function at(e,n,t,r){let i=n.end-n.start,o=Math.max(q,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return X(n.start+s*i-s*o,o,e.count)}function lt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return X(n.start-t/i,r,e.count)}function ct(e,n,t){let r=e.brush;if(!r||!He(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.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:X(s-o/2,o,e.count)}}function dt(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return X(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-q,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+q,Math.round(t.end+o)));return{start:t.start,end:s}}function ht(e,n){switch(n.type){case"svg":return Promise.resolve(ut(e,n.label,n.resolve));case"csv":return Promise.resolve(Ut(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=ut(e,n.label,n.resolve);return Wt(t,e.width,e.height,n.scale,n.background)}}}var V=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),le=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${V(String(t))}"`).join("");function Et(e){let n=e.title?`<title>${V(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${le([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${le([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${le([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${le([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${le([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]])}>${V(e.text)}</text>`}}function Zt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${V(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="${V(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function ut(e,n,t){let r=Zt(e)+e.shapes.map(Et).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<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="${V(n)}" font-family="${V(v.fontFamily)}" font-size="${V(v.fontSize)}"><title>${V(n)}</title>${r}</svg>`}function Wt(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(a);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let u=c.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),c.toBlob(p=>p?o(p):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Ut(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
- `)}var we=e=>Ae(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+we(t),0),pt=e=>Ae(e.value)||(e.children??[]).some(pt);var ke=e=>e.id??e.name;function Kt(e,n){for(let t of e){if(ke(t)===n||t.name===n)return[t];let r=Kt(t.children??[],n);if(r)return[t,...r]}}function ft(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:we(r),children:void 0}:{...r,children:r.children?ft(r.children,n,t+1):void 0})}function Yt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Kt(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 mt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let l=["",...a.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],c=r.rows.map(u=>[u[0],...u.slice(1).map(p=>p.slice(p.lastIndexOf(": ")+2))]);return[l,...c]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(l=>l[a]!==void 0)),s=(a,l)=>a[l]===void 0?"":String(a[l]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(l=>s(a,l)))]}var bt=new Map;function $e(e){let n=bt.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&bt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return bt.set(e,{group:i,listeners:t}),i}var qt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',xt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${qt}{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){${qt}{animation:none;transition:none}}`;function gt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Xt(e){let{nodes:n,path:t}=Yt(e.data,e.rootId),r=ft(n,e.maxDepth),i=Rt(e,r.length===0);if(i)return i;let o=Ct(e.format),{width:s,height:a}=fe(e),l=e.orientation!=="horizontal",c=e.nodeShape==="box",u=e.linkStyle??"curve",p=new Set(e.collapsed??[]),m=e.labels??!0,S=[],M=0,k=0,$=(g,T,O,de)=>{let Y=p.has(ke(g))||p.has(g.name),te=Y?[]:g.children??[],F=g.color??O?.color??Pt(e,de),B={node:g,depth:T,slot:0,parent:O,collapsed:Y,color:F};if(k=Math.max(k,T),te.length===0)B.slot=M++;else{let L=te.map((G,j)=>$(G,T+1,B,j));B.slot=(L[0].slot+L[L.length-1].slot)/2}return S.push(B),B};r.forEach((g,T)=>$(g,0,void 0,T));let C=g=>Math.max(g.name.length,g.subtitle?.length??0),I=Math.max(0,...S.map(g=>C(g.node)))*P+16,A=e.nodeSize??36,N=e.nodeSize??5,_=c?I:2*N,E=c?A:2*N,Me=!c&&m?I:0,R=Ot(s,a,{top:Ne(e)+E/2+4,bottom:E/2+4+(l&&!c?16:0),left:_/2+4,right:_/2+4+(l?0:Me)}),J=Math.max(1,M),ce=l?R.width:R.height,Ce=l?R.height:R.width,Ie=J===1?0:ce/(J-1),Qt=k===0?0:Ce/k,wt=g=>{let T=J===1?ce/2:g.slot*Ie,O=g.depth*Qt;return l?{x:b(R.x+T),y:b(R.y+O)}:{x:b(R.x+O),y:b(R.y+T)}},kt=[],Te=[],ee=[];for(let g of S){let{x:T,y:O}=wt(g);if(g.parent){let F=wt(g.parent),B=c?l?E/2:_/2:N,L=l?F.x:b(F.x+B),G=l?b(F.y+B):F.y,j=l?T:b(T-B),U=l?b(O-B):O,Oe=b((L+j)/2),ze=b((G+U)/2),en=u==="straight"?`M${L} ${G}L${j} ${U}`:u==="elbow"?l?`M${L} ${G}V${ze}H${j}V${U}`:`M${L} ${G}H${Oe}V${U}H${j}`:l?`M${L} ${G}C${L} ${ze} ${j} ${ze} ${j} ${U}`:`M${L} ${G}C${Oe} ${G} ${Oe} ${U} ${j} ${U}`;kt.push({kind:"path",part:"link",d:en,stroke:v.axis,strokeWidth:1.5,title:`${g.parent.node.name} \u2192 ${g.node.name}`})}let de=we(g.node),Y=`${g.node.name}${g.node.subtitle?` \xB7 ${g.node.subtitle}`:""}${pt(g.node)?`: ${o(de)}`:""}${g.collapsed?" (collapsed)":""}`,te={label:Y,id:ke(g.node),name:g.node.name,value:de};if(c){if(Te.push({kind:"rect",part:"node",x:b(T-_/2),y:b(O-E/2),width:b(_),height:b(E),fill:g.color,rx:4,title:Y,item:te}),m){let F=!!g.node.subtitle;ee.push(K(T,b(F?O-7:O),g.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),F&&ee.push(K(T,b(O+8),g.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else Te.push({kind:"circle",part:"node",cx:T,cy:O,r:b(N),fill:g.color,stroke:"var(--skdx-color-surface-default)",title:Y,item:te}),m&&ee.push(l?K(T,b(O+N+12),g.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):K(b(T+N+4),O,g.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));g.collapsed&&ee.push(K(b(c?T+_/2-8:T+N+(l?6:-2)),b(c?O-E/2+8:O-N-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:v.label,weight:"bold"}))}let Jt=t.length?[K(8,Ne(e)+10,t.map(g=>g.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],$t=Re(e,s,a);return{...$t,shapes:Bt([...kt,...Te,...ee,...Jt,...$t.shapes])}}var yt=e=>Xt({...e,nodeShape:"box",linkStyle:"elbow"});var f=require("lit"),h=require("lit/decorators.js"),y=require("lit/directives/if-defined.js");var vt={fromAttribute:()=>!1},x=class extends f.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 i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Ye(ye(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[Xe(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Je(r,i.gantt,o-i.x),this.overlay=[tt(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(rt(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,a]=[...this.pointers.values()];if(s===void 0||a===void 0||!i.distance)return;this.setZoom(at(r.hit,i.zoom,Math.abs(s-a)/i.distance,(s+a)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?lt(r.hit,i.zoom,o-i.x):dt(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Ze(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=We(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ue(r,t.target)),this.syncId&&r.hit?.crosshair){let o=se(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:i,y:o}=this.viewBox(t,r),s=W(r,t.target)?.item.legend,a=this.canEdit(r)?Qe(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;this.drag={x:i,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,i),this.pointers.size===2){let[c,u]=[...this.pointers.values()];this.drag={x:(c+u)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-u)||1}}else{let c=ct(l,i,o);if(c)this.drag={x:i,y:o,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&i>=l.plot.x&&i<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:i,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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(Ke(o,ye(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(qe(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(i<l.x||i>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(nt(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let a=st(s,t.deltaY,i);a&&(t.preventDefault(),this.setZoom(a))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=W(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 a=r.shapes[this.focused]?.item;a&&(t.preventDefault(),this.select(a),this.emit("skdx-item-click",a));return}let i=this.canEdit(r)?et(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=ot(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?Z(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:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:p,decorative:m,animated:S,responsive:M,highlighted:k,highlightScope:$,accessibleTable:C}=this;return{...typeof M=="object"&&this.measured!==void 0&&this.measured<(M.breakpoint??480)?M.compact:void 0,width:M&&this.measured?this.measured:t,height:r,animate:S,responsive:M,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:p,decorative:m,highlighted:k===void 0?this.highlightState:k,highlightScope:$,accessibleTable:C,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&&$e(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=$e(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Fe(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(Ge(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 Q(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&H(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?ht(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=je(Be(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let $ of o.issues??[])this.emit("skdx-data-issue",$)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),u=s||a||l||c,p=!o.decorative&&ve(o).length>0,m=gt(o),S=mt(o,this.accessibleTable),M=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,k=this.portal;return f.html`<svg
1
+ "use strict";var ue=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var tn=Object.getOwnPropertyNames;var nn=Object.prototype.hasOwnProperty;var rn=(e,n)=>{for(var t in n)ue(e,t,{get:n[t],enumerable:!0})},on=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of tn(n))!nn.call(e,i)&&i!==t&&ue(e,i,{get:()=>n[i],enumerable:!(r=St(n,i))||r.enumerable});return e};var sn=e=>on(ue({},"__esModule",{value:!0}),e),d=(e,n,t,r)=>{for(var i=r>1?void 0:r?St(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&ue(n,t,i),i};var Sn={};rn(Sn,{SkdxOrganizationChart:()=>z});module.exports=sn(Sn);var F=require("lit/decorators.js");var Mt=e=>Number(e.toPrecision(12)),an,ln=e=>(an??(an=new Intl.NumberFormat)).format(Mt(e)),cn=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function Ct(e){if(e===void 0)return ln;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?p=>u(p)+i:u,a=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let p=new Intl.NumberFormat(t,u);return s(m=>p.format(Mt(m)))},c=u=>{let p=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return m=>p.format(m)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(a(2));case"percent":return l({style:"percent",...a(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...a()});case"compact":return l({notation:"compact",...a(1)});case"scientific":return l({notation:"scientific",...a(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return s(cn)}}var b=e=>Number(e.toFixed(2)),Ae=e=>typeof e=="number"&&Number.isFinite(e);var ne=1e3,re=60*ne,ie=60*re,he=24*ie,In=[ne,5*ne,15*ne,30*ne,re,5*re,15*re,30*re,ie,3*ie,6*ie,12*ie,he,2*he,7*he,14*he];var dn=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,un=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,hn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function pn(e,n,t){return e.replace(un,(r,i,o)=>{let s=hn[i];if(s===void 0)return i+o;let l=(o.match(dn)??[]).map((c,u)=>{let p=Number(c);if(s===-1)return String(p+n);if(s===-2)return String(p+t);let m=u%s;return s===7?m===5?String(p+n):m===6?String(p+t):c:String(m%2===0?p+n:p+t)});return i+l.join(" ")})}var It=(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:pn(r.d,n,t)}}});var Le=["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)"))),v={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)"};var Tt=(e,n)=>n??Le[e%Le.length];var fn={top:16,right:16,bottom:32,left:48};function Ot(e,n,t=fn){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 oe(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function zt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var pe=20,mn=120,At=e=>{let n=oe(e);return n&&(n.position==="left"||n.position==="right")?n.width??mn:0},fe=(e,n=600,t=300)=>({width:(e.width??n)-At(e),height:(e.height??t)-(oe(e)?.position==="bottom"?pe:0)}),Ne=(e,n,t)=>{let r=oe(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Nt(n,t??fe(e).width,r)):1)*pe},P=6.5;function Lt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/P));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var Pt=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Tt(n));function Pe(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,u=e.length-c.length,p=r.interactive??!0,m=o,S=i,T=(k,$,M,I)=>{let A=($?18:4)+k.length*P;m>o&&(s||m+A>n-8)&&(m=o,S+=pe),$&&a.push({kind:"rect",part:"legend-swatch",x:m,y:S-5,width:10,height:10,fill:$,opacity:I?.3:void 0,item:M}),a.push({kind:"text",part:"legend-label",x:m+($?14:0),y:S,text:k,baseline:"middle",fill:I?v.grid:v.label,item:M}),m+=A+12};for(let k of c){let $=t.includes(k.name),M=p?{label:k.name,series:k.name,legend:!0}:void 0;T(r.formatter?.(k.name)??k.name,k.color,M,$)}return u>0&&T(`+${u} more`,void 0,void 0,!1),r.align==="end"?bn(a,n):a}function bn(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(a=>a.kind==="rect"?a.x+a.width:a.x+a.text.length*P)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var Nt=(e,n,t={})=>new Set(Pe(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Re(e,n,t,r=[]){let i=oe(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=zt(e),a=o?.position==="bottom",l=At(e),c=e.hiddenSeries??[],u=o?l?Pe(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Pe(r,n,c,o,a?t+10:10):[],p=a?Nt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,p)*pe: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 Be(e){let n=e.legendOffset;if(!n)return e;let t=[...It(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}),i=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,a=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:a,legendOffset:void 0}}function me(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/P)),l=s.flatMap($=>{let M=[],I=Array.from($);for(;I.length>a;){let A=I.slice(0,a+1).lastIndexOf(" ");A<1&&(A=a),M.push(I.slice(0,A).join("")),I=I.slice(A),I[0]===" "&&I.shift()}return M.push(I.join("")),M}),c=Math.max(1,Math.floor((i-6)/16)),u=l.slice(0,c);l.length>c&&(u[c-1]=Lt(`${u[c-1]}\u2026`,r-12));let p=Math.min(r,Math.max(0,...u.map($=>Array.from($).length))*P+12),m=Math.min(i,6+u.length*16),S=o==="top"?{x:e-p/2,y:n-m-8}:o==="bottom"?{x:e-p/2,y:n+8}:o==="left"?{x:e-p-8,y:n-m/2}:o==="right"?{x:e+8,y:n-m/2}:{x:e+12,y:n-m-6},T=Math.max(0,Math.min(r-p,S.x)),k=Math.max(0,Math.min(i-m,S.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
+ `),x:b(T),y:b(k),width:b(p),height:m,fill:"var(--skdx-color-surface-raised)",stroke:v.axis,rx:8},...u.map(($,M)=>({kind:"text",part:"tooltip-label",x:b(T+6),y:b(k+11+M*16),text:$,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:u.length>1&&M===0?"bold":void 0}))]}function Rt(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=fe(e,t,r),a=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return i==="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-${i}`,x:b(o/2),y:b(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":v.label}),{...Re(e,o,s),shapes:l,tooltip:!1}}var K=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:v.label,...r});function Bt(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*P+8,r=n.x-(n.anchor==="middle"?t/2:n.anchor==="end"?t-4:4),i=n.y-(n.baseline==="hanging"?2:n.baseline==="middle"?9:14);return[{kind:"rect",part:"label-background",x:r,y:i,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)"}]})}function be(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var De=e=>e.id??e.name??e.series,Dt=e=>e.seriesId??e.series;function V(e,n){let t=!1;return n.id!==void 0&&(t=!0,De(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Dt(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}function Z(e){let n={},t=De(e);t!==void 0&&(n.id=t);let r=Dt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Fe=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ge(e,n,t){let r=be(e),i=Z(n),o=r.some(s=>V(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!V(n,s)):[...r,i]}var xn=.2;function gn(e){let n=v.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 yn=(e,n)=>e.kind==="text"?{...e,fill:v.grid}:{...e,opacity:(e.opacity??1)*n};function je(e,n){let t=be(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:be(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=u=>!i||r.some(p=>V(u,p))?!0:o.highlighted==="series"?r.some(p=>p.series!==void 0&&V(u,{series:p.series})):!1,l=u=>{if(!i||o.faded==="none"||a(u))return!1;if(o.faded==="series"){let p=i.series;return p!==void 0&&V(u,{series:p})}return!0},c=e.shapes.map(u=>{let p=u.item;if(!p||p.legend)return u;if(t.some(m=>V(p,m))){let m=gn(u);m&&s.push(m)}return l(p)?yn(u,xn):u});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Ft="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function xe(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Ft:void 0}function Q(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var He=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Gt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function se(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Gt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ve(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Gt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:v.axis,dash:"3 3"}}function _e(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!He(r.plot,n,t))return[];let i=Ve(e,n),{rows:o}=se(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...me(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ee(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 i=t.xs[r];return _e(e,i,t.plot.y+8)}function Ze(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=Q(t,r,i,e.width,e.height);if(He(e.hit.plot,l,c)){let u=se(e,l),p=Ve(e,l);if(u&&p)return{lines:u.rows,shapes:[p]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?W(e,n)?.item:void 0,a=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return a?{lines:Array.isArray(a)?a:[a],shapes:[]}:{lines:[],shapes:[]}}function jt(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?W(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(T=>T.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=s?.tooltipAnchored?W(s,e):void 0,p=u?s?.shapes[u.index]:void 0,{x:m,y:S}=p?ae(p):Q(n,t,r,i,o);return me(m,S,c,i,o,s?.tooltipPlacement)}function We(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Q(t,r,i,e.width,e.height),a=_e(e,o,s);if(a.length>0)return a}return jt(n,t,r,i,e.width,e.height,e)}function Ue(e,n){let t=W(e,n);return t&&!t.item.legend?Z(t.item):null}var vn=(e,n)=>{let{x:t,y:r}=ae(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function Ke(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!vn(i,n))continue;let o=Z(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Ye=e=>({kind:"rect",part:"selection-box",x:b(e.x),y:b(e.y),width:b(e.width),height:b(e.height),fill:v.focus,opacity:.12,stroke:v.focus}),ye=(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 Ht(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],a=e[o];s.y>t!=a.y>t&&n<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(r=!r)}return r}function qe(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=ae(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Ht(n,o,a))continue;let l=Z(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Xe=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${b(n.x)} ${b(n.y)}`).join("L")}`:"",fill:v.focus,fillOpacity:.12,stroke:v.focus,dash:"4 3"}),ge=6;function Qe(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-ge||n>i.x1+ge))return Math.abs(n-i.x0)<=ge?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ge?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Je(e,n,t){let r=e.edit;return Vt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function et(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(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",a=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Vt(r,{bar:o,mode:s},i*a)}function Vt(e,{bar:n,mode:t},r){let i=a=>e.snap?Math.round(a/e.snap)*e.snap:a,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function tt(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:b(Math.min(i,o)),y:b(n.bar.y),width:b(Math.max(1,Math.abs(o-i))),height:b(n.bar.height),fill:v.focus,opacity:.25,stroke:v.focus,rx:2}}var wn=64,kn=e=>Math.max(1,Math.min(wn,e));function nt(e,n,t,r){let i=n>0?.8:1.25,o=kn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,c]=e.view.center,u=(t-(s.x+s.width/2))/a,p=(r-(s.y+s.height/2))/a,m=e.view.zoom/o;return{center:[l+u*(1-m),e.fromY(e.toY(c)-p*(1-m))],zoom:o}}function rt(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function W(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var ve=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function ae(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 it(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=v.focus,i;switch(t.kind){case"rect":i={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":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*P+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=ae(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?me(b(o),b(s),a,e.width,e.height):[]]}function ot(e,n,t){let r=ve(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var q=2,X=(e,n,t)=>{let r=Math.max(q,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},_t=(e,n)=>!e||e.start<=0&&e.end>=n;function st(e,n,t){if(e.count<=q||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(q,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!_t(e.zoom,e.count)?X(r,a,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*o;return X(c-l*a,a,e.count)}function at(e,n,t,r){let i=n.end-n.start,o=Math.max(q,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return X(n.start+s*i-s*o,o,e.count)}function lt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return X(n.start-t/i,r,e.count)}function ct(e,n,t){let r=e.brush;if(!r||!He(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.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:X(s-o/2,o,e.count)}}function dt(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return X(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-q,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+q,Math.round(t.end+o)));return{start:t.start,end:s}}function ht(e,n){switch(n.type){case"svg":return Promise.resolve(ut(e,n.label,n.resolve));case"csv":return Promise.resolve(Ut(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=ut(e,n.label,n.resolve);return Wt(t,e.width,e.height,n.scale,n.background)}}}var D=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),le=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${D(String(t))}"`).join("");function Et(e){let n=e.title?`<title>${D(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${le([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${le([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${le([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${le([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${le([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]])}>${D(e.text)}</text>`}}function Zt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${D(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="${D(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function ut(e,n,t){let r=Zt(e)+e.shapes.map(Et).join("");t&&(r=r.replace(/var\((--[\w-]+)\)/g,(s,a)=>t(a).trim()||s));let i=e.decorative?'aria-hidden="true"':`role="img" aria-label="${D(n)}"`,o=e.description?`<desc>${D(e.description)}</desc>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" ${i} font-family="${D(v.fontFamily)}" font-size="${D(v.fontSize)}"><title>${D(n)}</title>${o}${r}</svg>`}function Wt(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(a);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let u=c.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),c.toBlob(p=>p?o(p):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Ut(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
+ `)}var we=e=>Ae(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+we(t),0),pt=e=>Ae(e.value)||(e.children??[]).some(pt);var ke=e=>e.id??e.name;function Kt(e,n){for(let t of e){if(ke(t)===n||t.name===n)return[t];let r=Kt(t.children??[],n);if(r)return[t,...r]}}function ft(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:we(r),children:void 0}:{...r,children:r.children?ft(r.children,n,t+1):void 0})}function Yt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Kt(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 mt(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let l=["",...a.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],c=r.rows.map(u=>[u[0],...u.slice(1).map(p=>p.slice(p.lastIndexOf(": ")+2))]);return[l,...c]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(l=>l[a]!==void 0)),s=(a,l)=>a[l]===void 0?"":String(a[l]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(l=>s(a,l)))]}var bt=new Map;function $e(e){let n=bt.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&bt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return bt.set(e,{group:i,listeners:t}),i}var qt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',xt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${qt}{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){${qt}{animation:none;transition:none}}`;function gt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Xt(e){let{nodes:n,path:t}=Yt(e.data,e.rootId),r=ft(n,e.maxDepth),i=Rt(e,r.length===0);if(i)return i;let o=Ct(e.format),{width:s,height:a}=fe(e),l=e.orientation!=="horizontal",c=e.nodeShape==="box",u=e.linkStyle??"curve",p=new Set(e.collapsed??[]),m=e.labels??!0,S=[],T=0,k=0,$=(g,C,O,de)=>{let Y=p.has(ke(g))||p.has(g.name),te=Y?[]:g.children??[],G=g.color??O?.color??Pt(e,de),B={node:g,depth:C,slot:0,parent:O,collapsed:Y,color:G};if(k=Math.max(k,C),te.length===0)B.slot=T++;else{let L=te.map((j,H)=>$(j,C+1,B,H));B.slot=(L[0].slot+L[L.length-1].slot)/2}return S.push(B),B};r.forEach((g,C)=>$(g,0,void 0,C));let M=g=>Math.max(g.name.length,g.subtitle?.length??0),I=Math.max(0,...S.map(g=>M(g.node)))*P+16,A=e.nodeSize??36,N=e.nodeSize??5,_=c?I:2*N,E=c?A:2*N,Me=!c&&m?I:0,R=Ot(s,a,{top:Ne(e)+E/2+4,bottom:E/2+4+(l&&!c?16:0),left:_/2+4,right:_/2+4+(l?0:Me)}),J=Math.max(1,T),ce=l?R.width:R.height,Ce=l?R.height:R.width,Ie=J===1?0:ce/(J-1),Qt=k===0?0:Ce/k,wt=g=>{let C=J===1?ce/2:g.slot*Ie,O=g.depth*Qt;return l?{x:b(R.x+C),y:b(R.y+O)}:{x:b(R.x+O),y:b(R.y+C)}},kt=[],Te=[],ee=[];for(let g of S){let{x:C,y:O}=wt(g);if(g.parent){let G=wt(g.parent),B=c?l?E/2:_/2:N,L=l?G.x:b(G.x+B),j=l?b(G.y+B):G.y,H=l?C:b(C-B),U=l?b(O-B):O,Oe=b((L+H)/2),ze=b((j+U)/2),en=u==="straight"?`M${L} ${j}L${H} ${U}`:u==="elbow"?l?`M${L} ${j}V${ze}H${H}V${U}`:`M${L} ${j}H${Oe}V${U}H${H}`:l?`M${L} ${j}C${L} ${ze} ${H} ${ze} ${H} ${U}`:`M${L} ${j}C${Oe} ${j} ${Oe} ${U} ${H} ${U}`;kt.push({kind:"path",part:"link",d:en,stroke:v.axis,strokeWidth:1.5,title:`${g.parent.node.name} \u2192 ${g.node.name}`})}let de=we(g.node),Y=`${g.node.name}${g.node.subtitle?` \xB7 ${g.node.subtitle}`:""}${pt(g.node)?`: ${o(de)}`:""}${g.collapsed?" (collapsed)":""}`,te={label:Y,id:ke(g.node),name:g.node.name,value:de};if(c){if(Te.push({kind:"rect",part:"node",x:b(C-_/2),y:b(O-E/2),width:b(_),height:b(E),fill:g.color,rx:4,title:Y,item:te}),m){let G=!!g.node.subtitle;ee.push(K(C,b(G?O-7:O),g.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),G&&ee.push(K(C,b(O+8),g.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else Te.push({kind:"circle",part:"node",cx:C,cy:O,r:b(N),fill:g.color,stroke:"var(--skdx-color-surface-default)",title:Y,item:te}),m&&ee.push(l?K(C,b(O+N+12),g.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):K(b(C+N+4),O,g.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));g.collapsed&&ee.push(K(b(c?C+_/2-8:C+N+(l?6:-2)),b(c?O-E/2+8:O-N-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:v.label,weight:"bold"}))}let Jt=t.length?[K(8,Ne(e)+10,t.map(g=>g.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],$t=Re(e,s,a);return{...$t,shapes:Bt([...kt,...Te,...ee,...Jt,...$t.shapes])}}var yt=e=>Xt({...e,nodeShape:"box",linkStyle:"elbow"});var f=require("lit"),h=require("lit/decorators.js"),y=require("lit/directives/if-defined.js");var vt={fromAttribute:()=>!1},x=class extends f.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 i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Ye(ye(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[Xe(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Je(r,i.gantt,o-i.x),this.overlay=[tt(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(rt(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,a]=[...this.pointers.values()];if(s===void 0||a===void 0||!i.distance)return;this.setZoom(at(r.hit,i.zoom,Math.abs(s-a)/i.distance,(s+a)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?lt(r.hit,i.zoom,o-i.x):dt(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Ze(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=We(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ue(r,t.target)),this.syncId&&r.hit?.crosshair){let o=se(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:i,y:o}=this.viewBox(t,r),s=W(r,t.target)?.item.legend,a=this.canEdit(r)?Qe(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;this.drag={x:i,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,i),this.pointers.size===2){let[c,u]=[...this.pointers.values()];this.drag={x:(c+u)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-u)||1}}else{let c=ct(l,i,o);if(c)this.drag={x:i,y:o,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&i>=l.plot.x&&i<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:i,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 i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(Ke(o,ye(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(qe(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,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:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(i<l.x||i>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(nt(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let a=st(s,t.deltaY,i);a&&(t.preventDefault(),this.setZoom(a))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=W(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 a=r.shapes[this.focused]?.item;a&&(t.preventDefault(),this.select(a),this.emit("skdx-item-click",a));return}let i=this.canEdit(r)?et(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=ot(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?Z(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:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:p,decorative:m,animated:S,responsive:T,highlighted:k,highlightScope:$,accessibleTable:M}=this;return{width:T&&this.measured?this.measured:t,height:r,animate:S,responsive:T,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:p,decorative:m,highlighted:k===void 0?this.highlightState:k,highlightScope:$,accessibleTable:M,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}compactOverrides(){let t=this.responsive;return typeof t=="object"&&this.measured!==void 0&&this.measured<(t.breakpoint??480)?{...t.compact,width:this.measured}:void 0}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&$e(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=$e(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}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,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Fe(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(Ge(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 Q(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 i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&V(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?ht(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=je(Be(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let $ of o.issues??[])this.emit("skdx-data-issue",$)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),u=s||a||l||c,p=!o.decorative&&ve(o).length>0,m=gt(o),S=mt(o,this.accessibleTable),T=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,k=this.portal;return f.html`<svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
5
  viewBox="0 0 ${o.width} ${o.height}"
6
6
  width=${o.width}
@@ -44,7 +44,7 @@
44
44
  </div>`:f.nothing}
45
45
  ${S?f.html`<table data-skdx-table=${r}>
46
46
  <caption>
47
- ${M}
47
+ ${T}
48
48
  </caption>
49
49
  <thead>
50
50
  <tr>
@@ -53,7 +53,7 @@
53
53
  </thead>
54
54
  <tbody>
55
55
  ${S.slice(1).map($=>f.html`<tr>
56
- ${$.map((C,I)=>I===0?f.html`<th scope="row">${C}</th>`:f.html`<td>${C}</td>`)}
56
+ ${$.map((M,I)=>I===0?f.html`<th scope="row">${M}</th>`:f.html`<td>${M}</td>`)}
57
57
  </tr>`)}
58
58
  </tbody>
59
59
  </table>`:f.nothing}`}};x.styles=f.css`
@@ -109,4 +109,4 @@
109
109
  [role='tooltip'] > :first-child:not(:only-child) {
110
110
  font-weight: bold;
111
111
  }
112
- `,d([(0,h.property)({type:Number})],x.prototype,"width",2),d([(0,h.property)({type:Number})],x.prototype,"height",2),d([(0,h.property)()],x.prototype,"label",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"legend",2),d([(0,h.property)({type:Boolean,attribute:"no-tooltip",converter:vt})],x.prototype,"tooltip",2),d([(0,h.property)({attribute:!1})],x.prototype,"format",2),d([(0,h.property)({attribute:!1})],x.prototype,"palette",2),d([(0,h.property)({attribute:!1})],x.prototype,"hiddenSeries",2),d([(0,h.property)({attribute:!1})],x.prototype,"selected",2),d([(0,h.property)({attribute:"selection-mode"})],x.prototype,"selectionMode",2),d([(0,h.property)({attribute:!1})],x.prototype,"highlighted",2),d([(0,h.property)({attribute:!1})],x.prototype,"highlightScope",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"loading",2),d([(0,h.property)()],x.prototype,"error",2),d([(0,h.property)({attribute:"empty-message"})],x.prototype,"emptyMessage",2),d([(0,h.property)()],x.prototype,"description",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"decorative",2),d([(0,h.property)({type:Boolean,attribute:"accessible-table"})],x.prototype,"accessibleTable",2),d([(0,h.property)({attribute:!1})],x.prototype,"zoom",2),d([(0,h.property)({attribute:!1})],x.prototype,"view",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"zoomable",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"editable",2),d([(0,h.property)({attribute:"sync-id"})],x.prototype,"syncId",2),d([(0,h.property)({type:Boolean,attribute:"cross-filter"})],x.prototype,"crossFilter",2),d([(0,h.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],x.prototype,"animated",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"responsive",2),d([(0,h.state)()],x.prototype,"tip",2),d([(0,h.state)()],x.prototype,"overlay",2),d([(0,h.state)()],x.prototype,"portal",2),d([(0,h.state)()],x.prototype,"measured",2),d([(0,h.state)()],x.prototype,"viewState",2),d([(0,h.state)()],x.prototype,"highlightState",2),d([(0,h.state)()],x.prototype,"crossState",2),d([(0,h.state)()],x.prototype,"focused",2),d([(0,h.state)()],x.prototype,"hiddenState",2),d([(0,h.state)()],x.prototype,"zoomState",2),d([(0,h.state)()],x.prototype,"selectedState",2);var w=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:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:p,nulls:m,stacked:S,stackOffset:M,orientation:k,radius:$,barGap:C,barWidth:I,sort:A,transform:N,transforms:_,bins:E,binWidth:Me,binDomain:R,binMode:J,sampling:ce,brush:Ce,crosshair:Ie}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:p,nulls:m,stacked:S,stackOffset:M,orientation:k,radius:$,barGap:C,barWidth:I,sort:A,transform:N,transforms:_,bins:E,binWidth:Me,binDomain:R,binMode:J,sampling:ce,brush:Ce,crosshair:Ie}}};d([(0,h.property)({attribute:!1})],w.prototype,"series",2),d([(0,h.property)({attribute:!1})],w.prototype,"categories",2),d([(0,h.property)({attribute:!1})],w.prototype,"xAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"yAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"rightAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"references",2),d([(0,h.property)({attribute:!1})],w.prototype,"annotations",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"labels",2),d([(0,h.property)()],w.prototype,"curve",2),d([(0,h.property)({type:Boolean,attribute:"connect-nulls"})],w.prototype,"connectNulls",2),d([(0,h.property)()],w.prototype,"nulls",2),d([(0,h.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],w.prototype,"stacked",2),d([(0,h.property)({attribute:"stack-offset"})],w.prototype,"stackOffset",2),d([(0,h.property)()],w.prototype,"orientation",2),d([(0,h.property)({type:Number})],w.prototype,"radius",2),d([(0,h.property)({type:Number,attribute:"bar-gap"})],w.prototype,"barGap",2),d([(0,h.property)({type:Number,attribute:"bar-width"})],w.prototype,"barWidth",2),d([(0,h.property)()],w.prototype,"sort",2),d([(0,h.property)()],w.prototype,"transform",2),d([(0,h.property)({attribute:!1})],w.prototype,"transforms",2),d([(0,h.property)({type:Number})],w.prototype,"bins",2),d([(0,h.property)({type:Number,attribute:"bin-width"})],w.prototype,"binWidth",2),d([(0,h.property)({attribute:!1})],w.prototype,"binDomain",2),d([(0,h.property)({attribute:"bin-mode"})],w.prototype,"binMode",2),d([(0,h.property)({attribute:!1})],w.prototype,"sampling",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"brush",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"crosshair",2);var $n=e=>e.defs&&e.defs.length?f.svg`<defs>${e.defs.map(n=>f.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=>f.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,y.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:f.nothing,Se=e=>f.svg`${e.map((n,t)=>{let r=n.title?f.svg`<title>${n.title}</title>`:f.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return f.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,y.ifDefined)(n.stroke)} stroke-width=${(0,y.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,y.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,y.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,y.ifDefined)(n.dash)} opacity=${(0,y.ifDefined)(n.opacity)} fill-opacity=${(0,y.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return f.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,y.ifDefined)(n.rx)} style=${(0,y.ifDefined)(xe(n.part)?`rx:${xe(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,y.ifDefined)(n.stroke)} fill-opacity=${(0,y.ifDefined)(n.opacity)} pointer-events=${(0,y.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return f.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,y.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,y.ifDefined)(n.dash)} opacity=${(0,y.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return f.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,y.ifDefined)(n.stroke)} opacity=${(0,y.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return f.svg`<text aria-label=${(0,y.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,y.ifDefined)(n.anchor)} dominant-baseline=${(0,y.ifDefined)(n.baseline)} fill=${(0,y.ifDefined)(n.fill)} font-weight=${(0,y.ifDefined)(n.weight)} pointer-events=${(0,y.ifDefined)(i===void 0?"none":void 0)} transform=${(0,y.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var z=class extends x{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,rootId:i,collapsed:o,maxDepth:s,labels:a,nodeSize:l}=this;return this.root(yt({...this.sized(),data:t,orientation:r,rootId:i,collapsed:o,maxDepth:s,labels:a,nodeSize:l}),"organization",this.label??"Organization chart")}};d([(0,D.property)({attribute:!1})],z.prototype,"data",2),d([(0,D.property)()],z.prototype,"orientation",2),d([(0,D.property)({attribute:!1})],z.prototype,"rootId",2),d([(0,D.property)({attribute:!1})],z.prototype,"collapsed",2),d([(0,D.property)({type:Number,attribute:"max-depth"})],z.prototype,"maxDepth",2),d([(0,D.property)({type:Boolean,attribute:"no-labels",converter:vt})],z.prototype,"labels",2),d([(0,D.property)({type:Number,attribute:"node-size"})],z.prototype,"nodeSize",2),z=d([(0,D.customElement)("skdx-organization-chart")],z);0&&(module.exports={SkdxOrganizationChart});
112
+ `,d([(0,h.property)({type:Number})],x.prototype,"width",2),d([(0,h.property)({type:Number})],x.prototype,"height",2),d([(0,h.property)()],x.prototype,"label",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"legend",2),d([(0,h.property)({type:Boolean,attribute:"no-tooltip",converter:vt})],x.prototype,"tooltip",2),d([(0,h.property)({attribute:!1})],x.prototype,"format",2),d([(0,h.property)({attribute:!1})],x.prototype,"palette",2),d([(0,h.property)({attribute:!1})],x.prototype,"hiddenSeries",2),d([(0,h.property)({attribute:!1})],x.prototype,"selected",2),d([(0,h.property)({attribute:"selection-mode"})],x.prototype,"selectionMode",2),d([(0,h.property)({attribute:!1})],x.prototype,"highlighted",2),d([(0,h.property)({attribute:!1})],x.prototype,"highlightScope",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"loading",2),d([(0,h.property)()],x.prototype,"error",2),d([(0,h.property)({attribute:"empty-message"})],x.prototype,"emptyMessage",2),d([(0,h.property)()],x.prototype,"description",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"decorative",2),d([(0,h.property)({type:Boolean,attribute:"accessible-table"})],x.prototype,"accessibleTable",2),d([(0,h.property)({attribute:!1})],x.prototype,"zoom",2),d([(0,h.property)({attribute:!1})],x.prototype,"view",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"zoomable",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"editable",2),d([(0,h.property)({attribute:"sync-id"})],x.prototype,"syncId",2),d([(0,h.property)({type:Boolean,attribute:"cross-filter"})],x.prototype,"crossFilter",2),d([(0,h.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],x.prototype,"animated",2),d([(0,h.property)({type:Boolean,reflect:!0})],x.prototype,"responsive",2),d([(0,h.state)()],x.prototype,"tip",2),d([(0,h.state)()],x.prototype,"overlay",2),d([(0,h.state)()],x.prototype,"portal",2),d([(0,h.state)()],x.prototype,"measured",2),d([(0,h.state)()],x.prototype,"viewState",2),d([(0,h.state)()],x.prototype,"highlightState",2),d([(0,h.state)()],x.prototype,"crossState",2),d([(0,h.state)()],x.prototype,"focused",2),d([(0,h.state)()],x.prototype,"hiddenState",2),d([(0,h.state)()],x.prototype,"zoomState",2),d([(0,h.state)()],x.prototype,"selectedState",2);var w=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:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:p,nulls:m,stacked:S,stackOffset:T,orientation:k,radius:$,barGap:M,barWidth:I,sort:A,transform:N,transforms:_,bins:E,binWidth:Me,binDomain:R,binMode:J,sampling:ce,brush:Ce,crosshair:Ie}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:p,nulls:m,stacked:S,stackOffset:T,orientation:k,radius:$,barGap:M,barWidth:I,sort:A,transform:N,transforms:_,bins:E,binWidth:Me,binDomain:R,binMode:J,sampling:ce,brush:Ce,crosshair:Ie,...this.compactOverrides()}}};d([(0,h.property)({attribute:!1})],w.prototype,"series",2),d([(0,h.property)({attribute:!1})],w.prototype,"categories",2),d([(0,h.property)({attribute:!1})],w.prototype,"xAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"yAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"rightAxis",2),d([(0,h.property)({attribute:!1})],w.prototype,"references",2),d([(0,h.property)({attribute:!1})],w.prototype,"annotations",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"labels",2),d([(0,h.property)()],w.prototype,"curve",2),d([(0,h.property)({type:Boolean,attribute:"connect-nulls"})],w.prototype,"connectNulls",2),d([(0,h.property)()],w.prototype,"nulls",2),d([(0,h.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],w.prototype,"stacked",2),d([(0,h.property)({attribute:"stack-offset"})],w.prototype,"stackOffset",2),d([(0,h.property)()],w.prototype,"orientation",2),d([(0,h.property)({type:Number})],w.prototype,"radius",2),d([(0,h.property)({type:Number,attribute:"bar-gap"})],w.prototype,"barGap",2),d([(0,h.property)({type:Number,attribute:"bar-width"})],w.prototype,"barWidth",2),d([(0,h.property)()],w.prototype,"sort",2),d([(0,h.property)()],w.prototype,"transform",2),d([(0,h.property)({attribute:!1})],w.prototype,"transforms",2),d([(0,h.property)({type:Number})],w.prototype,"bins",2),d([(0,h.property)({type:Number,attribute:"bin-width"})],w.prototype,"binWidth",2),d([(0,h.property)({attribute:!1})],w.prototype,"binDomain",2),d([(0,h.property)({attribute:"bin-mode"})],w.prototype,"binMode",2),d([(0,h.property)({attribute:!1})],w.prototype,"sampling",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"brush",2),d([(0,h.property)({type:Boolean,reflect:!0})],w.prototype,"crosshair",2);var $n=e=>e.defs&&e.defs.length?f.svg`<defs>${e.defs.map(n=>f.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=>f.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,y.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:f.nothing,Se=e=>f.svg`${e.map((n,t)=>{let r=n.title?f.svg`<title>${n.title}</title>`:f.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return f.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,y.ifDefined)(n.stroke)} stroke-width=${(0,y.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,y.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,y.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,y.ifDefined)(n.dash)} opacity=${(0,y.ifDefined)(n.opacity)} fill-opacity=${(0,y.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return f.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,y.ifDefined)(n.rx)} style=${(0,y.ifDefined)(xe(n.part)?`rx:${xe(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,y.ifDefined)(n.stroke)} fill-opacity=${(0,y.ifDefined)(n.opacity)} pointer-events=${(0,y.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return f.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,y.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,y.ifDefined)(n.dash)} opacity=${(0,y.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return f.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,y.ifDefined)(n.stroke)} opacity=${(0,y.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return f.svg`<text aria-label=${(0,y.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,y.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,y.ifDefined)(n.anchor)} dominant-baseline=${(0,y.ifDefined)(n.baseline)} fill=${(0,y.ifDefined)(n.fill)} font-weight=${(0,y.ifDefined)(n.weight)} pointer-events=${(0,y.ifDefined)(i===void 0?"none":void 0)} transform=${(0,y.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var z=class extends x{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,orientation:r,rootId:i,collapsed:o,maxDepth:s,labels:a,nodeSize:l}=this;return this.root(yt({...this.sized(),data:t,orientation:r,rootId:i,collapsed:o,maxDepth:s,labels:a,nodeSize:l,...this.compactOverrides()}),"organization",this.label??"Organization chart")}};d([(0,F.property)({attribute:!1})],z.prototype,"data",2),d([(0,F.property)()],z.prototype,"orientation",2),d([(0,F.property)({attribute:!1})],z.prototype,"rootId",2),d([(0,F.property)({attribute:!1})],z.prototype,"collapsed",2),d([(0,F.property)({type:Number,attribute:"max-depth"})],z.prototype,"maxDepth",2),d([(0,F.property)({type:Boolean,attribute:"no-labels",converter:vt})],z.prototype,"labels",2),d([(0,F.property)({type:Number,attribute:"node-size"})],z.prototype,"nodeSize",2),z=d([(0,F.customElement)("skdx-organization-chart")],z);0&&(module.exports={SkdxOrganizationChart});
@@ -1,2 +1,3 @@
1
1
  import 'lit';
2
- export { ay as SkdxOrganizationChart } from './index-D44-61v7.cjs';
2
+ import './types-DPf3PUs2.cjs';
3
+ export { x as SkdxOrganizationChart } from './index-Hexgp_4S.cjs';
@@ -1,2 +1,3 @@
1
1
  import 'lit';
2
- export { ay as SkdxOrganizationChart } from './index-D44-61v7.js';
2
+ import './types-DPf3PUs2.js';
3
+ export { x as SkdxOrganizationChart } from './index-pqdWxinA.js';