@skdx/web-components-charts 0.45.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-H-_fLjtt.d.cts → index-Hexgp_4S.d.cts} +4 -1069
  70. package/dist/{index-H-_fLjtt.d.ts → index-pqdWxinA.d.ts} +4 -1069
  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
@@ -1,36 +1,36 @@
1
- var nn=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var d=(e,n,t,r)=>{for(var i=r>1?void 0:r?rn(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&&nn(n,t,i),i};import{customElement as Sn,property as X}from"lit/decorators.js";var Ct=e=>Number(e.toPrecision(12)),on,sn=e=>(on??(on=new Intl.NumberFormat)).format(Ct(e)),an=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 It(e){if(e===void 0)return sn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?h=>u(h)+i:u,a=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let h=new Intl.NumberFormat(t,u);return s(f=>h.format(Ct(f)))},c=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return f=>h.format(f)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(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(an)}}var m=e=>Number(e.toFixed(2)),Pe=e=>typeof e=="number"&&Number.isFinite(e);var oe=1e3,se=60*oe,ae=60*se,fe=24*ae,In=[oe,5*oe,15*oe,30*oe,se,5*se,15*se,30*se,ae,3*ae,6*ae,12*ae,fe,2*fe,7*fe,14*fe];var ln=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,cn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,dn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function un(e,n,t){return e.replace(cn,(r,i,o)=>{let s=dn[i];if(s===void 0)return i+o;let l=(o.match(ln)??[]).map((c,u)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let f=u%s;return s===7?f===5?String(h+n):f===6?String(h+t):c:String(f%2===0?h+n:h+t)});return i+l.join(" ")})}var Tt=(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:un(r.d,n,t)}}});var Ne=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),y={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"};var Ot=(e,n)=>n??Ne[e%Ne.length];var hn={top:16,right:16,bottom:32,left:48};function zt(e,n,t=hn){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 le(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function At(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,pn=120,Lt=e=>{let n=le(e);return n&&(n.position==="left"||n.position==="right")?n.width??pn:0},be=(e,n=600,t=300)=>({width:(e.width??n)-Lt(e),height:(e.height??t)-(le(e)?.position==="bottom"?me:0)}),Be=(e,n,t)=>{let r=le(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Rt(n,t??be(e).width,r)):1)*me},P=6.5;function Pt(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 Nt=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Ot(n));function Re(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,h=r.interactive??!0,f=o,$=i,S=(w,k,M,I)=>{let A=(k?18:4)+w.length*P;f>o&&(s||f+A>n-8)&&(f=o,$+=me),k&&a.push({kind:"rect",part:"legend-swatch",x:f,y:$-5,width:10,height:10,fill:k,opacity:I?.3:void 0,item:M}),a.push({kind:"text",part:"legend-label",x:f+(k?14:0),y:$,text:w,baseline:"middle",fill:I?y.grid:y.label,item:M}),f+=A+12};for(let w of c){let k=t.includes(w.name),M=h?{label:w.name,series:w.name,legend:!0}:void 0;S(r.formatter?.(w.name)??w.name,w.color,M,k)}return u>0&&S(`+${u} more`,void 0,void 0,!1),r.align==="end"?fn(a,n):a}function fn(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 Rt=(e,n,t={})=>new Set(Re(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function De(e,n,t,r=[]){let i=le(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=At(e),a=o?.position==="bottom",l=Lt(e),c=e.hiddenSeries??[],u=o?l?Re(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Re(r,n,c,o,a?t+10:10):[],h=a?Rt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*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:u}}function Fe(e){let n=e.legendOffset;if(!n)return e;let t=[...Tt(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 xe(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(k=>{let M=[],I=Array.from(k);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]=Pt(`${u[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...u.map(k=>Array.from(k).length))*P+12),f=Math.min(i,6+u.length*16),$=o==="top"?{x:e-h/2,y:n-f-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-f/2}:o==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},S=Math.max(0,Math.min(r-h,$.x)),w=Math.max(0,Math.min(i-f,$.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
- `),x:m(S),y:m(w),width:m(h),height:f,fill:"var(--skdx-color-surface-raised)",stroke:y.axis,rx:8},...u.map((k,M)=>({kind:"text",part:"tooltip-label",x:m(S+6),y:m(w+11+M*16),text:k,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:u.length>1&&M===0?"bold":void 0}))]}function Bt(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}=be(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:m(o/2),y:m(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":y.label}),{...De(e,o,s),shapes:l,tooltip:!1}}var q=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:y.label,...r});function Dt(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 ge(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ge=e=>e.id??e.name??e.series,Ft=e=>e.seriesId??e.series;function V(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ge(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ft(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 W(e){let n={},t=Ge(e);t!==void 0&&(n.id=t);let r=Ft(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var je=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function He(e,n,t){let r=ge(e),i=W(n),o=r.some(s=>V(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!V(n,s)):[...r,i]}var mn=.2;function bn(e){let n=y.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var xn=(e,n)=>e.kind==="text"?{...e,fill:y.grid}:{...e,opacity:(e.opacity??1)*n};function Ve(e,n){let t=ge(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:ge(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(h=>V(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&V(u,{series:h.series})):!1,l=u=>{if(!i||o.faded==="none"||a(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&V(u,{series:h})}return!0},c=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(f=>V(h,f))){let f=bn(u);f&&s.push(f)}return l(h)?xn(u,mn):u});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Gt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function ye(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Gt:void 0}function te(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 _e=(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 ce(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 Ee(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:y.axis,dash:"3 3"}}function Ze(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!_e(r.plot,n,t))return[];let i=Ee(e,n),{rows:o}=ce(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...xe(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function We(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 Ze(e,i,t.plot.y+8)}function Ue(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=te(t,r,i,e.width,e.height);if(_e(e.hit.plot,l,c)){let u=ce(e,l),h=Ee(e,l);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?U(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 Ht(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?U(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(S=>S.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=s?.tooltipAnchored?U(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:f,y:$}=h?de(h):te(n,t,r,i,o);return xe(f,$,c,i,o,s?.tooltipPlacement)}function Ke(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=te(t,r,i,e.width,e.height),a=Ze(e,o,s);if(a.length>0)return a}return Ht(n,t,r,i,e.width,e.height,e)}function Ye(e,n){let t=U(e,n);return t&&!t.item.legend?W(t.item):null}var gn=(e,n)=>{let{x:t,y:r}=de(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 qe(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!gn(i,n))continue;let o=W(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Xe=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:y.focus,opacity:.12,stroke:y.focus}),we=(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 Vt(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}=de(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Vt(n,o,a))continue;let l=W(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Je=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:y.focus,fillOpacity:.12,stroke:y.focus,dash:"4 3"}),ve=6;function et(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-ve||n>i.x1+ve))return Math.abs(n-i.x0)<=ve?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ve?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function tt(e,n,t){let r=e.edit;return _t(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function nt(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 _t(r,{bar:o,mode:s},i*a)}function _t(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 rt(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:m(Math.min(i,o)),y:m(n.bar.y),width:m(Math.max(1,Math.abs(o-i))),height:m(n.bar.height),fill:y.focus,opacity:.25,stroke:y.focus,rx:2}}var yn=64,vn=e=>Math.max(1,Math.min(yn,e));function it(e,n,t,r){let i=n>0?.8:1.25,o=vn(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,h=(r-(s.y+s.height/2))/a,f=e.view.zoom/o;return{center:[l+u*(1-f),e.fromY(e.toY(c)-h*(1-f))],zoom:o}}function ot(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 U(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 ke=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function de(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 st(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=y.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}=de(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?xe(m(o),m(s),a,e.width,e.height):[]]}function at(e,n,t){let r=ke(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 J=2,ee=(e,n,t)=>{let r=Math.max(J,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Et=(e,n)=>!e||e.start<=0&&e.end>=n;function lt(e,n,t){if(e.count<=J||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(J,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!Et(e.zoom,e.count)?ee(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 ee(c-l*a,a,e.count)}function ct(e,n,t,r){let i=n.end-n.start,o=Math.max(J,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 ee(n.start+s*i-s*o,o,e.count)}function dt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return ee(n.start-t/i,r,e.count)}function ut(e,n,t){let r=e.brush;if(!r||!_e(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:ee(s-o/2,o,e.count)}}function ht(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 ee(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-J,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+J,Math.round(t.end+o)));return{start:t.start,end:s}}function ft(e,n){switch(n.type){case"svg":return Promise.resolve(pt(e,n.label,n.resolve));case"csv":return Promise.resolve(Kt(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=pt(e,n.label,n.resolve);return Ut(t,e.width,e.height,n.scale,n.background)}}}var _=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),ue=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${_(String(t))}"`).join("");function Zt(e){let n=e.title?`<title>${_(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${ue([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${ue([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${ue([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${ue([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${ue([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 Wt(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 pt(e,n,t){let r=Wt(e)+e.shapes.map(Zt).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="${_(y.fontFamily)}" font-size="${_(y.fontSize)}"><title>${_(n)}</title>${r}</svg>`}function Ut(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(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Kt(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 $e=e=>Pe(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+$e(t),0),mt=e=>Pe(e.value)||(e.children??[]).some(mt);var Se=e=>e.id??e.name;function Yt(e,n){for(let t of e){if(Se(t)===n||t.name===n)return[t];let r=Yt(t.children??[],n);if(r)return[t,...r]}}function bt(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:$e(r),children:void 0}:{...r,children:r.children?bt(r.children,n,t+1):void 0})}function qt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Yt(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 xt(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(h=>h.slice(h.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 gt=new Map;function Me(e){let n=gt.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&&gt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return gt.set(e,{group:i,listeners:t}),i}var Xt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',yt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Xt}{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){${Xt}{animation:none;transition:none}}`;function vt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Qt(e){let{nodes:n,path:t}=qt(e.data,e.rootId),r=bt(n,e.maxDepth),i=Bt(e,r.length===0);if(i)return i;let o=It(e.format),{width:s,height:a}=be(e),l=e.orientation!=="horizontal",c=e.nodeShape==="box",u=e.linkStyle??"curve",h=new Set(e.collapsed??[]),f=e.labels??!0,$=[],S=0,w=0,k=(x,T,O,pe)=>{let Q=h.has(Se(x))||h.has(x.name),ie=Q?[]:x.children??[],G=x.color??O?.color??Nt(e,pe),F={node:x,depth:T,slot:0,parent:O,collapsed:Q,color:G};if(w=Math.max(w,T),ie.length===0)F.slot=S++;else{let L=ie.map((j,H)=>k(j,T+1,F,H));F.slot=(L[0].slot+L[L.length-1].slot)/2}return $.push(F),F};r.forEach((x,T)=>k(x,0,void 0,T));let M=x=>Math.max(x.name.length,x.subtitle?.length??0),I=Math.max(0,...$.map(x=>M(x.node)))*P+16,A=e.nodeSize??36,B=e.nodeSize??5,E=c?I:2*B,Z=c?A:2*B,Ie=!c&&f?I:0,D=zt(s,a,{top:Be(e)+Z/2+4,bottom:Z/2+4+(l&&!c?16:0),left:E/2+4,right:E/2+4+(l?0:Ie)}),ne=Math.max(1,S),he=l?D.width:D.height,Te=l?D.height:D.width,Oe=ne===1?0:he/(ne-1),Jt=w===0?0:Te/w,$t=x=>{let T=ne===1?he/2:x.slot*Oe,O=x.depth*Jt;return l?{x:m(D.x+T),y:m(D.y+O)}:{x:m(D.x+O),y:m(D.y+T)}},St=[],ze=[],re=[];for(let x of $){let{x:T,y:O}=$t(x);if(x.parent){let G=$t(x.parent),F=c?l?Z/2:E/2:B,L=l?G.x:m(G.x+F),j=l?m(G.y+F):G.y,H=l?T:m(T-F),Y=l?m(O-F):O,Ae=m((L+H)/2),Le=m((j+Y)/2),tn=u==="straight"?`M${L} ${j}L${H} ${Y}`:u==="elbow"?l?`M${L} ${j}V${Le}H${H}V${Y}`:`M${L} ${j}H${Ae}V${Y}H${H}`:l?`M${L} ${j}C${L} ${Le} ${H} ${Le} ${H} ${Y}`:`M${L} ${j}C${Ae} ${j} ${Ae} ${Y} ${H} ${Y}`;St.push({kind:"path",part:"link",d:tn,stroke:y.axis,strokeWidth:1.5,title:`${x.parent.node.name} \u2192 ${x.node.name}`})}let pe=$e(x.node),Q=`${x.node.name}${x.node.subtitle?` \xB7 ${x.node.subtitle}`:""}${mt(x.node)?`: ${o(pe)}`:""}${x.collapsed?" (collapsed)":""}`,ie={label:Q,id:Se(x.node),name:x.node.name,value:pe};if(c){if(ze.push({kind:"rect",part:"node",x:m(T-E/2),y:m(O-Z/2),width:m(E),height:m(Z),fill:x.color,rx:4,title:Q,item:ie}),f){let G=!!x.node.subtitle;re.push(q(T,m(G?O-7:O),x.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),G&&re.push(q(T,m(O+8),x.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else ze.push({kind:"circle",part:"node",cx:T,cy:O,r:m(B),fill:x.color,stroke:"var(--skdx-color-surface-default)",title:Q,item:ie}),f&&re.push(l?q(T,m(O+B+12),x.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):q(m(T+B+4),O,x.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));x.collapsed&&re.push(q(m(c?T+E/2-8:T+B+(l?6:-2)),m(c?O-Z/2+8:O-B-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:y.label,weight:"bold"}))}let en=t.length?[q(8,Be(e)+10,t.map(x=>x.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],Mt=De(e,s,a);return{...Mt,shapes:Dt([...St,...ze,...re,...en,...Mt.shapes])}}var wt=e=>Qt({...e,nodeShape:"box",linkStyle:"elbow"});import{css as wn,html as K,LitElement as kn,nothing as C,svg as z}from"lit";import{property as p,state as N}from"lit/decorators.js";import{ifDefined as g}from"lit/directives/if-defined.js";var kt={fromAttribute:()=>!1},b=class extends kn{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=[Xe(we(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=[Je(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=tt(r,i.gantt,o-i.x),this.overlay=[rt(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(ot(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(ct(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"?dt(r.hit,i.zoom,o-i.x):ht(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Ue(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=Ke(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ye(r,t.target)),this.syncId&&r.hit?.crosshair){let o=ce(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=U(r,t.target)?.item.legend,a=this.canEdit(r)?et(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=ut(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(qe(o,we(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(it(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=lt(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=U(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)?nt(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=at(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?W(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:h,decorative:f,animated:$,responsive:S,highlighted:w,highlightScope:k,accessibleTable:M}=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:$,responsive:S,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:h,decorative:f,highlighted:w===void 0?this.highlightState:w,highlightScope:k,accessibleTable:M,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&&Me(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=Me(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&&je(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(He(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 te(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?ft(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ve(Fe(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let k of o.issues??[])this.emit("skdx-data-issue",k)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),u=s||a||l||c,h=!o.decorative&&ke(o).length>0,f=vt(o),$=xt(o,this.accessibleTable),S=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,w=this.portal;return K`<svg
1
+ var nn=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var d=(e,n,t,r)=>{for(var i=r>1?void 0:r?rn(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&&nn(n,t,i),i};import{customElement as Sn,property as X}from"lit/decorators.js";var Ct=e=>Number(e.toPrecision(12)),on,sn=e=>(on??(on=new Intl.NumberFormat)).format(Ct(e)),an=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 It(e){if(e===void 0)return sn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?h=>u(h)+i:u,a=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let h=new Intl.NumberFormat(t,u);return s(f=>h.format(Ct(f)))},c=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return f=>h.format(f)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(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(an)}}var m=e=>Number(e.toFixed(2)),Pe=e=>typeof e=="number"&&Number.isFinite(e);var oe=1e3,se=60*oe,ae=60*se,fe=24*ae,In=[oe,5*oe,15*oe,30*oe,se,5*se,15*se,30*se,ae,3*ae,6*ae,12*ae,fe,2*fe,7*fe,14*fe];var ln=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,cn=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,dn={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function un(e,n,t){return e.replace(cn,(r,i,o)=>{let s=dn[i];if(s===void 0)return i+o;let l=(o.match(ln)??[]).map((c,u)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let f=u%s;return s===7?f===5?String(h+n):f===6?String(h+t):c:String(f%2===0?h+n:h+t)});return i+l.join(" ")})}var Tt=(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:un(r.d,n,t)}}});var Ne=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),y={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"};var Ot=(e,n)=>n??Ne[e%Ne.length];var hn={top:16,right:16,bottom:32,left:48};function zt(e,n,t=hn){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 le(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function At(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,pn=120,Lt=e=>{let n=le(e);return n&&(n.position==="left"||n.position==="right")?n.width??pn:0},be=(e,n=600,t=300)=>({width:(e.width??n)-Lt(e),height:(e.height??t)-(le(e)?.position==="bottom"?me:0)}),Be=(e,n,t)=>{let r=le(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,Rt(n,t??be(e).width,r)):1)*me},P=6.5;function Pt(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 Nt=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:Ot(n));function Re(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,h=r.interactive??!0,f=o,$=i,T=(w,k,S,I)=>{let A=(k?18:4)+w.length*P;f>o&&(s||f+A>n-8)&&(f=o,$+=me),k&&a.push({kind:"rect",part:"legend-swatch",x:f,y:$-5,width:10,height:10,fill:k,opacity:I?.3:void 0,item:S}),a.push({kind:"text",part:"legend-label",x:f+(k?14:0),y:$,text:w,baseline:"middle",fill:I?y.grid:y.label,item:S}),f+=A+12};for(let w of c){let k=t.includes(w.name),S=h?{label:w.name,series:w.name,legend:!0}:void 0;T(r.formatter?.(w.name)??w.name,w.color,S,k)}return u>0&&T(`+${u} more`,void 0,void 0,!1),r.align==="end"?fn(a,n):a}function fn(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 Rt=(e,n,t={})=>new Set(Re(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function De(e,n,t,r=[]){let i=le(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=At(e),a=o?.position==="bottom",l=Lt(e),c=e.hiddenSeries??[],u=o?l?Re(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Re(r,n,c,o,a?t+10:10):[],h=a?Rt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*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:u}}function Fe(e){let n=e.legendOffset;if(!n)return e;let t=[...Tt(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 xe(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(k=>{let S=[],I=Array.from(k);for(;I.length>a;){let A=I.slice(0,a+1).lastIndexOf(" ");A<1&&(A=a),S.push(I.slice(0,A).join("")),I=I.slice(A),I[0]===" "&&I.shift()}return S.push(I.join("")),S}),c=Math.max(1,Math.floor((i-6)/16)),u=l.slice(0,c);l.length>c&&(u[c-1]=Pt(`${u[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...u.map(k=>Array.from(k).length))*P+12),f=Math.min(i,6+u.length*16),$=o==="top"?{x:e-h/2,y:n-f-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-f/2}:o==="right"?{x:e+8,y:n-f/2}:{x:e+12,y:n-f-6},T=Math.max(0,Math.min(r-h,$.x)),w=Math.max(0,Math.min(i-f,$.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
+ `),x:m(T),y:m(w),width:m(h),height:f,fill:"var(--skdx-color-surface-raised)",stroke:y.axis,rx:8},...u.map((k,S)=>({kind:"text",part:"tooltip-label",x:m(T+6),y:m(w+11+S*16),text:k,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:u.length>1&&S===0?"bold":void 0}))]}function Bt(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}=be(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:m(o/2),y:m(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":y.label}),{...De(e,o,s),shapes:l,tooltip:!1}}var q=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:y.label,...r});function Dt(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 ge(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ge=e=>e.id??e.name??e.series,Ft=e=>e.seriesId??e.series;function _(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ge(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ft(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 W(e){let n={},t=Ge(e);t!==void 0&&(n.id=t);let r=Ft(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var je=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function He(e,n,t){let r=ge(e),i=W(n),o=r.some(s=>_(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!_(n,s)):[...r,i]}var mn=.2;function bn(e){let n=y.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var xn=(e,n)=>e.kind==="text"?{...e,fill:y.grid}:{...e,opacity:(e.opacity??1)*n};function Ve(e,n){let t=ge(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:ge(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(h=>_(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&_(u,{series:h.series})):!1,l=u=>{if(!i||o.faded==="none"||a(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&_(u,{series:h})}return!0},c=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(f=>_(h,f))){let f=bn(u);f&&s.push(f)}return l(h)?xn(u,mn):u});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var Gt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function ye(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?Gt:void 0}function te(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 _e=(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 ce(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 Ee(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:y.axis,dash:"3 3"}}function Ze(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!_e(r.plot,n,t))return[];let i=Ee(e,n),{rows:o}=ce(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...xe(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function We(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 Ze(e,i,t.plot.y+8)}function Ue(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=te(t,r,i,e.width,e.height);if(_e(e.hit.plot,l,c)){let u=ce(e,l),h=Ee(e,l);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?U(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 Ht(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?U(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?U(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:f,y:$}=h?de(h):te(n,t,r,i,o);return xe(f,$,c,i,o,s?.tooltipPlacement)}function Ke(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=te(t,r,i,e.width,e.height),a=Ze(e,o,s);if(a.length>0)return a}return Ht(n,t,r,i,e.width,e.height,e)}function Ye(e,n){let t=U(e,n);return t&&!t.item.legend?W(t.item):null}var gn=(e,n)=>{let{x:t,y:r}=de(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 qe(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!gn(i,n))continue;let o=W(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Xe=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:y.focus,opacity:.12,stroke:y.focus}),we=(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 Vt(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}=de(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Vt(n,o,a))continue;let l=W(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Je=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:y.focus,fillOpacity:.12,stroke:y.focus,dash:"4 3"}),ve=6;function et(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-ve||n>i.x1+ve))return Math.abs(n-i.x0)<=ve?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ve?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function tt(e,n,t){let r=e.edit;return _t(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function nt(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 _t(r,{bar:o,mode:s},i*a)}function _t(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 rt(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:m(Math.min(i,o)),y:m(n.bar.y),width:m(Math.max(1,Math.abs(o-i))),height:m(n.bar.height),fill:y.focus,opacity:.25,stroke:y.focus,rx:2}}var yn=64,vn=e=>Math.max(1,Math.min(yn,e));function it(e,n,t,r){let i=n>0?.8:1.25,o=vn(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,h=(r-(s.y+s.height/2))/a,f=e.view.zoom/o;return{center:[l+u*(1-f),e.fromY(e.toY(c)-h*(1-f))],zoom:o}}function ot(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 U(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 ke=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function de(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 st(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=y.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}=de(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?xe(m(o),m(s),a,e.width,e.height):[]]}function at(e,n,t){let r=ke(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 J=2,ee=(e,n,t)=>{let r=Math.max(J,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Et=(e,n)=>!e||e.start<=0&&e.end>=n;function lt(e,n,t){if(e.count<=J||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(J,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!Et(e.zoom,e.count)?ee(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 ee(c-l*a,a,e.count)}function ct(e,n,t,r){let i=n.end-n.start,o=Math.max(J,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 ee(n.start+s*i-s*o,o,e.count)}function dt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return ee(n.start-t/i,r,e.count)}function ut(e,n,t){let r=e.brush;if(!r||!_e(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:ee(s-o/2,o,e.count)}}function ht(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 ee(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-J,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+J,Math.round(t.end+o)));return{start:t.start,end:s}}function ft(e,n){switch(n.type){case"svg":return Promise.resolve(pt(e,n.label,n.resolve));case"csv":return Promise.resolve(Kt(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=pt(e,n.label,n.resolve);return Ut(t,e.width,e.height,n.scale,n.background)}}}var G=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),ue=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${G(String(t))}"`).join("");function Zt(e){let n=e.title?`<title>${G(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${ue([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${ue([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${ue([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${ue([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${ue([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]])}>${G(e.text)}</text>`}}function Wt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${G(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="${G(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function pt(e,n,t){let r=Wt(e)+e.shapes.map(Zt).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="${G(n)}"`,o=e.description?`<desc>${G(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="${G(y.fontFamily)}" font-size="${G(y.fontSize)}"><title>${G(n)}</title>${o}${r}</svg>`}function Ut(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(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Kt(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 $e=e=>Pe(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+$e(t),0),mt=e=>Pe(e.value)||(e.children??[]).some(mt);var Se=e=>e.id??e.name;function Yt(e,n){for(let t of e){if(Se(t)===n||t.name===n)return[t];let r=Yt(t.children??[],n);if(r)return[t,...r]}}function bt(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:$e(r),children:void 0}:{...r,children:r.children?bt(r.children,n,t+1):void 0})}function qt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Yt(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 xt(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(h=>h.slice(h.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 gt=new Map;function Me(e){let n=gt.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&&gt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return gt.set(e,{group:i,listeners:t}),i}var Xt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',yt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Xt}{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){${Xt}{animation:none;transition:none}}`;function vt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Qt(e){let{nodes:n,path:t}=qt(e.data,e.rootId),r=bt(n,e.maxDepth),i=Bt(e,r.length===0);if(i)return i;let o=It(e.format),{width:s,height:a}=be(e),l=e.orientation!=="horizontal",c=e.nodeShape==="box",u=e.linkStyle??"curve",h=new Set(e.collapsed??[]),f=e.labels??!0,$=[],T=0,w=0,k=(x,C,O,pe)=>{let Q=h.has(Se(x))||h.has(x.name),ie=Q?[]:x.children??[],j=x.color??O?.color??Nt(e,pe),F={node:x,depth:C,slot:0,parent:O,collapsed:Q,color:j};if(w=Math.max(w,C),ie.length===0)F.slot=T++;else{let L=ie.map((H,V)=>k(H,C+1,F,V));F.slot=(L[0].slot+L[L.length-1].slot)/2}return $.push(F),F};r.forEach((x,C)=>k(x,0,void 0,C));let S=x=>Math.max(x.name.length,x.subtitle?.length??0),I=Math.max(0,...$.map(x=>S(x.node)))*P+16,A=e.nodeSize??36,B=e.nodeSize??5,E=c?I:2*B,Z=c?A:2*B,Ie=!c&&f?I:0,D=zt(s,a,{top:Be(e)+Z/2+4,bottom:Z/2+4+(l&&!c?16:0),left:E/2+4,right:E/2+4+(l?0:Ie)}),ne=Math.max(1,T),he=l?D.width:D.height,Te=l?D.height:D.width,Oe=ne===1?0:he/(ne-1),Jt=w===0?0:Te/w,$t=x=>{let C=ne===1?he/2:x.slot*Oe,O=x.depth*Jt;return l?{x:m(D.x+C),y:m(D.y+O)}:{x:m(D.x+O),y:m(D.y+C)}},St=[],ze=[],re=[];for(let x of $){let{x:C,y:O}=$t(x);if(x.parent){let j=$t(x.parent),F=c?l?Z/2:E/2:B,L=l?j.x:m(j.x+F),H=l?m(j.y+F):j.y,V=l?C:m(C-F),Y=l?m(O-F):O,Ae=m((L+V)/2),Le=m((H+Y)/2),tn=u==="straight"?`M${L} ${H}L${V} ${Y}`:u==="elbow"?l?`M${L} ${H}V${Le}H${V}V${Y}`:`M${L} ${H}H${Ae}V${Y}H${V}`:l?`M${L} ${H}C${L} ${Le} ${V} ${Le} ${V} ${Y}`:`M${L} ${H}C${Ae} ${H} ${Ae} ${Y} ${V} ${Y}`;St.push({kind:"path",part:"link",d:tn,stroke:y.axis,strokeWidth:1.5,title:`${x.parent.node.name} \u2192 ${x.node.name}`})}let pe=$e(x.node),Q=`${x.node.name}${x.node.subtitle?` \xB7 ${x.node.subtitle}`:""}${mt(x.node)?`: ${o(pe)}`:""}${x.collapsed?" (collapsed)":""}`,ie={label:Q,id:Se(x.node),name:x.node.name,value:pe};if(c){if(ze.push({kind:"rect",part:"node",x:m(C-E/2),y:m(O-Z/2),width:m(E),height:m(Z),fill:x.color,rx:4,title:Q,item:ie}),f){let j=!!x.node.subtitle;re.push(q(C,m(j?O-7:O),x.node.name,{part:"node-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)",weight:"bold"})),j&&re.push(q(C,m(O+8),x.node.subtitle,{part:"node-subtitle",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"}))}}else ze.push({kind:"circle",part:"node",cx:C,cy:O,r:m(B),fill:x.color,stroke:"var(--skdx-color-surface-default)",title:Q,item:ie}),f&&re.push(l?q(C,m(O+B+12),x.node.name,{part:"node-label",anchor:"middle",fill:"var(--skdx-color-text-default)"}):q(m(C+B+4),O,x.node.name,{part:"node-label",baseline:"middle",fill:"var(--skdx-color-text-default)"}));x.collapsed&&re.push(q(m(c?C+E/2-8:C+B+(l?6:-2)),m(c?O-Z/2+8:O-B-2),"+",{part:"collapsed",anchor:"middle",baseline:"middle",fill:y.label,weight:"bold"}))}let en=t.length?[q(8,Be(e)+10,t.map(x=>x.name).join(" \u203A "),{part:"breadcrumb",baseline:"middle"})]:[],Mt=De(e,s,a);return{...Mt,shapes:Dt([...St,...ze,...re,...en,...Mt.shapes])}}var wt=e=>Qt({...e,nodeShape:"box",linkStyle:"elbow"});import{css as wn,html as K,LitElement as kn,nothing as M,svg as z}from"lit";import{property as p,state as N}from"lit/decorators.js";import{ifDefined as g}from"lit/directives/if-defined.js";var kt={fromAttribute:()=>!1},b=class extends kn{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=[Xe(we(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=[Je(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=tt(r,i.gantt,o-i.x),this.overlay=[rt(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(ot(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(ct(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"?dt(r.hit,i.zoom,o-i.x):ht(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Ue(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=Ke(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ye(r,t.target)),this.syncId&&r.hit?.crosshair){let o=ce(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=U(r,t.target)?.item.legend,a=this.canEdit(r)?et(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=ut(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(qe(o,we(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(it(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=lt(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=U(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)?nt(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=at(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?W(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:h,decorative:f,animated:$,responsive:T,highlighted:w,highlightScope:k,accessibleTable:S}=this;return{width:T&&this.measured?this.measured:t,height:r,animate:$,responsive:T,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:h,decorative:f,highlighted:w===void 0?this.highlightState:w,highlightScope:k,accessibleTable:S,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&&Me(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=Me(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&&je(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(He(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 te(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?ft(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ve(Fe(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let k of o.issues??[])this.emit("skdx-data-issue",k)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),u=s||a||l||c,h=!o.decorative&&ke(o).length>0,f=vt(o),$=xt(o,this.accessibleTable),T=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,w=this.portal;return K`<svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
5
  viewBox="0 0 ${o.width} ${o.height}"
6
6
  width=${o.width}
7
7
  height=${o.height}
8
8
  role=${o.decorative?"presentation":"img"}
9
- aria-hidden=${o.decorative?"true":C}
10
- aria-label=${o.decorative?C:i}
9
+ aria-hidden=${o.decorative?"true":M}
10
+ aria-label=${o.decorative?M:i}
11
11
  aria-description=${g(o.description)}
12
- tabindex=${h?0:C}
12
+ tabindex=${h?0:M}
13
13
  data-skdx-chart=${r}
14
- data-zoomable=${s||a?"":C}
15
- data-brushing=${c&&!(s||a)?"":C}
16
- data-editable=${l?"":C}
17
- style=${f?`--skdx-chart-duration:${f}`:C}
14
+ data-zoomable=${s||a?"":M}
15
+ data-brushing=${c&&!(s||a)?"":M}
16
+ data-editable=${l?"":M}
17
+ style=${f?`--skdx-chart-duration:${f}`:M}
18
18
  font-family=${y.fontFamily}
19
19
  font-size=${y.fontSize}
20
- @pointermove=${o.tooltip||u?this.onPointerMove:C}
20
+ @pointermove=${o.tooltip||u?this.onPointerMove:M}
21
21
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
22
- @pointerdown=${u?this.onPointerDown:C}
23
- @pointerup=${u?this.onPointerUp:C}
24
- @pointercancel=${u?this.onPointerUp:C}
25
- @wheel=${s||a?this.onWheel:C}
26
- @dblclick=${s||a?()=>a?this.setView(void 0):this.setZoom(void 0):C}
22
+ @pointerdown=${u?this.onPointerDown:M}
23
+ @pointerup=${u?this.onPointerUp:M}
24
+ @pointercancel=${u?this.onPointerUp:M}
25
+ @wheel=${s||a?this.onWheel:M}
26
+ @dblclick=${s||a?()=>a?this.setView(void 0):this.setZoom(void 0):M}
27
27
  @click=${this.onClick}
28
- @keydown=${h?this.onKeyDown:C}
28
+ @keydown=${h?this.onKeyDown:M}
29
29
  @blur=${()=>{this.focused=null,this.highlight(null)}}
30
30
  >
31
31
  <title>${i}</title>
32
- ${o.description?z`<desc>${o.description}</desc>`:C}
33
- ${f?z`<style>${yt}</style>`:C} ${$n(o)}
32
+ ${o.description?z`<desc>${o.description}</desc>`:M}
33
+ ${f?z`<style>${yt}</style>`:M} ${$n(o)}
34
34
  ${Ce(o.shapes)}
35
35
  ${Ce(this.tip.length||!this.crossState?this.tip:We(o,this.crossState))}
36
36
  ${Ce(st(o,this.focused))} ${Ce(this.overlay)}
@@ -41,10 +41,10 @@ var nn=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var d=(e,n,t
41
41
  style="left:${w.x+12}px;top:${w.y+12}px"
42
42
  >
43
43
  ${w.lines.map(k=>K`<div>${k}</div>`)}
44
- </div>`:C}
44
+ </div>`:M}
45
45
  ${$?K`<table data-skdx-table=${r}>
46
46
  <caption>
47
- ${S}
47
+ ${T}
48
48
  </caption>
49
49
  <thead>
50
50
  <tr>
@@ -53,10 +53,10 @@ var nn=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var d=(e,n,t
53
53
  </thead>
54
54
  <tbody>
55
55
  ${$.slice(1).map(k=>K`<tr>
56
- ${k.map((M,I)=>I===0?K`<th scope="row">${M}</th>`:K`<td>${M}</td>`)}
56
+ ${k.map((S,I)=>I===0?K`<th scope="row">${S}</th>`:K`<td>${S}</td>`)}
57
57
  </tr>`)}
58
58
  </tbody>
59
- </table>`:C}`}};b.styles=wn`
59
+ </table>`:M}`}};b.styles=wn`
60
60
  :host {
61
61
  display: inline-block;
62
62
  }
@@ -109,4 +109,4 @@ var nn=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var d=(e,n,t
109
109
  [role='tooltip'] > :first-child:not(:only-child) {
110
110
  font-weight: bold;
111
111
  }
112
- `,d([p({type:Number})],b.prototype,"width",2),d([p({type:Number})],b.prototype,"height",2),d([p()],b.prototype,"label",2),d([p({type:Boolean,reflect:!0})],b.prototype,"legend",2),d([p({type:Boolean,attribute:"no-tooltip",converter:kt})],b.prototype,"tooltip",2),d([p({attribute:!1})],b.prototype,"format",2),d([p({attribute:!1})],b.prototype,"palette",2),d([p({attribute:!1})],b.prototype,"hiddenSeries",2),d([p({attribute:!1})],b.prototype,"selected",2),d([p({attribute:"selection-mode"})],b.prototype,"selectionMode",2),d([p({attribute:!1})],b.prototype,"highlighted",2),d([p({attribute:!1})],b.prototype,"highlightScope",2),d([p({type:Boolean,reflect:!0})],b.prototype,"loading",2),d([p()],b.prototype,"error",2),d([p({attribute:"empty-message"})],b.prototype,"emptyMessage",2),d([p()],b.prototype,"description",2),d([p({type:Boolean,reflect:!0})],b.prototype,"decorative",2),d([p({type:Boolean,attribute:"accessible-table"})],b.prototype,"accessibleTable",2),d([p({attribute:!1})],b.prototype,"zoom",2),d([p({attribute:!1})],b.prototype,"view",2),d([p({type:Boolean,reflect:!0})],b.prototype,"zoomable",2),d([p({type:Boolean,reflect:!0})],b.prototype,"editable",2),d([p({attribute:"sync-id"})],b.prototype,"syncId",2),d([p({type:Boolean,attribute:"cross-filter"})],b.prototype,"crossFilter",2),d([p({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],b.prototype,"animated",2),d([p({type:Boolean,reflect:!0})],b.prototype,"responsive",2),d([N()],b.prototype,"tip",2),d([N()],b.prototype,"overlay",2),d([N()],b.prototype,"portal",2),d([N()],b.prototype,"measured",2),d([N()],b.prototype,"viewState",2),d([N()],b.prototype,"highlightState",2),d([N()],b.prototype,"crossState",2),d([N()],b.prototype,"focused",2),d([N()],b.prototype,"hiddenState",2),d([N()],b.prototype,"zoomState",2),d([N()],b.prototype,"selectedState",2);var v=class extends b{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:h,nulls:f,stacked:$,stackOffset:S,orientation:w,radius:k,barGap:M,barWidth:I,sort:A,transform:B,transforms:E,bins:Z,binWidth:Ie,binDomain:D,binMode:ne,sampling:he,brush:Te,crosshair:Oe}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:h,nulls:f,stacked:$,stackOffset:S,orientation:w,radius:k,barGap:M,barWidth:I,sort:A,transform:B,transforms:E,bins:Z,binWidth:Ie,binDomain:D,binMode:ne,sampling:he,brush:Te,crosshair:Oe}}};d([p({attribute:!1})],v.prototype,"series",2),d([p({attribute:!1})],v.prototype,"categories",2),d([p({attribute:!1})],v.prototype,"xAxis",2),d([p({attribute:!1})],v.prototype,"yAxis",2),d([p({attribute:!1})],v.prototype,"rightAxis",2),d([p({attribute:!1})],v.prototype,"references",2),d([p({attribute:!1})],v.prototype,"annotations",2),d([p({type:Boolean,reflect:!0})],v.prototype,"labels",2),d([p()],v.prototype,"curve",2),d([p({type:Boolean,attribute:"connect-nulls"})],v.prototype,"connectNulls",2),d([p()],v.prototype,"nulls",2),d([p({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],v.prototype,"stacked",2),d([p({attribute:"stack-offset"})],v.prototype,"stackOffset",2),d([p()],v.prototype,"orientation",2),d([p({type:Number})],v.prototype,"radius",2),d([p({type:Number,attribute:"bar-gap"})],v.prototype,"barGap",2),d([p({type:Number,attribute:"bar-width"})],v.prototype,"barWidth",2),d([p()],v.prototype,"sort",2),d([p()],v.prototype,"transform",2),d([p({attribute:!1})],v.prototype,"transforms",2),d([p({type:Number})],v.prototype,"bins",2),d([p({type:Number,attribute:"bin-width"})],v.prototype,"binWidth",2),d([p({attribute:!1})],v.prototype,"binDomain",2),d([p({attribute:"bin-mode"})],v.prototype,"binMode",2),d([p({attribute:!1})],v.prototype,"sampling",2),d([p({type:Boolean,reflect:!0})],v.prototype,"brush",2),d([p({type:Boolean,reflect:!0})],v.prototype,"crosshair",2);var $n=e=>e.defs&&e.defs.length?z`<defs>${e.defs.map(n=>z`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>z`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${g(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:C,Ce=e=>z`${e.map((n,t)=>{let r=n.title?z`<title>${n.title}</title>`:C,i=n.item?t:void 0;switch(n.kind){case"path":return z`<path data-skdx-part=${n.part} data-skdx-i=${g(i)} d=${n.d} fill=${n.fill??"none"} stroke=${g(n.stroke)} stroke-width=${g(n.strokeWidth)} stroke-linecap=${g(n.strokeLinecap)} stroke-linejoin=${g(n.strokeLinejoin)} stroke-dasharray=${g(n.dash)} opacity=${g(n.opacity)} fill-opacity=${g(n.fillOpacity)}>${r}</path>`;case"rect":return z`<rect data-skdx-part=${n.part} data-skdx-i=${g(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${g(n.rx)} style=${g(ye(n.part)?`rx:${ye(n.part)}`:void 0)} fill=${n.fill} stroke=${g(n.stroke)} fill-opacity=${g(n.opacity)} pointer-events=${g(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return z`<line data-skdx-part=${n.part} data-skdx-i=${g(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${g(n.strokeWidth)} stroke-dasharray=${g(n.dash)} opacity=${g(n.opacity)}>${r}</line>`;case"circle":return z`<circle data-skdx-part=${n.part} data-skdx-i=${g(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${g(n.stroke)} opacity=${g(n.opacity)}>${r}</circle>`;case"text":return z`<text aria-label=${g(n.title)} data-skdx-part=${n.part} data-skdx-i=${g(i)} x=${n.x} y=${n.y} text-anchor=${g(n.anchor)} dominant-baseline=${g(n.baseline)} fill=${g(n.fill)} font-weight=${g(n.weight)} pointer-events=${g(i===void 0?"none":void 0)} transform=${g(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var R=class extends b{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(wt({...this.sized(),data:t,orientation:r,rootId:i,collapsed:o,maxDepth:s,labels:a,nodeSize:l}),"organization",this.label??"Organization chart")}};d([X({attribute:!1})],R.prototype,"data",2),d([X()],R.prototype,"orientation",2),d([X({attribute:!1})],R.prototype,"rootId",2),d([X({attribute:!1})],R.prototype,"collapsed",2),d([X({type:Number,attribute:"max-depth"})],R.prototype,"maxDepth",2),d([X({type:Boolean,attribute:"no-labels",converter:kt})],R.prototype,"labels",2),d([X({type:Number,attribute:"node-size"})],R.prototype,"nodeSize",2),R=d([Sn("skdx-organization-chart")],R);export{R as SkdxOrganizationChart};
112
+ `,d([p({type:Number})],b.prototype,"width",2),d([p({type:Number})],b.prototype,"height",2),d([p()],b.prototype,"label",2),d([p({type:Boolean,reflect:!0})],b.prototype,"legend",2),d([p({type:Boolean,attribute:"no-tooltip",converter:kt})],b.prototype,"tooltip",2),d([p({attribute:!1})],b.prototype,"format",2),d([p({attribute:!1})],b.prototype,"palette",2),d([p({attribute:!1})],b.prototype,"hiddenSeries",2),d([p({attribute:!1})],b.prototype,"selected",2),d([p({attribute:"selection-mode"})],b.prototype,"selectionMode",2),d([p({attribute:!1})],b.prototype,"highlighted",2),d([p({attribute:!1})],b.prototype,"highlightScope",2),d([p({type:Boolean,reflect:!0})],b.prototype,"loading",2),d([p()],b.prototype,"error",2),d([p({attribute:"empty-message"})],b.prototype,"emptyMessage",2),d([p()],b.prototype,"description",2),d([p({type:Boolean,reflect:!0})],b.prototype,"decorative",2),d([p({type:Boolean,attribute:"accessible-table"})],b.prototype,"accessibleTable",2),d([p({attribute:!1})],b.prototype,"zoom",2),d([p({attribute:!1})],b.prototype,"view",2),d([p({type:Boolean,reflect:!0})],b.prototype,"zoomable",2),d([p({type:Boolean,reflect:!0})],b.prototype,"editable",2),d([p({attribute:"sync-id"})],b.prototype,"syncId",2),d([p({type:Boolean,attribute:"cross-filter"})],b.prototype,"crossFilter",2),d([p({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],b.prototype,"animated",2),d([p({type:Boolean,reflect:!0})],b.prototype,"responsive",2),d([N()],b.prototype,"tip",2),d([N()],b.prototype,"overlay",2),d([N()],b.prototype,"portal",2),d([N()],b.prototype,"measured",2),d([N()],b.prototype,"viewState",2),d([N()],b.prototype,"highlightState",2),d([N()],b.prototype,"crossState",2),d([N()],b.prototype,"focused",2),d([N()],b.prototype,"hiddenState",2),d([N()],b.prototype,"zoomState",2),d([N()],b.prototype,"selectedState",2);var v=class extends b{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:h,nulls:f,stacked:$,stackOffset:T,orientation:w,radius:k,barGap:S,barWidth:I,sort:A,transform:B,transforms:E,bins:Z,binWidth:Ie,binDomain:D,binMode:ne,sampling:he,brush:Te,crosshair:Oe}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:h,nulls:f,stacked:$,stackOffset:T,orientation:w,radius:k,barGap:S,barWidth:I,sort:A,transform:B,transforms:E,bins:Z,binWidth:Ie,binDomain:D,binMode:ne,sampling:he,brush:Te,crosshair:Oe,...this.compactOverrides()}}};d([p({attribute:!1})],v.prototype,"series",2),d([p({attribute:!1})],v.prototype,"categories",2),d([p({attribute:!1})],v.prototype,"xAxis",2),d([p({attribute:!1})],v.prototype,"yAxis",2),d([p({attribute:!1})],v.prototype,"rightAxis",2),d([p({attribute:!1})],v.prototype,"references",2),d([p({attribute:!1})],v.prototype,"annotations",2),d([p({type:Boolean,reflect:!0})],v.prototype,"labels",2),d([p()],v.prototype,"curve",2),d([p({type:Boolean,attribute:"connect-nulls"})],v.prototype,"connectNulls",2),d([p()],v.prototype,"nulls",2),d([p({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],v.prototype,"stacked",2),d([p({attribute:"stack-offset"})],v.prototype,"stackOffset",2),d([p()],v.prototype,"orientation",2),d([p({type:Number})],v.prototype,"radius",2),d([p({type:Number,attribute:"bar-gap"})],v.prototype,"barGap",2),d([p({type:Number,attribute:"bar-width"})],v.prototype,"barWidth",2),d([p()],v.prototype,"sort",2),d([p()],v.prototype,"transform",2),d([p({attribute:!1})],v.prototype,"transforms",2),d([p({type:Number})],v.prototype,"bins",2),d([p({type:Number,attribute:"bin-width"})],v.prototype,"binWidth",2),d([p({attribute:!1})],v.prototype,"binDomain",2),d([p({attribute:"bin-mode"})],v.prototype,"binMode",2),d([p({attribute:!1})],v.prototype,"sampling",2),d([p({type:Boolean,reflect:!0})],v.prototype,"brush",2),d([p({type:Boolean,reflect:!0})],v.prototype,"crosshair",2);var $n=e=>e.defs&&e.defs.length?z`<defs>${e.defs.map(n=>z`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>z`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${g(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:M,Ce=e=>z`${e.map((n,t)=>{let r=n.title?z`<title>${n.title}</title>`:M,i=n.item?t:void 0;switch(n.kind){case"path":return z`<path data-skdx-part=${n.part} data-skdx-i=${g(i)} d=${n.d} fill=${n.fill??"none"} stroke=${g(n.stroke)} stroke-width=${g(n.strokeWidth)} stroke-linecap=${g(n.strokeLinecap)} stroke-linejoin=${g(n.strokeLinejoin)} stroke-dasharray=${g(n.dash)} opacity=${g(n.opacity)} fill-opacity=${g(n.fillOpacity)}>${r}</path>`;case"rect":return z`<rect data-skdx-part=${n.part} data-skdx-i=${g(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${g(n.rx)} style=${g(ye(n.part)?`rx:${ye(n.part)}`:void 0)} fill=${n.fill} stroke=${g(n.stroke)} fill-opacity=${g(n.opacity)} pointer-events=${g(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return z`<line data-skdx-part=${n.part} data-skdx-i=${g(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${g(n.strokeWidth)} stroke-dasharray=${g(n.dash)} opacity=${g(n.opacity)}>${r}</line>`;case"circle":return z`<circle data-skdx-part=${n.part} data-skdx-i=${g(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${g(n.stroke)} opacity=${g(n.opacity)}>${r}</circle>`;case"text":return z`<text aria-label=${g(n.title)} data-skdx-part=${n.part} data-skdx-i=${g(i)} x=${n.x} y=${n.y} text-anchor=${g(n.anchor)} dominant-baseline=${g(n.baseline)} fill=${g(n.fill)} font-weight=${g(n.weight)} pointer-events=${g(i===void 0?"none":void 0)} transform=${g(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var R=class extends b{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(wt({...this.sized(),data:t,orientation:r,rootId:i,collapsed:o,maxDepth:s,labels:a,nodeSize:l,...this.compactOverrides()}),"organization",this.label??"Organization chart")}};d([X({attribute:!1})],R.prototype,"data",2),d([X()],R.prototype,"orientation",2),d([X({attribute:!1})],R.prototype,"rootId",2),d([X({attribute:!1})],R.prototype,"collapsed",2),d([X({type:Number,attribute:"max-depth"})],R.prototype,"maxDepth",2),d([X({type:Boolean,attribute:"no-labels",converter:kt})],R.prototype,"labels",2),d([X({type:Number,attribute:"node-size"})],R.prototype,"nodeSize",2),R=d([Sn("skdx-organization-chart")],R);export{R as SkdxOrganizationChart};
package/dist/parallel.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var ee=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Pt=Object.prototype.hasOwnProperty;var Bt=(e,n)=>{for(var t in n)ee(e,t,{get:n[t],enumerable:!0})},Dt=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Rt(n))!Pt.call(e,i)&&i!==t&&ee(e,i,{get:()=>n[i],enumerable:!(r=it(n,i))||r.enumerable});return e};var Nt=e=>Dt(ee({},"__esModule",{value:!0}),e),d=(e,n,t,r)=>{for(var i=r>1?void 0:r?it(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&&ee(n,t,i),i};var on={};Bt(on,{SkdxParallelCoordinatesChart:()=>P});module.exports=Nt(on);var F=require("lit/decorators.js");var ot=e=>Number(e.toPrecision(12)),Gt,Ft=e=>(Gt??(Gt=new Intl.NumberFormat)).format(ot(e)),jt=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 st(e){if(e===void 0)return Ft;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?h=>u(h)+i:u,a=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let h=new Intl.NumberFormat(t,u);return s(p=>h.format(ot(p)))},c=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return p=>h.format(p)};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(jt)}}function fe([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function me(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,a=Math.floor(e/s)*s,l=Math.ceil(n/s)*s,c=[];for(let u=a;u<=l+s/2;u+=s)c.push(Ht(u));return c}var Ht=e=>Number(e.toPrecision(12)),y=e=>Number(e.toFixed(2)),ge=e=>typeof e=="number"&&Number.isFinite(e);function be(e){let n=1/0,t=-1/0;for(let r of e)ge(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function at(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let c=`M${t.x} ${t.y}`;for(let u=1;u<e.length;u++){let h=e[u-1],p=e[u];n==="stepAfter"?c+=`H${p.x}V${p.y}`:n==="stepBefore"?c+=`V${p.y}H${p.x}`:c+=`H${y((h.x+p.x)/2)}V${p.y}H${p.x}`}return c}if(n==="linear"||e.length<3)return`M${e.map(c=>`${c.x} ${c.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((c,u)=>c.x-e[u].x),o=e.slice(1).map((c,u)=>c.y-e[u].y),s=i.map((c,u)=>c===0?0:o[u]/c),a=[s[0]];for(let c=1;c<r-1;c++){let u=s[c-1],h=s[c];a.push(u*h<=0?0:(u+h)/2)}a.push(s[r-2]);for(let c=0;c<r-1;c++){let u=s[c];if(u===0){a[c]=0,a[c+1]=0;continue}let h=a[c]/u,p=a[c+1]/u,S=Math.hypot(h,p);S>3&&(a[c]=3*h*u/S,a[c+1]=3*p*u/S)}let l=`M${t.x} ${t.y}`;for(let c=0;c<r-1;c++){let u=e[c],h=e[c+1],p=i[c]/3;l+=`C${y(u.x+p)} ${y(u.y+p*a[c])} ${y(h.x-p)} ${y(h.y-p*a[c+1])} ${h.x} ${h.y}`}return l}var W=1e3,U=60*W,K=60*U,te=24*K,ln=[W,5*W,15*W,30*W,U,5*U,15*U,30*U,K,3*K,6*K,12*K,te,2*te,7*te,14*te];var _t=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Et=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Vt={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Zt(e,n,t){return e.replace(Et,(r,i,o)=>{let s=Vt[i];if(s===void 0)return i+o;let l=(o.match(_t)??[]).map((c,u)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let p=u%s;return s===7?p===5?String(h+n):p===6?String(h+t):c:String(p%2===0?h+n:h+t)});return i+l.join(" ")})}var lt=(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:Zt(r.d,n,t)}}});var xe=["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)"))),w={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 ct=(e,n)=>n??xe[e%xe.length];var Wt={top:16,right:16,bottom:32,left:48};function ut(e,n,t=Wt){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 Y(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function dt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var ne=20,Ut=120,ht=e=>{let n=Y(e);return n&&(n.position==="left"||n.position==="right")?n.width??Ut:0},re=(e,n=600,t=300)=>({width:(e.width??n)-ht(e),height:(e.height??t)-(Y(e)?.position==="bottom"?ne:0)}),pt=(e,n,t)=>{let r=Y(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,mt(n,t??re(e).width,r)):1)*ne},D=6.5;function Kt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/D));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ie=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:ct(n)),ft=(e,n)=>e.hiddenSeries?.includes(n)??!1;function ye(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,h=r.interactive??!0,p=o,S=i,$=(k,M,C,T)=>{let L=(M?18:4)+k.length*D;p>o&&(s||p+L>n-8)&&(p=o,S+=ne),M&&a.push({kind:"rect",part:"legend-swatch",x:p,y:S-5,width:10,height:10,fill:M,opacity:T?.3:void 0,item:C}),a.push({kind:"text",part:"legend-label",x:p+(M?14:0),y:S,text:k,baseline:"middle",fill:T?w.grid:w.label,item:C}),p+=L+12};for(let k of c){let M=t.includes(k.name),C=h?{label:k.name,series:k.name,legend:!0}:void 0;$(r.formatter?.(k.name)??k.name,k.color,C,M)}return u>0&&$(`+${u} more`,void 0,void 0,!1),r.align==="end"?Yt(a,n):a}function Yt(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*D)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var mt=(e,n,t={})=>new Set(ye(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function ve(e,n,t,r=[]){let i=Y(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=dt(e),a=o?.position==="bottom",l=ht(e),c=e.hiddenSeries??[],u=o?l?ye(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):ye(r,n,c,o,a?t+10:10):[],h=a?mt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*ne: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 we(e){let n=e.legendOffset;if(!n)return e;let t=[...lt(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 oe(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/D)),l=s.flatMap(M=>{let C=[],T=Array.from(M);for(;T.length>a;){let L=T.slice(0,a+1).lastIndexOf(" ");L<1&&(L=a),C.push(T.slice(0,L).join("")),T=T.slice(L),T[0]===" "&&T.shift()}return C.push(T.join("")),C}),c=Math.max(1,Math.floor((i-6)/16)),u=l.slice(0,c);l.length>c&&(u[c-1]=Kt(`${u[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...u.map(M=>Array.from(M).length))*D+12),p=Math.min(i,6+u.length*16),S=o==="top"?{x:e-h/2,y:n-p-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-p/2}:o==="right"?{x:e+8,y:n-p/2}:{x:e+12,y:n-p-6},$=Math.max(0,Math.min(r-h,S.x)),k=Math.max(0,Math.min(i-p,S.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
- `),x:y($),y:y(k),width:y(h),height:p,fill:"var(--skdx-color-surface-raised)",stroke:w.axis,rx:8},...u.map((M,C)=>({kind:"text",part:"tooltip-label",x:y($+6),y:y(k+11+C*16),text:M,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:u.length>1&&C===0?"bold":void 0}))]}function gt(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}=re(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:y(o/2),y:y(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":w.label}),{...ve(e,o,s),shapes:l,tooltip:!1}}var ke=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:w.label,...r});function se(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Me=e=>e.id??e.name??e.series,bt=e=>e.seriesId??e.series;function N(e,n){let t=!1;return n.id!==void 0&&(t=!0,Me(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,bt(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 j(e){let n={},t=Me(e);t!==void 0&&(n.id=t);let r=bt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Se=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function $e(e,n,t){let r=se(e),i=j(n),o=r.some(s=>N(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!N(n,s)):[...r,i]}var qt=.2;function Xt(e){let n=w.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 Qt=(e,n)=>e.kind==="text"?{...e,fill:w.grid}:{...e,opacity:(e.opacity??1)*n};function Ce(e,n){let t=se(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:se(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(h=>N(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&N(u,{series:h.series})):!1,l=u=>{if(!i||o.faded==="none"||a(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&N(u,{series:h})}return!0},c=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(p=>N(h,p))){let p=Xt(u);p&&s.push(p)}return l(h)?Qt(u,qt):u});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var xt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function ae(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?xt:void 0}function Z(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 Ie=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function yt(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 q(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=yt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Te(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[yt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:w.axis,dash:"3 3"}}function Oe(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Ie(r.plot,n,t))return[];let i=Te(e,n),{rows:o}=q(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...oe(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ae(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 Oe(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}=Z(t,r,i,e.width,e.height);if(Ie(e.hit.plot,l,c)){let u=q(e,l),h=Te(e,l);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?H(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 vt(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?H(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find($=>$.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=s?.tooltipAnchored?H(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:p,y:S}=h?X(h):Z(n,t,r,i,o);return oe(p,S,c,i,o,s?.tooltipPlacement)}function Le(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Z(t,r,i,e.width,e.height),a=Oe(e,o,s);if(a.length>0)return a}return vt(n,t,r,i,e.width,e.height,e)}function Re(e,n){let t=H(e,n);return t&&!t.item.legend?j(t.item):null}var Jt=(e,n)=>{let{x:t,y:r}=X(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 Pe(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Jt(i,n))continue;let o=j(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Be=e=>({kind:"rect",part:"selection-box",x:y(e.x),y:y(e.y),width:y(e.width),height:y(e.height),fill:w.focus,opacity:.12,stroke:w.focus}),ce=(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 wt(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 De(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}=X(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!wt(n,o,a))continue;let l=j(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Ne=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${y(n.x)} ${y(n.y)}`).join("L")}`:"",fill:w.focus,fillOpacity:.12,stroke:w.focus,dash:"4 3"}),le=6;function Ge(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-le||n>i.x1+le))return Math.abs(n-i.x0)<=le?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=le?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Fe(e,n,t){let r=e.edit;return kt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function je(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 kt(r,{bar:o,mode:s},i*a)}function kt(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 He(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:y(Math.min(i,o)),y:y(n.bar.y),width:y(Math.max(1,Math.abs(o-i))),height:y(n.bar.height),fill:w.focus,opacity:.25,stroke:w.focus,rx:2}}var en=64,tn=e=>Math.max(1,Math.min(en,e));function _e(e,n,t,r){let i=n>0?.8:1.25,o=tn(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,h=(r-(s.y+s.height/2))/a,p=e.view.zoom/o;return{center:[l+u*(1-p),e.fromY(e.toY(c)-h*(1-p))],zoom:o}}function Ee(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 H(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 ue=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function X(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 Ve(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=w.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*D+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}=X(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?oe(y(o),y(s),a,e.width,e.height):[]]}function Ze(e,n,t){let r=ue(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 E=2,V=(e,n,t)=>{let r=Math.max(E,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Mt=(e,n)=>!e||e.start<=0&&e.end>=n;function We(e,n,t){if(e.count<=E||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(E,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!Mt(e.zoom,e.count)?V(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 V(c-l*a,a,e.count)}function Ue(e,n,t,r){let i=n.end-n.start,o=Math.max(E,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 V(n.start+s*i-s*o,o,e.count)}function Ke(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return V(n.start-t/i,r,e.count)}function Ye(e,n,t){let r=e.brush;if(!r||!Ie(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:V(s-o/2,o,e.count)}}function qe(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 V(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-E,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+E,Math.round(t.end+o)));return{start:t.start,end:s}}function Qe(e,n){switch(n.type){case"svg":return Promise.resolve(Xe(e,n.label,n.resolve));case"csv":return Promise.resolve(It(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Xe(e,n.label,n.resolve);return Ct(t,e.width,e.height,n.scale,n.background)}}}var G=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),Q=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${G(String(t))}"`).join("");function St(e){let n=e.title?`<title>${G(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Q([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${Q([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${Q([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${Q([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Q([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]])}>${G(e.text)}</text>`}}function $t(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${G(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="${G(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Xe(e,n,t){let r=$t(e)+e.shapes.map(St).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="${G(n)}" font-family="${G(w.fontFamily)}" font-size="${G(w.fontSize)}"><title>${G(n)}</title>${r}</svg>`}function Ct(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(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function It(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 Je(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(h=>h.slice(h.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 et=new Map;function de(e){let n=et.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&&et.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return et.set(e,{group:i,listeners:t}),i}var Tt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',tt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Tt}{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){${Tt}{animation:none;transition:none}}`;function nt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var Ot=500;function rt(e){let n=[],t=e.dimensions,r=e.data.filter(m=>!(m.group!==void 0&&ft(e,m.group))),i=gt(e,t.length===0||r.length===0);if(i)return{...i,issues:n};let{width:o,height:s}=re(e),a=[...new Set(e.data.map(m=>m.group).filter(m=>m!==void 0))],l=t[0],c=t[t.length-1],u=m=>(m.label??m.key).length*D/2+8,h=a.map((m,O)=>({name:m,color:ie(e,O)})),p=ut(o,s,{top:28+pt(e,h,o),right:Math.max(16,u(c)),bottom:16,left:Math.max(48,u(l))}),S=(m,O)=>{let I=m.values[O];return I==null?null:ge(I)?I:(n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has a value on "${O}" that is not a number; drawn as a gap.`,itemId:m.id??m.name}),null)},$=t.map((m,O)=>{let[I,z]=be(r.map(_=>S(_,m.key))),B=me(m.min??I,m.max??z),A=m.min??B[0],R=m.max??B[B.length-1],pe=m.reversed?[p.y,p.y+p.height]:[p.y+p.height,p.y],At=fe([A,R],pe),zt=y(t.length===1?p.x+p.width/2:p.x+O*p.width/(t.length-1)),Lt=st(m.format??e.format);return{d:m,x:zt,scale:_=>y(At(Math.max(A,Math.min(R,_)))),format:Lt,ticks:B.filter(_=>_>=A-1e-9&&_<=R+1e-9)}}),k=[];$.forEach((m,O)=>{k.push({kind:"line",part:"axis",x1:m.x,x2:m.x,y1:p.y,y2:p.y+p.height,stroke:w.axis});let I=O===$.length-1&&$.length>1?"start":"end";for(let z of m.ticks)k.push(ke(y(I==="end"?m.x-6:m.x+6),m.scale(z),m.format(z),{part:"y-label",anchor:I,baseline:"middle"}));k.push(ke(m.x,p.y-12,m.d.label??m.d.key,{part:"axis-title",anchor:"middle"}))});let M=r.length<=Ot,C=e.opacity??(r.length>200?.25:.6),T=m=>(e.filters??[]).every(O=>{let I=S(m,O.key);return I!==null&&I>=(O.min??-1/0)&&I<=(O.max??1/0)}),L=r.map((m,O)=>{let I=[],z=[];for(let A of $){let R=S(m,A.d.key);if(R===null){!e.connectNulls&&z.length&&(I.push(z),z=[]);continue}z.push({x:A.x,y:A.scale(R)})}z.length&&I.push(z);let B=`${m.name}: ${$.map(A=>{let R=S(m,A.d.key);return`${A.d.label??A.d.key} ${R===null?"\u2014":A.format(R)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:I.map(A=>at(A,e.curve)).join(""),stroke:m.color??(m.group!==void 0?ie(e,a.indexOf(m.group)):ie(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:T(m)?C:.08,title:M?B:void 0,item:M?{label:B,id:m.id??m.name,name:m.name,category:m.group,index:O}:void 0}}),J=ve(e,o,s,h);return{...J,shapes:[...k,...L,...J.shapes],issues:n}}var g=require("lit"),f=require("lit/decorators.js"),x=require("lit/directives/if-defined.js");var nn={fromAttribute:()=>!1},b=class extends g.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=[Be(ce(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=[Ne(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Fe(r,i.gantt,o-i.x),this.overlay=[He(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(Ee(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(Ue(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"?Ke(r.hit,i.zoom,o-i.x):qe(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=Le(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Re(r,t.target)),this.syncId&&r.hit?.crosshair){let o=q(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=H(r,t.target)?.item.legend,a=this.canEdit(r)?Ge(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=Ye(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(Pe(o,ce(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(De(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(_e(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=We(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=H(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)?je(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=Ze(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:c,emptyMessage:u,description:h,decorative:p,animated:S,responsive:$,highlighted:k,highlightScope:M,accessibleTable:C}=this;return{...typeof $=="object"&&this.measured!==void 0&&this.measured<($.breakpoint??480)?$.compact:void 0,width:$&&this.measured?this.measured:t,height:r,animate:S,responsive:$,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:h,decorative:p,highlighted:k===void 0?this.highlightState:k,highlightScope:M,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&&de(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=de(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&&Se(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($e(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 Z(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&&N(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?Qe(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ce(we(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let M of o.issues??[])this.emit("skdx-data-issue",M)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),u=s||a||l||c,h=!o.decorative&&ue(o).length>0,p=nt(o),S=Je(o,this.accessibleTable),$=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,k=this.portal;return g.html`<svg
1
+ "use strict";var ee=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Pt=Object.prototype.hasOwnProperty;var Bt=(e,n)=>{for(var t in n)ee(e,t,{get:n[t],enumerable:!0})},Dt=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Rt(n))!Pt.call(e,i)&&i!==t&&ee(e,i,{get:()=>n[i],enumerable:!(r=it(n,i))||r.enumerable});return e};var Nt=e=>Dt(ee({},"__esModule",{value:!0}),e),u=(e,n,t,r)=>{for(var i=r>1?void 0:r?it(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&&ee(n,t,i),i};var on={};Bt(on,{SkdxParallelCoordinatesChart:()=>P});module.exports=Nt(on);var F=require("lit/decorators.js");var ot=e=>Number(e.toPrecision(12)),Gt,Ft=e=>(Gt??(Gt=new Intl.NumberFormat)).format(ot(e)),jt=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 st(e){if(e===void 0)return Ft;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=d=>i?h=>d(h)+i:d,a=d=>r===void 0?d===void 0?{}:{maximumFractionDigits:d}:{minimumFractionDigits:r,maximumFractionDigits:r},l=d=>{let h=new Intl.NumberFormat(t,d);return s(p=>h.format(ot(p)))},c=d=>{let h=new Intl.DateTimeFormat(t,o?{...d,timeZone:o}:d);return p=>h.format(p)};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(jt)}}function fe([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function me(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,a=Math.floor(e/s)*s,l=Math.ceil(n/s)*s,c=[];for(let d=a;d<=l+s/2;d+=s)c.push(Ht(d));return c}var Ht=e=>Number(e.toPrecision(12)),y=e=>Number(e.toFixed(2)),ge=e=>typeof e=="number"&&Number.isFinite(e);function be(e){let n=1/0,t=-1/0;for(let r of e)ge(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function at(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let c=`M${t.x} ${t.y}`;for(let d=1;d<e.length;d++){let h=e[d-1],p=e[d];n==="stepAfter"?c+=`H${p.x}V${p.y}`:n==="stepBefore"?c+=`V${p.y}H${p.x}`:c+=`H${y((h.x+p.x)/2)}V${p.y}H${p.x}`}return c}if(n==="linear"||e.length<3)return`M${e.map(c=>`${c.x} ${c.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((c,d)=>c.x-e[d].x),o=e.slice(1).map((c,d)=>c.y-e[d].y),s=i.map((c,d)=>c===0?0:o[d]/c),a=[s[0]];for(let c=1;c<r-1;c++){let d=s[c-1],h=s[c];a.push(d*h<=0?0:(d+h)/2)}a.push(s[r-2]);for(let c=0;c<r-1;c++){let d=s[c];if(d===0){a[c]=0,a[c+1]=0;continue}let h=a[c]/d,p=a[c+1]/d,S=Math.hypot(h,p);S>3&&(a[c]=3*h*d/S,a[c+1]=3*p*d/S)}let l=`M${t.x} ${t.y}`;for(let c=0;c<r-1;c++){let d=e[c],h=e[c+1],p=i[c]/3;l+=`C${y(d.x+p)} ${y(d.y+p*a[c])} ${y(h.x-p)} ${y(h.y-p*a[c+1])} ${h.x} ${h.y}`}return l}var W=1e3,U=60*W,K=60*U,te=24*K,ln=[W,5*W,15*W,30*W,U,5*U,15*U,30*U,K,3*K,6*K,12*K,te,2*te,7*te,14*te];var _t=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Et=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Vt={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Zt(e,n,t){return e.replace(Et,(r,i,o)=>{let s=Vt[i];if(s===void 0)return i+o;let l=(o.match(_t)??[]).map((c,d)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let p=d%s;return s===7?p===5?String(h+n):p===6?String(h+t):c:String(p%2===0?h+n:h+t)});return i+l.join(" ")})}var lt=(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:Zt(r.d,n,t)}}});var xe=["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)"))),w={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 ct=(e,n)=>n??xe[e%xe.length];var Wt={top:16,right:16,bottom:32,left:48};function dt(e,n,t=Wt){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 Y(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function ut(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var ne=20,Ut=120,ht=e=>{let n=Y(e);return n&&(n.position==="left"||n.position==="right")?n.width??Ut:0},re=(e,n=600,t=300)=>({width:(e.width??n)-ht(e),height:(e.height??t)-(Y(e)?.position==="bottom"?ne:0)}),pt=(e,n,t)=>{let r=Y(e);return!r||!(r.position===void 0||r.position==="top")?0:(n?Math.max(1,mt(n,t??re(e).width,r)):1)*ne},N=6.5;function Kt(e,n){let t=Array.from(e),r=Math.max(0,Math.floor(n/N));return t.length<=r?e:r===0?"":`${t.slice(0,r-1).join("")}\u2026`}var ie=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:ct(n)),ft=(e,n)=>e.hiddenSeries?.includes(n)??!1;function ye(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,d=e.length-c.length,h=r.interactive??!0,p=o,S=i,$=(k,M,C,T)=>{let L=(M?18:4)+k.length*N;p>o&&(s||p+L>n-8)&&(p=o,S+=ne),M&&a.push({kind:"rect",part:"legend-swatch",x:p,y:S-5,width:10,height:10,fill:M,opacity:T?.3:void 0,item:C}),a.push({kind:"text",part:"legend-label",x:p+(M?14:0),y:S,text:k,baseline:"middle",fill:T?w.grid:w.label,item:C}),p+=L+12};for(let k of c){let M=t.includes(k.name),C=h?{label:k.name,series:k.name,legend:!0}:void 0;$(r.formatter?.(k.name)??k.name,k.color,C,M)}return d>0&&$(`+${d} more`,void 0,void 0,!1),r.align==="end"?Yt(a,n):a}function Yt(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*N)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var mt=(e,n,t={})=>new Set(ye(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function ve(e,n,t,r=[]){let i=Y(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=ut(e),a=o?.position==="bottom",l=ht(e),c=e.hiddenSeries??[],d=o?l?ye(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):ye(r,n,c,o,a?t+10:10):[],h=a?mt(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*ne: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 we(e){let n=e.legendOffset;if(!n)return e;let t=[...lt(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 oe(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(1,Math.floor((r-12)/N)),l=s.flatMap(M=>{let C=[],T=Array.from(M);for(;T.length>a;){let L=T.slice(0,a+1).lastIndexOf(" ");L<1&&(L=a),C.push(T.slice(0,L).join("")),T=T.slice(L),T[0]===" "&&T.shift()}return C.push(T.join("")),C}),c=Math.max(1,Math.floor((i-6)/16)),d=l.slice(0,c);l.length>c&&(d[c-1]=Kt(`${d[c-1]}\u2026`,r-12));let h=Math.min(r,Math.max(0,...d.map(M=>Array.from(M).length))*N+12),p=Math.min(i,6+d.length*16),S=o==="top"?{x:e-h/2,y:n-p-8}:o==="bottom"?{x:e-h/2,y:n+8}:o==="left"?{x:e-h-8,y:n-p/2}:o==="right"?{x:e+8,y:n-p/2}:{x:e+12,y:n-p-6},$=Math.max(0,Math.min(r-h,S.x)),k=Math.max(0,Math.min(i-p,S.y));return[{kind:"rect",part:"tooltip",title:s.join(`
2
+ `),x:y($),y:y(k),width:y(h),height:p,fill:"var(--skdx-color-surface-raised)",stroke:w.axis,rx:8},...d.map((M,C)=>({kind:"text",part:"tooltip-label",x:y($+6),y:y(k+11+C*16),text:M,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:d.length>1&&C===0?"bold":void 0}))]}function gt(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}=re(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:y(o/2),y:y(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":w.label}),{...ve(e,o,s),shapes:l,tooltip:!1}}var ke=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:w.label,...r});function se(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Me=e=>e.id??e.name??e.series,bt=e=>e.seriesId??e.series;function G(e,n){let t=!1;return n.id!==void 0&&(t=!0,Me(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,bt(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 j(e){let n={},t=Me(e);t!==void 0&&(n.id=t);let r=bt(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Se=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function $e(e,n,t){let r=se(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 qt=.2;function Xt(e){let n=w.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 Qt=(e,n)=>e.kind==="text"?{...e,fill:w.grid}:{...e,opacity:(e.opacity??1)*n};function Ce(e,n){let t=se(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:se(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(h=>G(d,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&G(d,{series:h.series})):!1,l=d=>{if(!i||o.faded==="none"||a(d))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&G(d,{series:h})}return!0},c=e.shapes.map(d=>{let h=d.item;if(!h||h.legend)return d;if(t.some(p=>G(h,p))){let p=Xt(d);p&&s.push(p)}return l(h)?Qt(d,qt):d});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}var xt="var(--skdx-radius-default, var(--skdx-radius-md, 0.5rem))";function ae(e){return["tooltip","skeleton","label-background","stage-label-background","brush-handle"].includes(e)?xt:void 0}function Z(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 Ie=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function yt(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 q(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=yt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Te(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[yt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:w.axis,dash:"3 3"}}function Oe(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Ie(r.plot,n,t))return[];let i=Te(e,n),{rows:o}=q(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...oe(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ae(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 Oe(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}=Z(t,r,i,e.width,e.height);if(Ie(e.hit.plot,l,c)){let d=q(e,l),h=Te(e,l);if(d&&h)return{lines:d.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?H(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 vt(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?H(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find($=>$.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let d=s?.tooltipAnchored?H(s,e):void 0,h=d?s?.shapes[d.index]:void 0,{x:p,y:S}=h?X(h):Z(n,t,r,i,o);return oe(p,S,c,i,o,s?.tooltipPlacement)}function Le(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Z(t,r,i,e.width,e.height),a=Oe(e,o,s);if(a.length>0)return a}return vt(n,t,r,i,e.width,e.height,e)}function Re(e,n){let t=H(e,n);return t&&!t.item.legend?j(t.item):null}var Jt=(e,n)=>{let{x:t,y:r}=X(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 Pe(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Jt(i,n))continue;let o=j(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Be=e=>({kind:"rect",part:"selection-box",x:y(e.x),y:y(e.y),width:y(e.width),height:y(e.height),fill:w.focus,opacity:.12,stroke:w.focus}),ce=(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 wt(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 De(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}=X(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!wt(n,o,a))continue;let l=j(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var Ne=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${y(n.x)} ${y(n.y)}`).join("L")}`:"",fill:w.focus,fillOpacity:.12,stroke:w.focus,dash:"4 3"}),le=6;function Ge(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-le||n>i.x1+le))return Math.abs(n-i.x0)<=le?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=le?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Fe(e,n,t){let r=e.edit;return kt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function je(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 kt(r,{bar:o,mode:s},i*a)}function kt(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 He(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:y(Math.min(i,o)),y:y(n.bar.y),width:y(Math.max(1,Math.abs(o-i))),height:y(n.bar.height),fill:w.focus,opacity:.25,stroke:w.focus,rx:2}}var en=64,tn=e=>Math.max(1,Math.min(en,e));function _e(e,n,t,r){let i=n>0?.8:1.25,o=tn(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,c]=e.view.center,d=(t-(s.x+s.width/2))/a,h=(r-(s.y+s.height/2))/a,p=e.view.zoom/o;return{center:[l+d*(1-p),e.fromY(e.toY(c)-h*(1-p))],zoom:o}}function Ee(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 H(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 de=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function X(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 Ve(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=w.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*N+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}=X(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?oe(y(o),y(s),a,e.width,e.height):[]]}function Ze(e,n,t){let r=de(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 E=2,V=(e,n,t)=>{let r=Math.max(E,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Mt=(e,n)=>!e||e.start<=0&&e.end>=n;function We(e,n,t){if(e.count<=E||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(E,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!Mt(e.zoom,e.count)?V(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 V(c-l*a,a,e.count)}function Ue(e,n,t,r){let i=n.end-n.start,o=Math.max(E,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 V(n.start+s*i-s*o,o,e.count)}function Ke(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return V(n.start-t/i,r,e.count)}function Ye(e,n,t){let r=e.brush;if(!r||!Ie(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:V(s-o/2,o,e.count)}}function qe(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 V(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-E,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+E,Math.round(t.end+o)));return{start:t.start,end:s}}function Qe(e,n){switch(n.type){case"svg":return Promise.resolve(Xe(e,n.label,n.resolve));case"csv":return Promise.resolve(It(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=Xe(e,n.label,n.resolve);return Ct(t,e.width,e.height,n.scale,n.background)}}}var B=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),Q=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${B(String(t))}"`).join("");function St(e){let n=e.title?`<title>${B(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Q([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${Q([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${Q([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${Q([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Q([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]])}>${B(e.text)}</text>`}}function $t(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${B(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="${B(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function Xe(e,n,t){let r=$t(e)+e.shapes.map(St).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="${B(n)}"`,o=e.description?`<desc>${B(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="${B(w.fontFamily)}" font-size="${B(w.fontSize)}"><title>${B(n)}</title>${o}${r}</svg>`}function Ct(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 d=c.getContext("2d");if(!d)return s(new Error("canvas 2d context unavailable"));i&&(d.fillStyle=i,d.fillRect(0,0,c.width,c.height)),d.drawImage(l,0,0,c.width,c.height),c.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function It(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 Je(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[^:]*$/,""))],c=r.rows.map(d=>[d[0],...d.slice(1).map(h=>h.slice(h.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 et=new Map;function ue(e){let n=et.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&&et.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return et.set(e,{group:i,listeners:t}),i}var Tt='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',tt=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Tt}{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){${Tt}{animation:none;transition:none}}`;function nt(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var Ot=500;function rt(e){let n=[],t=e.dimensions,r=e.data.filter(m=>!(m.group!==void 0&&ft(e,m.group))),i=gt(e,t.length===0||r.length===0);if(i)return{...i,issues:n};let{width:o,height:s}=re(e),a=[...new Set(e.data.map(m=>m.group).filter(m=>m!==void 0))],l=t[0],c=t[t.length-1],d=m=>(m.label??m.key).length*N/2+8,h=a.map((m,O)=>({name:m,color:ie(e,O)})),p=dt(o,s,{top:28+pt(e,h,o),right:Math.max(16,d(c)),bottom:16,left:Math.max(48,d(l))}),S=(m,O)=>{let I=m.values[O];return I==null?null:ge(I)?I:(n.push({code:"invalid-value",severity:"warning",message:`"${m.name}" has a value on "${O}" that is not a number; drawn as a gap.`,itemId:m.id??m.name}),null)},$=t.map((m,O)=>{let[I,z]=be(r.map(_=>S(_,m.key))),D=me(m.min??I,m.max??z),A=m.min??D[0],R=m.max??D[D.length-1],pe=m.reversed?[p.y,p.y+p.height]:[p.y+p.height,p.y],At=fe([A,R],pe),zt=y(t.length===1?p.x+p.width/2:p.x+O*p.width/(t.length-1)),Lt=st(m.format??e.format);return{d:m,x:zt,scale:_=>y(At(Math.max(A,Math.min(R,_)))),format:Lt,ticks:D.filter(_=>_>=A-1e-9&&_<=R+1e-9)}}),k=[];$.forEach((m,O)=>{k.push({kind:"line",part:"axis",x1:m.x,x2:m.x,y1:p.y,y2:p.y+p.height,stroke:w.axis});let I=O===$.length-1&&$.length>1?"start":"end";for(let z of m.ticks)k.push(ke(y(I==="end"?m.x-6:m.x+6),m.scale(z),m.format(z),{part:"y-label",anchor:I,baseline:"middle"}));k.push(ke(m.x,p.y-12,m.d.label??m.d.key,{part:"axis-title",anchor:"middle"}))});let M=r.length<=Ot,C=e.opacity??(r.length>200?.25:.6),T=m=>(e.filters??[]).every(O=>{let I=S(m,O.key);return I!==null&&I>=(O.min??-1/0)&&I<=(O.max??1/0)}),L=r.map((m,O)=>{let I=[],z=[];for(let A of $){let R=S(m,A.d.key);if(R===null){!e.connectNulls&&z.length&&(I.push(z),z=[]);continue}z.push({x:A.x,y:A.scale(R)})}z.length&&I.push(z);let D=`${m.name}: ${$.map(A=>{let R=S(m,A.d.key);return`${A.d.label??A.d.key} ${R===null?"\u2014":A.format(R)}`}).join(" \xB7 ")}`;return{kind:"path",part:"row",d:I.map(A=>at(A,e.curve)).join(""),stroke:m.color??(m.group!==void 0?ie(e,a.indexOf(m.group)):ie(e,0)),strokeWidth:1.5,strokeLinejoin:"round",opacity:T(m)?C:.08,title:M?D:void 0,item:M?{label:D,id:m.id??m.name,name:m.name,category:m.group,index:O}:void 0}}),J=ve(e,o,s,h);return{...J,shapes:[...k,...L,...J.shapes],issues:n}}var g=require("lit"),f=require("lit/decorators.js"),x=require("lit/directives/if-defined.js");var nn={fromAttribute:()=>!1},b=class extends g.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=[Be(ce(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=[Ne(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Fe(r,i.gantt,o-i.x),this.overlay=[He(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(Ee(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(Ue(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"?Ke(r.hit,i.zoom,o-i.x):qe(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=Le(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Re(r,t.target)),this.syncId&&r.hit?.crosshair){let o=q(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=H(r,t.target)?.item.legend,a=this.canEdit(r)?Ge(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,d]=[...this.pointers.values()];this.drag={x:(c+d)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-d)||1}}else{let c=Ye(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(Pe(o,ce(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(De(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(_e(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=We(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=H(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)?je(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=Ze(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:c,emptyMessage:d,description:h,decorative:p,animated:S,responsive:$,highlighted:k,highlightScope:M,accessibleTable:C}=this;return{width:$&&this.measured?this.measured:t,height:r,animate:S,responsive:$,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:d,description:h,decorative:p,highlighted:k===void 0?this.highlightState:k,highlightScope:M,accessibleTable:C,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&&ue(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=ue(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&&Se(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($e(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 Z(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?Qe(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ce(we(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let M of o.issues??[])this.emit("skdx-data-issue",M)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),d=s||a||l||c,h=!o.decorative&&de(o).length>0,p=nt(o),S=Je(o,this.accessibleTable),$=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,k=this.portal;return g.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}
@@ -17,11 +17,11 @@
17
17
  style=${p?`--skdx-chart-duration:${p}`:g.nothing}
18
18
  font-family=${w.fontFamily}
19
19
  font-size=${w.fontSize}
20
- @pointermove=${o.tooltip||u?this.onPointerMove:g.nothing}
20
+ @pointermove=${o.tooltip||d?this.onPointerMove:g.nothing}
21
21
  @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
22
- @pointerdown=${u?this.onPointerDown:g.nothing}
23
- @pointerup=${u?this.onPointerUp:g.nothing}
24
- @pointercancel=${u?this.onPointerUp:g.nothing}
22
+ @pointerdown=${d?this.onPointerDown:g.nothing}
23
+ @pointerup=${d?this.onPointerUp:g.nothing}
24
+ @pointercancel=${d?this.onPointerUp:g.nothing}
25
25
  @wheel=${s||a?this.onWheel:g.nothing}
26
26
  @dblclick=${s||a?()=>a?this.setView(void 0):this.setZoom(void 0):g.nothing}
27
27
  @click=${this.onClick}
@@ -109,4 +109,4 @@
109
109
  [role='tooltip'] > :first-child:not(:only-child) {
110
110
  font-weight: bold;
111
111
  }
112
- `,d([(0,f.property)({type:Number})],b.prototype,"width",2),d([(0,f.property)({type:Number})],b.prototype,"height",2),d([(0,f.property)()],b.prototype,"label",2),d([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"legend",2),d([(0,f.property)({type:Boolean,attribute:"no-tooltip",converter:nn})],b.prototype,"tooltip",2),d([(0,f.property)({attribute:!1})],b.prototype,"format",2),d([(0,f.property)({attribute:!1})],b.prototype,"palette",2),d([(0,f.property)({attribute:!1})],b.prototype,"hiddenSeries",2),d([(0,f.property)({attribute:!1})],b.prototype,"selected",2),d([(0,f.property)({attribute:"selection-mode"})],b.prototype,"selectionMode",2),d([(0,f.property)({attribute:!1})],b.prototype,"highlighted",2),d([(0,f.property)({attribute:!1})],b.prototype,"highlightScope",2),d([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"loading",2),d([(0,f.property)()],b.prototype,"error",2),d([(0,f.property)({attribute:"empty-message"})],b.prototype,"emptyMessage",2),d([(0,f.property)()],b.prototype,"description",2),d([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"decorative",2),d([(0,f.property)({type:Boolean,attribute:"accessible-table"})],b.prototype,"accessibleTable",2),d([(0,f.property)({attribute:!1})],b.prototype,"zoom",2),d([(0,f.property)({attribute:!1})],b.prototype,"view",2),d([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"zoomable",2),d([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"editable",2),d([(0,f.property)({attribute:"sync-id"})],b.prototype,"syncId",2),d([(0,f.property)({type:Boolean,attribute:"cross-filter"})],b.prototype,"crossFilter",2),d([(0,f.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],b.prototype,"animated",2),d([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"responsive",2),d([(0,f.state)()],b.prototype,"tip",2),d([(0,f.state)()],b.prototype,"overlay",2),d([(0,f.state)()],b.prototype,"portal",2),d([(0,f.state)()],b.prototype,"measured",2),d([(0,f.state)()],b.prototype,"viewState",2),d([(0,f.state)()],b.prototype,"highlightState",2),d([(0,f.state)()],b.prototype,"crossState",2),d([(0,f.state)()],b.prototype,"focused",2),d([(0,f.state)()],b.prototype,"hiddenState",2),d([(0,f.state)()],b.prototype,"zoomState",2),d([(0,f.state)()],b.prototype,"selectedState",2);var v=class extends b{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:h,nulls:p,stacked:S,stackOffset:$,orientation:k,radius:M,barGap:C,barWidth:T,sort:L,transform:J,transforms:m,bins:O,binWidth:I,binDomain:z,binMode:B,sampling:A,brush:R,crosshair:pe}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:h,nulls:p,stacked:S,stackOffset:$,orientation:k,radius:M,barGap:C,barWidth:T,sort:L,transform:J,transforms:m,bins:O,binWidth:I,binDomain:z,binMode:B,sampling:A,brush:R,crosshair:pe}}};d([(0,f.property)({attribute:!1})],v.prototype,"series",2),d([(0,f.property)({attribute:!1})],v.prototype,"categories",2),d([(0,f.property)({attribute:!1})],v.prototype,"xAxis",2),d([(0,f.property)({attribute:!1})],v.prototype,"yAxis",2),d([(0,f.property)({attribute:!1})],v.prototype,"rightAxis",2),d([(0,f.property)({attribute:!1})],v.prototype,"references",2),d([(0,f.property)({attribute:!1})],v.prototype,"annotations",2),d([(0,f.property)({type:Boolean,reflect:!0})],v.prototype,"labels",2),d([(0,f.property)()],v.prototype,"curve",2),d([(0,f.property)({type:Boolean,attribute:"connect-nulls"})],v.prototype,"connectNulls",2),d([(0,f.property)()],v.prototype,"nulls",2),d([(0,f.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],v.prototype,"stacked",2),d([(0,f.property)({attribute:"stack-offset"})],v.prototype,"stackOffset",2),d([(0,f.property)()],v.prototype,"orientation",2),d([(0,f.property)({type:Number})],v.prototype,"radius",2),d([(0,f.property)({type:Number,attribute:"bar-gap"})],v.prototype,"barGap",2),d([(0,f.property)({type:Number,attribute:"bar-width"})],v.prototype,"barWidth",2),d([(0,f.property)()],v.prototype,"sort",2),d([(0,f.property)()],v.prototype,"transform",2),d([(0,f.property)({attribute:!1})],v.prototype,"transforms",2),d([(0,f.property)({type:Number})],v.prototype,"bins",2),d([(0,f.property)({type:Number,attribute:"bin-width"})],v.prototype,"binWidth",2),d([(0,f.property)({attribute:!1})],v.prototype,"binDomain",2),d([(0,f.property)({attribute:"bin-mode"})],v.prototype,"binMode",2),d([(0,f.property)({attribute:!1})],v.prototype,"sampling",2),d([(0,f.property)({type:Boolean,reflect:!0})],v.prototype,"brush",2),d([(0,f.property)({type:Boolean,reflect:!0})],v.prototype,"crosshair",2);var rn=e=>e.defs&&e.defs.length?g.svg`<defs>${e.defs.map(n=>g.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=>g.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,x.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:g.nothing,he=e=>g.svg`${e.map((n,t)=>{let r=n.title?g.svg`<title>${n.title}</title>`:g.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return g.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,x.ifDefined)(n.stroke)} stroke-width=${(0,x.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,x.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,x.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,x.ifDefined)(n.dash)} opacity=${(0,x.ifDefined)(n.opacity)} fill-opacity=${(0,x.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return g.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,x.ifDefined)(n.rx)} style=${(0,x.ifDefined)(ae(n.part)?`rx:${ae(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,x.ifDefined)(n.stroke)} fill-opacity=${(0,x.ifDefined)(n.opacity)} pointer-events=${(0,x.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return g.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,x.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,x.ifDefined)(n.dash)} opacity=${(0,x.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return g.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,x.ifDefined)(n.stroke)} opacity=${(0,x.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return g.svg`<text aria-label=${(0,x.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,x.ifDefined)(n.anchor)} dominant-baseline=${(0,x.ifDefined)(n.baseline)} fill=${(0,x.ifDefined)(n.fill)} font-weight=${(0,x.ifDefined)(n.weight)} pointer-events=${(0,x.ifDefined)(i===void 0?"none":void 0)} transform=${(0,x.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var P=class extends b{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:a}=this;return this.root(rt({...this.sized(),dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:a}),"parallel",this.label??"Parallel coordinates chart")}};d([(0,F.property)({attribute:!1})],P.prototype,"dimensions",2),d([(0,F.property)({attribute:!1})],P.prototype,"data",2),d([(0,F.property)({type:Number})],P.prototype,"opacity",2),d([(0,F.property)()],P.prototype,"curve",2),d([(0,F.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],P.prototype,"connectNulls",2),d([(0,F.property)({attribute:!1})],P.prototype,"filters",2),P=d([(0,F.customElement)("skdx-parallel-coordinates-chart")],P);0&&(module.exports={SkdxParallelCoordinatesChart});
112
+ `,u([(0,f.property)({type:Number})],b.prototype,"width",2),u([(0,f.property)({type:Number})],b.prototype,"height",2),u([(0,f.property)()],b.prototype,"label",2),u([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"legend",2),u([(0,f.property)({type:Boolean,attribute:"no-tooltip",converter:nn})],b.prototype,"tooltip",2),u([(0,f.property)({attribute:!1})],b.prototype,"format",2),u([(0,f.property)({attribute:!1})],b.prototype,"palette",2),u([(0,f.property)({attribute:!1})],b.prototype,"hiddenSeries",2),u([(0,f.property)({attribute:!1})],b.prototype,"selected",2),u([(0,f.property)({attribute:"selection-mode"})],b.prototype,"selectionMode",2),u([(0,f.property)({attribute:!1})],b.prototype,"highlighted",2),u([(0,f.property)({attribute:!1})],b.prototype,"highlightScope",2),u([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"loading",2),u([(0,f.property)()],b.prototype,"error",2),u([(0,f.property)({attribute:"empty-message"})],b.prototype,"emptyMessage",2),u([(0,f.property)()],b.prototype,"description",2),u([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"decorative",2),u([(0,f.property)({type:Boolean,attribute:"accessible-table"})],b.prototype,"accessibleTable",2),u([(0,f.property)({attribute:!1})],b.prototype,"zoom",2),u([(0,f.property)({attribute:!1})],b.prototype,"view",2),u([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"zoomable",2),u([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"editable",2),u([(0,f.property)({attribute:"sync-id"})],b.prototype,"syncId",2),u([(0,f.property)({type:Boolean,attribute:"cross-filter"})],b.prototype,"crossFilter",2),u([(0,f.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],b.prototype,"animated",2),u([(0,f.property)({type:Boolean,reflect:!0})],b.prototype,"responsive",2),u([(0,f.state)()],b.prototype,"tip",2),u([(0,f.state)()],b.prototype,"overlay",2),u([(0,f.state)()],b.prototype,"portal",2),u([(0,f.state)()],b.prototype,"measured",2),u([(0,f.state)()],b.prototype,"viewState",2),u([(0,f.state)()],b.prototype,"highlightState",2),u([(0,f.state)()],b.prototype,"crossState",2),u([(0,f.state)()],b.prototype,"focused",2),u([(0,f.state)()],b.prototype,"hiddenState",2),u([(0,f.state)()],b.prototype,"zoomState",2),u([(0,f.state)()],b.prototype,"selectedState",2);var v=class extends b{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:d,connectNulls:h,nulls:p,stacked:S,stackOffset:$,orientation:k,radius:M,barGap:C,barWidth:T,sort:L,transform:J,transforms:m,bins:O,binWidth:I,binDomain:z,binMode:D,sampling:A,brush:R,crosshair:pe}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:d,connectNulls:h,nulls:p,stacked:S,stackOffset:$,orientation:k,radius:M,barGap:C,barWidth:T,sort:L,transform:J,transforms:m,bins:O,binWidth:I,binDomain:z,binMode:D,sampling:A,brush:R,crosshair:pe,...this.compactOverrides()}}};u([(0,f.property)({attribute:!1})],v.prototype,"series",2),u([(0,f.property)({attribute:!1})],v.prototype,"categories",2),u([(0,f.property)({attribute:!1})],v.prototype,"xAxis",2),u([(0,f.property)({attribute:!1})],v.prototype,"yAxis",2),u([(0,f.property)({attribute:!1})],v.prototype,"rightAxis",2),u([(0,f.property)({attribute:!1})],v.prototype,"references",2),u([(0,f.property)({attribute:!1})],v.prototype,"annotations",2),u([(0,f.property)({type:Boolean,reflect:!0})],v.prototype,"labels",2),u([(0,f.property)()],v.prototype,"curve",2),u([(0,f.property)({type:Boolean,attribute:"connect-nulls"})],v.prototype,"connectNulls",2),u([(0,f.property)()],v.prototype,"nulls",2),u([(0,f.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],v.prototype,"stacked",2),u([(0,f.property)({attribute:"stack-offset"})],v.prototype,"stackOffset",2),u([(0,f.property)()],v.prototype,"orientation",2),u([(0,f.property)({type:Number})],v.prototype,"radius",2),u([(0,f.property)({type:Number,attribute:"bar-gap"})],v.prototype,"barGap",2),u([(0,f.property)({type:Number,attribute:"bar-width"})],v.prototype,"barWidth",2),u([(0,f.property)()],v.prototype,"sort",2),u([(0,f.property)()],v.prototype,"transform",2),u([(0,f.property)({attribute:!1})],v.prototype,"transforms",2),u([(0,f.property)({type:Number})],v.prototype,"bins",2),u([(0,f.property)({type:Number,attribute:"bin-width"})],v.prototype,"binWidth",2),u([(0,f.property)({attribute:!1})],v.prototype,"binDomain",2),u([(0,f.property)({attribute:"bin-mode"})],v.prototype,"binMode",2),u([(0,f.property)({attribute:!1})],v.prototype,"sampling",2),u([(0,f.property)({type:Boolean,reflect:!0})],v.prototype,"brush",2),u([(0,f.property)({type:Boolean,reflect:!0})],v.prototype,"crosshair",2);var rn=e=>e.defs&&e.defs.length?g.svg`<defs>${e.defs.map(n=>g.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=>g.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,x.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:g.nothing,he=e=>g.svg`${e.map((n,t)=>{let r=n.title?g.svg`<title>${n.title}</title>`:g.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return g.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,x.ifDefined)(n.stroke)} stroke-width=${(0,x.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,x.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,x.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,x.ifDefined)(n.dash)} opacity=${(0,x.ifDefined)(n.opacity)} fill-opacity=${(0,x.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return g.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,x.ifDefined)(n.rx)} style=${(0,x.ifDefined)(ae(n.part)?`rx:${ae(n.part)}`:void 0)} fill=${n.fill} stroke=${(0,x.ifDefined)(n.stroke)} fill-opacity=${(0,x.ifDefined)(n.opacity)} pointer-events=${(0,x.ifDefined)(n.part==="stage-label-background"||n.part==="label-background"?"none":void 0)}>${r}</rect>`;case"line":return g.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,x.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,x.ifDefined)(n.dash)} opacity=${(0,x.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return g.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,x.ifDefined)(n.stroke)} opacity=${(0,x.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return g.svg`<text aria-label=${(0,x.ifDefined)(n.title)} data-skdx-part=${n.part} data-skdx-i=${(0,x.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,x.ifDefined)(n.anchor)} dominant-baseline=${(0,x.ifDefined)(n.baseline)} fill=${(0,x.ifDefined)(n.fill)} font-weight=${(0,x.ifDefined)(n.weight)} pointer-events=${(0,x.ifDefined)(i===void 0?"none":void 0)} transform=${(0,x.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var P=class extends b{constructor(){super(...arguments);this.dimensions=[];this.data=[];this.connectNulls=!1}render(){let{dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:a}=this;return this.root(rt({...this.sized(),dimensions:t,data:r,opacity:i,curve:o,connectNulls:s,filters:a,...this.compactOverrides()}),"parallel",this.label??"Parallel coordinates chart")}};u([(0,F.property)({attribute:!1})],P.prototype,"dimensions",2),u([(0,F.property)({attribute:!1})],P.prototype,"data",2),u([(0,F.property)({type:Number})],P.prototype,"opacity",2),u([(0,F.property)()],P.prototype,"curve",2),u([(0,F.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],P.prototype,"connectNulls",2),u([(0,F.property)({attribute:!1})],P.prototype,"filters",2),P=u([(0,F.customElement)("skdx-parallel-coordinates-chart")],P);0&&(module.exports={SkdxParallelCoordinatesChart});
@@ -1,2 +1,3 @@
1
1
  import 'lit';
2
- export { az as SkdxParallelCoordinatesChart } from './index-H-_fLjtt.cjs';
2
+ import './types-DPf3PUs2.cjs';
3
+ export { y as SkdxParallelCoordinatesChart } from './index-Hexgp_4S.cjs';
@@ -1,2 +1,3 @@
1
1
  import 'lit';
2
- export { az as SkdxParallelCoordinatesChart } from './index-H-_fLjtt.js';
2
+ import './types-DPf3PUs2.js';
3
+ export { y as SkdxParallelCoordinatesChart } from './index-pqdWxinA.js';