@skdx/web-components-charts 0.38.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 (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/area.cjs +109 -0
  4. package/dist/area.d.cts +2 -0
  5. package/dist/area.d.ts +2 -0
  6. package/dist/area.js +109 -0
  7. package/dist/bar.cjs +109 -0
  8. package/dist/bar.d.cts +2 -0
  9. package/dist/bar.d.ts +2 -0
  10. package/dist/bar.js +109 -0
  11. package/dist/boxplot.cjs +109 -0
  12. package/dist/boxplot.d.cts +2 -0
  13. package/dist/boxplot.d.ts +2 -0
  14. package/dist/boxplot.js +109 -0
  15. package/dist/bubble.cjs +109 -0
  16. package/dist/bubble.d.cts +2 -0
  17. package/dist/bubble.d.ts +2 -0
  18. package/dist/bubble.js +109 -0
  19. package/dist/bullet.cjs +109 -0
  20. package/dist/bullet.d.cts +2 -0
  21. package/dist/bullet.d.ts +2 -0
  22. package/dist/bullet.js +109 -0
  23. package/dist/bump.cjs +109 -0
  24. package/dist/bump.d.cts +2 -0
  25. package/dist/bump.d.ts +2 -0
  26. package/dist/bump.js +109 -0
  27. package/dist/candlestick.cjs +109 -0
  28. package/dist/candlestick.d.cts +2 -0
  29. package/dist/candlestick.d.ts +2 -0
  30. package/dist/candlestick.js +109 -0
  31. package/dist/chord.cjs +109 -0
  32. package/dist/chord.d.cts +2 -0
  33. package/dist/chord.d.ts +2 -0
  34. package/dist/chord.js +109 -0
  35. package/dist/circle-packing.cjs +109 -0
  36. package/dist/circle-packing.d.cts +2 -0
  37. package/dist/circle-packing.d.ts +2 -0
  38. package/dist/circle-packing.js +109 -0
  39. package/dist/combo.cjs +109 -0
  40. package/dist/combo.d.cts +2 -0
  41. package/dist/combo.d.ts +2 -0
  42. package/dist/combo.js +109 -0
  43. package/dist/dumbbell.cjs +109 -0
  44. package/dist/dumbbell.d.cts +2 -0
  45. package/dist/dumbbell.d.ts +2 -0
  46. package/dist/dumbbell.js +109 -0
  47. package/dist/funnel.cjs +109 -0
  48. package/dist/funnel.d.cts +2 -0
  49. package/dist/funnel.d.ts +2 -0
  50. package/dist/funnel.js +109 -0
  51. package/dist/gantt.cjs +109 -0
  52. package/dist/gantt.d.cts +2 -0
  53. package/dist/gantt.d.ts +2 -0
  54. package/dist/gantt.js +109 -0
  55. package/dist/gauge.cjs +109 -0
  56. package/dist/gauge.d.cts +2 -0
  57. package/dist/gauge.d.ts +2 -0
  58. package/dist/gauge.js +109 -0
  59. package/dist/heatmap.cjs +109 -0
  60. package/dist/heatmap.d.cts +2 -0
  61. package/dist/heatmap.d.ts +2 -0
  62. package/dist/heatmap.js +109 -0
  63. package/dist/histogram.cjs +109 -0
  64. package/dist/histogram.d.cts +2 -0
  65. package/dist/histogram.d.ts +2 -0
  66. package/dist/histogram.js +109 -0
  67. package/dist/icicle.cjs +109 -0
  68. package/dist/icicle.d.cts +2 -0
  69. package/dist/icicle.d.ts +2 -0
  70. package/dist/icicle.js +109 -0
  71. package/dist/index-oF5ss8v9.d.cts +2331 -0
  72. package/dist/index-oF5ss8v9.d.ts +2331 -0
  73. package/dist/index.cjs +109 -0
  74. package/dist/index.d.cts +29 -0
  75. package/dist/index.d.ts +29 -0
  76. package/dist/index.js +109 -0
  77. package/dist/line.cjs +109 -0
  78. package/dist/line.d.cts +2 -0
  79. package/dist/line.d.ts +2 -0
  80. package/dist/line.js +109 -0
  81. package/dist/linear-gauge.cjs +109 -0
  82. package/dist/linear-gauge.d.cts +2 -0
  83. package/dist/linear-gauge.d.ts +2 -0
  84. package/dist/linear-gauge.js +109 -0
  85. package/dist/map.cjs +109 -0
  86. package/dist/map.d.cts +2 -0
  87. package/dist/map.d.ts +2 -0
  88. package/dist/map.js +109 -0
  89. package/dist/marimekko.cjs +109 -0
  90. package/dist/marimekko.d.cts +2 -0
  91. package/dist/marimekko.d.ts +2 -0
  92. package/dist/marimekko.js +109 -0
  93. package/dist/network.cjs +109 -0
  94. package/dist/network.d.cts +2 -0
  95. package/dist/network.d.ts +2 -0
  96. package/dist/network.js +109 -0
  97. package/dist/organization.cjs +109 -0
  98. package/dist/organization.d.cts +2 -0
  99. package/dist/organization.d.ts +2 -0
  100. package/dist/organization.js +109 -0
  101. package/dist/parallel.cjs +109 -0
  102. package/dist/parallel.d.cts +2 -0
  103. package/dist/parallel.d.ts +2 -0
  104. package/dist/parallel.js +109 -0
  105. package/dist/pareto.cjs +109 -0
  106. package/dist/pareto.d.cts +2 -0
  107. package/dist/pareto.d.ts +2 -0
  108. package/dist/pareto.js +109 -0
  109. package/dist/pie.cjs +109 -0
  110. package/dist/pie.d.cts +2 -0
  111. package/dist/pie.d.ts +2 -0
  112. package/dist/pie.js +109 -0
  113. package/dist/polar-area.cjs +109 -0
  114. package/dist/polar-area.d.cts +2 -0
  115. package/dist/polar-area.d.ts +2 -0
  116. package/dist/polar-area.js +109 -0
  117. package/dist/radar.cjs +109 -0
  118. package/dist/radar.d.cts +2 -0
  119. package/dist/radar.d.ts +2 -0
  120. package/dist/radar.js +109 -0
  121. package/dist/radial.cjs +109 -0
  122. package/dist/radial.d.cts +2 -0
  123. package/dist/radial.d.ts +2 -0
  124. package/dist/radial.js +109 -0
  125. package/dist/range.cjs +109 -0
  126. package/dist/range.d.cts +2 -0
  127. package/dist/range.d.ts +2 -0
  128. package/dist/range.js +109 -0
  129. package/dist/sankey.cjs +109 -0
  130. package/dist/sankey.d.cts +2 -0
  131. package/dist/sankey.d.ts +2 -0
  132. package/dist/sankey.js +109 -0
  133. package/dist/scatter.cjs +109 -0
  134. package/dist/scatter.d.cts +2 -0
  135. package/dist/scatter.d.ts +2 -0
  136. package/dist/scatter.js +109 -0
  137. package/dist/sparkline.cjs +109 -0
  138. package/dist/sparkline.d.cts +2 -0
  139. package/dist/sparkline.d.ts +2 -0
  140. package/dist/sparkline.js +109 -0
  141. package/dist/sunburst.cjs +109 -0
  142. package/dist/sunburst.d.cts +2 -0
  143. package/dist/sunburst.d.ts +2 -0
  144. package/dist/sunburst.js +109 -0
  145. package/dist/swarm.cjs +109 -0
  146. package/dist/swarm.d.cts +2 -0
  147. package/dist/swarm.d.ts +2 -0
  148. package/dist/swarm.js +109 -0
  149. package/dist/timeline.cjs +109 -0
  150. package/dist/timeline.d.cts +2 -0
  151. package/dist/timeline.d.ts +2 -0
  152. package/dist/timeline.js +109 -0
  153. package/dist/tree.cjs +109 -0
  154. package/dist/tree.d.cts +2 -0
  155. package/dist/tree.d.ts +2 -0
  156. package/dist/tree.js +109 -0
  157. package/dist/treemap.cjs +109 -0
  158. package/dist/treemap.d.cts +2 -0
  159. package/dist/treemap.d.ts +2 -0
  160. package/dist/treemap.js +109 -0
  161. package/dist/waffle.cjs +109 -0
  162. package/dist/waffle.d.cts +2 -0
  163. package/dist/waffle.d.ts +2 -0
  164. package/dist/waffle.js +109 -0
  165. package/dist/waterfall.cjs +109 -0
  166. package/dist/waterfall.d.cts +2 -0
  167. package/dist/waterfall.d.ts +2 -0
  168. package/dist/waterfall.js +109 -0
  169. package/package.json +76 -0
package/dist/range.cjs ADDED
@@ -0,0 +1,109 @@
1
+ "use strict";var Ye=Object.defineProperty;var Kn=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Zr=Object.prototype.hasOwnProperty;var Er=(e,n)=>{for(var t in n)Ye(e,t,{get:n[t],enumerable:!0})},Ur=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Wr(n))!Zr.call(e,i)&&i!==t&&Ye(e,i,{get:()=>n[i],enumerable:!(r=Kn(n,i))||r.enumerable});return e};var Kr=e=>Ur(Ye({},"__esModule",{value:!0}),e),g=(e,n,t,r)=>{for(var i=r>1?void 0:r?Kn(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&&Ye(n,t,i),i};var Li={};Er(Li,{SkdxRangeChart:()=>Y});module.exports=Kr(Li);var ee=require("lit/decorators.js");var qn=e=>Number(e.toPrecision(12)),qr,Xn=e=>(qr??(qr=new Intl.NumberFormat)).format(qn(e)),Xr=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 Me(e){if(e===void 0)return Xn;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,l=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},c=u=>{let h=new Intl.NumberFormat(t,u);return s(b=>h.format(qn(b)))},d=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return b=>h.format(b)};switch(n){case"integer":return c({maximumFractionDigits:0});case"decimal":return c(l(2));case"percent":return c({style:"percent",...l(0)});case"currency":return c({style:"currency",currency:e.currency??"USD",...l()});case"compact":return c({notation:"compact",...l(1)});case"scientific":return c({notation:"scientific",...l(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Xr)}}function Qe(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?Me(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):Xn(t)}var se=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function Se([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function ge(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,l=Math.floor(e/s)*s,c=Math.ceil(n/s)*s,d=[];for(let u=l;u<=c+s/2;u+=s)d.push(Qn(u));return d}function Yn(e,[n,t],r=.2){let i=e===0?0:(t-n)/e,o=i*(1-Math.max(0,Math.min(.9,r)));return{step:i,bandwidth:o,start:s=>n+s*i+(i-o)/2,center:s=>n+(s+.5)*i}}var Qn=e=>Number(e.toPrecision(12)),m=e=>Number(e.toFixed(2)),I=e=>typeof e=="number"&&Number.isFinite(e),ae=e=>e.filter(I);function le(e){let n=1/0,t=-1/0;for(let r of e)I(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function xe(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let d=`M${t.x} ${t.y}`;for(let u=1;u<e.length;u++){let h=e[u-1],b=e[u];n==="stepAfter"?d+=`H${b.x}V${b.y}`:n==="stepBefore"?d+=`V${b.y}H${b.x}`:d+=`H${m((h.x+b.x)/2)}V${b.y}H${b.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((d,u)=>d.x-e[u].x),o=e.slice(1).map((d,u)=>d.y-e[u].y),s=i.map((d,u)=>d===0?0:o[u]/d),l=[s[0]];for(let d=1;d<r-1;d++){let u=s[d-1],h=s[d];l.push(u*h<=0?0:(u+h)/2)}l.push(s[r-2]);for(let d=0;d<r-1;d++){let u=s[d];if(u===0){l[d]=0,l[d+1]=0;continue}let h=l[d]/u,b=l[d+1]/u,v=Math.hypot(h,b);v>3&&(l[d]=3*h*u/v,l[d+1]=3*b*u/v)}let c=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let u=e[d],h=e[d+1],b=i[d]/3;c+=`C${m(u.x+b)} ${m(u.y+b*l[d])} ${m(h.x-b)} ${m(h.y-b*l[d+1])} ${h.x} ${h.y}`}return c}var Ve=1e3,Be=60*Ve,Pe=60*Be,Ne=24*Pe,Yr=[Ve,5*Ve,15*Ve,30*Ve,Be,5*Be,15*Be,30*Be,Pe,3*Pe,6*Pe,12*Pe,Ne,2*Ne,7*Ne,14*Ne];function Jn(e,n,t=6){if(!(n>e))return[e];let r=n-e,i=Yr.find(h=>r/h<=t),o=[];if(i!==void 0){for(let h=Math.ceil(e/i)*i;h<=n;h+=i)o.push(h);return o.length?o:[e,n]}let s=r/(30*Ne),l=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,c=new Date(e),d=c.getUTCFullYear(),u=Math.ceil((c.getUTCMonth()+(c.getUTCDate()>1?1:0))/l)*l;for(let h=Date.UTC(d,u,1);h<=n;)o.push(h),u+=l,u>=12&&(d+=Math.floor(u/12),u%=12),h=Date.UTC(d,u,1);return o.length?o:[e,n]}function er(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),i=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let l of i)o.push(Qn(l*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function Je(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((c,d)=>c-d);let[t,r]=n.domain??le(e),i=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(i)+1)),s=n.binWidth??(r>t?(r-t)/o:1),l=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:l+1},(c,d)=>Number((t+d*s).toPrecision(12)))}function et(e,n){let t=[];for(let o=0;o+1<n.length;o++)t.push({x0:n[o],x1:n[o+1],count:0});if(t.length===0)return t;let r=n[0],i=n[n.length-1];for(let o of ae(e)){if(o<r||o>i)continue;let s=0,l=t.length-1;for(;s<l;){let c=s+l+1>>1;t[c].x0<=o?s=c:l=c-1}t[s].count++}return t}var Qr=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Jr=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,ei={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function ti(e,n,t){return e.replace(Jr,(r,i,o)=>{let s=ei[i];if(s===void 0)return i+o;let c=(o.match(Qr)??[]).map((d,u)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let b=u%s;return s===7?b===5?String(h+n):b===6?String(h+t):d:String(b%2===0?h+n:h+t)});return i+c.join(" ")})}var tr=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:ti(r.d,n,t)}}});var At=["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)"))),B={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)"},tt=(e="neutral")=>e==="neutral"?B.axis:`var(--skdx-color-${e}-500)`,Ot=(e="neutral")=>e==="neutral"?B.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,nr=(e,n)=>n??At[e%At.length];var ne={top:16,right:16,bottom:32,left:48};function rr(e,n,t=ne){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 De(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Lt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var ir=e=>e.crosshair===!0||Lt(e).trigger==="axis",nt=20,ni=120,or=e=>{let n=De(e);return n&&(n.position==="left"||n.position==="right")?n.width??ni:0},Rt=(e,n=600,t=300)=>({width:(e.width??n)-or(e),height:(e.height??t)-(De(e)?.position==="bottom"?nt:0)}),sr=e=>{let n=De(e);return n&&(n.position===void 0||n.position==="top")?nt:0},ce=6.5,ar=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:nr(n)),lr=(e,n)=>e.hiddenSeries?.includes(n)??!1;function zt(e,n,t=[],r={},i=10,o=8,s=!1){let l=[],c=r.maxItems,d=c!==void 0&&c>=0&&e.length>c?e.slice(0,c):e,u=e.length-d.length,h=r.interactive??!0,b=o,v=i,y=(p,S,k,f)=>{let M=(S?18:4)+p.length*ce;b>o&&(s||b+M>n-8)&&(b=o,v+=nt),S&&l.push({kind:"rect",part:"legend-swatch",x:b,y:v-5,width:10,height:10,fill:S,opacity:f?.3:void 0,item:k}),l.push({kind:"text",part:"legend-label",x:b+(S?14:0),y:v,text:p,baseline:"middle",fill:f?B.grid:B.label,item:k}),b+=M+12};for(let p of d){let S=t.includes(p.name),k=h?{label:p.name,series:p.name,legend:!0}:void 0;y(r.formatter?.(p.name)??p.name,p.color,k,S)}return u>0&&y(`+${u} more`,void 0,void 0,!1),r.align==="end"?ri(l,n):l}function ri(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(l=>l.kind==="rect"?l.x+l.width:l.x+l.text.length*ce)),s=n-8-o;for(let l of i)r.push({...l,x:l.x+s})}return r}var ii=(e,n,t={})=>new Set(zt(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Vt(e,n,t,r=[]){let i=De(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=Lt(e),l=o?.position==="bottom",c=or(e),d=e.hiddenSeries??[],u=o?c?zt(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):zt(r,n,d,o,l?t+10:10):[],h=l?ii(r,n,o):0;return{width:n+c,height:l?t+Math.max(1,h)*nt:t,legendOffset:o?.position==="left"?c:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function Bt(e){let n=e.legendOffset;if(!n)return e;let t=[...tr(e.shapes.filter(c=>!c.part.startsWith("legend-")),n,0),...e.shapes.filter(c=>c.part.startsWith("legend-"))],r=c=>({...c,x:c.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(c=>c+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:c=>o.scale(c)+n,invert:c=>o.invert(c-n),bars:o.bars.map(c=>({...c,x0:c.x0+n,x1:c.x1+n}))}:void 0,l=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:l,legendOffset:void 0}}function rt(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],l=Math.max(...s.map(b=>b.length))*ce+12,c=6+s.length*16,d=o==="top"?{x:e-l/2,y:n-c-8}:o==="bottom"?{x:e-l/2,y:n+8}:o==="left"?{x:e-l-8,y:n-c/2}:o==="right"?{x:e+8,y:n-c/2}:{x:e+12,y:n-c-6},u=Math.max(0,Math.min(r-l,d.x)),h=Math.max(0,Math.min(i-c,d.y));return[{kind:"rect",part:"tooltip",x:m(u),y:m(h),width:m(l),height:c,fill:"var(--skdx-color-surface-raised)",stroke:B.axis,rx:3},...s.map((b,v)=>({kind:"text",part:"tooltip-label",x:m(u+6),y:m(h+11+v*16),text:b,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:s.length>1&&v===0?"bold":void 0}))]}function cr([e,n],t,r=!1,i){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=Me(o.format??i),l=o.min??e,c=o.max??n;o.reversed&&(t=[t[1],t[0]]);let d={id:o.id,position:o.position,options:o};if(o.scale==="sqrt"){let p=O=>Math.sign(O)*Math.sqrt(Math.abs(O)),S=o.nice===!1?[l,c]:ge(l,c,o.ticks),k=o.min??S[0],f=o.max??S[S.length-1],M=Se([p(k),p(f)],t),A=O=>M(p(O)),w=ge(k,f,o.ticks).filter(O=>O>=k-1e-9&&O<=f+1e-9);return{...d,scale:A,domain:[k,f],format:s,ticks:(w.length>=2?w:[k,f]).map(O=>({pos:m(A(O)),label:s(O)})),zero:m(A(Math.min(Math.max(0,k),f)))}}if(o.scale==="log"){let p=Math.max(l,Number.EPSILON),S=Math.max(c,p),k=er(p,S),f=[Math.log10(p),Math.log10(S)],M=Se(f,t),A=w=>M(Math.log10(Math.max(w,Number.EPSILON)));return{...d,scale:A,domain:f,format:s,ticks:k.map(w=>({pos:m(A(w)),label:s(w)})),zero:m(t[0])}}let u=ge(l,c,o.ticks),h=[o.min??(o.nice===!1?l:u[0]),o.max??(o.nice===!1?c:u[u.length-1])],b=Se(h,t),v=u.filter(p=>p>=h[0]-1e-9&&p<=h[1]+1e-9),y=(v.length>=2?v:[h[0],h[1]]).map(p=>({pos:m(b(p)),label:s(p)}));return{...d,scale:b,domain:h,format:s,ticks:y,zero:m(b(Math.min(Math.max(0,h[0]),h[1])))}}var dr=e=>e?.grid!==!1;function it(e,n){if(e.length<2)return e;let t=e.reduce((i,o)=>Math.max(i,o.label.length),0)*ce+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((i,o)=>o%r===0)}var Pt=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function ur(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}=Rt(e,t,r),l=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",c=[];return i==="loading"&&c.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:4}),c.push({kind:"text",part:`state-${i}`,x:m(o/2),y:m(s/2),text:l,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":B.label}),{...Vt(e,o,s),shapes:c,tooltip:!1}}function Nt(e,n={}){let{plot:t,xTicks:r,yTicks:i,baseline:o}=e,s=t.x+t.width,l=t.y+t.height,c=[],d=n.grid??!0,u=(y,p)=>p?{kind:"line",part:"grid",x1:y.pos,x2:y.pos,y1:t.y,y2:l,stroke:B.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:y.pos,y2:y.pos,stroke:B.grid},h=n.x?.tickRotation??0,b=(y,p,S,k)=>h?X(y,p,S,{part:k,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):X(y,p,S,{part:k,anchor:"middle"}),v=(y,p,S,k,f)=>{for(let M of y)c.push(p==="x"?{kind:"line",part:"tick",x1:M.pos,x2:M.pos,y1:S,y2:m(S+k*f),stroke:B.axis}:{kind:"line",part:"tick",x1:S,x2:m(S+k*f),y1:M.pos,y2:M.pos,stroke:B.axis})};if(n.categoryGrid)for(let y of r)c.push(u(y,!n.horizontal));if(n.horizontal){let y=n.axes??[{ticks:i,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let p of i)c.push(u(p,!0));y[0]?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:l,stroke:B.axis});for(let p of y){let S=p.position==="top"||p.position==="right",k=m(S?t.y-p.offset:l+p.offset),f=S||p.offset>0;p.showLine&&f&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:k,y2:k,stroke:B.axis}),p.showTicks&&v(p.ticks,"x",k,S?-1:1,p.tickSize??4);let M=m(S?k-8:k+20);for(let A of p.ticks)c.push(S?X(A.pos,M,A.label,{part:"x-label-top",anchor:"middle"}):b(A.pos,M,A.label,"x-label"));p.label&&c.push(f?X(4,M,p.label,{part:"axis-title",anchor:"start",baseline:S?void 0:"middle"}):X(4,t.y-6,p.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&c.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:l,stroke:B.axis}),n.x?.showTicks&&v(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let p of r)c.push(n.rtl?X(s+8,p.pos,p.label,{part:"y-label",anchor:"start",baseline:"middle"}):X(t.x-8,p.pos,p.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let p of i)c.push(u(p,!1));n.y?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:B.axis});let y=n.axes??[{ticks:i,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let p of y){let S=p.position==="left",k=S?t.x-p.offset:s+p.offset,f=S?"y-label":"y-label-right";p.showLine&&c.push({kind:"line",part:"axis",x1:m(k),x2:m(k),y1:t.y,y2:l,stroke:B.axis}),p.showTicks&&v(p.ticks,"y",m(k),S?-1:1,p.tickSize??4);for(let M of p.ticks)c.push(X(m(S?k-8:k+8),M.pos,M.label,{part:f,anchor:S?"end":"start",baseline:"middle"}));p.label&&c.push(X(m(S?p.offset===0?4:Math.max(4,k-40):p.offset===0?e.width-4:Math.min(e.width-4,k+40)),t.y-6,p.label,{part:"axis-title",anchor:S?"start":"end"}))}n.x?.showTicks&&v(r,"x",l,1,n.x.tickSize??4);for(let p of r)c.push(b(p.pos,l+(h?12:20),p.label,"x-label"))}return n.xLabel&&c.push(X(m(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&c.push(X(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),c}var X=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:B.label,...r}),Ge=(e,n,t,r,i,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:i,item:o});function Dt(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height,s=c=>Math.max(r.x,Math.min(i,c)),l=c=>Math.max(r.y,Math.min(o,c));for(let c of e??[]){let d=c.color??tt(c.variant),u=c.color??Ot(c.variant),h={part:"reference-label",fill:u},b=n.horizontal===!0;if("y"in c){let v=m(n.y(c.y,c.axis??"left"));if(b){let y=s(v);t.push(...fr(y,r.y,o,d,c.label,h))}else{let y=l(v);t.push(...hr(r.x,i,y,d,c.label,h))}}else if("x"in c){let v=n.x(c.x);if(v===void 0)continue;b?t.push(...hr(r.x,i,l(m(v)),d,c.label,h)):t.push(...fr(s(m(v)),r.y,o,d,c.label,h))}else if("y1"in c){let v=m(n.y(c.y1,c.axis??"left")),y=m(n.y(c.y2,c.axis??"left"));b?t.push(...pr(s(Math.min(v,y)),s(Math.max(v,y)),r,d,c.label,u)):t.push(...mr(l(Math.min(v,y)),l(Math.max(v,y)),r,d,c.label,u))}else{let v=n.x(c.x1),y=n.x(c.x2);if(v===void 0||y===void 0)continue;let p=m(Math.min(v,y)),S=m(Math.max(v,y));b?t.push(...mr(l(p),l(S),r,d,c.label,u)):t.push(...pr(s(p),s(S),r,d,c.label,u))}}return t}function hr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,X(n-4,t-5,i,{...o,anchor:"end"})]:[s]}function fr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,X(e+4,n+10,i,{...o,anchor:"start"})]:[s]}function mr(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:m(Math.max(0,n-e)),fill:r,opacity:.12,title:i};return i?[s,X(t.x+t.width-4,e+12,i,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function pr(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:m(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:i};return i?[s,X(e+4,t.y+12,i,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function br(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let l=s.color??tt(s.variant),c=s.color??Ot(s.variant),d=(y,p,S)=>{let k=n.x(y);if(k===void 0)return;let f=n.y(p,S??"left");return n.horizontal?{x:m(f),y:m(k)}:{x:m(k),y:m(f)}},u=s.id??s.label,h=y=>({label:y,id:u,name:s.label});if(s.type==="line"||s.type==="band"){let{type:y,id:p,...S}=s;t.push(...Dt([S],n));continue}if(s.type==="rect"){let y=d(s.x1,s.y1,s.axis),p=d(s.x2,s.y2,s.axis);if(!y||!p)continue;let S=Math.max(r.x,Math.min(y.x,p.x)),k=Math.max(r.y,Math.min(y.y,p.y)),f=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:m(S),y:m(k),width:m(Math.max(0,Math.min(i,Math.max(y.x,p.x))-S)),height:m(Math.max(0,Math.min(o,Math.max(y.y,p.y))-k)),fill:l,opacity:.12,stroke:l,title:f||void 0,item:f?h(f):void 0}),s.label&&t.push(X(m(S+4),m(k+12),s.label,{part:"annotation-label",fill:c}));continue}let b=d(s.x,s.y,s.axis);if(!b)continue;if(s.type==="text"){t.push(X(b.x,b.y,s.text,{part:"annotation-text",fill:c,anchor:"middle",baseline:"middle",title:s.label}));continue}let v=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:b.x,cy:b.y,r:5,fill:l,stroke:"var(--skdx-color-surface-default)",title:v,item:h(v)}),s.type==="callout"&&s.label){let[y,p]=s.offset??[16,-16],S=m(Math.max(r.x,Math.min(i,b.x+y))),k=m(Math.max(r.y,Math.min(o,b.y+p)));t.push({kind:"line",part:"annotation-leader",x1:b.x,y1:b.y,x2:S,y2:k,stroke:l},X(S,k,s.label,{part:"annotation-label",fill:c,anchor:y>=0?"start":"end",baseline:"middle"}))}}return t}var Gt=2e3;function oi(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:Gt}:typeof e=="string"?{strategy:e,threshold:Gt}:{strategy:e.strategy,threshold:e.threshold??Gt}}function si(e,n){let t=e.length;if(n>=t||n<3)return e.map((l,c)=>c);let r=[0],i=[],o=(t-2)/(n-2),s=0;for(let l=0;l<n-2;l++){let c=Math.floor((l+1)*o)+1,d=Math.min(t-1,Math.floor((l+2)*o)+1),u=0,h=0,b=0;for(let M=c;M<d;M++){let A=e[M];I(A)&&(u+=M,h+=A,b++)}u=b?u/b:(c+d)/2,h=b?h/b:0;let v=Math.floor(l*o)+1,y=Math.min(t-1,Math.floor((l+1)*o)+1),p=e[s],S=I(p)?p:0,k=-1,f=-1;for(let M=v;M<y;M++){let A=e[M];if(!I(A)){i.push(M);continue}let w=Math.abs((s-u)*(A-S)-(s-M)*(h-S));w>f&&(f=w,k=M)}k<0&&(k=v),r.push(k),s=k}return r.push(t-1),i.length?[...new Set([...r,...i])].sort((l,c)=>l-c):r}function ai(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1;for(let h=l;h<c;h++){let b=e[h];if(!I(b)){i.push(h);continue}(d<0||b<e[d])&&(d=h),(u<0||b>e[u])&&(u=h)}d>=0&&i.push(Math.min(d,u)),u>=0&&u!==d&&i.push(Math.max(d,u))}return[...new Set(i)].sort((s,l)=>s-l)}function li(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1,h=-1,b=-1;for(let v=l;v<c;v++){let y=e[v];if(!I(y)){i.push(v);continue}h<0&&(h=v),b=v,(d<0||y<e[d])&&(d=v),(u<0||y>e[u])&&(u=v)}for(let v of[h,d,u,b])v>=0&&i.push(v)}return[...new Set(i)].sort((s,l)=>s-l)}function gr(e,n,t){let r=oi(t);if(!r||n<=r.threshold||e.length===0)return;let i=r.strategy==="minmax"?ai:r.strategy==="m4"?li:si,o=new Set;for(let s of e)for(let l of i(s.slice(0,n),r.threshold))o.add(l);return[...o].sort((s,l)=>s-l)}function xr(e,n,t,r,i,o,s,l){if(r==="circle")return{...Ge(e,n,t,i,o,s),part:l};let c=r==="square"?`M${m(e-t)} ${m(n-t)}h${m(2*t)}v${m(2*t)}h${m(-2*t)}Z`:r==="diamond"?`M${m(e)} ${m(n-t*1.3)}L${m(e+t*1.3)} ${m(n)}L${m(e)} ${m(n+t*1.3)}L${m(e-t*1.3)} ${m(n)}Z`:`M${m(e)} ${m(n-t*1.2)}L${m(e+t*1.15)} ${m(n+t*.9)}L${m(e-t*1.15)} ${m(n+t*.9)}Z`;return{kind:"path",part:l,d:c,fill:i,title:o,item:s}}var ci=e=>{let n=0;return e.map(t=>I(t)?n+=t:null)},di=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)?n-r:null}),ui=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)&&r!==0?(n-r)/Math.abs(r):null});function hi(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,i)=>{if(i<t-1)return null;let o=0;for(let s=i-t+1;s<=i;s++){let l=e[s];if(!I(l))return null;o+=l}return o/t})}function fi(e,n="max"){let t=0;for(let r of e)I(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>I(r)?t===0?0:r/t:null)}function mi(e,n="desc"){let t=e.filter(I).sort((r,i)=>n==="asc"?r-i:i-r);return e.map(r=>I(r)?t.indexOf(r)+1:null)}var pi=(e,n=-1/0,t=1/0)=>e.map(r=>I(r)&&r>=n&&r<=t?r:null),bi=(e,n="asc")=>[...e].sort((t,r)=>I(t)?I(r)?n==="asc"?t-r:r-t:-1:I(r)?1:0);function gi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),i=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(I);if(s.length===0){i.push(null);continue}let l=s.reduce((c,d)=>c+d,0);i.push(t==="sum"?l:t==="mean"?l/s.length:t==="min"?Math.min(...s):Math.max(...s))}return i}function xi(e,n={}){let t=e.filter(I),r=Je(t,n);return{edges:r,counts:et(t,r).map(i=>i.count)}}function Ft(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=ci(t);break;case"difference":t=di(t);break;case"percentageChange":t=ui(t);break;case"movingAverage":t=hi(t,r.window);break;case"normalize":t=fi(t,r.to);break;case"rank":t=mi(t,r.order);break;case"filter":t=pi(t,r.min,r.max);break;case"sort":t=bi(t,r.order);break;case"aggregate":t=gi(t,r.every,r.method);break;case"bin":t=xi(t,r).counts;break}return t}var yi=100,vi=2e3,yr=32,vr=28,st=e=>e.position==="right"||e.position==="top";function ki(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((i,o)=>({...i,id:i.id??(o===0?"left":o===1?"right":String(o)),position:i.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(i=>i.id==="right"||st(i));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(i=>i.axis==="right")&&t.push({id:"right",position:"right"}),t}function wr(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(st))?.id:e.find(r=>r.id===n)?.id}var ot=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function Mr(e,n){let t=Me(e.format),{series:r,categories:i,issues:o,axes:s}=Mi(e,n,t),l=e.direction==="rtl",c=e.baseline??0,d=Math.max(i.length,...r.map(a=>Math.max(a.data.length,a.low.length))),u=r.every(a=>ae(a.data).length===0&&ae(a.high).length===0),h=ur(e,u);if(h)return{...h,issues:o};let b=e.xAxis?.type??"category",v=b!=="category"&&i.length>0&&i.every(a=>typeof a!="string"||b==="time"&&I(se(a))),y=v?i.map(se):[],[p,S]=le(y),k=e.xAxis?.format??(b==="time"?{style:S-p<2*864e5?"time":"date"}:void 0),f=Array.from({length:d},(a,x)=>{let C=i[x];return C===void 0?String(x+1):Qe(C,k)}),M=wi(e.zoom,d),A=Array.from({length:M.end-M.start},(a,x)=>M.start+x),w=e.orientation==="horizontal",_=r.map(a=>({...a,hidden:a.hidden||w&&!ot(a)})).filter(a=>!a.hidden),H=_.some(a=>!ot(a))?gr(_.filter(a=>!ot(a)).map(a=>A.map(x=>(a.kind==="range"?a.high[x]:a.data[x])??null)),A.length,e.sampling):void 0,P=H?H.map(a=>A[a]):A,Q=e.stacked==="percent"||e.stackOffset==="expand",J=e.stackOffset??"zero",re=new Map,he=new Map,ft=new Map;for(let a of _)a.stack!==void 0&&a.kind!=="range"&&ft.set(a.stack,[...ft.get(a.stack)??[],a]);for(let a of ft.values()){let x=new Array(d).fill(c),C=new Array(d).fill(c),j=new Array(d).fill(0);if(Q)for(let N of a)N.data.forEach((z,G)=>{I(z)&&(j[G]=j[G]+Math.abs(z))});for(let N of a){let z=[],G=[];for(let D=0;D<d;D++){let F=N.data[D];if(!I(F)){z.push(null),G.push(null);continue}let R=j[D],T=Q?R>0?F/R:0:F,W=T>=0?x:C;z.push(W[D]),W[D]=W[D]+T,G.push(W[D])}re.set(N,z),he.set(N,G)}if(J==="silhouette"||J==="wiggle"){let N=new Array(d).fill(0);if(J==="silhouette")for(let z=0;z<d;z++)N[z]=-(x[z]-c)/2;else{let z=0;for(let G=0;G<d;G++){let D=a.length,F=0;for(let T=0;T<D;T++){let W=a[T],Z=W.data[G],q=W.data[G-1],te=G>0&&I(Z)&&I(q)?Z-q:0;F+=(D-T-.5)*te}let R=x[G]-c;z=G===0?-R/2:z-(R>0?F/Math.max(1,D):0),N[G]=z}}for(let z of a){let G=re.get(z),D=he.get(z);for(let F=0;F<d;F++){let R=G[F],T=D[F];I(R)&&(G[F]=R+N[F]),I(T)&&(D[F]=T+N[F])}}}}let Mn=a=>a.kind==="range"?{from:a.low,to:a.high}:{from:re.get(a)??new Array(d).fill(c),to:he.get(a)??a.data},Sn=a=>{let x=[],C=!1;for(let z of _){if(z.axis!==a)continue;let{from:G,to:D}=Mn(z);for(let F of P){let R=D[F];if(I(R)&&x.push(R),z.kind==="range"||z.stack!==void 0){let T=G[F];I(T)&&x.push(T)}}if(z.errors)for(let F of P){let R=kr(z.data[F],z.errors[F]);R&&x.push(R[0],R[1])}(z.kind==="bar"||z.kind==="area")&&J==="zero"&&(C=!0)}let[j,N]=le(x);return C?[Math.min(c,j),Math.max(c,N)]:[j,N]},{width:$n,height:Cn}=Rt(e),Br=e.brush?yr+vr:0,In=P.reduce((a,x)=>Math.max(a,f[x].length),0)*ce,Tn=Q?{style:"percent"}:void 0,Pr=a=>{if(a.scale==="log")return ne.left;let[x,C]=Sn(a.id),j=Me(a.format??Tn??e.format),N=ge(a.min??x,a.max??C).reduce((z,G)=>Math.max(z,j(G).length),0);return Math.max(ne.left,N*ce+14)+(a.showTicks?a.tickSize??4:0)},mt=a=>w?st(a)?"top":"bottom":st(a)!==l?"right":"left",An=a=>w?24+(a.showTicks?a.tickSize??4:0):Pr(a),Nr=new Set(_.map(a=>a.axis)),pt=s.filter(a=>Nr.has(a.id)||s.length>1),On=new Map,ye={left:0,right:0,top:0,bottom:0};for(let a of pt){let x=mt(a);On.set(a.id,ye[x]),ye[x]+=An(a)}let zn=pt.find(a=>mt(a)==="bottom"),Dr={top:ne.top+sr(e)+(s.some(a=>a.label)?12:0)+ye.top,right:w?l?Math.max(ne.left,In+16):ne.right:Math.max(ne.right,ye.right),bottom:ne.bottom+Br+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+ye.bottom-(zn?An(zn):0),left:w?l?ne.right:Math.max(ne.left,In+16):Math.max(ne.left,ye.left)},K=rr($n,Cn,Dr),Gr=w?l?[K.x+K.width,K.x]:[K.x,K.x+K.width]:[K.y+K.height,K.y],Ln=w?[K.y,K.y+K.height]:l?[K.x+K.width,K.x]:[K.x,K.x+K.width],bt=new Map(s.map(a=>[a.id,{...cr(Sn(a.id),Gr,{format:Tn,...a},e.format),position:mt(a),offset:On.get(a.id)??0}])),Rn=s[0]?.id,He=bt.get(Rn),gt=a=>bt.get(wr(s,a)??Rn)??He,ie=(a,x)=>gt(x).scale(a),Vn=a=>m(a.scale(Math.min(Math.max(c,Math.min(...a.domain)),Math.max(...a.domain)))),We=Yn(P.length,Ln,e.barGap),xt=P.map(a=>y[a]),yt=[...xt].sort((a,x)=>a-x),ve=1/0;for(let a=1;a<yt.length;a++)ve=Math.min(ve,yt[a]-yt[a-1]);let[ke,Te]=le(xt),oe=ve===1/0?Math.max(1,Math.abs(Te)*.05||1):ve/2,Ae=Se([ke-oe,Te+oe],Ln),Ze=a=>m(v?Ae(xt[a]):We.center(a)),Bn=v?Math.abs(Ae(ke+(ve===1/0?oe:ve))-Ae(ke))*.8:We.bandwidth,Pn=a=>v?Ze(a)-Bn/2:We.start(a),Fr=v?(b==="time"?Jn(ke-oe,Te+oe):ge(ke-oe,Te+oe)).filter(a=>a>=ke-oe&&a<=Te+oe).map(a=>({pos:m(Ae(a)),label:Qe(a,k)})):it(P.map((a,x)=>({pos:Ze(x),label:f[a]})),w?1/0:K.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),vt={...Vt(e,$n,Cn,r.map(a=>({name:a.name,color:a.color}))),plot:K,xTicks:Fr,yTicks:w?it(He.ticks,K.width):He.ticks,baseline:Vn(He)},_r=s[0],Nn=Nt(vt,{horizontal:w,rtl:l,axes:pt.map(a=>{let x=bt.get(a.id);return{ticks:w?it(x.ticks,K.width):x.ticks,position:x.position,offset:x.offset??0,label:a.label,showLine:a.showLine,showTicks:a.showTicks,tickSize:a.tickSize}}),xLabel:e.xAxis?.label,grid:dr(_r),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),jr=a=>{if(typeof a=="number"&&i.every(C=>typeof C=="string"))return a;let x=typeof a=="string"?a:se(a);for(let C=0;C<d;C++){let j=i[C];if(j!==void 0&&(typeof x=="string"?j===x||f[C]===x:se(j)===x))return C}},Dn={plot:K,horizontal:w,x:a=>{if(v&&(typeof a!="string"||I(se(a))))return Ae(se(a));let x=jr(a),C=x===void 0?-1:P.indexOf(x);return C<0?void 0:We.center(C)},y:(a,x)=>ie(a,x)};Nn.push(...Dt(e.references,Dn));let kt=[],wt=new Map;for(let a of _){if(!ot(a))continue;let x=a.stack??a,C=kt.indexOf(x);C<0&&(C=kt.push(x)-1),wt.set(a,C)}let Ee=Bn/Math.max(1,kt.length),fe=Math.min(Ee,e.barWidth??1/0),Gn=(Ee-fe)/2,Mt=[],Ue=[],St=[],$t=[],Ct=[],Fn=[],Ke=[],qe=a=>gt(a.axis).format,It=Math.max(0,e.minBarSize??0),Hr=(a,x,C)=>{let j=Math.abs(x-a);if(j>=It)return[Math.min(a,x),j];let z=a+(w?C?1:-1:C?-1:1)*It;return[Math.min(a,z),It]},Oe=(a,x,C,j)=>({label:j,series:a.name,seriesId:a.id??a.name,category:f[x],index:x,value:C}),_n=(a,x,C,j)=>{let N=kr(j,a.errors?.[x]);if(!N)return;let z=m(ie(N[0],a.axis)),G=m(ie(N[1],a.axis)),D=4,F="var(--skdx-color-text-default)",R=`${a.name}, ${f[x]}: ${qe(a)(N[0])} \u2013 ${qe(a)(N[1])}`;Fn.push(w?{kind:"line",part:"error-bar",x1:z,x2:G,y1:C,y2:C,stroke:F,title:R}:{kind:"line",part:"error-bar",x1:C,x2:C,y1:z,y2:G,stroke:F,title:R},w?{kind:"line",part:"error-cap",x1:z,x2:z,y1:m(C-D),y2:m(C+D),stroke:F}:{kind:"line",part:"error-cap",x1:m(C-D),x2:m(C+D),y1:z,y2:z,stroke:F},w?{kind:"line",part:"error-cap",x1:G,x2:G,y1:m(C-D),y2:m(C+D),stroke:F}:{kind:"line",part:"error-cap",x1:m(C-D),x2:m(C+D),y1:G,y2:G,stroke:F})};for(let a of _){let{from:x,to:C}=Mn(a),j=qe(a),N=P.length<=vi;if(a.kind==="bar"){let R="";P.forEach((T,W)=>{let Z=a.data[T],q=x[T],te=C[T];if(!I(Z)||!I(q)||!I(te))return;let we=ie(q,a.axis),be=ie(te,a.axis),[ze,Le]=Hr(we,be,te>=q),Re=Pn(W)+wt.get(a)*Ee+Gn,Hn=m(w?ze:Re),Wn=m(w?Re:ze),Tt=m(w?Le:fe),Zn=m(w?fe:Le);if(!N){R+=`M${Hn} ${Wn}h${Tt}v${Zn}h${-Tt}Z`;return}let En=Pt(a.name,f[T],Q?te-q:Z,j);if(Ue.push({kind:"rect",part:"bar",x:Hn,y:Wn,width:Tt,height:Zn,fill:a.color,rx:e.radius,title:En,item:Oe(a,T,Z,En)}),_n(a,T,m(Re+fe/2),Z),e.labels){let Un=j(Q?te-q:Z);Ct.push(w?X(m(Math.max(we,be)+4),m(Re+fe/2),Un,{baseline:"middle"}):X(m(Re+fe/2),m(Math.min(we,be)-4),Un,{anchor:"middle"}))}}),R&&Ue.push({kind:"path",part:"bars",d:R,fill:a.color,title:a.name});continue}if(a.kind==="range"&&a.style==="bar"){P.forEach((R,T)=>{let W=x[R],Z=C[R];if(!I(W)||!I(Z))return;let q=ie(Math.min(W,Z),a.axis),te=ie(Math.max(W,Z),a.axis),we=Pn(T)+wt.get(a)*Ee+Gn,be=`${a.name}, ${f[R]}: ${j(Math.min(W,Z))} \u2013 ${j(Math.max(W,Z))}`,ze=Oe(a,R,Z,be),Le=Math.max(1,Math.abs(te-q));Ue.push(w?{kind:"rect",part:"range",x:m(Math.min(q,te)),y:m(we),width:m(Le),height:m(fe),fill:a.color,rx:e.radius,title:N?be:void 0,item:ze}:{kind:"rect",part:"range",x:m(we),y:m(Math.min(q,te)),width:m(fe),height:m(Le),fill:a.color,rx:e.radius,title:N?be:void 0,item:ze})});continue}let z=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,G=[],D=[];P.forEach((R,T)=>{let W=x[R],Z=C[R];if(!I(Z)||!I(W)){!z&&D.length&&(G.push(D),D=[]);return}D.push({x:Ze(T),y:m(ie(Z,a.axis)),y0:m(ie(W,a.axis)),i:R})}),D.length&&G.push(D);let F=a.markers??P.length<=yi;for(let R of G){let T=xe(R,a.curve);if(a.kind==="range"&&a.style==="line"){St.push({kind:"path",part:"range-high",d:T,stroke:a.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:xe(R.map(W=>({x:W.x,y:W.y0})),a.curve),stroke:a.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(a.kind==="range"){let W=xe([...R].reverse().map(Z=>({x:Z.x,y:Z.y0})),a.curve);Mt.push({kind:"path",part:"range",d:`${T}L${W.slice(1)}Z`,fill:a.color,fillOpacity:.2,title:a.name});continue}if(a.kind==="area"){let W=Vn(gt(a.axis)),Z=a.stack!==void 0?xe([...R].reverse().map(te=>({x:te.x,y:te.y0})),a.curve).slice(1):`${R[R.length-1]?.x} ${W}L${R[0]?.x} ${W}`,q=`skdx-g-${a.index}`;a.gradient&&!Ke.some(te=>te.id===q)&&Ke.push({id:q,vertical:!0,stops:[{offset:0,color:a.color,opacity:a.fillOpacity},{offset:1,color:a.color,opacity:0}]}),Mt.push({kind:"path",part:"area",d:`${T}L${Z}Z`,fill:a.gradient?`url(#${q})`:a.color,fillOpacity:a.gradient?void 0:a.fillOpacity})}St.push({kind:"path",part:"line",d:T,stroke:a.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:a.dash})}if(a.kind==="range"&&N)for(let R of G)for(let T of R){let W=a.low[T.i],Z=a.high[T.i],q=`${a.name}, ${f[T.i]}: ${j(Math.min(W,Z))} \u2013 ${j(Math.max(W,Z))}`;$t.push({...Ge(T.x,T.y,.01,a.color,q,Oe(a,T.i,Z,q)),part:"anchor"})}if(a.kind!=="range")for(let R of G)for(let T of R){if(!F&&!N&&!e.labels&&!a.errors)continue;let W=a.data[T.i],Z=Q?C[T.i]-x[T.i]:W,q=Pt(a.name,f[T.i],Z,j);(F||N)&&$t.push(F&&a.symbol!=="circle"?xr(T.x,T.y,a.markerSize,a.symbol,a.color,N?q:void 0,Oe(a,T.i,W,q),"point"):{...Ge(T.x,T.y,F?a.markerSize:.01,a.color,N?q:void 0,Oe(a,T.i,W,q)),part:F?"point":"anchor"}),N&&_n(a,T.i,w?T.y:T.x,C[T.i]),e.labels&&Ct.push(X(T.x,T.y-8,j(Z),{anchor:"middle"}))}}let jn={plot:K,xs:w?[]:P.map((a,x)=>Ze(x)),rows:P.map(a=>[f[a],..._.map(x=>{let C=qe(x);if(x.kind==="range"){let N=x.low[a],z=x.high[a];return`${x.name}: ${I(N)&&I(z)?`${C(N)} \u2013 ${C(z)}`:"\u2014"}`}let j=x.data[a];return`${x.name}: ${I(j)?C(Q?(he.get(x)?.[a]??0)-(re.get(x)?.[a]??0):j):"\u2014"}`})]),count:d,zoom:M,crosshair:ir(e)},Xe=[];if(e.brush&&!w){let a={x:K.x,y:K.y+K.height+vr,width:K.width,height:yr},x=_.find(j=>j.kind!=="range"),C={x:m(a.x+M.start/Math.max(1,d)*a.width),y:a.y,width:m((M.end-M.start)/Math.max(1,d)*a.width),height:a.height};if(Xe.push({kind:"rect",part:"brush",x:a.x,y:a.y,width:a.width,height:a.height,fill:"var(--skdx-color-surface-sunken)",stroke:B.grid}),x){let j=ae(x.data),[N,z]=le(j),G=d>1?a.width/(d-1):0,D=x.data.flatMap((R,T)=>I(R)?[{x:m(a.x+T*G),y:m(a.y+a.height-(z===N?.5:(R-N)/(z-N))*(a.height-4)-2)}]:[]),F=xe(D);D.length>1&&Xe.push({kind:"path",part:"brush-series",d:`${F}L${D[D.length-1]?.x} ${a.y+a.height}L${D[0]?.x} ${a.y+a.height}Z`,fill:x.color,fillOpacity:.3})}Xe.push({kind:"rect",part:"brush-window",...C,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:B.axis},{kind:"rect",part:"brush-handle",x:m(C.x-3),y:a.y+8,width:6,height:a.height-16,fill:B.axis,rx:2},{kind:"rect",part:"brush-handle",x:m(C.x+C.width-3),y:a.y+8,width:6,height:a.height-16,fill:B.axis,rx:2}),jn.brush={box:a,window:C}}return{...vt,shapes:[...Nn,...Mt,...Ue,...St,...Fn,...$t,...Ct,...br(e.annotations,Dn),...Xe,...vt.shapes],hit:jn,issues:o,defs:Ke.length?Ke:void 0}}function kr(e,n){if(!(!I(e)||n===null||n===void 0))return typeof n=="number"?I(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:I(n[0])&&I(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function wi(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function Mi(e,n,t){let r=f=>f.type??n,i=[],o=ki(e),s=e.categories??[],l=(e.transforms??[]).filter(f=>f.type==="sort"||f.type==="bin"||f.type==="aggregate"),c=(e.transforms??[]).filter(f=>!l.includes(f)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",u=(f,M,A)=>{let w=A.filter(O=>O!==null&&!(typeof O=="number"&&Number.isFinite(O))).length;w&&i.push({code:"invalid-value",severity:"warning",message:`Series "${f}" has ${w} value${w===1?"":"s"} that ${w===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:M??f}),s.length&&A.length!==s.length&&!e.transform&&i.push({code:"length-mismatch",severity:"warning",message:`Series "${f}" has ${A.length} values for ${s.length} categories.`,itemId:M??f})},h=e.series.map((f,M)=>{let A=r(f),w=d?!0:void 0,O=f.type==="range"?void 0:f.stack,_=O===!1?void 0:O===!0||O===void 0&&w?`${A}`:O;f.type==="range"?(u(f.name,f.id,f.low),u(f.name,f.id,f.high)):u(f.name,f.id,f.data);let H=Q=>e.nulls==="zero"?Q.map(J=>I(J)?J:0):Q,P=wr(o,f.axis);return P===void 0&&i.push({code:"unknown-axis",severity:"warning",message:`Series "${f.name}" names axis "${String(f.axis)}", which is not defined; drawn on the first axis.`,itemId:f.id??f.name}),{name:f.name,id:f.id,color:ar(e,M,f.color),axis:P??o[0]?.id,hidden:lr(e,f.name),index:M,kind:A,data:f.type==="range"?[]:H(Ft(Ft(f.data,c),f.transforms)),low:f.type==="range"?f.low:[],high:f.type==="range"?f.high:[],curve:f.curve??e.curve??"linear",dash:f.type==="range"?void 0:f.dash,markers:f.type==="range"?void 0:f.markers,symbol:f.type==="range"?"circle":f.symbol??"circle",markerSize:f.type==="range"?3:f.markerSize??3,errors:f.type==="range"?void 0:f.errors,stack:A==="range"||A==="line"?void 0:_,style:f.type==="range"?f.style??"area":"area",fillOpacity:(f.type==="range"?void 0:f.fillOpacity)??e.fillOpacity??.25,gradient:f.type!=="range"&&f.gradient===!0}}),b=()=>Math.max(s.length,...h.map(f=>Math.max(f.data.length,f.low.length))),v=f=>{let M=w=>w.length?f.map(O=>w[O]??null):w,A=Array.from({length:b()},(w,O)=>s[O]??String(O+1));s=f.map(w=>A[w]),h=h.map(w=>({...w,data:M(w.data),low:M(w.low),high:M(w.high)}))},y=(f,M)=>{let A=(M!==void 0?h.find(O=>O.name===M):void 0)??h.find(O=>!O.hidden&&O.kind!=="range")??h[0];M!==void 0&&!h.some(O=>O.name===M)&&i.push({code:"unknown-series",severity:"warning",message:`sort.by names "${M}", which is not a series; sorted by the first series.`});let w=Array.from({length:b()},(O,_)=>_).sort((O,_)=>{let H=A?.data[O]??A?.high[O],P=A?.data[_]??A?.high[_],Q=I(H)?H:-1/0,J=I(P)?P:-1/0;return f==="asc"?Q-J:J-Q});v(w)},p=f=>{let M=h.flatMap(w=>ae(w.data)),A=Je(M,f);s=A.slice(1).map((w,O)=>`${t(A[O])}\u2013${t(w)}`),h=h.map(w=>{let O=ae(w.data),_=0,H=et(O,A).map(P=>e.binMode==="density"?O.length?P.count/(O.length*(P.x1-P.x0)):0:e.binMode==="cumulative"?_+=P.count:P.count);return{...w,data:H}})},S=(f,M)=>{let A=Math.max(1,Math.floor(f)),w=b(),O=H=>{if(!H.length)return H;let P=[];for(let Q=0;Q<w;Q+=A){let J=ae(H.slice(Q,Q+A));P.push(J.length===0?null:M==="sum"?J.reduce((re,he)=>re+he,0):M==="mean"?J.reduce((re,he)=>re+he,0)/J.length:M==="min"?Math.min(...J):Math.max(...J))}return P};s=Array.from({length:w},(H,P)=>s[P]??String(P+1)).filter((H,P)=>P%A===0),h=h.map(H=>({...H,data:O(H.data),low:O(H.low),high:O(H.high)}))};e.transform==="histogram"?p({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(f=>{let M=0;return{...f,data:f.data.map(A=>I(A)?M+=A:M)}}));for(let f of l)f.type==="sort"?y(f.order??"desc"):f.type==="bin"?p(f):f.type==="aggregate"&&S(f.every,f.method??"sum");typeof e.sort=="string"?y(e.sort):e.sort&&y(e.sort.order,e.sort.by);let k=e.xAxis?.domain;if(k){let f=b(),M=Array.from({length:f},(_,H)=>s[H]??String(H+1)),A=_=>{let H=typeof _=="string"?_:se(_);return M.findIndex(P=>typeof H=="string"?P===H||Qe(P)===H:se(P)===H)},w=k.map(A),O=_=>_.length?w.map(H=>H<0?null:_[H]??null):_;s=[...k],h=h.map(_=>({..._,data:O(_.data),low:O(_.low),high:O(_.high)}))}return{series:h,categories:s,issues:i,axes:o}}function at(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var _t=e=>e.id??e.name??e.series,Sr=e=>e.seriesId??e.series;function de(e,n){let t=!1;return n.id!==void 0&&(t=!0,_t(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Sr(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 me(e){let n={},t=_t(e);t!==void 0&&(n.id=t);let r=Sr(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var jt=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Ht(e,n,t){let r=at(e),i=me(n),o=r.some(s=>de(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!de(n,s)):[...r,i]}var Si=.2;function $i(e){let n=B.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 Ci=(e,n)=>e.kind==="text"?{...e,fill:B.grid}:{...e,opacity:(e.opacity??1)*n};function Wt(e,n){let t=at(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:at(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=[],l=u=>!i||r.some(h=>de(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&de(u,{series:h.series})):!1,c=u=>{if(!i||o.faded==="none"||l(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&de(u,{series:h})}return!0},d=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(b=>de(h,b))){let b=$i(u);b&&s.push(b)}return c(h)?Ci(u,Si):u});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}function Zt(e){let n=e.variant??"area";return Mr({...e,series:e.series.map(t=>({type:"range",name:t.name,low:t.low,high:t.high,color:t.color,axis:t.axis,curve:t.curve,style:n}))},"bar")}function Ie(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 Et=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function $r(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function Fe(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=$r(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Ut(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[$r(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:B.axis,dash:"3 3"}}function Kt(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Et(r.plot,n,t))return[];let i=Ut(e,n),{rows:o}=Fe(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...rt(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function qt(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 Kt(e,i,t.plot.y+8)}function Xt(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:c,y:d}=Ie(t,r,i,e.width,e.height);if(Et(e.hit.plot,c,d)){let u=Fe(e,c),h=Ut(e,c);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?pe(e,n)?.item:void 0,l=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(c=>c.tagName.toLowerCase()==="title")?.textContent;return l?{lines:Array.isArray(l)?l:[l],shapes:[]}:{lines:[],shapes:[]}}function Cr(e,n,t,r,i,o,s){let l=e?.closest?.("[data-skdx-part]"),c=s&&s.tooltipFormatter?pe(s,e)?.item:void 0,d=c&&s?.tooltipFormatter?.(c)||l&&Array.from(l.children).find(y=>y.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let u=s?.tooltipAnchored?pe(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:b,y:v}=h?_e(h):Ie(n,t,r,i,o);return rt(b,v,d,i,o,s?.tooltipPlacement)}function Yt(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Ie(t,r,i,e.width,e.height),l=Kt(e,o,s);if(l.length>0)return l}return Cr(n,t,r,i,e.width,e.height,e)}function Qt(e,n){let t=pe(e,n);return t&&!t.item.legend?me(t.item):null}var Ii=(e,n)=>{let{x:t,y:r}=_e(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 Jt(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Ii(i,n))continue;let o=me(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var en=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:B.focus,opacity:.12,stroke:B.focus}),ct=(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 Ir(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],l=e[o];s.y>t!=l.y>t&&n<(l.x-s.x)*(t-s.y)/(l.y-s.y)+s.x&&(r=!r)}return r}function tn(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}=_e(i),l=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Ir(n,o,l))continue;let c=me(i.item),d=JSON.stringify(c);t.has(d)||(t.add(d),r.push(c))}return r}var nn=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:B.focus,fillOpacity:.12,stroke:B.focus,dash:"4 3"}),lt=6;function rn(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-lt||n>i.x1+lt))return Math.abs(n-i.x0)<=lt?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=lt?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function on(e,n,t){let r=e.edit;return Tr(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function sn(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(c=>c.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",l=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Tr(r,{bar:o,mode:s},i*l)}function Tr(e,{bar:n,mode:t},r){let i=l=>e.snap?Math.round(l/e.snap)*e.snap:l,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 an(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:B.focus,opacity:.25,stroke:B.focus,rx:2}}var Ti=64,Ai=e=>Math.max(1,Math.min(Ti,e));function ln(e,n,t,r){let i=n>0?.8:1.25,o=Ai(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:l}=e,[c,d]=e.view.center,u=(t-(s.x+s.width/2))/l,h=(r-(s.y+s.height/2))/l,b=e.view.zoom/o;return{center:[c+u*(1-b),e.fromY(e.toY(d)-h*(1-b))],zoom:o}}function cn(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 pe(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 dt=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function _e(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 dn(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=B.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*ce+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}=_e(t),l=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...l?rt(m(o),m(s),l,e.width,e.height):[]]}function un(e,n,t){let r=dt(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,Ce=(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}},Ar=(e,n)=>!e||e.start<=0&&e.end>=n;function hn(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,l=Math.max($e,Math.min(e.count,Math.round(o*s)));if(l===o)return n>0&&!Ar(e.zoom,e.count)?Ce(r,l,e.count):void 0;let c=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+c*o;return Ce(d-c*l,l,e.count)}function fn(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 Ce(n.start+s*i-s*o,o,e.count)}function mn(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Ce(n.start-t/i,r,e.count)}function pn(e,n,t){let r=e.brush;if(!r||!Et(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:Ce(s-o/2,o,e.count)}}function bn(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 Ce(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 xn(e,n){switch(n.type){case"svg":return Promise.resolve(gn(e,n.label,n.resolve));case"csv":return Promise.resolve(Rr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=gn(e,n.label,n.resolve);return Lr(t,e.width,e.height,n.scale,n.background)}}}var ue=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),je=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${ue(String(t))}"`).join("");function Or(e){let n=e.title?`<title>${ue(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${je([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${je([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${je([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${je([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${je([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${ue(e.text)}</text>`}}function zr(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${ue(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="${ue(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function gn(e,n,t){let r=zr(e)+e.shapes.map(Or).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="${ue(n)}" font-family="${ue(B.fontFamily)}" font-size="${ue(B.fontSize)}"><title>${ue(n)}</title>${r}</svg>`}function Lr(e,n,t,r=2,i){return new Promise((o,s)=>{let l=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),c=new Image;c.onload=()=>{URL.revokeObjectURL(l);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let u=d.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,d.width,d.height)),u.drawImage(c,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},c.onerror=()=>{URL.revokeObjectURL(l),s(new Error("svg could not be decoded"))},c.src=l})}function Rr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
2
+ `)}function yn(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let l=r.rows[0];if(r.rows.length>t)return;let c=["",...l.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],d=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[c,...d]}let i=e.shapes.flatMap(l=>l.item&&!l.item.legend&&!(l.part==="anchor"&&!l.title)?[l.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(l=>i.some(c=>c[l]!==void 0)),s=(l,c)=>l[c]===void 0?"":String(l[c]);return[o.map(l=>l[0]?.toUpperCase()+l.slice(1)),...i.map(l=>o.map(c=>s(l,c)))]}var vn=new Map;function ut(e){let n=vn.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&&vn.delete(e)}},publish(o,s){Object.assign(r,o);for(let l of t)l(o,s)}};return vn.set(e,{group:i,listeners:t}),i}var Vr='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',kn=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Vr}{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){${Vr}{animation:none;transition:none}}`;function wn(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var L=require("lit"),$=require("lit/decorators.js"),E=require("lit/directives/if-defined.js");var Oi={fromAttribute:()=>!1},V=class extends L.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=[en(ct(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=[nn(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=on(r,i.gantt,o-i.x),this.overlay=[an(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(cn(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,l]=[...this.pointers.values()];if(s===void 0||l===void 0||!i.distance)return;this.setZoom(fn(r.hit,i.zoom,Math.abs(s-l)/i.distance,(s+l)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?mn(r.hit,i.zoom,o-i.x):bn(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Xt(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=Yt(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Qt(r,t.target)),this.syncId&&r.hit?.crosshair){let o=Fe(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:i,y:o}=this.viewBox(t,r),s=pe(r,t.target)?.item.legend,l=this.canEdit(r)?rn(r,i,o):void 0;if(l){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:l},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 d=r.map.plot;if(i<d.x||i>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let c=r.hit;if(!(!c||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[d,u]=[...this.pointers.values()];this.drag={x:(d+u)/2,y:o,zoom:c.zoom,grab:"pinch",distance:Math.abs(d-u)||1}}else{let d=pn(c,i,o);if(d)this.drag={x:i,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==c.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&i>=c.plot.x&&i<=c.plot.x+c.plot.width&&o>=c.plot.y&&o<=c.plot.y+c.plot.height)this.drag={x:i,y:o,zoom:c.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:l}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(l-i.y)>2){i.grab==="select"?this.setSelected(Jt(o,ct(i.x,i.y,s,l))):i.grab==="lasso"?this.setSelected(tn(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;t.preventDefault(),this.setView(ln(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 l=hn(s,t.deltaY,i);l&&(t.preventDefault(),this.setZoom(l))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=pe(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let l=r.shapes[this.focused]?.item;l&&(t.preventDefault(),this.select(l),this.emit("skdx-item-click",l));return}let i=this.canEdit(r)?sn(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=un(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?me(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:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,animated:v,responsive:y,highlighted:p,highlightScope:S,accessibleTable:k}=this;return{...typeof y=="object"&&this.measured!==void 0&&this.measured<(y.breakpoint??480)?y.compact:void 0,width:y&&this.measured?this.measured:t,height:r,animate:v,responsive:y,legend:i,tooltip:o,format:s,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,highlighted:p===void 0?this.highlightState:p,highlightScope:S,accessibleTable:k,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&&ut(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=ut(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&&jt(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Ht(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 Ie(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&&de(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?xn(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Wt(Bt(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),l=this.canPan(o),c=this.canEdit(o),d=this.brushing(),u=s||l||c||d,h=!o.decorative&&dt(o).length>0,b=o.description?`${r}-desc`:void 0,v=wn(o),y=yn(o,this.accessibleTable),p=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,S=this.portal;return L.html`<svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 ${o.width} ${o.height}"
5
+ width=${o.width}
6
+ height=${o.height}
7
+ role=${o.decorative?"presentation":"img"}
8
+ aria-hidden=${o.decorative?"true":L.nothing}
9
+ aria-label=${o.decorative?L.nothing:i}
10
+ aria-describedby=${(0,E.ifDefined)(b)}
11
+ tabindex=${h?0:L.nothing}
12
+ data-skdx-chart=${r}
13
+ data-zoomable=${s||l?"":L.nothing}
14
+ data-brushing=${d&&!(s||l)?"":L.nothing}
15
+ data-editable=${c?"":L.nothing}
16
+ style=${v?`--skdx-chart-duration:${v}`:L.nothing}
17
+ font-family=${B.fontFamily}
18
+ font-size=${B.fontSize}
19
+ @pointermove=${o.tooltip||u?this.onPointerMove:L.nothing}
20
+ @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
21
+ @pointerdown=${u?this.onPointerDown:L.nothing}
22
+ @pointerup=${u?this.onPointerUp:L.nothing}
23
+ @pointercancel=${u?this.onPointerUp:L.nothing}
24
+ @wheel=${s||l?this.onWheel:L.nothing}
25
+ @dblclick=${s||l?()=>l?this.setView(void 0):this.setZoom(void 0):L.nothing}
26
+ @click=${this.onClick}
27
+ @keydown=${h?this.onKeyDown:L.nothing}
28
+ @blur=${()=>{this.focused=null,this.highlight(null)}}
29
+ >
30
+ <title>${i}</title>
31
+ ${o.description?L.svg`<desc id=${(0,E.ifDefined)(b)}>${o.description}</desc>`:L.nothing}
32
+ ${v?L.svg`<style>${kn}</style>`:L.nothing} ${zi(o)}
33
+ ${ht(o.shapes)}
34
+ ${ht(this.tip.length||!this.crossState?this.tip:qt(o,this.crossState))}
35
+ ${ht(dn(o,this.focused))} ${ht(this.overlay)}
36
+ </svg>
37
+ ${S?L.html`<div
38
+ role="tooltip"
39
+ data-skdx-tooltip=${r}
40
+ style="left:${S.x+12}px;top:${S.y+12}px"
41
+ >
42
+ ${S.lines.map(k=>L.html`<div>${k}</div>`)}
43
+ </div>`:L.nothing}
44
+ ${y?L.html`<table data-skdx-table=${r}>
45
+ <caption>
46
+ ${p}
47
+ </caption>
48
+ <thead>
49
+ <tr>
50
+ ${(y[0]??[]).map(k=>L.html`<th scope="col">${k}</th>`)}
51
+ </tr>
52
+ </thead>
53
+ <tbody>
54
+ ${y.slice(1).map(k=>L.html`<tr>
55
+ ${k.map((f,M)=>M===0?L.html`<th scope="row">${f}</th>`:L.html`<td>${f}</td>`)}
56
+ </tr>`)}
57
+ </tbody>
58
+ </table>`:L.nothing}`}};V.styles=L.css`
59
+ :host {
60
+ display: inline-block;
61
+ }
62
+ svg {
63
+ display: block;
64
+ max-width: 100%;
65
+ height: auto;
66
+ outline: none;
67
+ }
68
+ svg[data-zoomable] {
69
+ cursor: grab;
70
+ touch-action: none;
71
+ }
72
+ svg[data-brushing] {
73
+ cursor: crosshair;
74
+ touch-action: none;
75
+ }
76
+ svg[data-editable] {
77
+ touch-action: none;
78
+ }
79
+ :host([responsive]) {
80
+ display: block;
81
+ }
82
+ table {
83
+ position: absolute;
84
+ width: 1px;
85
+ height: 1px;
86
+ margin: -1px;
87
+ padding: 0;
88
+ overflow: hidden;
89
+ clip: rect(0 0 0 0);
90
+ white-space: nowrap;
91
+ border: 0;
92
+ }
93
+ [role='tooltip'] {
94
+ position: fixed;
95
+ pointer-events: none;
96
+ z-index: 1000;
97
+ background: var(--skdx-color-surface-raised);
98
+ color: var(--skdx-color-text-default);
99
+ border: 1px solid var(--skdx-color-border-strong);
100
+ border-radius: 3px;
101
+ padding: 4px 8px;
102
+ font-family: var(--skdx-font-family);
103
+ font-size: var(--skdx-font-size-xs);
104
+ white-space: nowrap;
105
+ }
106
+ [role='tooltip'] > :first-child:not(:only-child) {
107
+ font-weight: bold;
108
+ }
109
+ `,g([(0,$.property)({type:Number})],V.prototype,"width",2),g([(0,$.property)({type:Number})],V.prototype,"height",2),g([(0,$.property)()],V.prototype,"label",2),g([(0,$.property)({type:Boolean,reflect:!0})],V.prototype,"legend",2),g([(0,$.property)({type:Boolean,attribute:"no-tooltip",converter:Oi})],V.prototype,"tooltip",2),g([(0,$.property)({attribute:!1})],V.prototype,"format",2),g([(0,$.property)({attribute:!1})],V.prototype,"palette",2),g([(0,$.property)({attribute:!1})],V.prototype,"hiddenSeries",2),g([(0,$.property)({attribute:!1})],V.prototype,"selected",2),g([(0,$.property)({attribute:"selection-mode"})],V.prototype,"selectionMode",2),g([(0,$.property)({attribute:!1})],V.prototype,"highlighted",2),g([(0,$.property)({attribute:!1})],V.prototype,"highlightScope",2),g([(0,$.property)({type:Boolean,reflect:!0})],V.prototype,"loading",2),g([(0,$.property)()],V.prototype,"error",2),g([(0,$.property)({attribute:"empty-message"})],V.prototype,"emptyMessage",2),g([(0,$.property)()],V.prototype,"description",2),g([(0,$.property)({type:Boolean,reflect:!0})],V.prototype,"decorative",2),g([(0,$.property)({type:Boolean,attribute:"accessible-table"})],V.prototype,"accessibleTable",2),g([(0,$.property)({attribute:!1})],V.prototype,"zoom",2),g([(0,$.property)({attribute:!1})],V.prototype,"view",2),g([(0,$.property)({type:Boolean,reflect:!0})],V.prototype,"zoomable",2),g([(0,$.property)({type:Boolean,reflect:!0})],V.prototype,"editable",2),g([(0,$.property)({attribute:"sync-id"})],V.prototype,"syncId",2),g([(0,$.property)({type:Boolean,attribute:"cross-filter"})],V.prototype,"crossFilter",2),g([(0,$.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],V.prototype,"animated",2),g([(0,$.property)({type:Boolean,reflect:!0})],V.prototype,"responsive",2),g([(0,$.state)()],V.prototype,"tip",2),g([(0,$.state)()],V.prototype,"overlay",2),g([(0,$.state)()],V.prototype,"portal",2),g([(0,$.state)()],V.prototype,"measured",2),g([(0,$.state)()],V.prototype,"viewState",2),g([(0,$.state)()],V.prototype,"highlightState",2),g([(0,$.state)()],V.prototype,"crossState",2),g([(0,$.state)()],V.prototype,"focused",2),g([(0,$.state)()],V.prototype,"hiddenState",2),g([(0,$.state)()],V.prototype,"zoomState",2),g([(0,$.state)()],V.prototype,"selectedState",2);var U=class extends V{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:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:v,stackOffset:y,orientation:p,radius:S,barGap:k,barWidth:f,sort:M,transform:A,transforms:w,bins:O,binWidth:_,binDomain:H,binMode:P,sampling:Q,brush:J,crosshair:re}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:v,stackOffset:y,orientation:p,radius:S,barGap:k,barWidth:f,sort:M,transform:A,transforms:w,bins:O,binWidth:_,binDomain:H,binMode:P,sampling:Q,brush:J,crosshair:re}}};g([(0,$.property)({attribute:!1})],U.prototype,"series",2),g([(0,$.property)({attribute:!1})],U.prototype,"categories",2),g([(0,$.property)({attribute:!1})],U.prototype,"xAxis",2),g([(0,$.property)({attribute:!1})],U.prototype,"yAxis",2),g([(0,$.property)({attribute:!1})],U.prototype,"rightAxis",2),g([(0,$.property)({attribute:!1})],U.prototype,"references",2),g([(0,$.property)({attribute:!1})],U.prototype,"annotations",2),g([(0,$.property)({type:Boolean,reflect:!0})],U.prototype,"labels",2),g([(0,$.property)()],U.prototype,"curve",2),g([(0,$.property)({type:Boolean,attribute:"connect-nulls"})],U.prototype,"connectNulls",2),g([(0,$.property)()],U.prototype,"nulls",2),g([(0,$.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],U.prototype,"stacked",2),g([(0,$.property)({attribute:"stack-offset"})],U.prototype,"stackOffset",2),g([(0,$.property)()],U.prototype,"orientation",2),g([(0,$.property)({type:Number})],U.prototype,"radius",2),g([(0,$.property)({type:Number,attribute:"bar-gap"})],U.prototype,"barGap",2),g([(0,$.property)({type:Number,attribute:"bar-width"})],U.prototype,"barWidth",2),g([(0,$.property)()],U.prototype,"sort",2),g([(0,$.property)()],U.prototype,"transform",2),g([(0,$.property)({attribute:!1})],U.prototype,"transforms",2),g([(0,$.property)({type:Number})],U.prototype,"bins",2),g([(0,$.property)({type:Number,attribute:"bin-width"})],U.prototype,"binWidth",2),g([(0,$.property)({attribute:!1})],U.prototype,"binDomain",2),g([(0,$.property)({attribute:"bin-mode"})],U.prototype,"binMode",2),g([(0,$.property)({attribute:!1})],U.prototype,"sampling",2),g([(0,$.property)({type:Boolean,reflect:!0})],U.prototype,"brush",2),g([(0,$.property)({type:Boolean,reflect:!0})],U.prototype,"crosshair",2);var zi=e=>e.defs&&e.defs.length?L.svg`<defs>${e.defs.map(n=>L.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=>L.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,E.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:L.nothing,ht=e=>L.svg`${e.map((n,t)=>{let r=n.title?L.svg`<title>${n.title}</title>`:L.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return L.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,E.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,E.ifDefined)(n.stroke)} stroke-width=${(0,E.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,E.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,E.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,E.ifDefined)(n.dash)} opacity=${(0,E.ifDefined)(n.opacity)} fill-opacity=${(0,E.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return L.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,E.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,E.ifDefined)(n.rx)} fill=${n.fill} stroke=${(0,E.ifDefined)(n.stroke)} fill-opacity=${(0,E.ifDefined)(n.opacity)}>${r}</rect>`;case"line":return L.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,E.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,E.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,E.ifDefined)(n.dash)} opacity=${(0,E.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return L.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,E.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,E.ifDefined)(n.stroke)} opacity=${(0,E.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return L.svg`<text data-skdx-part=${n.part} data-skdx-i=${(0,E.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,E.ifDefined)(n.anchor)} dominant-baseline=${(0,E.ifDefined)(n.baseline)} fill=${(0,E.ifDefined)(n.fill)} font-weight=${(0,E.ifDefined)(n.weight)} pointer-events=${(0,E.ifDefined)(i===void 0?"none":void 0)} transform=${(0,E.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var Y=class extends V{constructor(){super(...arguments);this.series=[];this.connectNulls=!1;this.brush=!1;this.crosshair=!1}render(){let{series:t,variant:r,categories:i,xAxis:o,yAxis:s,rightAxis:l,references:c,annotations:d,curve:u,connectNulls:h,orientation:b,radius:v,barGap:y,barWidth:p,brush:S,crosshair:k}=this;return this.root(Zt({...this.sized(),series:t,variant:r,categories:i,xAxis:o,yAxis:s,rightAxis:l,references:c,annotations:d,curve:u,connectNulls:h,orientation:b,radius:v,barGap:y,barWidth:p,brush:S,crosshair:k}),"range",this.label??"Range chart")}};g([(0,ee.property)({attribute:!1})],Y.prototype,"series",2),g([(0,ee.property)()],Y.prototype,"variant",2),g([(0,ee.property)({attribute:!1})],Y.prototype,"categories",2),g([(0,ee.property)({attribute:!1})],Y.prototype,"xAxis",2),g([(0,ee.property)({attribute:!1})],Y.prototype,"yAxis",2),g([(0,ee.property)({attribute:!1})],Y.prototype,"rightAxis",2),g([(0,ee.property)({attribute:!1})],Y.prototype,"references",2),g([(0,ee.property)({attribute:!1})],Y.prototype,"annotations",2),g([(0,ee.property)()],Y.prototype,"curve",2),g([(0,ee.property)({type:Boolean,reflect:!0,attribute:"connect-nulls"})],Y.prototype,"connectNulls",2),g([(0,ee.property)()],Y.prototype,"orientation",2),g([(0,ee.property)({type:Number})],Y.prototype,"radius",2),g([(0,ee.property)({type:Number,attribute:"bar-gap"})],Y.prototype,"barGap",2),g([(0,ee.property)({type:Number,attribute:"bar-width"})],Y.prototype,"barWidth",2),g([(0,ee.property)({type:Boolean,reflect:!0})],Y.prototype,"brush",2),g([(0,ee.property)({type:Boolean,reflect:!0})],Y.prototype,"crosshair",2),Y=g([(0,ee.customElement)("skdx-range-chart")],Y);0&&(module.exports={SkdxRangeChart});
@@ -0,0 +1,2 @@
1
+ import 'lit';
2
+ export { aE as SkdxRangeChart } from './index-oF5ss8v9.cjs';
@@ -0,0 +1,2 @@
1
+ import 'lit';
2
+ export { aE as SkdxRangeChart } from './index-oF5ss8v9.js';
package/dist/range.js ADDED
@@ -0,0 +1,109 @@
1
+ var Zr=Object.defineProperty;var Er=Object.getOwnPropertyDescriptor;var g=(e,n,t,r)=>{for(var i=r>1?void 0:r?Er(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&&Zr(n,t,i),i};import{customElement as Li,property as te}from"lit/decorators.js";var Xn=e=>Number(e.toPrecision(12)),Ur,Yn=e=>(Ur??(Ur=new Intl.NumberFormat)).format(Xn(e)),Kr=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 Ce(e){if(e===void 0)return Yn;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,l=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},c=u=>{let h=new Intl.NumberFormat(t,u);return s(b=>h.format(Xn(b)))},d=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return b=>h.format(b)};switch(n){case"integer":return c({maximumFractionDigits:0});case"decimal":return c(l(2));case"percent":return c({style:"percent",...l(0)});case"currency":return c({style:"currency",currency:e.currency??"USD",...l()});case"compact":return c({notation:"compact",...l(1)});case"scientific":return c({notation:"scientific",...l(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Kr)}}function et(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?Ce(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):Yn(t)}var le=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function Ie([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function ve(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,l=Math.floor(e/s)*s,c=Math.ceil(n/s)*s,d=[];for(let u=l;u<=c+s/2;u+=s)d.push(Jn(u));return d}function Qn(e,[n,t],r=.2){let i=e===0?0:(t-n)/e,o=i*(1-Math.max(0,Math.min(.9,r)));return{step:i,bandwidth:o,start:s=>n+s*i+(i-o)/2,center:s=>n+(s+.5)*i}}var Jn=e=>Number(e.toPrecision(12)),m=e=>Number(e.toFixed(2)),C=e=>typeof e=="number"&&Number.isFinite(e),ce=e=>e.filter(C);function de(e){let n=1/0,t=-1/0;for(let r of e)C(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function ke(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let d=`M${t.x} ${t.y}`;for(let u=1;u<e.length;u++){let h=e[u-1],b=e[u];n==="stepAfter"?d+=`H${b.x}V${b.y}`:n==="stepBefore"?d+=`V${b.y}H${b.x}`:d+=`H${m((h.x+b.x)/2)}V${b.y}H${b.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((d,u)=>d.x-e[u].x),o=e.slice(1).map((d,u)=>d.y-e[u].y),s=i.map((d,u)=>d===0?0:o[u]/d),l=[s[0]];for(let d=1;d<r-1;d++){let u=s[d-1],h=s[d];l.push(u*h<=0?0:(u+h)/2)}l.push(s[r-2]);for(let d=0;d<r-1;d++){let u=s[d];if(u===0){l[d]=0,l[d+1]=0;continue}let h=l[d]/u,b=l[d+1]/u,v=Math.hypot(h,b);v>3&&(l[d]=3*h*u/v,l[d+1]=3*b*u/v)}let c=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let u=e[d],h=e[d+1],b=i[d]/3;c+=`C${m(u.x+b)} ${m(u.y+b*l[d])} ${m(h.x-b)} ${m(h.y-b*l[d+1])} ${h.x} ${h.y}`}return c}var Ne=1e3,De=60*Ne,Ge=60*De,Fe=24*Ge,qr=[Ne,5*Ne,15*Ne,30*Ne,De,5*De,15*De,30*De,Ge,3*Ge,6*Ge,12*Ge,Fe,2*Fe,7*Fe,14*Fe];function er(e,n,t=6){if(!(n>e))return[e];let r=n-e,i=qr.find(h=>r/h<=t),o=[];if(i!==void 0){for(let h=Math.ceil(e/i)*i;h<=n;h+=i)o.push(h);return o.length?o:[e,n]}let s=r/(30*Fe),l=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,c=new Date(e),d=c.getUTCFullYear(),u=Math.ceil((c.getUTCMonth()+(c.getUTCDate()>1?1:0))/l)*l;for(let h=Date.UTC(d,u,1);h<=n;)o.push(h),u+=l,u>=12&&(d+=Math.floor(u/12),u%=12),h=Date.UTC(d,u,1);return o.length?o:[e,n]}function tr(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),i=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let l of i)o.push(Jn(l*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function tt(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((c,d)=>c-d);let[t,r]=n.domain??de(e),i=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(i)+1)),s=n.binWidth??(r>t?(r-t)/o:1),l=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:l+1},(c,d)=>Number((t+d*s).toPrecision(12)))}function nt(e,n){let t=[];for(let o=0;o+1<n.length;o++)t.push({x0:n[o],x1:n[o+1],count:0});if(t.length===0)return t;let r=n[0],i=n[n.length-1];for(let o of ce(e)){if(o<r||o>i)continue;let s=0,l=t.length-1;for(;s<l;){let c=s+l+1>>1;t[c].x0<=o?s=c:l=c-1}t[s].count++}return t}var Xr=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Yr=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Qr={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Jr(e,n,t){return e.replace(Yr,(r,i,o)=>{let s=Qr[i];if(s===void 0)return i+o;let c=(o.match(Xr)??[]).map((d,u)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let b=u%s;return s===7?b===5?String(h+n):b===6?String(h+t):d:String(b%2===0?h+n:h+t)});return i+c.join(" ")})}var nr=(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:Jr(r.d,n,t)}}});var zt=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),V={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"},rt=(e="neutral")=>e==="neutral"?V.axis:`var(--skdx-color-${e}-500)`,Lt=(e="neutral")=>e==="neutral"?V.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,rr=(e,n)=>n??zt[e%zt.length];var ne={top:16,right:16,bottom:32,left:48};function ir(e,n,t=ne){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 _e(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Vt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var or=e=>e.crosshair===!0||Vt(e).trigger==="axis",it=20,ei=120,sr=e=>{let n=_e(e);return n&&(n.position==="left"||n.position==="right")?n.width??ei:0},Bt=(e,n=600,t=300)=>({width:(e.width??n)-sr(e),height:(e.height??t)-(_e(e)?.position==="bottom"?it:0)}),ar=e=>{let n=_e(e);return n&&(n.position===void 0||n.position==="top")?it:0},ue=6.5,lr=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:rr(n)),cr=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Rt(e,n,t=[],r={},i=10,o=8,s=!1){let l=[],c=r.maxItems,d=c!==void 0&&c>=0&&e.length>c?e.slice(0,c):e,u=e.length-d.length,h=r.interactive??!0,b=o,v=i,y=(p,S,k,f)=>{let M=(S?18:4)+p.length*ue;b>o&&(s||b+M>n-8)&&(b=o,v+=it),S&&l.push({kind:"rect",part:"legend-swatch",x:b,y:v-5,width:10,height:10,fill:S,opacity:f?.3:void 0,item:k}),l.push({kind:"text",part:"legend-label",x:b+(S?14:0),y:v,text:p,baseline:"middle",fill:f?V.grid:V.label,item:k}),b+=M+12};for(let p of d){let S=t.includes(p.name),k=h?{label:p.name,series:p.name,legend:!0}:void 0;y(r.formatter?.(p.name)??p.name,p.color,k,S)}return u>0&&y(`+${u} more`,void 0,void 0,!1),r.align==="end"?ti(l,n):l}function ti(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(l=>l.kind==="rect"?l.x+l.width:l.x+l.text.length*ue)),s=n-8-o;for(let l of i)r.push({...l,x:l.x+s})}return r}var ni=(e,n,t={})=>new Set(Rt(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Pt(e,n,t,r=[]){let i=_e(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=Vt(e),l=o?.position==="bottom",c=sr(e),d=e.hiddenSeries??[],u=o?c?Rt(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):Rt(r,n,d,o,l?t+10:10):[],h=l?ni(r,n,o):0;return{width:n+c,height:l?t+Math.max(1,h)*it:t,legendOffset:o?.position==="left"?c:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function Nt(e){let n=e.legendOffset;if(!n)return e;let t=[...nr(e.shapes.filter(c=>!c.part.startsWith("legend-")),n,0),...e.shapes.filter(c=>c.part.startsWith("legend-"))],r=c=>({...c,x:c.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(c=>c+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:c=>o.scale(c)+n,invert:c=>o.invert(c-n),bars:o.bars.map(c=>({...c,x0:c.x0+n,x1:c.x1+n}))}:void 0,l=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:l,legendOffset:void 0}}function ot(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],l=Math.max(...s.map(b=>b.length))*ue+12,c=6+s.length*16,d=o==="top"?{x:e-l/2,y:n-c-8}:o==="bottom"?{x:e-l/2,y:n+8}:o==="left"?{x:e-l-8,y:n-c/2}:o==="right"?{x:e+8,y:n-c/2}:{x:e+12,y:n-c-6},u=Math.max(0,Math.min(r-l,d.x)),h=Math.max(0,Math.min(i-c,d.y));return[{kind:"rect",part:"tooltip",x:m(u),y:m(h),width:m(l),height:c,fill:"var(--skdx-color-surface-raised)",stroke:V.axis,rx:3},...s.map((b,v)=>({kind:"text",part:"tooltip-label",x:m(u+6),y:m(h+11+v*16),text:b,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:s.length>1&&v===0?"bold":void 0}))]}function dr([e,n],t,r=!1,i){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=Ce(o.format??i),l=o.min??e,c=o.max??n;o.reversed&&(t=[t[1],t[0]]);let d={id:o.id,position:o.position,options:o};if(o.scale==="sqrt"){let p=O=>Math.sign(O)*Math.sqrt(Math.abs(O)),S=o.nice===!1?[l,c]:ve(l,c,o.ticks),k=o.min??S[0],f=o.max??S[S.length-1],M=Ie([p(k),p(f)],t),T=O=>M(p(O)),w=ve(k,f,o.ticks).filter(O=>O>=k-1e-9&&O<=f+1e-9);return{...d,scale:T,domain:[k,f],format:s,ticks:(w.length>=2?w:[k,f]).map(O=>({pos:m(T(O)),label:s(O)})),zero:m(T(Math.min(Math.max(0,k),f)))}}if(o.scale==="log"){let p=Math.max(l,Number.EPSILON),S=Math.max(c,p),k=tr(p,S),f=[Math.log10(p),Math.log10(S)],M=Ie(f,t),T=w=>M(Math.log10(Math.max(w,Number.EPSILON)));return{...d,scale:T,domain:f,format:s,ticks:k.map(w=>({pos:m(T(w)),label:s(w)})),zero:m(t[0])}}let u=ve(l,c,o.ticks),h=[o.min??(o.nice===!1?l:u[0]),o.max??(o.nice===!1?c:u[u.length-1])],b=Ie(h,t),v=u.filter(p=>p>=h[0]-1e-9&&p<=h[1]+1e-9),y=(v.length>=2?v:[h[0],h[1]]).map(p=>({pos:m(b(p)),label:s(p)}));return{...d,scale:b,domain:h,format:s,ticks:y,zero:m(b(Math.min(Math.max(0,h[0]),h[1])))}}var ur=e=>e?.grid!==!1;function st(e,n){if(e.length<2)return e;let t=e.reduce((i,o)=>Math.max(i,o.label.length),0)*ue+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((i,o)=>o%r===0)}var Dt=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function hr(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}=Bt(e,t,r),l=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",c=[];return i==="loading"&&c.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:4}),c.push({kind:"text",part:`state-${i}`,x:m(o/2),y:m(s/2),text:l,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":V.label}),{...Pt(e,o,s),shapes:c,tooltip:!1}}function Gt(e,n={}){let{plot:t,xTicks:r,yTicks:i,baseline:o}=e,s=t.x+t.width,l=t.y+t.height,c=[],d=n.grid??!0,u=(y,p)=>p?{kind:"line",part:"grid",x1:y.pos,x2:y.pos,y1:t.y,y2:l,stroke:V.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:y.pos,y2:y.pos,stroke:V.grid},h=n.x?.tickRotation??0,b=(y,p,S,k)=>h?q(y,p,S,{part:k,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):q(y,p,S,{part:k,anchor:"middle"}),v=(y,p,S,k,f)=>{for(let M of y)c.push(p==="x"?{kind:"line",part:"tick",x1:M.pos,x2:M.pos,y1:S,y2:m(S+k*f),stroke:V.axis}:{kind:"line",part:"tick",x1:S,x2:m(S+k*f),y1:M.pos,y2:M.pos,stroke:V.axis})};if(n.categoryGrid)for(let y of r)c.push(u(y,!n.horizontal));if(n.horizontal){let y=n.axes??[{ticks:i,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let p of i)c.push(u(p,!0));y[0]?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:l,stroke:V.axis});for(let p of y){let S=p.position==="top"||p.position==="right",k=m(S?t.y-p.offset:l+p.offset),f=S||p.offset>0;p.showLine&&f&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:k,y2:k,stroke:V.axis}),p.showTicks&&v(p.ticks,"x",k,S?-1:1,p.tickSize??4);let M=m(S?k-8:k+20);for(let T of p.ticks)c.push(S?q(T.pos,M,T.label,{part:"x-label-top",anchor:"middle"}):b(T.pos,M,T.label,"x-label"));p.label&&c.push(f?q(4,M,p.label,{part:"axis-title",anchor:"start",baseline:S?void 0:"middle"}):q(4,t.y-6,p.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&c.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:l,stroke:V.axis}),n.x?.showTicks&&v(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let p of r)c.push(n.rtl?q(s+8,p.pos,p.label,{part:"y-label",anchor:"start",baseline:"middle"}):q(t.x-8,p.pos,p.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let p of i)c.push(u(p,!1));n.y?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:V.axis});let y=n.axes??[{ticks:i,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let p of y){let S=p.position==="left",k=S?t.x-p.offset:s+p.offset,f=S?"y-label":"y-label-right";p.showLine&&c.push({kind:"line",part:"axis",x1:m(k),x2:m(k),y1:t.y,y2:l,stroke:V.axis}),p.showTicks&&v(p.ticks,"y",m(k),S?-1:1,p.tickSize??4);for(let M of p.ticks)c.push(q(m(S?k-8:k+8),M.pos,M.label,{part:f,anchor:S?"end":"start",baseline:"middle"}));p.label&&c.push(q(m(S?p.offset===0?4:Math.max(4,k-40):p.offset===0?e.width-4:Math.min(e.width-4,k+40)),t.y-6,p.label,{part:"axis-title",anchor:S?"start":"end"}))}n.x?.showTicks&&v(r,"x",l,1,n.x.tickSize??4);for(let p of r)c.push(b(p.pos,l+(h?12:20),p.label,"x-label"))}return n.xLabel&&c.push(q(m(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&c.push(q(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),c}var q=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:V.label,...r}),je=(e,n,t,r,i,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:i,item:o});function Ft(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height,s=c=>Math.max(r.x,Math.min(i,c)),l=c=>Math.max(r.y,Math.min(o,c));for(let c of e??[]){let d=c.color??rt(c.variant),u=c.color??Lt(c.variant),h={part:"reference-label",fill:u},b=n.horizontal===!0;if("y"in c){let v=m(n.y(c.y,c.axis??"left"));if(b){let y=s(v);t.push(...mr(y,r.y,o,d,c.label,h))}else{let y=l(v);t.push(...fr(r.x,i,y,d,c.label,h))}}else if("x"in c){let v=n.x(c.x);if(v===void 0)continue;b?t.push(...fr(r.x,i,l(m(v)),d,c.label,h)):t.push(...mr(s(m(v)),r.y,o,d,c.label,h))}else if("y1"in c){let v=m(n.y(c.y1,c.axis??"left")),y=m(n.y(c.y2,c.axis??"left"));b?t.push(...br(s(Math.min(v,y)),s(Math.max(v,y)),r,d,c.label,u)):t.push(...pr(l(Math.min(v,y)),l(Math.max(v,y)),r,d,c.label,u))}else{let v=n.x(c.x1),y=n.x(c.x2);if(v===void 0||y===void 0)continue;let p=m(Math.min(v,y)),S=m(Math.max(v,y));b?t.push(...pr(l(p),l(S),r,d,c.label,u)):t.push(...br(s(p),s(S),r,d,c.label,u))}}return t}function fr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,q(n-4,t-5,i,{...o,anchor:"end"})]:[s]}function mr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,q(e+4,n+10,i,{...o,anchor:"start"})]:[s]}function pr(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:m(Math.max(0,n-e)),fill:r,opacity:.12,title:i};return i?[s,q(t.x+t.width-4,e+12,i,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function br(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:m(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:i};return i?[s,q(e+4,t.y+12,i,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function gr(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let l=s.color??rt(s.variant),c=s.color??Lt(s.variant),d=(y,p,S)=>{let k=n.x(y);if(k===void 0)return;let f=n.y(p,S??"left");return n.horizontal?{x:m(f),y:m(k)}:{x:m(k),y:m(f)}},u=s.id??s.label,h=y=>({label:y,id:u,name:s.label});if(s.type==="line"||s.type==="band"){let{type:y,id:p,...S}=s;t.push(...Ft([S],n));continue}if(s.type==="rect"){let y=d(s.x1,s.y1,s.axis),p=d(s.x2,s.y2,s.axis);if(!y||!p)continue;let S=Math.max(r.x,Math.min(y.x,p.x)),k=Math.max(r.y,Math.min(y.y,p.y)),f=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:m(S),y:m(k),width:m(Math.max(0,Math.min(i,Math.max(y.x,p.x))-S)),height:m(Math.max(0,Math.min(o,Math.max(y.y,p.y))-k)),fill:l,opacity:.12,stroke:l,title:f||void 0,item:f?h(f):void 0}),s.label&&t.push(q(m(S+4),m(k+12),s.label,{part:"annotation-label",fill:c}));continue}let b=d(s.x,s.y,s.axis);if(!b)continue;if(s.type==="text"){t.push(q(b.x,b.y,s.text,{part:"annotation-text",fill:c,anchor:"middle",baseline:"middle",title:s.label}));continue}let v=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:b.x,cy:b.y,r:5,fill:l,stroke:"var(--skdx-color-surface-default)",title:v,item:h(v)}),s.type==="callout"&&s.label){let[y,p]=s.offset??[16,-16],S=m(Math.max(r.x,Math.min(i,b.x+y))),k=m(Math.max(r.y,Math.min(o,b.y+p)));t.push({kind:"line",part:"annotation-leader",x1:b.x,y1:b.y,x2:S,y2:k,stroke:l},q(S,k,s.label,{part:"annotation-label",fill:c,anchor:y>=0?"start":"end",baseline:"middle"}))}}return t}var _t=2e3;function ri(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:_t}:typeof e=="string"?{strategy:e,threshold:_t}:{strategy:e.strategy,threshold:e.threshold??_t}}function ii(e,n){let t=e.length;if(n>=t||n<3)return e.map((l,c)=>c);let r=[0],i=[],o=(t-2)/(n-2),s=0;for(let l=0;l<n-2;l++){let c=Math.floor((l+1)*o)+1,d=Math.min(t-1,Math.floor((l+2)*o)+1),u=0,h=0,b=0;for(let M=c;M<d;M++){let T=e[M];C(T)&&(u+=M,h+=T,b++)}u=b?u/b:(c+d)/2,h=b?h/b:0;let v=Math.floor(l*o)+1,y=Math.min(t-1,Math.floor((l+1)*o)+1),p=e[s],S=C(p)?p:0,k=-1,f=-1;for(let M=v;M<y;M++){let T=e[M];if(!C(T)){i.push(M);continue}let w=Math.abs((s-u)*(T-S)-(s-M)*(h-S));w>f&&(f=w,k=M)}k<0&&(k=v),r.push(k),s=k}return r.push(t-1),i.length?[...new Set([...r,...i])].sort((l,c)=>l-c):r}function oi(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1;for(let h=l;h<c;h++){let b=e[h];if(!C(b)){i.push(h);continue}(d<0||b<e[d])&&(d=h),(u<0||b>e[u])&&(u=h)}d>=0&&i.push(Math.min(d,u)),u>=0&&u!==d&&i.push(Math.max(d,u))}return[...new Set(i)].sort((s,l)=>s-l)}function si(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1,h=-1,b=-1;for(let v=l;v<c;v++){let y=e[v];if(!C(y)){i.push(v);continue}h<0&&(h=v),b=v,(d<0||y<e[d])&&(d=v),(u<0||y>e[u])&&(u=v)}for(let v of[h,d,u,b])v>=0&&i.push(v)}return[...new Set(i)].sort((s,l)=>s-l)}function xr(e,n,t){let r=ri(t);if(!r||n<=r.threshold||e.length===0)return;let i=r.strategy==="minmax"?oi:r.strategy==="m4"?si:ii,o=new Set;for(let s of e)for(let l of i(s.slice(0,n),r.threshold))o.add(l);return[...o].sort((s,l)=>s-l)}function yr(e,n,t,r,i,o,s,l){if(r==="circle")return{...je(e,n,t,i,o,s),part:l};let c=r==="square"?`M${m(e-t)} ${m(n-t)}h${m(2*t)}v${m(2*t)}h${m(-2*t)}Z`:r==="diamond"?`M${m(e)} ${m(n-t*1.3)}L${m(e+t*1.3)} ${m(n)}L${m(e)} ${m(n+t*1.3)}L${m(e-t*1.3)} ${m(n)}Z`:`M${m(e)} ${m(n-t*1.2)}L${m(e+t*1.15)} ${m(n+t*.9)}L${m(e-t*1.15)} ${m(n+t*.9)}Z`;return{kind:"path",part:l,d:c,fill:i,title:o,item:s}}var ai=e=>{let n=0;return e.map(t=>C(t)?n+=t:null)},li=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&C(n)&&C(r)?n-r:null}),ci=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&C(n)&&C(r)&&r!==0?(n-r)/Math.abs(r):null});function di(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,i)=>{if(i<t-1)return null;let o=0;for(let s=i-t+1;s<=i;s++){let l=e[s];if(!C(l))return null;o+=l}return o/t})}function ui(e,n="max"){let t=0;for(let r of e)C(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>C(r)?t===0?0:r/t:null)}function hi(e,n="desc"){let t=e.filter(C).sort((r,i)=>n==="asc"?r-i:i-r);return e.map(r=>C(r)?t.indexOf(r)+1:null)}var fi=(e,n=-1/0,t=1/0)=>e.map(r=>C(r)&&r>=n&&r<=t?r:null),mi=(e,n="asc")=>[...e].sort((t,r)=>C(t)?C(r)?n==="asc"?t-r:r-t:-1:C(r)?1:0);function pi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),i=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(C);if(s.length===0){i.push(null);continue}let l=s.reduce((c,d)=>c+d,0);i.push(t==="sum"?l:t==="mean"?l/s.length:t==="min"?Math.min(...s):Math.max(...s))}return i}function bi(e,n={}){let t=e.filter(C),r=tt(t,n);return{edges:r,counts:nt(t,r).map(i=>i.count)}}function jt(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=ai(t);break;case"difference":t=li(t);break;case"percentageChange":t=ci(t);break;case"movingAverage":t=di(t,r.window);break;case"normalize":t=ui(t,r.to);break;case"rank":t=hi(t,r.order);break;case"filter":t=fi(t,r.min,r.max);break;case"sort":t=mi(t,r.order);break;case"aggregate":t=pi(t,r.every,r.method);break;case"bin":t=bi(t,r).counts;break}return t}var gi=100,xi=2e3,vr=32,kr=28,lt=e=>e.position==="right"||e.position==="top";function yi(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((i,o)=>({...i,id:i.id??(o===0?"left":o===1?"right":String(o)),position:i.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(i=>i.id==="right"||lt(i));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(i=>i.axis==="right")&&t.push({id:"right",position:"right"}),t}function Mr(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(lt))?.id:e.find(r=>r.id===n)?.id}var at=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function Sr(e,n){let t=Ce(e.format),{series:r,categories:i,issues:o,axes:s}=ki(e,n,t),l=e.direction==="rtl",c=e.baseline??0,d=Math.max(i.length,...r.map(a=>Math.max(a.data.length,a.low.length))),u=r.every(a=>ce(a.data).length===0&&ce(a.high).length===0),h=hr(e,u);if(h)return{...h,issues:o};let b=e.xAxis?.type??"category",v=b!=="category"&&i.length>0&&i.every(a=>typeof a!="string"||b==="time"&&C(le(a))),y=v?i.map(le):[],[p,S]=de(y),k=e.xAxis?.format??(b==="time"?{style:S-p<2*864e5?"time":"date"}:void 0),f=Array.from({length:d},(a,x)=>{let $=i[x];return $===void 0?String(x+1):et($,k)}),M=vi(e.zoom,d),T=Array.from({length:M.end-M.start},(a,x)=>M.start+x),w=e.orientation==="horizontal",F=r.map(a=>({...a,hidden:a.hidden||w&&!at(a)})).filter(a=>!a.hidden),j=F.some(a=>!at(a))?xr(F.filter(a=>!at(a)).map(a=>T.map(x=>(a.kind==="range"?a.high[x]:a.data[x])??null)),T.length,e.sampling):void 0,B=j?j.map(a=>T[a]):T,X=e.stacked==="percent"||e.stackOffset==="expand",J=e.stackOffset??"zero",oe=new Map,me=new Map,pt=new Map;for(let a of F)a.stack!==void 0&&a.kind!=="range"&&pt.set(a.stack,[...pt.get(a.stack)??[],a]);for(let a of pt.values()){let x=new Array(d).fill(c),$=new Array(d).fill(c),_=new Array(d).fill(0);if(X)for(let P of a)P.data.forEach((z,D)=>{C(z)&&(_[D]=_[D]+Math.abs(z))});for(let P of a){let z=[],D=[];for(let N=0;N<d;N++){let G=P.data[N];if(!C(G)){z.push(null),D.push(null);continue}let L=_[N],I=X?L>0?G/L:0:G,H=I>=0?x:$;z.push(H[N]),H[N]=H[N]+I,D.push(H[N])}oe.set(P,z),me.set(P,D)}if(J==="silhouette"||J==="wiggle"){let P=new Array(d).fill(0);if(J==="silhouette")for(let z=0;z<d;z++)P[z]=-(x[z]-c)/2;else{let z=0;for(let D=0;D<d;D++){let N=a.length,G=0;for(let I=0;I<N;I++){let H=a[I],W=H.data[D],K=H.data[D-1],ee=D>0&&C(W)&&C(K)?W-K:0;G+=(N-I-.5)*ee}let L=x[D]-c;z=D===0?-L/2:z-(L>0?G/Math.max(1,N):0),P[D]=z}}for(let z of a){let D=oe.get(z),N=me.get(z);for(let G=0;G<d;G++){let L=D[G],I=N[G];C(L)&&(D[G]=L+P[G]),C(I)&&(N[G]=I+P[G])}}}}let $n=a=>a.kind==="range"?{from:a.low,to:a.high}:{from:oe.get(a)??new Array(d).fill(c),to:me.get(a)??a.data},Cn=a=>{let x=[],$=!1;for(let z of F){if(z.axis!==a)continue;let{from:D,to:N}=$n(z);for(let G of B){let L=N[G];if(C(L)&&x.push(L),z.kind==="range"||z.stack!==void 0){let I=D[G];C(I)&&x.push(I)}}if(z.errors)for(let G of B){let L=wr(z.data[G],z.errors[G]);L&&x.push(L[0],L[1])}(z.kind==="bar"||z.kind==="area")&&J==="zero"&&($=!0)}let[_,P]=de(x);return $?[Math.min(c,_),Math.max(c,P)]:[_,P]},{width:In,height:Tn}=Bt(e),Pr=e.brush?vr+kr:0,An=B.reduce((a,x)=>Math.max(a,f[x].length),0)*ue,On=X?{style:"percent"}:void 0,Nr=a=>{if(a.scale==="log")return ne.left;let[x,$]=Cn(a.id),_=Ce(a.format??On??e.format),P=ve(a.min??x,a.max??$).reduce((z,D)=>Math.max(z,_(D).length),0);return Math.max(ne.left,P*ue+14)+(a.showTicks?a.tickSize??4:0)},bt=a=>w?lt(a)?"top":"bottom":lt(a)!==l?"right":"left",zn=a=>w?24+(a.showTicks?a.tickSize??4:0):Nr(a),Dr=new Set(F.map(a=>a.axis)),gt=s.filter(a=>Dr.has(a.id)||s.length>1),Ln=new Map,we={left:0,right:0,top:0,bottom:0};for(let a of gt){let x=bt(a);Ln.set(a.id,we[x]),we[x]+=zn(a)}let Rn=gt.find(a=>bt(a)==="bottom"),Gr={top:ne.top+ar(e)+(s.some(a=>a.label)?12:0)+we.top,right:w?l?Math.max(ne.left,An+16):ne.right:Math.max(ne.right,we.right),bottom:ne.bottom+Pr+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+we.bottom-(Rn?zn(Rn):0),left:w?l?ne.right:Math.max(ne.left,An+16):Math.max(ne.left,we.left)},U=ir(In,Tn,Gr),Fr=w?l?[U.x+U.width,U.x]:[U.x,U.x+U.width]:[U.y+U.height,U.y],Vn=w?[U.y,U.y+U.height]:l?[U.x+U.width,U.x]:[U.x,U.x+U.width],xt=new Map(s.map(a=>[a.id,{...dr(Cn(a.id),Fr,{format:On,...a},e.format),position:bt(a),offset:Ln.get(a.id)??0}])),Bn=s[0]?.id,Ee=xt.get(Bn),yt=a=>xt.get(Mr(s,a)??Bn)??Ee,se=(a,x)=>yt(x).scale(a),Pn=a=>m(a.scale(Math.min(Math.max(c,Math.min(...a.domain)),Math.max(...a.domain)))),Ue=Qn(B.length,Vn,e.barGap),vt=B.map(a=>y[a]),kt=[...vt].sort((a,x)=>a-x),Me=1/0;for(let a=1;a<kt.length;a++)Me=Math.min(Me,kt[a]-kt[a-1]);let[Se,ze]=de(vt),ae=Me===1/0?Math.max(1,Math.abs(ze)*.05||1):Me/2,Le=Ie([Se-ae,ze+ae],Vn),Ke=a=>m(v?Le(vt[a]):Ue.center(a)),Nn=v?Math.abs(Le(Se+(Me===1/0?ae:Me))-Le(Se))*.8:Ue.bandwidth,Dn=a=>v?Ke(a)-Nn/2:Ue.start(a),_r=v?(b==="time"?er(Se-ae,ze+ae):ve(Se-ae,ze+ae)).filter(a=>a>=Se-ae&&a<=ze+ae).map(a=>({pos:m(Le(a)),label:et(a,k)})):st(B.map((a,x)=>({pos:Ke(x),label:f[a]})),w?1/0:U.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),wt={...Pt(e,In,Tn,r.map(a=>({name:a.name,color:a.color}))),plot:U,xTicks:_r,yTicks:w?st(Ee.ticks,U.width):Ee.ticks,baseline:Pn(Ee)},jr=s[0],Gn=Gt(wt,{horizontal:w,rtl:l,axes:gt.map(a=>{let x=xt.get(a.id);return{ticks:w?st(x.ticks,U.width):x.ticks,position:x.position,offset:x.offset??0,label:a.label,showLine:a.showLine,showTicks:a.showTicks,tickSize:a.tickSize}}),xLabel:e.xAxis?.label,grid:ur(jr),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),Hr=a=>{if(typeof a=="number"&&i.every($=>typeof $=="string"))return a;let x=typeof a=="string"?a:le(a);for(let $=0;$<d;$++){let _=i[$];if(_!==void 0&&(typeof x=="string"?_===x||f[$]===x:le(_)===x))return $}},Fn={plot:U,horizontal:w,x:a=>{if(v&&(typeof a!="string"||C(le(a))))return Le(le(a));let x=Hr(a),$=x===void 0?-1:B.indexOf(x);return $<0?void 0:Ue.center($)},y:(a,x)=>se(a,x)};Gn.push(...Ft(e.references,Fn));let Mt=[],St=new Map;for(let a of F){if(!at(a))continue;let x=a.stack??a,$=Mt.indexOf(x);$<0&&($=Mt.push(x)-1),St.set(a,$)}let qe=Nn/Math.max(1,Mt.length),pe=Math.min(qe,e.barWidth??1/0),_n=(qe-pe)/2,$t=[],Xe=[],Ct=[],It=[],Tt=[],jn=[],Ye=[],Qe=a=>yt(a.axis).format,At=Math.max(0,e.minBarSize??0),Wr=(a,x,$)=>{let _=Math.abs(x-a);if(_>=At)return[Math.min(a,x),_];let z=a+(w?$?1:-1:$?-1:1)*At;return[Math.min(a,z),At]},Re=(a,x,$,_)=>({label:_,series:a.name,seriesId:a.id??a.name,category:f[x],index:x,value:$}),Hn=(a,x,$,_)=>{let P=wr(_,a.errors?.[x]);if(!P)return;let z=m(se(P[0],a.axis)),D=m(se(P[1],a.axis)),N=4,G="var(--skdx-color-text-default)",L=`${a.name}, ${f[x]}: ${Qe(a)(P[0])} \u2013 ${Qe(a)(P[1])}`;jn.push(w?{kind:"line",part:"error-bar",x1:z,x2:D,y1:$,y2:$,stroke:G,title:L}:{kind:"line",part:"error-bar",x1:$,x2:$,y1:z,y2:D,stroke:G,title:L},w?{kind:"line",part:"error-cap",x1:z,x2:z,y1:m($-N),y2:m($+N),stroke:G}:{kind:"line",part:"error-cap",x1:m($-N),x2:m($+N),y1:z,y2:z,stroke:G},w?{kind:"line",part:"error-cap",x1:D,x2:D,y1:m($-N),y2:m($+N),stroke:G}:{kind:"line",part:"error-cap",x1:m($-N),x2:m($+N),y1:D,y2:D,stroke:G})};for(let a of F){let{from:x,to:$}=$n(a),_=Qe(a),P=B.length<=xi;if(a.kind==="bar"){let L="";B.forEach((I,H)=>{let W=a.data[I],K=x[I],ee=$[I];if(!C(W)||!C(K)||!C(ee))return;let $e=se(K,a.axis),ye=se(ee,a.axis),[Ve,Be]=Wr($e,ye,ee>=K),Pe=Dn(H)+St.get(a)*qe+_n,Zn=m(w?Ve:Pe),En=m(w?Pe:Ve),Ot=m(w?Be:pe),Un=m(w?pe:Be);if(!P){L+=`M${Zn} ${En}h${Ot}v${Un}h${-Ot}Z`;return}let Kn=Dt(a.name,f[I],X?ee-K:W,_);if(Xe.push({kind:"rect",part:"bar",x:Zn,y:En,width:Ot,height:Un,fill:a.color,rx:e.radius,title:Kn,item:Re(a,I,W,Kn)}),Hn(a,I,m(Pe+pe/2),W),e.labels){let qn=_(X?ee-K:W);Tt.push(w?q(m(Math.max($e,ye)+4),m(Pe+pe/2),qn,{baseline:"middle"}):q(m(Pe+pe/2),m(Math.min($e,ye)-4),qn,{anchor:"middle"}))}}),L&&Xe.push({kind:"path",part:"bars",d:L,fill:a.color,title:a.name});continue}if(a.kind==="range"&&a.style==="bar"){B.forEach((L,I)=>{let H=x[L],W=$[L];if(!C(H)||!C(W))return;let K=se(Math.min(H,W),a.axis),ee=se(Math.max(H,W),a.axis),$e=Dn(I)+St.get(a)*qe+_n,ye=`${a.name}, ${f[L]}: ${_(Math.min(H,W))} \u2013 ${_(Math.max(H,W))}`,Ve=Re(a,L,W,ye),Be=Math.max(1,Math.abs(ee-K));Xe.push(w?{kind:"rect",part:"range",x:m(Math.min(K,ee)),y:m($e),width:m(Be),height:m(pe),fill:a.color,rx:e.radius,title:P?ye:void 0,item:Ve}:{kind:"rect",part:"range",x:m($e),y:m(Math.min(K,ee)),width:m(pe),height:m(Be),fill:a.color,rx:e.radius,title:P?ye:void 0,item:Ve})});continue}let z=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,D=[],N=[];B.forEach((L,I)=>{let H=x[L],W=$[L];if(!C(W)||!C(H)){!z&&N.length&&(D.push(N),N=[]);return}N.push({x:Ke(I),y:m(se(W,a.axis)),y0:m(se(H,a.axis)),i:L})}),N.length&&D.push(N);let G=a.markers??B.length<=gi;for(let L of D){let I=ke(L,a.curve);if(a.kind==="range"&&a.style==="line"){Ct.push({kind:"path",part:"range-high",d:I,stroke:a.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:ke(L.map(H=>({x:H.x,y:H.y0})),a.curve),stroke:a.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(a.kind==="range"){let H=ke([...L].reverse().map(W=>({x:W.x,y:W.y0})),a.curve);$t.push({kind:"path",part:"range",d:`${I}L${H.slice(1)}Z`,fill:a.color,fillOpacity:.2,title:a.name});continue}if(a.kind==="area"){let H=Pn(yt(a.axis)),W=a.stack!==void 0?ke([...L].reverse().map(ee=>({x:ee.x,y:ee.y0})),a.curve).slice(1):`${L[L.length-1]?.x} ${H}L${L[0]?.x} ${H}`,K=`skdx-g-${a.index}`;a.gradient&&!Ye.some(ee=>ee.id===K)&&Ye.push({id:K,vertical:!0,stops:[{offset:0,color:a.color,opacity:a.fillOpacity},{offset:1,color:a.color,opacity:0}]}),$t.push({kind:"path",part:"area",d:`${I}L${W}Z`,fill:a.gradient?`url(#${K})`:a.color,fillOpacity:a.gradient?void 0:a.fillOpacity})}Ct.push({kind:"path",part:"line",d:I,stroke:a.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:a.dash})}if(a.kind==="range"&&P)for(let L of D)for(let I of L){let H=a.low[I.i],W=a.high[I.i],K=`${a.name}, ${f[I.i]}: ${_(Math.min(H,W))} \u2013 ${_(Math.max(H,W))}`;It.push({...je(I.x,I.y,.01,a.color,K,Re(a,I.i,W,K)),part:"anchor"})}if(a.kind!=="range")for(let L of D)for(let I of L){if(!G&&!P&&!e.labels&&!a.errors)continue;let H=a.data[I.i],W=X?$[I.i]-x[I.i]:H,K=Dt(a.name,f[I.i],W,_);(G||P)&&It.push(G&&a.symbol!=="circle"?yr(I.x,I.y,a.markerSize,a.symbol,a.color,P?K:void 0,Re(a,I.i,H,K),"point"):{...je(I.x,I.y,G?a.markerSize:.01,a.color,P?K:void 0,Re(a,I.i,H,K)),part:G?"point":"anchor"}),P&&Hn(a,I.i,w?I.y:I.x,$[I.i]),e.labels&&Tt.push(q(I.x,I.y-8,_(W),{anchor:"middle"}))}}let Wn={plot:U,xs:w?[]:B.map((a,x)=>Ke(x)),rows:B.map(a=>[f[a],...F.map(x=>{let $=Qe(x);if(x.kind==="range"){let P=x.low[a],z=x.high[a];return`${x.name}: ${C(P)&&C(z)?`${$(P)} \u2013 ${$(z)}`:"\u2014"}`}let _=x.data[a];return`${x.name}: ${C(_)?$(X?(me.get(x)?.[a]??0)-(oe.get(x)?.[a]??0):_):"\u2014"}`})]),count:d,zoom:M,crosshair:or(e)},Je=[];if(e.brush&&!w){let a={x:U.x,y:U.y+U.height+kr,width:U.width,height:vr},x=F.find(_=>_.kind!=="range"),$={x:m(a.x+M.start/Math.max(1,d)*a.width),y:a.y,width:m((M.end-M.start)/Math.max(1,d)*a.width),height:a.height};if(Je.push({kind:"rect",part:"brush",x:a.x,y:a.y,width:a.width,height:a.height,fill:"var(--skdx-color-surface-sunken)",stroke:V.grid}),x){let _=ce(x.data),[P,z]=de(_),D=d>1?a.width/(d-1):0,N=x.data.flatMap((L,I)=>C(L)?[{x:m(a.x+I*D),y:m(a.y+a.height-(z===P?.5:(L-P)/(z-P))*(a.height-4)-2)}]:[]),G=ke(N);N.length>1&&Je.push({kind:"path",part:"brush-series",d:`${G}L${N[N.length-1]?.x} ${a.y+a.height}L${N[0]?.x} ${a.y+a.height}Z`,fill:x.color,fillOpacity:.3})}Je.push({kind:"rect",part:"brush-window",...$,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:V.axis},{kind:"rect",part:"brush-handle",x:m($.x-3),y:a.y+8,width:6,height:a.height-16,fill:V.axis,rx:2},{kind:"rect",part:"brush-handle",x:m($.x+$.width-3),y:a.y+8,width:6,height:a.height-16,fill:V.axis,rx:2}),Wn.brush={box:a,window:$}}return{...wt,shapes:[...Gn,...$t,...Xe,...Ct,...jn,...It,...Tt,...gr(e.annotations,Fn),...Je,...wt.shapes],hit:Wn,issues:o,defs:Ye.length?Ye:void 0}}function wr(e,n){if(!(!C(e)||n===null||n===void 0))return typeof n=="number"?C(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:C(n[0])&&C(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function vi(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function ki(e,n,t){let r=f=>f.type??n,i=[],o=yi(e),s=e.categories??[],l=(e.transforms??[]).filter(f=>f.type==="sort"||f.type==="bin"||f.type==="aggregate"),c=(e.transforms??[]).filter(f=>!l.includes(f)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",u=(f,M,T)=>{let w=T.filter(O=>O!==null&&!(typeof O=="number"&&Number.isFinite(O))).length;w&&i.push({code:"invalid-value",severity:"warning",message:`Series "${f}" has ${w} value${w===1?"":"s"} that ${w===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:M??f}),s.length&&T.length!==s.length&&!e.transform&&i.push({code:"length-mismatch",severity:"warning",message:`Series "${f}" has ${T.length} values for ${s.length} categories.`,itemId:M??f})},h=e.series.map((f,M)=>{let T=r(f),w=d?!0:void 0,O=f.type==="range"?void 0:f.stack,F=O===!1?void 0:O===!0||O===void 0&&w?`${T}`:O;f.type==="range"?(u(f.name,f.id,f.low),u(f.name,f.id,f.high)):u(f.name,f.id,f.data);let j=X=>e.nulls==="zero"?X.map(J=>C(J)?J:0):X,B=Mr(o,f.axis);return B===void 0&&i.push({code:"unknown-axis",severity:"warning",message:`Series "${f.name}" names axis "${String(f.axis)}", which is not defined; drawn on the first axis.`,itemId:f.id??f.name}),{name:f.name,id:f.id,color:lr(e,M,f.color),axis:B??o[0]?.id,hidden:cr(e,f.name),index:M,kind:T,data:f.type==="range"?[]:j(jt(jt(f.data,c),f.transforms)),low:f.type==="range"?f.low:[],high:f.type==="range"?f.high:[],curve:f.curve??e.curve??"linear",dash:f.type==="range"?void 0:f.dash,markers:f.type==="range"?void 0:f.markers,symbol:f.type==="range"?"circle":f.symbol??"circle",markerSize:f.type==="range"?3:f.markerSize??3,errors:f.type==="range"?void 0:f.errors,stack:T==="range"||T==="line"?void 0:F,style:f.type==="range"?f.style??"area":"area",fillOpacity:(f.type==="range"?void 0:f.fillOpacity)??e.fillOpacity??.25,gradient:f.type!=="range"&&f.gradient===!0}}),b=()=>Math.max(s.length,...h.map(f=>Math.max(f.data.length,f.low.length))),v=f=>{let M=w=>w.length?f.map(O=>w[O]??null):w,T=Array.from({length:b()},(w,O)=>s[O]??String(O+1));s=f.map(w=>T[w]),h=h.map(w=>({...w,data:M(w.data),low:M(w.low),high:M(w.high)}))},y=(f,M)=>{let T=(M!==void 0?h.find(O=>O.name===M):void 0)??h.find(O=>!O.hidden&&O.kind!=="range")??h[0];M!==void 0&&!h.some(O=>O.name===M)&&i.push({code:"unknown-series",severity:"warning",message:`sort.by names "${M}", which is not a series; sorted by the first series.`});let w=Array.from({length:b()},(O,F)=>F).sort((O,F)=>{let j=T?.data[O]??T?.high[O],B=T?.data[F]??T?.high[F],X=C(j)?j:-1/0,J=C(B)?B:-1/0;return f==="asc"?X-J:J-X});v(w)},p=f=>{let M=h.flatMap(w=>ce(w.data)),T=tt(M,f);s=T.slice(1).map((w,O)=>`${t(T[O])}\u2013${t(w)}`),h=h.map(w=>{let O=ce(w.data),F=0,j=nt(O,T).map(B=>e.binMode==="density"?O.length?B.count/(O.length*(B.x1-B.x0)):0:e.binMode==="cumulative"?F+=B.count:B.count);return{...w,data:j}})},S=(f,M)=>{let T=Math.max(1,Math.floor(f)),w=b(),O=j=>{if(!j.length)return j;let B=[];for(let X=0;X<w;X+=T){let J=ce(j.slice(X,X+T));B.push(J.length===0?null:M==="sum"?J.reduce((oe,me)=>oe+me,0):M==="mean"?J.reduce((oe,me)=>oe+me,0)/J.length:M==="min"?Math.min(...J):Math.max(...J))}return B};s=Array.from({length:w},(j,B)=>s[B]??String(B+1)).filter((j,B)=>B%T===0),h=h.map(j=>({...j,data:O(j.data),low:O(j.low),high:O(j.high)}))};e.transform==="histogram"?p({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(f=>{let M=0;return{...f,data:f.data.map(T=>C(T)?M+=T:M)}}));for(let f of l)f.type==="sort"?y(f.order??"desc"):f.type==="bin"?p(f):f.type==="aggregate"&&S(f.every,f.method??"sum");typeof e.sort=="string"?y(e.sort):e.sort&&y(e.sort.order,e.sort.by);let k=e.xAxis?.domain;if(k){let f=b(),M=Array.from({length:f},(F,j)=>s[j]??String(j+1)),T=F=>{let j=typeof F=="string"?F:le(F);return M.findIndex(B=>typeof j=="string"?B===j||et(B)===j:le(B)===j)},w=k.map(T),O=F=>F.length?w.map(j=>j<0?null:F[j]??null):F;s=[...k],h=h.map(F=>({...F,data:O(F.data),low:O(F.low),high:O(F.high)}))}return{series:h,categories:s,issues:i,axes:o}}function ct(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ht=e=>e.id??e.name??e.series,$r=e=>e.seriesId??e.series;function he(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ht(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,$r(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 be(e){let n={},t=Ht(e);t!==void 0&&(n.id=t);let r=$r(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Wt=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Zt(e,n,t){let r=ct(e),i=be(n),o=r.some(s=>he(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!he(n,s)):[...r,i]}var wi=.2;function Mi(e){let n=V.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var Si=(e,n)=>e.kind==="text"?{...e,fill:V.grid}:{...e,opacity:(e.opacity??1)*n};function Et(e,n){let t=ct(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:ct(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=[],l=u=>!i||r.some(h=>he(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&he(u,{series:h.series})):!1,c=u=>{if(!i||o.faded==="none"||l(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&he(u,{series:h})}return!0},d=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(b=>he(h,b))){let b=Mi(u);b&&s.push(b)}return c(h)?Si(u,wi):u});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}function Ut(e){let n=e.variant??"area";return Sr({...e,series:e.series.map(t=>({type:"range",name:t.name,low:t.low,high:t.high,color:t.color,axis:t.axis,curve:t.curve,style:n}))},"bar")}function Oe(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 Kt=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Cr(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 He(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Cr(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function qt(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Cr(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:V.axis,dash:"3 3"}}function Xt(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Kt(r.plot,n,t))return[];let i=qt(e,n),{rows:o}=He(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...ot(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Yt(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 Xt(e,i,t.plot.y+8)}function Qt(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:c,y:d}=Oe(t,r,i,e.width,e.height);if(Kt(e.hit.plot,c,d)){let u=He(e,c),h=qt(e,c);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?ge(e,n)?.item:void 0,l=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(c=>c.tagName.toLowerCase()==="title")?.textContent;return l?{lines:Array.isArray(l)?l:[l],shapes:[]}:{lines:[],shapes:[]}}function Ir(e,n,t,r,i,o,s){let l=e?.closest?.("[data-skdx-part]"),c=s&&s.tooltipFormatter?ge(s,e)?.item:void 0,d=c&&s?.tooltipFormatter?.(c)||l&&Array.from(l.children).find(y=>y.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let u=s?.tooltipAnchored?ge(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:b,y:v}=h?We(h):Oe(n,t,r,i,o);return ot(b,v,d,i,o,s?.tooltipPlacement)}function Jt(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Oe(t,r,i,e.width,e.height),l=Xt(e,o,s);if(l.length>0)return l}return Ir(n,t,r,i,e.width,e.height,e)}function en(e,n){let t=ge(e,n);return t&&!t.item.legend?be(t.item):null}var $i=(e,n)=>{let{x:t,y:r}=We(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 tn(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!$i(i,n))continue;let o=be(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var nn=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:V.focus,opacity:.12,stroke:V.focus}),ut=(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 Tr(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],l=e[o];s.y>t!=l.y>t&&n<(l.x-s.x)*(t-s.y)/(l.y-s.y)+s.x&&(r=!r)}return r}function rn(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}=We(i),l=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Tr(n,o,l))continue;let c=be(i.item),d=JSON.stringify(c);t.has(d)||(t.add(d),r.push(c))}return r}var on=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:V.focus,fillOpacity:.12,stroke:V.focus,dash:"4 3"}),dt=6;function sn(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-dt||n>i.x1+dt))return Math.abs(n-i.x0)<=dt?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=dt?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function an(e,n,t){let r=e.edit;return Ar(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function ln(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(c=>c.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",l=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Ar(r,{bar:o,mode:s},i*l)}function Ar(e,{bar:n,mode:t},r){let i=l=>e.snap?Math.round(l/e.snap)*e.snap:l,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 cn(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:V.focus,opacity:.25,stroke:V.focus,rx:2}}var Ci=64,Ii=e=>Math.max(1,Math.min(Ci,e));function dn(e,n,t,r){let i=n>0?.8:1.25,o=Ii(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:l}=e,[c,d]=e.view.center,u=(t-(s.x+s.width/2))/l,h=(r-(s.y+s.height/2))/l,b=e.view.zoom/o;return{center:[c+u*(1-b),e.fromY(e.toY(d)-h*(1-b))],zoom:o}}function un(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 ge(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 ht=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function We(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 hn(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=V.focus,i;switch(t.kind){case"rect":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ue+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}=We(t),l=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...l?ot(m(o),m(s),l,e.width,e.height):[]]}function fn(e,n,t){let r=ht(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 Te=2,Ae=(e,n,t)=>{let r=Math.max(Te,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Or=(e,n)=>!e||e.start<=0&&e.end>=n;function mn(e,n,t){if(e.count<=Te||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,l=Math.max(Te,Math.min(e.count,Math.round(o*s)));if(l===o)return n>0&&!Or(e.zoom,e.count)?Ae(r,l,e.count):void 0;let c=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+c*o;return Ae(d-c*l,l,e.count)}function pn(e,n,t,r){let i=n.end-n.start,o=Math.max(Te,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 Ae(n.start+s*i-s*o,o,e.count)}function bn(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Ae(n.start-t/i,r,e.count)}function gn(e,n,t){let r=e.brush;if(!r||!Kt(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:Ae(s-o/2,o,e.count)}}function xn(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 Ae(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Te,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+Te,Math.round(t.end+o)));return{start:t.start,end:s}}function vn(e,n){switch(n.type){case"svg":return Promise.resolve(yn(e,n.label,n.resolve));case"csv":return Promise.resolve(Vr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=yn(e,n.label,n.resolve);return Rr(t,e.width,e.height,n.scale,n.background)}}}var fe=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),Ze=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${fe(String(t))}"`).join("");function zr(e){let n=e.title?`<title>${fe(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Ze([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${Ze([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${Ze([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${Ze([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Ze([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${fe(e.text)}</text>`}}function Lr(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${fe(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="${fe(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function yn(e,n,t){let r=Lr(e)+e.shapes.map(zr).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="${fe(n)}" font-family="${fe(V.fontFamily)}" font-size="${fe(V.fontSize)}"><title>${fe(n)}</title>${r}</svg>`}function Rr(e,n,t,r=2,i){return new Promise((o,s)=>{let l=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),c=new Image;c.onload=()=>{URL.revokeObjectURL(l);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let u=d.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,d.width,d.height)),u.drawImage(c,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},c.onerror=()=>{URL.revokeObjectURL(l),s(new Error("svg could not be decoded"))},c.src=l})}function Vr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
2
+ `)}function kn(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let l=r.rows[0];if(r.rows.length>t)return;let c=["",...l.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],d=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[c,...d]}let i=e.shapes.flatMap(l=>l.item&&!l.item.legend&&!(l.part==="anchor"&&!l.title)?[l.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(l=>i.some(c=>c[l]!==void 0)),s=(l,c)=>l[c]===void 0?"":String(l[c]);return[o.map(l=>l[0]?.toUpperCase()+l.slice(1)),...i.map(l=>o.map(c=>s(l,c)))]}var wn=new Map;function ft(e){let n=wn.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&&wn.delete(e)}},publish(o,s){Object.assign(r,o);for(let l of t)l(o,s)}};return wn.set(e,{group:i,listeners:t}),i}var Br='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',Mn=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Br}{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){${Br}{animation:none;transition:none}}`;function Sn(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}import{css as Ti,html as xe,LitElement as Ai,nothing as Y,svg as re}from"lit";import{property as A,state as ie}from"lit/decorators.js";import{ifDefined as E}from"lit/directives/if-defined.js";var Oi={fromAttribute:()=>!1},R=class extends Ai{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=[nn(ut(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=[on(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=an(r,i.gantt,o-i.x),this.overlay=[cn(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(un(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,l]=[...this.pointers.values()];if(s===void 0||l===void 0||!i.distance)return;this.setZoom(pn(r.hit,i.zoom,Math.abs(s-l)/i.distance,(s+l)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?bn(r.hit,i.zoom,o-i.x):xn(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=Qt(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=Jt(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(en(r,t.target)),this.syncId&&r.hit?.crosshair){let o=He(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=ge(r,t.target)?.item.legend,l=this.canEdit(r)?sn(r,i,o):void 0;if(l){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:l},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 d=r.map.plot;if(i<d.x||i>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let c=r.hit;if(!(!c||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[d,u]=[...this.pointers.values()];this.drag={x:(d+u)/2,y:o,zoom:c.zoom,grab:"pinch",distance:Math.abs(d-u)||1}}else{let d=gn(c,i,o);if(d)this.drag={x:i,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==c.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&i>=c.plot.x&&i<=c.plot.x+c.plot.width&&o>=c.plot.y&&o<=c.plot.y+c.plot.height)this.drag={x:i,y:o,zoom:c.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:l}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(l-i.y)>2){i.grab==="select"?this.setSelected(tn(o,ut(i.x,i.y,s,l))):i.grab==="lasso"?this.setSelected(rn(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;t.preventDefault(),this.setView(dn(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 l=mn(s,t.deltaY,i);l&&(t.preventDefault(),this.setZoom(l))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=ge(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let l=r.shapes[this.focused]?.item;l&&(t.preventDefault(),this.select(l),this.emit("skdx-item-click",l));return}let i=this.canEdit(r)?ln(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=fn(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?be(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:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,animated:v,responsive:y,highlighted:p,highlightScope:S,accessibleTable:k}=this;return{...typeof y=="object"&&this.measured!==void 0&&this.measured<(y.breakpoint??480)?y.compact:void 0,width:y&&this.measured?this.measured:t,height:r,animate:v,responsive:y,legend:i,tooltip:o,format:s,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,highlighted:p===void 0?this.highlightState:p,highlightScope:S,accessibleTable:k,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&&ft(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=ft(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&&Wt(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Zt(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 Oe(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&&he(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?vn(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Et(Nt(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),l=this.canPan(o),c=this.canEdit(o),d=this.brushing(),u=s||l||c||d,h=!o.decorative&&ht(o).length>0,b=o.description?`${r}-desc`:void 0,v=Sn(o),y=kn(o,this.accessibleTable),p=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,S=this.portal;return xe`<svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 ${o.width} ${o.height}"
5
+ width=${o.width}
6
+ height=${o.height}
7
+ role=${o.decorative?"presentation":"img"}
8
+ aria-hidden=${o.decorative?"true":Y}
9
+ aria-label=${o.decorative?Y:i}
10
+ aria-describedby=${E(b)}
11
+ tabindex=${h?0:Y}
12
+ data-skdx-chart=${r}
13
+ data-zoomable=${s||l?"":Y}
14
+ data-brushing=${d&&!(s||l)?"":Y}
15
+ data-editable=${c?"":Y}
16
+ style=${v?`--skdx-chart-duration:${v}`:Y}
17
+ font-family=${V.fontFamily}
18
+ font-size=${V.fontSize}
19
+ @pointermove=${o.tooltip||u?this.onPointerMove:Y}
20
+ @pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
21
+ @pointerdown=${u?this.onPointerDown:Y}
22
+ @pointerup=${u?this.onPointerUp:Y}
23
+ @pointercancel=${u?this.onPointerUp:Y}
24
+ @wheel=${s||l?this.onWheel:Y}
25
+ @dblclick=${s||l?()=>l?this.setView(void 0):this.setZoom(void 0):Y}
26
+ @click=${this.onClick}
27
+ @keydown=${h?this.onKeyDown:Y}
28
+ @blur=${()=>{this.focused=null,this.highlight(null)}}
29
+ >
30
+ <title>${i}</title>
31
+ ${o.description?re`<desc id=${E(b)}>${o.description}</desc>`:Y}
32
+ ${v?re`<style>${Mn}</style>`:Y} ${zi(o)}
33
+ ${mt(o.shapes)}
34
+ ${mt(this.tip.length||!this.crossState?this.tip:Yt(o,this.crossState))}
35
+ ${mt(hn(o,this.focused))} ${mt(this.overlay)}
36
+ </svg>
37
+ ${S?xe`<div
38
+ role="tooltip"
39
+ data-skdx-tooltip=${r}
40
+ style="left:${S.x+12}px;top:${S.y+12}px"
41
+ >
42
+ ${S.lines.map(k=>xe`<div>${k}</div>`)}
43
+ </div>`:Y}
44
+ ${y?xe`<table data-skdx-table=${r}>
45
+ <caption>
46
+ ${p}
47
+ </caption>
48
+ <thead>
49
+ <tr>
50
+ ${(y[0]??[]).map(k=>xe`<th scope="col">${k}</th>`)}
51
+ </tr>
52
+ </thead>
53
+ <tbody>
54
+ ${y.slice(1).map(k=>xe`<tr>
55
+ ${k.map((f,M)=>M===0?xe`<th scope="row">${f}</th>`:xe`<td>${f}</td>`)}
56
+ </tr>`)}
57
+ </tbody>
58
+ </table>`:Y}`}};R.styles=Ti`
59
+ :host {
60
+ display: inline-block;
61
+ }
62
+ svg {
63
+ display: block;
64
+ max-width: 100%;
65
+ height: auto;
66
+ outline: none;
67
+ }
68
+ svg[data-zoomable] {
69
+ cursor: grab;
70
+ touch-action: none;
71
+ }
72
+ svg[data-brushing] {
73
+ cursor: crosshair;
74
+ touch-action: none;
75
+ }
76
+ svg[data-editable] {
77
+ touch-action: none;
78
+ }
79
+ :host([responsive]) {
80
+ display: block;
81
+ }
82
+ table {
83
+ position: absolute;
84
+ width: 1px;
85
+ height: 1px;
86
+ margin: -1px;
87
+ padding: 0;
88
+ overflow: hidden;
89
+ clip: rect(0 0 0 0);
90
+ white-space: nowrap;
91
+ border: 0;
92
+ }
93
+ [role='tooltip'] {
94
+ position: fixed;
95
+ pointer-events: none;
96
+ z-index: 1000;
97
+ background: var(--skdx-color-surface-raised);
98
+ color: var(--skdx-color-text-default);
99
+ border: 1px solid var(--skdx-color-border-strong);
100
+ border-radius: 3px;
101
+ padding: 4px 8px;
102
+ font-family: var(--skdx-font-family);
103
+ font-size: var(--skdx-font-size-xs);
104
+ white-space: nowrap;
105
+ }
106
+ [role='tooltip'] > :first-child:not(:only-child) {
107
+ font-weight: bold;
108
+ }
109
+ `,g([A({type:Number})],R.prototype,"width",2),g([A({type:Number})],R.prototype,"height",2),g([A()],R.prototype,"label",2),g([A({type:Boolean,reflect:!0})],R.prototype,"legend",2),g([A({type:Boolean,attribute:"no-tooltip",converter:Oi})],R.prototype,"tooltip",2),g([A({attribute:!1})],R.prototype,"format",2),g([A({attribute:!1})],R.prototype,"palette",2),g([A({attribute:!1})],R.prototype,"hiddenSeries",2),g([A({attribute:!1})],R.prototype,"selected",2),g([A({attribute:"selection-mode"})],R.prototype,"selectionMode",2),g([A({attribute:!1})],R.prototype,"highlighted",2),g([A({attribute:!1})],R.prototype,"highlightScope",2),g([A({type:Boolean,reflect:!0})],R.prototype,"loading",2),g([A()],R.prototype,"error",2),g([A({attribute:"empty-message"})],R.prototype,"emptyMessage",2),g([A()],R.prototype,"description",2),g([A({type:Boolean,reflect:!0})],R.prototype,"decorative",2),g([A({type:Boolean,attribute:"accessible-table"})],R.prototype,"accessibleTable",2),g([A({attribute:!1})],R.prototype,"zoom",2),g([A({attribute:!1})],R.prototype,"view",2),g([A({type:Boolean,reflect:!0})],R.prototype,"zoomable",2),g([A({type:Boolean,reflect:!0})],R.prototype,"editable",2),g([A({attribute:"sync-id"})],R.prototype,"syncId",2),g([A({type:Boolean,attribute:"cross-filter"})],R.prototype,"crossFilter",2),g([A({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],R.prototype,"animated",2),g([A({type:Boolean,reflect:!0})],R.prototype,"responsive",2),g([ie()],R.prototype,"tip",2),g([ie()],R.prototype,"overlay",2),g([ie()],R.prototype,"portal",2),g([ie()],R.prototype,"measured",2),g([ie()],R.prototype,"viewState",2),g([ie()],R.prototype,"highlightState",2),g([ie()],R.prototype,"crossState",2),g([ie()],R.prototype,"focused",2),g([ie()],R.prototype,"hiddenState",2),g([ie()],R.prototype,"zoomState",2),g([ie()],R.prototype,"selectedState",2);var Z=class extends R{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:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:v,stackOffset:y,orientation:p,radius:S,barGap:k,barWidth:f,sort:M,transform:T,transforms:w,bins:O,binWidth:F,binDomain:j,binMode:B,sampling:X,brush:J,crosshair:oe}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:v,stackOffset:y,orientation:p,radius:S,barGap:k,barWidth:f,sort:M,transform:T,transforms:w,bins:O,binWidth:F,binDomain:j,binMode:B,sampling:X,brush:J,crosshair:oe}}};g([A({attribute:!1})],Z.prototype,"series",2),g([A({attribute:!1})],Z.prototype,"categories",2),g([A({attribute:!1})],Z.prototype,"xAxis",2),g([A({attribute:!1})],Z.prototype,"yAxis",2),g([A({attribute:!1})],Z.prototype,"rightAxis",2),g([A({attribute:!1})],Z.prototype,"references",2),g([A({attribute:!1})],Z.prototype,"annotations",2),g([A({type:Boolean,reflect:!0})],Z.prototype,"labels",2),g([A()],Z.prototype,"curve",2),g([A({type:Boolean,attribute:"connect-nulls"})],Z.prototype,"connectNulls",2),g([A()],Z.prototype,"nulls",2),g([A({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],Z.prototype,"stacked",2),g([A({attribute:"stack-offset"})],Z.prototype,"stackOffset",2),g([A()],Z.prototype,"orientation",2),g([A({type:Number})],Z.prototype,"radius",2),g([A({type:Number,attribute:"bar-gap"})],Z.prototype,"barGap",2),g([A({type:Number,attribute:"bar-width"})],Z.prototype,"barWidth",2),g([A()],Z.prototype,"sort",2),g([A()],Z.prototype,"transform",2),g([A({attribute:!1})],Z.prototype,"transforms",2),g([A({type:Number})],Z.prototype,"bins",2),g([A({type:Number,attribute:"bin-width"})],Z.prototype,"binWidth",2),g([A({attribute:!1})],Z.prototype,"binDomain",2),g([A({attribute:"bin-mode"})],Z.prototype,"binMode",2),g([A({attribute:!1})],Z.prototype,"sampling",2),g([A({type:Boolean,reflect:!0})],Z.prototype,"brush",2),g([A({type:Boolean,reflect:!0})],Z.prototype,"crosshair",2);var zi=e=>e.defs&&e.defs.length?re`<defs>${e.defs.map(n=>re`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>re`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${E(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:Y,mt=e=>re`${e.map((n,t)=>{let r=n.title?re`<title>${n.title}</title>`:Y,i=n.item?t:void 0;switch(n.kind){case"path":return re`<path data-skdx-part=${n.part} data-skdx-i=${E(i)} d=${n.d} fill=${n.fill??"none"} stroke=${E(n.stroke)} stroke-width=${E(n.strokeWidth)} stroke-linecap=${E(n.strokeLinecap)} stroke-linejoin=${E(n.strokeLinejoin)} stroke-dasharray=${E(n.dash)} opacity=${E(n.opacity)} fill-opacity=${E(n.fillOpacity)}>${r}</path>`;case"rect":return re`<rect data-skdx-part=${n.part} data-skdx-i=${E(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${E(n.rx)} fill=${n.fill} stroke=${E(n.stroke)} fill-opacity=${E(n.opacity)}>${r}</rect>`;case"line":return re`<line data-skdx-part=${n.part} data-skdx-i=${E(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${E(n.strokeWidth)} stroke-dasharray=${E(n.dash)} opacity=${E(n.opacity)}>${r}</line>`;case"circle":return re`<circle data-skdx-part=${n.part} data-skdx-i=${E(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${E(n.stroke)} opacity=${E(n.opacity)}>${r}</circle>`;case"text":return re`<text data-skdx-part=${n.part} data-skdx-i=${E(i)} x=${n.x} y=${n.y} text-anchor=${E(n.anchor)} dominant-baseline=${E(n.baseline)} fill=${E(n.fill)} font-weight=${E(n.weight)} pointer-events=${E(i===void 0?"none":void 0)} transform=${E(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var Q=class extends R{constructor(){super(...arguments);this.series=[];this.connectNulls=!1;this.brush=!1;this.crosshair=!1}render(){let{series:t,variant:r,categories:i,xAxis:o,yAxis:s,rightAxis:l,references:c,annotations:d,curve:u,connectNulls:h,orientation:b,radius:v,barGap:y,barWidth:p,brush:S,crosshair:k}=this;return this.root(Ut({...this.sized(),series:t,variant:r,categories:i,xAxis:o,yAxis:s,rightAxis:l,references:c,annotations:d,curve:u,connectNulls:h,orientation:b,radius:v,barGap:y,barWidth:p,brush:S,crosshair:k}),"range",this.label??"Range chart")}};g([te({attribute:!1})],Q.prototype,"series",2),g([te()],Q.prototype,"variant",2),g([te({attribute:!1})],Q.prototype,"categories",2),g([te({attribute:!1})],Q.prototype,"xAxis",2),g([te({attribute:!1})],Q.prototype,"yAxis",2),g([te({attribute:!1})],Q.prototype,"rightAxis",2),g([te({attribute:!1})],Q.prototype,"references",2),g([te({attribute:!1})],Q.prototype,"annotations",2),g([te()],Q.prototype,"curve",2),g([te({type:Boolean,reflect:!0,attribute:"connect-nulls"})],Q.prototype,"connectNulls",2),g([te()],Q.prototype,"orientation",2),g([te({type:Number})],Q.prototype,"radius",2),g([te({type:Number,attribute:"bar-gap"})],Q.prototype,"barGap",2),g([te({type:Number,attribute:"bar-width"})],Q.prototype,"barWidth",2),g([te({type:Boolean,reflect:!0})],Q.prototype,"brush",2),g([te({type:Boolean,reflect:!0})],Q.prototype,"crosshair",2),Q=g([Li("skdx-range-chart")],Q);export{Q as SkdxRangeChart};