@tabler/charts-bootstrap 0.3.0 → 0.4.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.
@@ -1,3 +1,4 @@
1
- var TablerCharts=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=0){let n=n=>{let r=typeof e==`number`?e:e?.[n];return Number.isFinite(r)?r:t};return{top:n(`top`),right:n(`right`),bottom:n(`bottom`),left:n(`left`)}}let n=(e,t)=>t?{...e,left:e.right,right:e.left}:e;function r(e,t,n){return{x:n.left,y:n.top,width:Math.max(0,e-n.left-n.right),height:Math.max(0,t-n.top-n.bottom)}}function i(e,n,i){let{width:a,height:o,rtl:s}=e,c=t(n),l=i({...c,start:s?c.right:c.left,end:s?c.left:c.right}),u=r(a,o,{...l,left:s?l.end:l.start,right:s?l.start:l.end}),d=u.x+u.width;return{area:u,side:s?`right`:`left`,range:(e=s)=>e?[d,u.x]:[u.x,d]}}let a=e=>e>=4352&&(e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=127744);function o(e){return e>=`0`&&e<=`9`?e===`1`?.45:.63:" !'.,:;|ijlI`".includes(e)?.27:`()[]{}-/frt`.includes(e)?.38:`%@MWmw`.includes(e)?.88:`CDGHNOQU`.includes(e)?.76:e>=`A`&&e<=`Z`?.66:.57}function s(e,t){let n=0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);n+=c[r]??(a(r)?1:.57),r>65535&&t++}return n*t}let c=/* @__PURE__ */ Array.from({length:128},(e,t)=>o(String.fromCharCode(t))),l=e=>Math.round(e*100)/100,u=1.25,d=`http://www.w3.org/2000/svg`,f={fill:`rgb(0, 0, 0)`,"fill-opacity":`1`,stroke:`none`,"stroke-width":`1px`,"stroke-opacity":`1`,"stroke-dasharray":`none`,"stroke-dashoffset":`0px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"paint-order":`normal`,"shape-rendering":`auto`,"vector-effect":`none`,opacity:`1`,visibility:`visible`},p={...f,"font-family":``,"font-size":``,"font-weight":`400`,"font-style":`normal`,"font-variant-numeric":`normal`,"letter-spacing":`normal`},m={"stop-color":``,"stop-opacity":`1`},h={opacity:`1`},g=/* @__PURE__ */ new Set([`path`,`line`,`rect`,`circle`,`ellipse`,`polygon`,`polyline`]);function _(e){let t=`element`in e&&!(e instanceof Element)?e.element:e,n=t.localName===`svg`?t:t.querySelector(`:scope > svg.tc-chart`);if(!n)throw Error(`@tabler/charts: no rendered chart to export.`);return n}function v(e){let t=e.transform;if(!t||t===`none`)return;let n=t.replace(/px/g,``);if(n.startsWith(`translate`))return n;let[r=0,i=0]=(e.transformOrigin||`0 0`).split(` `).map(Number.parseFloat);return r||i?`translate(${r} ${i}) ${n} translate(${-r} ${-i})`:n}function y(e,t){let n=getComputedStyle(e);if(n.display===`none`)return!1;let r=e.localName,i=r===`text`?p:r===`stop`?m:g.has(r)?f:h,a=[];for(let e in i){let t=n.getPropertyValue(e);t&&t!==i[e]&&a.push(`${e}:${t}`)}t.removeAttribute(`style`),a.length&&t.setAttribute(`style`,a.join(`;`));let o=v(n);o&&t.setAttribute(`transform`,o);let s=Array.from(e.children),c=Array.from(t.children);return s.forEach((e,t)=>{let n=c[t];(e.classList.contains(`tc-hover-layer`)||!y(e,n))&&n.remove()}),!0}function b(e){let t=e.querySelector(`:scope > .tc-legend`),n=t?Array.from(t.querySelectorAll(`.tc-legend-item`)):[];if(!t||!n.length)return;let r=e.ownerDocument,i=e.querySelector(`:scope > svg.tc-patterned`),a=t.getBoundingClientRect(),o=r.createElementNS(d,`g`);for(let e of n){let t=e.querySelector(`.tc-legend-swatch`),n=e.querySelector(`.tc-legend-name`);if(!t||!n)continue;let s=t.getBoundingClientRect(),c=n.getBoundingClientRect(),u=getComputedStyle(t).getPropertyValue(`--tc-series-color`).trim(),f=/\btc-series-([1-8])\b/.exec(e.getAttribute(`class`)??``)?.[1]??`other`,p=i?getComputedStyle(i).getPropertyValue(`--tc-pattern-${f}`).trim():``,m=e.classList.contains(`tc-legend-item-hidden`),h=r.createElementNS(d,`circle`);h.setAttribute(`cx`,String(l(s.left-a.left+s.width/2))),h.setAttribute(`cy`,String(l(s.top-a.top+s.height/2))),h.setAttribute(`r`,String(l(s.width/2-(m?.75:0)))),h.setAttribute(`style`,m?`fill:none;stroke:${u};stroke-width:1.5px`:`fill:${p.startsWith(`url(`)?p:u}`);let g=getComputedStyle(n),_=r.createElementNS(d,`text`);_.setAttribute(`x`,String(l(c.left-a.left))),_.setAttribute(`y`,String(l(c.top-a.top+c.height/2))),_.setAttribute(`dy`,`0.35em`),_.setAttribute(`style`,`fill:${g.color};font-family:${g.fontFamily};font-size:${g.fontSize};font-weight:${g.fontWeight}`),_.textContent=n.textContent,o.append(h,_)}return{svg:o,box:a}}function x(e,t={}){let n=_(e);for(let e of n.getAnimations?.({subtree:!0})??[])e.finish();let r=n.cloneNode(!0);y(n,r);let i=n.ownerDocument,a=Number(n.getAttribute(`width`)),o=Number(n.getAttribute(`height`));r.setAttribute(`xmlns`,d),r.removeAttribute(`class`),r.removeAttribute(`tabindex`),r.removeAttribute(`data-resizing`),r.removeAttribute(`aria-describedby`),r.removeAttribute(`aria-activedescendant`);let s=getComputedStyle(n),c=n.parentElement,u=t.legend!==!1&&c?b(c):void 0,f=a,p=o;if(u){let{box:e}=u,t=n.getBoundingClientRect(),s=Math.min(t.left,e.left),c=Math.min(t.top,e.top),m=i.createElementNS(d,`g`);m.append(...Array.from(r.childNodes));let h=(e,t,n)=>{(t||n)&&e.setAttribute(`transform`,`translate(${l(t)} ${l(n)})`)};h(m,t.left-s,t.top-c),h(u.svg,e.left-s,e.top-c),r.append(m,u.svg),f=l(Math.max(t.left+a,e.right)-s),p=l(Math.max(t.top+o,e.bottom)-c)}r.setAttribute(`width`,String(f)),r.setAttribute(`height`,String(p)),r.setAttribute(`viewBox`,`0 0 ${f} ${p}`);let m=n.getAttribute(`aria-label`);if(m){let e=i.createElementNS(d,`title`);e.textContent=m,r.prepend(e)}let h=t.background===void 0||t.background===`auto`?s.getPropertyValue(`--tc-surface`).trim()||void 0:t.background||void 0;if(h){let e=i.createElementNS(d,`rect`);e.setAttribute(`width`,`100%`),e.setAttribute(`height`,`100%`),e.setAttribute(`fill`,h),r.insertBefore(e,r.querySelector(`:scope > title`)?.nextSibling??r.firstChild)}return new XMLSerializer().serializeToString(r)}async function S(e,t={}){let{type:n=`image/png`,scale:r=2,quality:i}=t,a=x(e,{...t,...n===`image/jpeg`&&t.background===!1?{background:`#fff`}:{}}),o=_(e).ownerDocument,s=new Image;s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(a)}`,await s.decode();let c=o.createElement(`canvas`);c.width=Math.round(s.width*r),c.height=Math.round(s.height*r);let l=c.getContext(`2d`);if(!l)throw Error(`@tabler/charts: no 2d canvas to draw the image.`);return l.drawImage(s,0,0,c.width,c.height),new Promise((e,t)=>{c.toBlob(n=>n?e(n):t(/* @__PURE__ */ Error(`@tabler/charts: could not encode.`)),n,i)})}async function C(e,t={}){let{format:n=`png`}=t,r=_(e),i=n===`svg`?new Blob([x(e,t)],{type:`image/svg+xml`}):await S(e,{...t,type:`image/${n}`}),a=(t.filename??r.getAttribute(`aria-label`)??`chart`).replace(/[\\/:*?"<>|]+/g,``).trim(),o=r.ownerDocument.createElement(`a`);o.href=URL.createObjectURL(i),o.download=`${a||`chart`}.${n===`jpeg`?`jpg`:n}`,o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)}let w={};function T(e){Object.assign(w,e)}let E=e=>e.shapes??e.patterns===!0?w.swatch:void 0,D=/* @__PURE__ */ new Set;function O(e){D.add(e),w.post=(e,t,n,r)=>{for(let i of D)t=i(e,t,n,r);return t}}function k(e){let t=w[e];if(!t)throw Error(`@tabler/charts: Import "@tabler/charts/${e===`dates`?`time`:e}" for ${e}.`);return t}T({export:C});function A(e,t,...n){let r={},i;if(t)for(let e in t){let n=t[e];if(e===`key`)n!=null&&(i=n);else if(e===`class`){let e=j(n);e&&(r.class=e)}else if(e===`style`){let e=N(n);e&&(r.style=e)}else n===!0?r[e]=``:(typeof n==`string`||typeof n==`number`&&Number.isFinite(n))&&(r[e]=n)}let a=[];return P(n,a),{tag:e,attrs:r,children:a,key:i}}function j(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n of e){let e=j(n);e&&(t=t?`${t} ${e}`:e)}return t}let M=/[;{}<>"'\\]|\/\*|\b(?:url(?!\(#[\w-]+\))|src|attr|image|image-set|cross-fade|element|expression)\s*\(/i;function N(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n in e){let r=e[n];r==null||r===``||M.test(String(r))||(t+=`${t?`;`:``}${n}:${r}`)}return t}function P(e,t){for(let n of e){if(n==null||typeof n==`boolean`)continue;if(Array.isArray(n)){P(n,t);continue}if(typeof n==`object`){t.push(n);continue}let e=String(n);if(e===``)continue;let r=t.length-1;r>=0&&typeof t[r]==`string`?t[r]+=e:t.push(e)}}let F=/* @__PURE__ */ new Map,I=/* @__PURE__ */ new Map;function L(e,t,n){let r=e.get(t);return r===void 0&&(e.size>=64&&e.clear(),r=n(),e.set(t,r)),r}function R(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function z(e,t={}){return L(F,R(e,t),()=>new Intl.NumberFormat(e,t))}function B(e,t={}){return L(I,R(e,t),()=>new Intl.DateTimeFormat(e,t))}let V=e=>e===0?0:e;function H(e,t){if(typeof e==`function`)return e;let{compactSymbols:n,...r}=e??{};if(n)return ee(n===!0?U:n,r,t);let i=z(t,r);return e=>i.format(V(e))}let U=[`K`,`M`,`B`,`T`];function ee(e,{notation:t,compactDisplay:n,...r},i){let a=ne(r),o=z(i,a?r:{...r,maximumSignificantDigits:2}),s=a?o:z(i,{...r,maximumFractionDigits:0});return t=>{for(let n=0;;n++){let r=V(t/1e3**n),i=(Math.abs(r)<10?o:s).formatToParts(r),a=``,c;for(let e of i)e.type===`integer`&&(a+=e.value),(e.type===`integer`||e.type===`fraction`)&&(c=e);if(a.length<4||n>=e.length)return n&&c&&(c.value+=e[n-1]),i.map(e=>e.value).join(``)}}}let te=e=>e.notation===`compact`||!!e.compactSymbols,ne=e=>(e.minimumFractionDigits??e.maximumFractionDigits??e.minimumSignificantDigits??e.maximumSignificantDigits)!==void 0;function W(e,t){return H(typeof e==`object`&&te(e)&&!ne(e)?{...e,maximumSignificantDigits:3}:e,t)}function re(e){let t=Math.abs(e);return!Number.isFinite(t)||t===0?0:Math.max(0,-Math.floor(Math.log10(t)+1e-9))}function ie(e){return ne(e)||!!e.compactSymbols||(e.notation??`standard`)!==`standard`}function ae(e,t,n){if(typeof t==`function`)return t;let r=t??{};if(ie(r))return H(r,n);let i=re(e);r.style===`percent`&&(i=Math.max(0,i-2));let a=H({...r,minimumFractionDigits:i,maximumFractionDigits:i},n),o=Math.abs(e)*1e-9;return e=>a(Math.abs(e)<o?0:e)}function oe(e,t){if(typeof e==`function`)return t=>e(typeof t==`number`?new Date(t):t);let n=B(t,e);return e=>n.format(e)}let se=Math.sqrt(50),ce=Math.sqrt(10),le=Math.sqrt(2);function ue(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=se?10:a>=ce?5:a>=le?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&n>=.5&&n<2?ue(e,t,n*2):[s,c,l]}function de(e,t,n=5){if(!(n>0)||!Number.isFinite(e)||!Number.isFinite(t))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?ue(t,e,n):ue(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);for(let e=0;e<s;e++){let t=r?a-e:i+e;c[e]=o<0?t/-o:t*o}return c}function fe(e,t,n){return ue(e,t,n)[2]}function pe(e,t,n=5){let r=t<e,i=r?fe(t,e,n):fe(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function G(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||e===t||!(n>0))return[e,t];let r=t<e,i=r?t:e,a=r?e:t,o;for(let e=0;e<10;e++){let e=fe(i,a,n);if(e===o)return r?[a,i]:[i,a];if(e>0)i=Math.floor(i/e)*e,a=Math.ceil(a/e)*e;else if(e<0)i=Math.ceil(i*e)/e,a=Math.floor(a*e)/e;else break;o=e}return[e,t]}function me(e,t={}){let{count:n=5,format:r,locale:i}=t,[a,o]=e.domain,s=ae(pe(a,o,n),r,i);return e.ticks(n).map(t=>({value:t,position:e(t),label:s(t)}))}function he(e,t=String){return e.domain.map((n,r)=>({value:n,position:e.at(r)+e.bandwidth/2,label:t(n,r)}))}let K=e=>e===`top`||e===`bottom`;function ge(e,t,n,r=8){if(e.length<2)return e.slice();let i=e.map(e=>K(t)?s(e.label,n):n*u),a=(t,n)=>Math.abs(e[n].position-e[t].position)>=(i[t]+i[n])/2+r,o=e.length-1,c=Math.abs(e[o].position-e[0].position),l=i.reduce((e,t)=>e+t+r,0),d=c>0?Math.max(1,Math.floor(l/c)):o;for(let t=d;t<=o;t++){let n=!0;for(let e=t;e<=o&&n;e+=t)n=a(e-t,e);if(!n)continue;let r=[];for(let e=0;e<=o;e+=t)r.push(e);let i=r[r.length-1];return i!==o&&(a(i,o)?r.push(o):r.length>1&&a(r[r.length-2],o)&&(r[r.length-1]=o)),r.map(t=>e[t])}return e.slice(0,1)}function _e(e,t,n,r={}){let{tickSize:i=0,tickPadding:a=8}=r;if(t.length===0)return 0;let o=K(e)?n*u:t.reduce((e,t)=>Math.max(e,s(t.label,n)),0)+3;return Math.ceil(o+i+a)}let ve=(e,t)=>e?Math.ceil(t*u)+6:0;function ye(e,t,n,r,i){let a=_e(e,t,i)+6,o=e===`left`?-1:1,s=a+i*u/2;return A(`text`,{key:`axis-title-${e}`,class:`tc-axis-title tc-axis-title-${e}`,transform:e===`bottom`?`translate(${l(n.x+n.width/2)},${l(n.y+n.height+a)})`:`translate(${l(e===`left`?n.x-s:n.x+n.width+s)},${l(n.y+n.height/2)}) rotate(${o*90})`,dy:e===`bottom`?`0.71em`:`0.32em`,"text-anchor":`middle`,"aria-hidden":`true`},r)}function be(e){let{position:t,ticks:n,area:r,tickSize:i=0,tickPadding:a=8,line:o=!1}=e,s=K(t),c=t===`top`||t===`left`?-1:1,u=c*(i+a),d=t===`top`?r.y:t===`bottom`?r.y+r.height:t===`left`?r.x:r.x+r.width,f=s?{y:u,dy:t===`top`?`0em`:`0.71em`,"text-anchor":`middle`}:{x:u,dy:`0.32em`,"text-anchor":t===`left`?`end`:`start`},p=s?{y2:c*i}:{x2:c*i};return A(`g`,{key:`axis-${t}`,class:[`tc-axis`,s?`tc-axis-x`:`tc-axis-y`,`tc-axis-${t}`],"aria-hidden":`true`},o&&A(`line`,s?{class:`tc-axis-line`,x1:r.x,x2:r.x+r.width,y1:d,y2:d}:{class:`tc-axis-line`,x1:d,x2:d,y1:r.y,y2:r.y+r.height}),n.map(e=>A(`g`,{key:e.value,class:`tc-tick`,style:s?`transform:translate(${l(e.position)}px,${l(d)}px)`:`transform:translate(${l(d)}px,${l(e.position)}px)`},i>0&&A(`line`,{class:`tc-tick-line`,...p}),A(`text`,{class:`tc-tick-label`,...f},e.label))))}function xe(e){let{direction:t,ticks:n,area:r}=e;return A(`g`,{key:`grid-${t}`,class:[`tc-grid`,`tc-grid-${t}`],"aria-hidden":`true`},n.map(e=>{let n=l(e.position);return A(`line`,{key:e.value,class:[`tc-grid-line`,e.value===0&&`tc-grid-line-zero`],...t===`y`?{x1:r.x,x2:r.x+r.width,y1:0,y2:0,style:`transform:translateY(${n}px)`}:{x1:0,x2:0,y1:r.y,y2:r.y+r.height,style:`transform:translateX(${n}px)`}})}))}function Se(e,t,n={}){let{paddingInner:r=0,paddingOuter:i=0,align:a=.5}=n,o=Math.min(1,Math.max(0,r)),s=e.length,[c,l]=t,u=l<c,d=u?l:c,f=u?c:l,p=(f-d)/Math.max(1,s-o+i*2),m=d+(f-d-p*(s-o))*a,h=p*(1-o),g=/* @__PURE__ */ new Map;for(let t=0;t<s;t++){let n=e[t];g.has(n)||g.set(n,t)}let _=e=>m+p*(u?s-1-e:e),v=e=>{let t=g.get(e);return t===void 0?void 0:_(t)};return Object.assign(v,{domain:e.slice(),range:[c,l],bandwidth:h,step:p,at:_,center(e){let t=v(e);return t===void 0?void 0:t+h/2},indexAt(e){if(s===0)return-1;let t=p===0?0:Math.round((e-m-h/2)/p),n=Math.min(s-1,Math.max(0,t));return u?s-1-n:n}})}function Ce(e,t,n={}){let{padding:r=0,align:i}=n;return Se(e,t,{paddingInner:1,paddingOuter:r,...i===void 0?{}:{align:i}})}function we(e){let t=1/0,n=-1/0;for(let r of e)r!=null&&Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t<=n?[t,n]:void 0}function Te(e,t,n={}){let[r,i]=e,[a,o]=t,s=i-r,c=s===0?0:(o-a)/s,l=(a+o)/2,{clamp:u=!1}=n,d=Math.min(a,o),f=Math.max(a,o),p=Math.min(r,i),m=Math.max(r,i);return Object.assign(e=>{if(s===0)return l;let t=a+(e-r)*c;return u?Math.min(f,Math.max(d,t)):t},{domain:[r,i],range:[a,o],invert(e){if(s===0||o===a)return r;let t=r+(e-a)/c;return u?Math.min(m,Math.max(p,t)):t},ticks(e){return de(r,i,e)},nice(e){return Te(G(r,i,e),t,n)}})}let q=e=>typeof e==`number`&&Math.abs(e)<=1e300?Math.abs(e)<1e-300?0:e:null,Ee=e=>q(e)??void 0,J=e=>!!e&&typeof e==`object`&&!Array.isArray(e),De=e=>Array.isArray(e)?e:[],Y=e=>typeof e==`string`?e:q(e)===null?``:String(e),Oe=e=>typeof e==`string`||q(e instanceof Date?+e:e)!==null?e:``,ke=e=>{let t=De(e);return t.every(e=>e==null||q(e)===e)?t:t.map(q)},Ae=(e,t)=>De(e).filter(J).map(t),je=e=>({...e,name:Y(e.name),id:typeof e.id==`string`?e.id:void 0,color:typeof e.color==`string`?e.color:void 0}),Me=e=>{let t=J(e)?e:{};return{...t,labels:Array.isArray(t.labels)?t.labels.map(Oe):void 0,series:Ae(t.series,e=>({...je(e),values:ke(e.values)}))}},X=e=>t=>({...t,data:e(t.data)}),Ne=e=>Ae(e,e=>({...je(e),value:q(e.value)??0,max:Ee(e.max)})),Z=e=>e.id??e.name;function Pe(e){return e.map((e,t)=>{let n={key:Z(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}function Fe(e,t){return{key:Z(e),class:[`tc-series`,`tc-series-${t+1}`,e.class],"data-series":e.name,style:{"--tc-series-color":e.color}}}let Ie=e=>e instanceof Date?e.getTime():e,Q=Z,Le=e=>e.orientation!==`horizontal`&&e.data.series.some(e=>e.axis===`y2`);function Re(e){let t=Le(e),n={second:!1,axis:e.y??{}},r={second:!0,axis:e.y2??{}};return e=>t&&e?.axis===`y2`?r:n}let ze=(e,t)=>e.y2&&t?.axis===`y2`?e.y2:e.y,Be=e=>Pe(e.series);function Ve(e){if(e.labels)return e.labels.slice();let t=Math.max(0,...e.series.map(e=>e.values.length));return Array.from({length:t},(e,t)=>t+1)}function He(e,t){return e==null||!Number.isFinite(e)?!1:t?.scale!==`log`||e>0}let Ue=e=>e.x?.type===`time`&&Ve(e.data).every(e=>Number.isFinite(Ge(e)));function We(e,t){return e.x?.format?e.x.format:Ue(e)?k(`dates`)(Ve(e.data),e.x?.utc,t.locale):e=>String(e)}let Ge=e=>new Date(e).getTime();function Ke(e,t,n){return n.scale===`log`?k(`log`).scale(e,t):Te(e,t)}function qe(e,t,n,r,i){return t.scale===`log`?k(`log`).ticks(e,n,r,i):me(e,{count:n,format:r,locale:i})}let Je=e=>{let{shapes:t,patterns:n}=e;return t??n===!0?w[`point-shapes`]:void 0};function Ye(e,t,n,r,i,a,o){return e?A(`path`,{key:n,class:[r,`tc-marker`],d:e(t,i,a,o)}):A(`circle`,{key:n,class:r,cx:i,cy:a,r:o})}let Xe=(e,t)=>Math.min(q(e?.ticks)??t,100);function Ze(e,t,n,r,i=/* @__PURE__ */ new Set,a,o=[]){let s=a??e.series.filter(e=>!i.has(Q(e))).flatMap(e=>e.values);return Qe(o.length?[...s,...o]:s,t,n,r)}function Qe(e,t,n,r){if(t.scale===`log`)return k(`log`).domain(e,t);let i=q(t.min),a=q(t.max),[o,s]=we(e)??[0,1];if((t.zero??n)&&(o=Math.min(o,0),s=Math.max(s,0)),o===s){if(o===0)s=1;else{let e=Math.abs(o)*.1;o-=e,s+=e}}if(i!==null&&(o=i),a!==null&&(s=a),t.nice!==!1){let[e,t]=G(o,s,r);i===null&&(o=e),a===null&&(s=t)}return[o,s]}function $e(e){return e.annotations?.length?k(`annotations`):void 0}function et(e,t,n,r,i){let a=i===`y2`,o=(a?e.y2:e.y)??{},s=Xe(o,Math.max(2,r)),c;if(a){let r=e.data.series.filter(e=>e.axis===`y2`),i=r.filter(e=>!t.hidden.has(Q(e)));c=Qe((i.length?i:r).flatMap(e=>e.values),o,n.zero2??n.zero,s)}else c=Ze(i===`y`?{...e.data,series:e.data.series.filter(e=>e.axis!==`y2`)}:e.data,o,n.zero,s,t.hidden,n.values,$e(e)?.values(e.annotations));let l=a?o.format:n.tickFormat??o.format,u=e=>Ke(c,e,o),d=e=>qe(e,o,s,l,t.locale);return{scale:u,ticks:d,probe:d(u([0,1]))}}function tt(e,t,n,r,i,a,o){let{area:s,x:c,y:l,xTicks:u,yTicks:d,y2Ticks:f,horizontal:p}=i,m=e.x??{},h=n===`left`?`right`:`left`,g=$e(e)?.layers(e.annotations,{area:s,horizontal:p,fontSize:t.fontSize,value:l,band:c,keys:a,time:o}),_=e.y?.show!==!1&&[be({position:p?`bottom`:n,ticks:d,area:s})],v=(m.show!==!1&&i.labels.length>0||m.line)&&[be({position:p?n:`bottom`,ticks:u,area:s,line:m.line===!0})],y=!!f&&e.y2?.show!==!1&&[be({position:h,ticks:f,area:s})],b=(e,n,r)=>!!e&&ye(n,r||[],s,e,t.fontSize),x=[b(e.y?.title,p?`bottom`:n,!!_&&d),b(m.title,p?n:`bottom`,u),!!f&&b(e.y2?.title,h,!!y&&f)],S=e=>e.flatMap(e=>e||[]);return{...i,background:S([e.y?.grid!==!1&&xe({direction:p?`x`:`y`,ticks:d,area:s}),m.grid&&xe({direction:p?`y`:`x`,ticks:u,area:s}),g?.under]),foreground:S([g?.over,p?v:_,p?_:v,y,...x]),clip:rt(t,s,r)}}function nt(e,t,n){let{data:r}=e,a=e.y??{},o=e.x??{},{fontSize:c,locale:l,width:d,height:f}=t,p=n.overhang??0,m=t.rtl===!0,h=o.reverse??m,g=Ve(r),_=We(e,t),v=a.show!==!1,y=o.show!==!1&&g.length>0,b=Ue(e)&&n.scale===`point`,x=Math.round(f/60),S=Le(e),C=et(e,t,n,x,S?`y`:void 0),w=C.probe,T=e.y2??{},E=S?et(e,t,n,x,`y2`):null,D=!!E&&T.show!==!1,O=Math.max(2,Math.round(d/80)),A=g.map(Ie),j=e=>_(g[e],e),M=b?k(`time`).axis(g,A,o,O,l):{edges:g.length?[j(0),j(g.length-1)]:[],scale:e=>n.scale===`point`?Ce(A,e):Se(A,e,{paddingInner:n.paddingInner??.3,paddingOuter:n.paddingOuter??.15}),ticks:e=>he(e,(e,t)=>j(t))},N=M.edges,P=Math.ceil(c*u/2),F=e=>y?s(N[e?N.length-1:0]??``,c):0,I=F(h!==m),L=F(h===m),R=n.scale===`point`,z=(v?_e(`left`,w,c):0)+ve(a.title,c),B=E?(D?_e(`right`,E.probe,c):0)+ve(T.title,c):0,{area:V,side:H,range:U}=i(t,e.padding,e=>{let t=t=>{let n=e=>R?Math.ceil(e/2):Math.max(0,Math.ceil(e/2-t));return{start:e.start+Math.max(z,n(I),p,v?0:8),end:e.end+Math.max(B,n(L),p,8)}},n=Math.max(1,g.length)*2,r=t((d-e.start-e.end-z-B)/n);return R||(r=t((d-r.start-r.end)/n)),{top:e.top+Math.max(v||D?P:0,p,4),bottom:e.bottom+Math.max((y?_e(`bottom`,[w[0]],c):v?P:0)+ve(o.title,c),p,4),...r}}),ee=M.scale(U(h)),te=C.scale([V.y+V.height,V.y]),ne=E?.scale([V.y+V.height,V.y]),W=ge(C.ticks(te),`left`,c,4),re={area:V,labels:g,x:ee,y:te,horizontal:!1,xTicks:y?ge(M.ticks(ee),`bottom`,c):[],yTicks:W};return E&&ne&&(re.y2=ne,re.y2Ticks=ge(E.ticks(ne),`right`,c,4)),tt(e,t,H,p,re,A,M.time)}function rt(e,t,n){let r=`${e.id}-clip`,i=n+1;return{def:A(`clipPath`,{id:r},A(`rect`,{x:t.x-i,y:t.y-i,width:t.width+i*2,height:t.height+i*2})),url:`url(#${r})`}}function it(e,t){let{dash:n,width:r}=e;return{...Fe(e,t),style:{"--tc-series-color":e.color,"--tc-series-dash":Number.isFinite(n)?`${n}px`:n,"--tc-series-width":Number.isFinite(r)?`${r}px`:void 0}}}function at(e,t,n,r,i){let{area:a,x:o,labels:s,horizontal:c}=e,{data:l}=t,u=We(t,n),d=Re(t),f=l.series.map(e=>d(e).axis),p=f.map(e=>W(e.format,n.locale)),m=e=>{let t=o.at(e),i=t+o.bandwidth/2,d=s[e],m=c?{x:a.x,y:i}:{x:i,y:null},h=[];l.series.forEach((t,i)=>{if(n.hidden.has(Q(t)))return;let a=t.values[e],o=He(a,f[i])?a:null,s=o===null?m:r(i,e,o),c={name:t.name,seriesIndex:i,value:o,text:o===null?`–`:p[i](o),...s};t.color&&(c.color=t.color),h.push(c)});let g={index:e,label:Ie(d),title:u(d,e),x:c?a.x+a.width/2:i,area:a,items:h};return c&&(g.y=i,g.axis=`y`),o.bandwidth>0&&(g.highlight=c?{kind:`band`,x:a.x,y:t,width:a.width,height:o.bandwidth}:{kind:`band`,x:t,y:a.y,width:o.bandwidth,height:a.height}),g};return{count:s.length,reversed:o.range[1]<o.range[0],hitTest(e,t){if(s.length===0||e<a.x-8||e>a.x+a.width+8||t<a.y-8||t>a.y+a.height+8)return null;let n=o.indexAt(c?t:e),r=m(n),l=i?.(e,t,n);return l!==void 0&&(r.seriesIndex=l),r},hitIndex(e,t){if(e<0||e>=s.length)return null;let n=m(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}}}function ot(e,t,n=1/0){let r=Ve(e.data),i=r.length>n?r.slice(0,n):r,a=We(e,t),o=Re(e),s=e.data.series.filter(e=>!t.hidden.has(Q(e))),c=s.map(e=>W(o(e).axis.format,t.locale));return{columns:[``,...s.map(e=>e.name)],total:r.length,rows:i.map((e,t)=>[a(e,t),...s.map((e,n)=>{let r=e.values[t];return r==null||!Number.isFinite(r)?`–`:c[n](r)})])}}function st(e,t){if(e.time){let n=e.time(new Date(Ge(t)));return Number.isFinite(n)?[n,n]:void 0}let n=e.keys.indexOf(Ie(t));return n<0?void 0:[e.band.at(n),e.band.at(n)+e.band.bandwidth]}let ct=(e,t)=>{if(!Array.isArray(e))return t(e);let n=e.map(t);return n.length===2&&!n.includes(null)?n:null},lt=e=>e===void 0?e:Ae(e,e=>({...e,y:e.y===void 0?e.y:ct(e.y,q),x:e.x===void 0?e.x:ct(e.x,Oe),label:e.label==null?void 0:Y(e.label),color:typeof e.color==`string`?e.color:void 0})).filter(e=>e.y!==null&&e.x!==null&&(e.x??e.y)!==void 0),ut=e=>Array.isArray(e);function dt(e){let t=[];for(let n of lt(e)??[])if(n.y!==void 0)for(let e of ut(n.y)?n.y:[n.y])Number.isFinite(e)&&t.push(e);return t}function ft(e,t){if(e=lt(e),!e?.length)return{under:null,over:null};let{area:n,horizontal:r,fontSize:i}=t,a=[],o=[],c=n.x,u=n.x+n.width,d=n.y,f=n.y+n.height,p=(e,t,n)=>e>=t-.5&&e<=n+.5,m=e.map(e=>{let n,i;if(e.y!==void 0){let[a,o]=ut(e.y)?e.y:[e.y,e.y];if(!Number.isFinite(a)||!Number.isFinite(o))return;n=[t.value(a),t.value(o)],i=r}else if(e.x!==void 0){let[a,o]=ut(e.x)?e.x:[e.x,e.x],s=st(t,a),c=st(t,o);if(!s||!c)return;n=ut(e.x)?[Math.min(s[0],c[0]),Math.max(s[1],c[1])]:[(s[0]+s[1])/2,(s[0]+s[1])/2],i=!r}else return;let a=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]),[s,l]=i?[c,u]:[d,f];if(p(a,s,l)||p(o,s,l)||a<s&&o>l)return{a0:Math.max(a,s),a1:Math.min(o,l),vertical:i}}),h=[],g=[];m.forEach((e,t)=>{if(!e||e.a1-e.a0>.5)return;let n=e.a0;g.push([t,e.vertical?[n-1.5,d,n+1.5,f]:[c,n-1.5,u,n+1.5]])});let _=(e,[t,n,r,i])=>e[2]<=t||e[0]>=r||e[3]<=n||e[1]>=i,v=e=>h.every(t=>_(e,t)),y=(e,t)=>v(e)&&g.every(([n,r])=>n===t||_(e,r));return e.forEach((e,t)=>{let n=e.id??t,r=t=>({key:t?`${n}-${t}`:n,class:[`tc-annotation`,e.y===void 0?`tc-annotation-x`:`tc-annotation-y`,e.class],style:{"--tc-annotation-color":e.color}}),p=e.position!==`start`,g=m[t];if(!g)return;let{a0:_,a1:b,vertical:x}=g,S;if(e.label){let n=s(e.label,i*.92),r=b-_<=.5,a=[];if(x){let e=_+4,t=r?_-4-n:Math.max(c,b-4-n),o=e+n<=u?[e,t]:[t,e],s=p?d+i:f-4,l=(p?1:-1)*i*1.2;for(let e of o)if(!(e<c||e+n>u))for(let t=0;t<3;t++)a.push([e,s+t*l]);a.length||a.push([Math.max(c+4,o[0]),s])}else{let e=p?u-4-n:c+4,t=p?c+4:u-4-n;for(let n of[e,t])r?a.push([n,_-4],[n,_+i]):a.push([n,_+i],[n,b-4])}let o=([e,t])=>[e,t-i,e+n,t+i*.25],m=a.find(e=>y(o(e),t))??a.find(e=>v(o(e)))??a[0];h.push(o(m)),S=A(`text`,{class:`tc-annotation-label`,x:l(m[0]),y:l(m[1])},e.label)}if(b-_>.5){let e=x?`M${l(_)},${l(d)}H${l(b)}V${l(f)}H${l(_)}Z`:`M${l(c)},${l(_)}H${l(u)}V${l(b)}H${l(c)}Z`;a.push(A(`g`,r(),A(`path`,{class:`tc-annotation-band`,d:e}))),S&&o.push(A(`g`,r(`label`),S));return}let C=l(_);o.push(A(`g`,r(),A(`line`,x?{class:`tc-annotation-line`,x1:C,x2:C,y1:l(d),y2:l(f)}:{class:`tc-annotation-line`,x1:l(c),x2:l(u),y1:C,y2:C}),S))}),{under:a.length?A(`g`,{key:`annotations-under`,class:`tc-annotations`,"aria-hidden":`true`},a):null,over:o.length?A(`g`,{key:`annotations-over`,class:`tc-annotations`,"aria-hidden":`true`},o):null}}function pt(e,t,n){let r=e[0],i=e[e.length-1],a=r!==void 0&&i!==void 0?Math.abs(Ge(i)-Ge(r)):0,o=oe({year:`numeric`,month:`short`,day:`numeric`,...a>0&&a<2592e5?{hour:`numeric`,minute:`2-digit`}:{},...t?{timeZone:`UTC`}:{}},n);return e=>Number.isFinite(Ge(e))?o(Ge(e)):String(e)}function mt(e,t,n={}){let r=n.base&&n.base>1?n.base:10,i=n.clamp===!0,a=e[0]<0||e[1]<0?-1:1,o=e=>Math.max(Number.MIN_VALUE,e*a),s=Math.log(r),c=r===10?Math.log10:r===2?Math.log2:e=>Math.log(e)/s,l=e=>c(o(e)),u=e=>a*r**e,d=l(e[0]),f=l(e[1]),[p,m]=t,h=f-d,g=h===0?0:(m-p)/h,_=Math.min(p,m),v=Math.max(p,m);return Object.assign(e=>{if(h===0)return(p+m)/2;let t=p+(l(e)-d)*g;return i?Math.min(v,Math.max(_,t)):t},{domain:[e[0],e[1]],range:[p,m],invert(t){return h===0||m===p?e[0]:u(d+(t-p)/g)},ticks(e=5){let t=Math.min(d,f),n=Math.max(d,f);if(!Number.isFinite(t)||!Number.isFinite(n))return[];let i=Math.floor(t),o=Math.ceil(n),s=o-i,c=e=>{let r=l(e);return r>=t-1e-9&&r<=n+1e-9},u=[];if(s<=e&&Number.isInteger(r)){let t=e=>{let t=[];for(let n=i;n<=o;n++)for(let i=1;i<r;i++){let o=a*i*r**n;e(i)&&c(o)&&t.push(o)}return t};u=t(()=>!0),u.length>e*2&&(u=t(e=>e===1||e===2||e===5)),u.length>e*2&&(u=t(e=>e===1))}else{let i=Math.max(1,Math.ceil(s/Math.max(1,e)));for(let e=Math.ceil(t/i)*i;e<=n+1e-9;e+=i){let t=a*r**e;c(t)&&u.push(t)}}return f<d?u.reverse():u},nice(){let e=u(Math.floor(Math.min(d,f))),r=u(Math.ceil(Math.max(d,f)));return mt(f<d?[r,e]:[e,r],t,n)}})}function ht(e,t){let[n,r]=we(e.filter(e=>e!=null&&e>0&&Number.isFinite(e)))??[1,10],i=q(t.min),a=q(t.max);if(i!==null&&i>0&&(n=i),a!==null&&a>0&&(r=a),n===r&&(r=n*10),t.nice!==!1){let e=mt([n,r],[0,1]).nice().domain;i===null&&(n=e[0]),a===null&&(r=e[1])}return[n,r]}function gt(e,t,n,r){let i=H(n,r);return e.ticks(t).map(t=>({value:t,position:e(t),label:i(t)}))}function _t(e){return e?`${e.index}:${e.seriesIndex??``}`:``}function vt(e,t,n,r,i){let a=e.getBoundingClientRect(),o=a.width>0?r/a.width:1,s=a.height>0?i/a.height:1;return{x:(t-a.left)*o,y:(n-a.top)*s}}function yt(e,t,n){return A(`div`,{class:`tc-legend-items`},e.map(e=>{let r=t.has(e.key);return A(`button`,{key:e.key,type:`button`,class:[`tc-legend-item`,`tc-series`,`tc-series-${e.index+1}`,r&&`tc-legend-item-hidden`],style:{"--tc-series-color":e.color,...n?.(e.index)},"aria-pressed":r?`false`:`true`,"data-key":e.key},A(`span`,{class:`tc-legend-swatch`,"aria-hidden":`true`}),A(`span`,{class:`tc-legend-name`},e.name))}))}function bt(e){return new Set(e.filter(e=>e.hidden).map(e=>e.key))}let xt=/^[a-zA-Z_][\w:.-]*$/,St=/^on/i;function Ct(e){return xt.test(e)}function wt(e){return xt.test(e)&&!St.test(e)}let Tt=`http://www.w3.org/2000/svg`,Et=/* @__PURE__ */ new WeakMap,Dt=/* @__PURE__ */ new WeakMap;function Ot(e,t,n){let r=Dt.get(e)??(n?.parentNode===e?n:void 0);if(t===null||!Ct(t.tag))return r&&(r.remove(),Dt.delete(e)),null;if(r&&Pt(r,t))return It(r,t),Dt.set(e,r),r;if(r&&w.hydrate?.(r,t,kt(e,t.tag)))return Dt.set(e,r),r;let i=Nt(t,kt(e,t.tag),e.ownerDocument);return r?r.replaceWith(i):e.appendChild(i),Dt.set(e,i),i}let kt=(e,t)=>t===`svg`?Tt:At(e);function At(e){return e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?Tt:`http://www.w3.org/1999/xhtml`}function jt(e,t,n){if(typeof e==`string`){let t=n.createTextNode(e);return Et.set(t,e),t}return Ct(e.tag)?Nt(e,e.tag===`svg`?Tt:t,n):null}function Mt(e,t,n){t===`style`?e.style.cssText=n:e.setAttribute(t,n)}function Nt(e,t,n){let r=n.createElementNS(t,e.tag),{attrs:i}=e;for(let e in i)wt(e)&&Mt(r,e,String(i[e]));let a=At(r);for(let t of e.children){let e=jt(t,a,n);e&&r.appendChild(e)}return Et.set(r,e),r}function Pt(e,t){let n=Et.get(e);return n===void 0?!1:typeof t==`string`?typeof n==`string`:typeof n!=`string`&&n.tag===t.tag&&n.key===t.key}function Ft(e,t){typeof t==`string`?Et.get(e)!==t&&(e.data=t,Et.set(e,t)):It(e,t)}function It(e,t){let n=Et.get(e);n!==t&&(Lt(e,n.attrs,w.sweep?.(e,n,t)??t.attrs,!0),Rt(e,t.children),Et.set(e,t))}function Lt(e,t,n,r=!1){for(let i in n){let a=n[i];t[i]!==a&&wt(i)&&(r&&i===`d`&&w.morph?.(e,String(t[i]??``),String(a))||Mt(e,i,String(a)))}for(let r in t)!(r in n)&&wt(r)&&e.removeAttribute(r)}function Rt(e,t){if(t.length===0&&e.firstChild===null)return;let n=Array.from(e.childNodes),r=/* @__PURE__ */ new Map,i=[];for(let e of n){let t=Et.get(e);t!==void 0&&(typeof t!=`string`&&t.key!==void 0?r.set(t.key,e):i.push(e))}let a=Array(t.length),o=/* @__PURE__ */ new Set,s=0;for(let e=0;e<t.length;e++){let n=t[e],c;typeof n!=`string`&&n.key!==void 0?c=r.get(n.key):s<i.length&&(c=i[s]),c&&!o.has(c)&&Pt(c,n)&&(a[e]=c,o.add(c),c===i[s]&&s++)}for(let t of n)o.has(t)||e.removeChild(t);let c=At(e),l=e.ownerDocument,u=null;for(let n=t.length-1;n>=0;n--){let r=t[n],i=a[n];if(i)Ft(i,r);else if(i=jt(r,c,l)??void 0,!i)continue;(i.parentNode!==e||i.nextSibling!==u)&&e.insertBefore(i,u),u=i}}let zt=/* @__PURE__ */ new Set([`a`,`b`,`button`,`caption`,`div`,`em`,`i`,`label`,`li`,`ol`,`p`,`section`,`small`,`span`,`strong`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`]),Bt=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]);function Vt(e,t={}){return typeof e==`string`?Yt(e):Ht(t.xmlns!==!1&&e.tag===`svg`&&e.attrs.xmlns===void 0?{...e,attrs:{xmlns:`http://www.w3.org/2000/svg`,...e.attrs}}:e,t.namespace?t.namespace===`svg`:!zt.has(e.tag))}function Ht(e,t){let{tag:n,attrs:r,children:i}=e;if(!Ct(n))return``;let a=t||n===`svg`,o=`<${n}`;for(let e in r)wt(e)&&(o+=` ${e}="${Xt(String(r[e]))}"`);if(i.length===0){if(a)return`${o}/>`;if(Bt.has(n.toLowerCase()))return`${o}>`}o+=`>`;let s=a&&n!==`foreignObject`;for(let e of i)o+=typeof e==`string`?Yt(e):Ht(e,s);return`${o}</${n}>`}let Ut=/[&<>]/,Wt=/[&"<>]/,Gt=/[&<>]/g,Kt=/[&"<>]/g,qt={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`},Jt=e=>qt[e];function Yt(e){return Ut.test(e)?e.replace(Gt,Jt):e}function Xt(e){return Wt.test(e)?e.replace(Kt,Jt):e}let Zt=/* @__PURE__ */ new WeakMap,Qt=/* @__PURE__ */ new WeakSet,$t;function en(){return $t||typeof ResizeObserver!=`function`||($t=new ResizeObserver(e=>{for(let{target:t,contentRect:n}of e)t.isConnected?(Qt.add(t),Zt.get(t)?.(n.width,n.height)):Qt.has(t)&&(Qt.delete(t),$t?.unobserve(t))})),$t}function tn(e,t){let n=en();return n?(Zt.set(e,t),n.observe(e),()=>{Zt.get(e)===t&&(Zt.delete(e),n.unobserve(e))}):()=>{}}let nn=/* @__PURE__ */ new Map,rn=!1,an=e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)};function on(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function sn(e,t){nn.set(e,t),rn||(rn=!0,an(un))}let cn={};function ln(e){nn.delete(e)}function un(){rn=!1;let e=0,t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;do{for(let[r,i]of nn)nn.delete(r),t.has(r)?n.set(r,i):(t.add(r),on(i),e++);e+=cn.idle?.()??0}while(nn.size>0);for(let[e,t]of n)sn(e,t);return e}let dn=0,fn=()=>`tc-${++dn}`;function pn(e,t){let n=t?.width??0,r=Math.max(0,Math.round(Number.isFinite(e.width)?e.width:n>0?n:600)),i=e.aspectRatio&&e.aspectRatio>0?e.aspectRatio:2,a=Number.isFinite(e.height)?e.height:e.height===`container`&&(t?.height??0)>0?t?.height:e.type?.height?.(hn(e),r)??r/i;return{width:r,height:Math.max(0,Math.round(a))}}let mn=/* @__PURE__ */ new WeakMap;function hn(e){let{prepare:t}=e.type;if(!t)return e;let n=mn.get(e)??t(e);return mn.set(e,n),n}function gn(e,t){let n=e.type.render(hn(e),t),r=n?.content===void 0?{content:n}:n;return w.post&&(r.content=w.post(e,r.content,r.interaction,t)),r}function _n(e,{size:t,id:n,hidden:r,fontSize:i,rtl:a=e.rtl===!0}){return{rtl:a,width:t.width,height:t.height,fontSize:e.fontSize??i??12,locale:e.locale,id:n,hidden:r}}function vn(e){let t={...e.type?.clean?e.type.clean(e):e};for(let e in t)typeof t[e]==`number`&&!Number.isFinite(t[e])&&delete t[e];return t}function yn(e){if(!e.type||typeof e.type.render!=`function`)throw TypeError("@tabler/charts: `type` must be a chart type such as line.")}let bn=[`top`,`bottom`,`left`,`right`,`auto`];function xn(e){let t=e.type.legend?.(hn(e))??[],n=e.legend,r=n===void 0?t.length>=2:n!==!1&&t.length>0,i=typeof n==`object`?n.position:void 0;return{items:t,show:r,position:i&&bn.includes(i)?i:`top`}}function Sn(e){if(e.title)return e.title;let t=xn(e).items.map(e=>e.name).filter(Boolean),n=t.slice(0,6).join(`, `);return`${e.type.name} chart${t.length?`: ${n}${t.length>6?`, …`:``}`:``}`}let Cn=e=>Array.isArray(e)?e.reduce((e,t)=>e+Cn(t),0):e&&typeof e==`object`?1+Cn(e.children):0,wn=(e,t)=>e.animate===!1||e.animate!==!0&&Cn(t)>1e3;function Tn(e,t,n,r,i,a,o,s,c=e.rtl===!0){let{width:l,height:u}=t,d=e.description?`${n}-desc`:void 0,{patterns:f}=e,p=f===!1?void 0:(f===!0?k(`patterns`):w.patterns)?.(e,n);return A(`svg`,{class:[`tc-chart`,`tc-chart-${e.type.name}`,r&&`tc-static`,c&&`tc-rtl`,p?.[0],e.class],style:p?.[1],viewBox:`0 0 ${l} ${u}`,width:l,height:u,role:`img`,"aria-label":Sn(e),"aria-describedby":d,...s},d&&A(`desc`,{key:`desc`,id:d},e.description),p?.[2],a&&A(`g`,{key:`hover-under`,class:`tc-hover-layer`},a),i,o&&A(`g`,{key:`hover-over`,class:`tc-hover-layer`},o))}function En(e,t,n=e.id??`tc`){yn(e);let r=vn(e),{content:i,interaction:a}=gn(r,_n(r,{size:t,id:n,hidden:bt(xn(r).items)}));return{svg:Tn(r,t,n,wn(r,i),i),interaction:a}}function Dn(e,t,n){return En(e,t,n).svg}function On(e,t){return Vt(En(e,t).svg)}let kn=[`hover`,`click`,`legend-toggle`,`render`],An=`:scope > svg.tc-chart`,jn=e=>typeof getComputedStyle==`function`?getComputedStyle(e):void 0,Mn=/* @__PURE__ */ new WeakMap;var Nn=class{element;id;#e;#t=(e,t)=>{let n=this.#e.height===`container`,r=e!==this.#n.width||n&&t!==this.#n.height;this.#n={width:e,height:t},r&&(e||t)&&(this.#h=void 0,this.#S(),this.#C())};#n={};#r=/* @__PURE__ */ new Map;#i;#a=[];#o=!1;#s;#c;#l=``;#u=null;#d;#f;#p=/* @__PURE__ */ new Map;#m;#h;#g=!1;constructor(e,t,n=[]){let r=typeof e==`string`?document.querySelector(e):e;if(!r)throw Error(`@tabler/charts: element "${String(e)}" not found.`);Mn.get(r)?.destroy(),Mn.set(r,this),this.element=r,this.#e=vn(t),this.id=t.id??fn(),this.#m=r.querySelector(An),this.#T(),this.#i=tn(r,this.#t);try{for(let e of[...n,...t.type.plugins??[],...t.plugins??[]])this.#a.push(e.install(this));this.render()}catch(e){throw this.destroy(),e}}get config(){return this.#e}get size(){let e=this.#n,t=0;for(let e of this.#a)t+=e.reservedWidth?.()??0;if(t&&e.width&&(e={...e,width:e.width-t}),this.#e.height===`container`&&e.height){let t=0;for(let e of this.#a)t+=e.reservedHeight?.()??0;t&&(e={...e,height:e.height-t})}return pn(this.#e,e)}get rtl(){let e=this.#e;return this.#h===void 0&&(this.#g=e.rtl===`auto`?jn(this.element)?.direction===`rtl`:e.rtl===!0,this.#h=e.fontSize??this.#w()),this.#g}get fontSize(){return this.#d?.fontSize??this.#e.fontSize??12}get interaction(){return this.#s}get active(){return this.#u}get pointer(){let e=this.#c;return this.#u&&e?.kind===`pointer`?{x:e.x,y:e.y}:void 0}get highlightSource(){return this.#u?this.#c?.kind:void 0}highlightIndex(e,t){let n=this.#s?.hitIndex(e,t)??null;return n?(this.#c={kind:`index`,index:e,seriesIndex:t},this.#b(n),n):null}highlightAt(e,t,n){let r=this.hitTest(e,t);return this.#c={kind:`pointer`,x:e,y:t},this.#b(r,n),r}clearHighlight(e){this.#c=void 0,this.#b(null,e)}toggleSeries(e,t){let{items:n}=xn(this.#e),r=typeof e==`number`?n.find(t=>t.index===e):n.find(t=>t.key===e)??n.find(t=>t.name===e);if(!r)return this;let i=t??!this.#x(n).has(r.key);return this.#p.set(r.key,i),this.emit(`legend-toggle`,{key:r.key,name:r.name,index:r.index,hidden:i}),this.#C(),this}isHidden(e){return this.#x(xn(this.#e).items).has(e)}update(e){this.#e=vn({...this.#e,...e});for(let t in e)t!==`data`&&(this.#h=void 0);return this.#C(),this}setConfig(e){return this.#e=vn(e),this.#h=void 0,this.#C(),this}setData(e){return this.update({data:e})}resize(){return this.#o||(this.#i=tn(this.element,this.#t)),this.#T(),this.#h=void 0,this.#C(),this}render(){if(this.#o)return this;ln(this);let e=this.#e,t=e;yn(t);let n=xn(e),r=this.#x(n.items);for(let e of this.#a)e.beforeRender?.({config:t,legend:n,hidden:r});let i=this.size,{content:a,stale:o,changed:s}=this.#_(i,r);o&&this.#v();let c=this.#m;Ot(this.element,this.#y(a,i),c),this.#m=null,c&&this.#S();for(let e of this.#a)e.afterRender?.({config:t,legend:n,hidden:r,size:i,stale:o,changed:s});return o&&this.emit(`render`,{size:i}),this}#_(e,t){let n=this.#e,r=[...t].sort().join(`\0`),i=this.rtl,a=n.fontSize??this.#h,o=this.#d,s=!o||o.cfg!==n||o.hidden!==r,c=s||o?.width!==e.width||o.height!==e.height||o.fontSize!==a||o.rtl!==i;if(!o||c){n.type.sweep&&(w.sweep=n.type.sweep);let{content:s,interaction:c}=gn(n,_n(n,{size:e,id:this.id,hidden:t,fontSize:a,rtl:i}));this.#s=c,o={cfg:n,width:e.width,height:e.height,hidden:r,fontSize:a,rtl:i,content:s,still:wn(n,s)},this.#d=o}return{content:o,stale:c,changed:s}}#v(){let e=this.#c;if(!e)return;let t=e.kind===`pointer`?this.hitTest(e.x,e.y):this.#s?.hitIndex(e.index,e.seriesIndex)??null;this.#b(t,void 0,!0,!1)}#y(e,t){let n=this.#e,r=this.#u,i=[],a=[],o;for(let e of this.#a){if(r&&e.layers){let t=e.layers(r,n);i.push(t.under),a.push(t.over)}let t=e.svgAttrs?.(n);t&&(o={...o,...t})}return Tn(n,t,this.id,e.still,e.content,i.length?i:void 0,a.length?a:void 0,o,e.rtl)}hitTest(e,t){return this.#s?.hitTest(e,t)??null}on(e,t){let n=this.#r.get(e);return n||(n=/* @__PURE__ */ new Set,this.#r.set(e,n)),n.add(t),()=>{n.delete(t)}}destroy(){if(!this.#o){this.#o=!0,Mn.get(this.element)===this&&Mn.delete(this.element),ln(this),clearTimeout(this.#f),this.#i();for(let e of this.#a)e.destroy?.();this.#r.clear(),Ot(this.element,null)}}#b(e,t,n=!1,r=!0){let i=_t(e);!n&&i===this.#l||n&&i===``&&this.#l===``||(this.#l=i,this.#u=e,this.emit(`hover`,t?{hit:e,event:t}:{hit:e}),r&&this.#C())}#x(e){let t=/* @__PURE__ */ new Set;for(let n of e)(this.#p.get(n.key)??n.hidden)&&t.add(n.key);return t}#S(){let e=this.element.querySelector(An);e&&(e.setAttribute(`data-resizing`,``),clearTimeout(this.#f),this.#f=setTimeout(()=>e.removeAttribute(`data-resizing`),200))}#C(){this.#o||sn(this,()=>this.render())}#w(){let e=Number.parseFloat(jn(this.element)?.getPropertyValue(`--tc-font-size`)??``);return Number.isFinite(e)&&e>0?e:void 0}#T(){let e=this.element,t=jn(e),n=e=>Number.parseFloat(e??``)||0;this.#n={width:e.clientWidth-n(t?.paddingLeft)-n(t?.paddingRight),height:e.clientHeight-n(t?.paddingTop)-n(t?.paddingBottom)}}emit(e,t){let n=this.#r.get(e);if(n)for(let e of n)e(t)}};let Pn=[`M-2,2L2,-2M0,8L8,0M6,10L10,6`,`M2,2h.01M6,6h.01`,`M-2,6L2,10M0,0L8,8M6,-2L10,2`,`M0,4H8`,`M0,8L8,0M0,0L8,8`,`M4,0V8`,`M0,4H8M4,0V8`,`M1,2H4M5,6H8`],Fn=Pn.length,In=e=>e<Fn?[`${e+1}`,`tc-series-${e+1}`]:[`other`,``];function Ln(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let[e,i]=In(r.index);n.has(e)||n.set(e,A(`pattern`,{key:e,id:`${t}-pattern-${e}`,class:[`tc-pattern`,`tc-series`,i],width:8,height:8,patternUnits:`userSpaceOnUse`,style:{"--tc-series-color":r.color}},A(`rect`,{class:`tc-pattern-bg`,width:8,height:8}),A(`path`,{class:`tc-pattern-ink`,d:Pn[r.index%Fn]})))}return[...n.values()]}function Rn(e,t){let n={};for(let r of e){let[e]=In(r.index);n[`--tc-pattern-${e}`]=`url(#${t}-pattern-${e})`}return n}function zn(e,t){let{items:n}=xn(e);if(n.length)return[e.patterns===!0?`tc-patterned`:`tc-patterns-auto`,Rn(n,t),A(`defs`,{key:`patterns`},Ln(n,t))]}let Bn=[[],[-.9,-.9,.9,-.9,.9,.9,-.9,.9],[0,-1.3,1.2,.9,-1.2,.9],[0,-1.3,1.3,0,0,1.3,-1.3,0],[-1.2,-.9,1.2,-.9,0,1.3],[-.4,-1.2,.4,-1.2,.4,-.4,1.2,-.4,1.2,.4,.4,.4,.4,1.2,-.4,1.2,-.4,.4,-1.2,.4,-1.2,-.4,-.4,-.4],[-.7,-1.2,0,-.5,.7,-1.2,1.2,-.7,.5,0,1.2,.7,.7,1.2,0,.5,-.7,1.2,-1.2,.7,-.5,0,-1.2,-.7],[0,-1.4,.32,-.44,1.33,-.43,.52,.17,.82,1.13,0,.55,-.82,1.13,-.52,.17,-1.33,-.43,-.32,-.44]];function Vn(e,t,n,r){let i=Bn[e]??[];if(!i.length)return`M${l(t-r)},${l(n)}a${r},${r},0,1,0,${2*r},0a${r},${r},0,1,0,${-2*r},0Z`;let a=``;for(let e=0;e<i.length;e+=2)a+=`${e?`L`:`M`}${l(t+i[e]*r)},${l(n+i[e+1]*r)}`;return`${a}Z`}function Hn(e){if(!Bn[e]?.length)return;let t=Vn(e,50,50,35.7).slice(1,-1).replace(/,/g,`% `).replace(/L/g,`%,`);return{"--tc-shape":e===1?`inset(10% round 1px)`:`polygon(${t}%)`,"--tc-shape-radius":0}}let Un=1e3,Wn=60*Un,Gn=60*Wn,Kn=24*Gn,qn=30*Kn,Jn=365*Kn,Yn=[{unit:`second`,step:1,ms:Un},{unit:`second`,step:5,ms:5*Un},{unit:`second`,step:15,ms:15*Un},{unit:`second`,step:30,ms:30*Un},{unit:`minute`,step:1,ms:Wn},{unit:`minute`,step:5,ms:5*Wn},{unit:`minute`,step:15,ms:15*Wn},{unit:`minute`,step:30,ms:30*Wn},{unit:`hour`,step:1,ms:Gn},{unit:`hour`,step:3,ms:3*Gn},{unit:`hour`,step:6,ms:6*Gn},{unit:`hour`,step:12,ms:12*Gn},{unit:`day`,step:1,ms:Kn},{unit:`day`,step:2,ms:2*Kn},{unit:`week`,step:1,ms:6048e5},{unit:`month`,step:1,ms:qn},{unit:`month`,step:3,ms:3*qn},{unit:`year`,step:1,ms:Jn}];function Xn(e){let t=(t,n)=>{switch(n){case`year`:return e?t.getUTCFullYear():t.getFullYear();case`month`:return e?t.getUTCMonth():t.getMonth();case`day`:case`week`:return e?t.getUTCDate():t.getDate();case`hour`:return e?t.getUTCHours():t.getHours();case`minute`:return e?t.getUTCMinutes():t.getMinutes();default:return e?t.getUTCSeconds():t.getSeconds()}},n=(t,n,r,i=0,a=0,o=0)=>e?new Date(Date.UTC(t,n,r,i,a,o)):new Date(t,n,r,i,a,o),r=t=>e?t.getUTCDay():t.getDay();return{floor:(e,{unit:i,step:a})=>{let o=t(e,`year`),s=t(e,`month`),c=t(e,`day`);switch(i){case`year`:return n(Math.floor(o/a)*a,0,1);case`month`:return n(o,Math.floor(s/a)*a,1);case`week`:return n(o,s,c-(r(e)+6)%7);case`day`:return n(o,s,Math.floor((c-1)/a)*a+1);case`hour`:return n(o,s,c,Math.floor(t(e,`hour`)/a)*a);case`minute`:return n(o,s,c,t(e,`hour`),Math.floor(t(e,`minute`)/a)*a);default:return n(o,s,c,t(e,`hour`),t(e,`minute`),Math.floor(t(e,`second`)/a)*a)}},next:(e,{unit:r,step:i})=>{let a=t(e,`year`),o=t(e,`month`),s=t(e,`day`);switch(r){case`year`:return n(a+i,0,1);case`month`:return n(a,o+i,1);case`week`:return n(a,o,s+7*i);case`day`:{let e=n(a,o,s+i);return t(e,`month`)===o?e:n(a,o+1,1)}case`hour`:return n(a,o,s,t(e,`hour`)+i);case`minute`:return n(a,o,s,t(e,`hour`),t(e,`minute`)+i);default:return n(a,o,s,t(e,`hour`),t(e,`minute`),t(e,`second`)+i)}},boundary:(e,n)=>{switch(n){case`second`:return t(e,`second`)===0;case`minute`:return t(e,`minute`)===0&&t(e,`second`)===0;case`hour`:return t(e,`hour`)===0&&t(e,`minute`)===0;case`day`:case`week`:return t(e,`day`)===1;case`month`:return t(e,`month`)===0;default:return!1}}}}function Zn(e,t){let n=Math.abs(e)/Math.max(1,t),r=0;for(;r<Yn.length&&Yn[r].ms<n;)r++;if(r===Yn.length){let e=Math.max(1,pe(0,n/Jn,1));return{unit:`year`,step:e,ms:e*Jn}}if(r===0)return Yn[0];let i=Yn[r-1],a=Yn[r];return n/i.ms<a.ms/n?i:a}let Qn=e=>e instanceof Date?e.getTime():e,$n={second:[{hour:`numeric`,minute:`2-digit`,second:`2-digit`},{hour:`numeric`,minute:`2-digit`}],minute:[{hour:`numeric`,minute:`2-digit`},{hour:`numeric`,minute:`2-digit`}],hour:[{hour:`numeric`,minute:`2-digit`},{month:`short`,day:`numeric`}],day:[{month:`short`,day:`numeric`},null],week:[{month:`short`,day:`numeric`},null],month:[{month:`short`},{year:`numeric`}],year:[{year:`numeric`},null]};function er(e,t,n={}){let r=n.utc===!0,i=Qn(e[0]),a=Qn(e[1]),[o,s]=t,c=a-i,l=c===0?0:(s-o)/c,u=Xn(r),d=n.clamp===!0,f=Math.min(o,s),p=Math.max(o,s),m=e=>{if(c===0)return(o+s)/2;let t=o+(Qn(e)-i)*l;return d?Math.min(p,Math.max(f,t)):t},h=(e=5)=>Zn(c,e);return Object.assign(m,{domain:[i,a],range:[o,s],utc:r,invert(e){return new Date(c===0||s===o?i:i+(e-o)/l)},ticks(e=5){if(!Number.isFinite(i)||!Number.isFinite(a))return[];let t=Math.min(i,a),n=Math.max(i,a);if(t===n)return[new Date(t)];let r=h(e),o=[],s=u.floor(new Date(t),r);for(s.getTime()<t&&(s=u.next(s,r));s.getTime()<=n&&o.length<1e3;)o.push(s),s=u.next(s,r);return a<i?o.reverse():o},tickFormat(e=5,t){let{unit:n}=h(e),[i,a]=$n[n],o=r?{timeZone:`UTC`}:{},s=B(t,{...i,...o}),c=a?B(t,{...a,...o}):null;return e=>(c&&u.boundary(e,n)?c:s).format(e)},nice(r=5){if(c===0||!Number.isFinite(c))return er(e,t,n);let o=h(r),s=u.floor(new Date(Math.min(i,a)),o),l=u.floor(new Date(Math.max(i,a)),o);return l.getTime()<Math.max(i,a)&&(l=u.next(l,o)),er(a<i?[l,s]:[s,l],t,n)}})}function tr(e,t,n,r){let[i,a]=we(e)??[0,1],o=e.filter(e=>Number.isFinite(e)),s=er([i,a],n,{utc:r}),c=e.map(e=>s(e));return{scale:Object.assign(e=>c[t.indexOf(e)],{domain:t.slice(),range:n,bandwidth:0,step:o.length>1?(n[1]-n[0])/(o.length-1):0,at:e=>c[e]??n[0],center:e=>c[t.indexOf(e)],indexAt(e){if(c.length===0)return-1;let t=n[1]<n[0],r=0,i=c.length-1;for(;r<i;){let n=r+i>>1;c[n]<e===t?i=n:r=n+1}let a=r-1;return a>=0&&Math.abs(e-c[a])<Math.abs(c[r]-e)?a:r}}),time:s}}function nr(e,t,n,r,i){let a=e.map(Ge),o=e=>tr(a,t,e,n.utc===!0),s=o([0,1]).time,{format:c}=n,l=c?e=>c(e,-1):s.tickFormat(r,i),u=s;return{edges:s.ticks(r).map(l),scale(e){let t=o(e);return u=t.time,t.scale},ticks:()=>u.ticks(r).map(e=>({value:e.getTime(),position:u(e),label:l(e)})),get time(){return u}}}let rr=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,ir=(e,t)=>t.x>=e.x-1&&t.y>=e.y-1&&t.x+t.width<=e.x+e.width+1&&t.y+t.height<=e.y+e.height+1,ar=e=>{let t=e.data?.series;return Array.isArray(t)?t.map(e=>e?.valueLabels):[]},or=e=>!!e.valueLabels||ar(e).includes(!0);function sr(e,t,n){let r=e.valueLabels,i=typeof r==`object`?r:{},{fontSize:a,locale:o}=n,c=e.type.valueLabels,u=c?.marks===`slice`,d=c?.marks===`cell`,f=!!e.stacked,p=i.format?H(i.format,o):u?e=>z(o,{style:`percent`,maximumFractionDigits:1}).format(e):c?.format?H(c.format(e),o):void 0,m=a,h=ar(e),g=e=>{let t=h[e];return typeof t==`boolean`?t:!!r},_=[],v=[],y=/* @__PURE__ */ new Map,b=0;for(let e=0;e<t.count;e++){let n=t.hitIndex(e);for(let t of n?.items??[])t.value!==null&&t.y!==null&&n&&(b+=Math.abs(t.value),t.box&&v.push(t.box),g(t.seriesIndex)&&(!u&&!t.box&&i.points!==`all`&&y.set(t.seriesIndex,_.length),_.push([`${e}-${t.seriesIndex}`,t,n])))}let x=[];return _.forEach(([e,t,r],o)=>{let{area:c}=r;if(!u&&!t.box&&i.points!==`all`&&y.get(t.seriesIndex)!==o)return;let l=t.value,h=l/(b||1),g=p?p(u?h:l):t.text,_=s(g,a),S=(n,r,i)=>(!t.box&&!u&&(n=Math.max(c.x+_/2+2,Math.min(n,c.x+c.width-_/2-2))),{key:e,series:t.seriesIndex,text:g,x:n,y:r,inside:i,box:{x:n-_/2-2,y:r-m/2,width:_+4,height:m}}),C=t.y,w=[],{box:T}=t;if(u)w.push(S(t.x,C,!0));else if(T){let e=r.axis===`y`,i=l<0;if(!f&&!d){let r=(e?_/2:m/2)+4,a=i?1:-1,o=C+a*r,s=n.rtl?-a:a;w.push(e?S(t.x-s*r,C,!1):S(t.x,o,!1),...e?[]:[S(T.x+_/2-3,o,!1),S(T.x+T.width-_/2+3,o,!1)],e?S(t.x+s*r,C,!0):S(t.x,C-a*r,!0))}else w.push(S(T.x+T.width/2,T.y+T.height/2,!0))}else{let e=_/2+4+4;w.push(S(t.x,C-m/2-4-2,!1),S(t.x,C+m/2+4+2,!1),S(t.x-e,C,!1),S(t.x+e,C,!1))}let E={...c,y:0,height:c.y+c.height},D=(e,n={...e.box,x:e.box.x+5,width:e.box.width-10})=>ir(u?c:E,e.box)&&(!e.inside||!T||ir(T,e.box))&&(!u||cr(t,c,h,e.box))&&!x.some(t=>rr(t.box,e.box))&&!v.some(e=>e!==T&&rr(e,n)),O=w.find(e=>D(e));O&&x.push(O)}),x.length?A(`g`,{key:`value-labels`,class:`tc-value-labels`,"aria-hidden":`true`},x.map(e=>A(`text`,{key:e.key,class:[`tc-value-label`,`tc-series`,`tc-series-${e.series+1}`,e.inside&&`tc-value-label-inside`],style:`transform:translate(${l(e.x)}px,${l(e.y)}px)`,"text-anchor":`middle`,dy:`0.35em`},e.text))):null}function cr(e,t,n,r){let i=t.width/2,a=Math.hypot(e.x-t.x-i,e.y-t.y-i),o=2*(i-a);return r.width<=n*2*Math.PI*a&&r.height<=o}let lr=(e,t,n,r)=>n&&or(e)?[t,sr(e,n,r)]:t;function ur(e,t,n){return e.nodeType===1&&e.localName===t.tag&&e.namespaceURI===n}function dr(e,t){let n={};for(let t of e.getAttributeNames())n[t]=e.getAttribute(t);n.style&&=``,Lt(e,n,t.attrs);let r=t.children.some(e=>typeof e==`string`);for(let t of Array.from(e.childNodes))(t.nodeType===8||!r&&t.nodeType===3)&&e.removeChild(t);let i=At(e),a=e.firstChild;for(let n of t.children){let t=a?a.nextSibling:null;if(typeof n==`string`?a?.nodeType===3:a&&ur(a,n,n.tag===`svg`?`http://www.w3.org/2000/svg`:i))typeof n==`string`?(a.data!==n&&(a.data=n),Et.set(a,n)):dr(a,n),a=t;else{let t=jt(n,i,e.ownerDocument);t&&e.insertBefore(t,a)}}for(;a;){let t=a;a=a.nextSibling,e.removeChild(t)}Et.set(e,t)}function fr(e,t,n){return Et.has(e)||!ur(e,t,n)?!1:(dr(e,t),!0)}let pr=/* @__PURE__ */ new WeakMap;function mr(e){let t=pr.get(e);return t&&cancelAnimationFrame(t.frame),pr.delete(e),t?.now}function hr(e,t,n,r,i,a){let o={frame:0,now:t.slice()},s=performance.now(),c=l=>{let u=Math.min(1,Math.max(0,(l-s)/r)),d=1-(1-u)**3;o.now=n.map((e,n)=>t[n]+(e-t[n])*d),e.setAttribute(`d`,u<1?i(o.now):a),u<1?o.frame=requestAnimationFrame(c):pr.delete(e)};pr.set(e,o),o.frame=requestAnimationFrame(c)}let gr=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,_r;function vr(e,t,n){_r??=typeof CSS>`u`||CSS.supports(`d`,`path("M0 0")`);let r=mr(e);if(_r||e.closest(`.tc-static,[data-resizing]`))return!1;let i=getComputedStyle(e),a=i.transitionProperty.split(`, `).findIndex(e=>e===`d`||e===`all`),o=a<0?0:Number.parseFloat(i.transitionDuration.split(`, `)[a]??``)*1e3,s=n.split(gr),c=n.match(gr)?.map(Number)??[],u=t.match(gr)?.map(Number)??[];return!(o>0)||u.length!==c.length||t.split(gr).join()!==s.join()?!1:(hr(e,r?.length===c.length?r:u,c,o,e=>e.reduce((e,t,n)=>e+l(t)+s[n+1],s[0]),n),!0)}function yr(e,t){let n=e.length;if(!(t>=3)||n<=t)return e.map((e,t)=>t);let r=[],i=-1;for(let t=0;t<n;t++){let n=e[t]!=null;n&&i===-1&&(i=t),!n&&i!==-1&&(r.push([i,t]),i=-1)}i!==-1&&r.push([i,n]);let a=r.reduce((e,[t,n])=>e+(n-t),0),o=[],s=0;for(let[n,i]of r)n>s&&o.push(s),br(e,n,i,Math.max(2,Math.round(t*(i-n)/a)),o),s=i;return s<n&&o.push(s),o}function br(e,t,n,r,i){let a=n-t;if(a<=r){for(let e=t;e<n;e++)i.push(e);return}let o=t=>e[t],s=(a-2)/(r-2),c=t;i.push(c);for(let e=0;e<r-2;e++){let r=t+1+Math.floor((e+1)*s),a=Math.min(n,t+1+Math.floor((e+2)*s)),l=0,u=0;for(let e=r;e<a;e++)l+=o(e)[0],u+=o(e)[1];let d=Math.max(1,a-r);l/=d,u/=d;let f=t+1+Math.floor(e*s),p=Math.min(n-1,t+1+Math.floor((e+1)*s)),[m,h]=o(c),g=f,_=-1;for(let e=f;e<p;e++){let[t,n]=o(e),r=Math.abs((m-l)*(n-h)-(m-t)*(u-h));r>_&&(_=r,g=e)}i.push(g),c=g}i.push(n-1)}function xr(e,t){return yr(e,t).map(t=>e[t])}function Sr(e){let t=10**Math.max(0,Math.min(12,Math.floor(e))),n=e=>Math.round(e*t)/t||0;return(e,t)=>`${n(e)},${n(t)}`}let Cr=(e,t)=>t===`monotone`?Er(e):e;function wr(e,t,n,r){let i=t[0];if(!i)return``;let a=(r?`M`:`L`)+e(i[0],i[1]);if(n===`monotone`)return a+kr(e,t);let o=Tr[n];if(o!==void 0)return a+Dr(e,t,o);let s=a;for(let n=1;n<t.length;n++){let r=t[n];s+=`L${e(r[0],r[1])}`}return s}let Tr={step:.5,"step-before":0,"step-after":1};function Er(e){return e.filter((t,n)=>{let r=e[n-1];return!r||t[0]!==r[0]||t[1]!==r[1]})}function Dr(e,t,n){let r=``;for(let i=1;i<t.length;i++){let[a,o]=t[i-1],[s,c]=t[i];if(n<=0)r+=`L${e(a,c)}L${e(s,c)}`;else if(n>=1)r+=`L${e(s,o)}L${e(s,c)}`;else{let l=a*(1-n)+s*n;r+=`L${e(l,o)}L${e(l,c)}`,i===t.length-1&&(r+=`L${e(s,c)}`)}}return r}let Or=e=>e<0?-1:1;function kr(e,t){let n=t.length;if(n<2)return``;if(n===2){let n=t[1];return`L${e(n[0],n[1])}`}let r=Array(n);for(let e=1;e<n-1;e++){let[n,i]=t[e-1],[a,o]=t[e],[s,c]=t[e+1],l=a-n,u=s-a,d=(o-i)/(l||(u<0?-0:0)),f=(c-o)/(u||(l<0?-0:0)),p=(d*u+f*l)/(l+u);r[e]=(Or(d)+Or(f))*Math.min(Math.abs(d),Math.abs(f),.5*Math.abs(p))||0}r[0]=Ar(t[0],t[1],r[1]),r[n-1]=Ar(t[n-2],t[n-1],r[n-2]);let i=``;for(let a=1;a<n;a++){let[n,o]=t[a-1],[s,c]=t[a],l=(s-n)/3;i+=`C${e(n+l,o+l*r[a-1])},${e(s-l,c-l*r[a])},${e(s,c)}`}return i}function Ar(e,t,n){let r=t[0]-e[0];return r?3*(t[1]-e[1])/r/2-n/2:n}let jr=e=>e!=null&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function Mr(e,t=()=>!0){let n=[],r;for(let i=0;i<e.length;i++)jr(e[i])&&t(i)?(r||(r=[],n.push(r)),r.push(i)):r=void 0;return n}function Nr(e,t={}){let{curve:n=`linear`,precision:r=2}=t,i=Sr(r),a=``;for(let t of Mr(e)){let r=Cr(t.map(t=>e[t]),n);a+=wr(i,r,n,!0),r.length===1&&(a+=`Z`)}return a}function Pr(e,t,n={}){let{curve:r=`linear`,precision:i=2}=n,a=Sr(i),o=``,s=e=>typeof t==`number`?t:t[e]??NaN;for(let t of Mr(e,e=>Number.isFinite(s(e)))){o+=wr(a,Cr(t.map(t=>e[t]),r),r,!0);let n=t.map(t=>[e[t][0],s(t)]).reverse(),i=r===`step-before`?`step-after`:r===`step-after`?`step-before`:r;o+=`${wr(a,Cr(n,i),i,!1)}Z`}return o}let Fr={png:`PNG`,svg:`SVG`,jpeg:`JPEG`,webp:`WebP`},Ir=[`png`,`svg`];function Lr(e){return e===!0?{}:Array.isArray(e)?{formats:e}:e}function Rr(){return{name:`download`,install(e){let t=e.element,n=t.ownerDocument,r,i={},a=!t.classList.contains(`tc-container`),o=()=>r?.querySelector(`.tc-download-toggle`),s=()=>r?.querySelector(`.tc-download-menu`),c=()=>Array.from(r?.querySelectorAll(`.tc-download-item`)??[]),l=e=>{let t=s();t&&(t.hidden=!e,o()?.setAttribute(`aria-expanded`,String(e)),e?n.addEventListener(`pointerdown`,d,!0):n.removeEventListener(`pointerdown`,d,!0))},u=()=>s()?.hidden===!1,d=e=>{r?.contains(e.target)||l(!1)},f=t=>{let n=t.target;if(n.closest(`.tc-download-toggle`)){l(!u()),u()&&c()[0]?.focus();return}let r=n.closest(`.tc-download-item`)?.getAttribute(`data-format`);r&&(l(!1),o()?.focus(),k(`export`)(e,{...i,format:r}))},p=e=>{if(e.key===`Escape`&&u()){e.preventDefault(),l(!1),o()?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=c();t.length&&(e.preventDefault(),u()||l(!0),t[(t.indexOf(n.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())},m=e=>{r?.contains(e.relatedTarget)||l(!1)},h=()=>{r&&(l(!1),Ot(r,null),r.remove(),r=void 0,a&&t.classList.remove(`tc-container`))};return{afterRender({config:a,changed:o}){let s=a.download;if(!s||typeof document>`u`){h();return}if(!o&&r?.isConnected)return;k(`export`),i=Lr(s);let c=i.formats?.length?i.formats:Ir;r||(r=n.createElement(`div`),r.className=`tc-download`,r.addEventListener(`click`,f),r.addEventListener(`keydown`,p),r.addEventListener(`focusout`,m)),Ot(r,A(`div`,{class:`tc-download-box`},A(`button`,{type:`button`,class:`tc-download-toggle`,"aria-label":i.label??`Download`,"aria-haspopup":`menu`,"aria-expanded":`false`},A(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},A(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`}))),A(`div`,{class:`tc-download-menu`,role:`menu`,hidden:``},c.map(e=>A(`button`,{key:e,type:`button`,role:`menuitem`,class:`tc-download-item`,"data-format":e},Fr[e]??e))))),r.dir=e.rtl?`rtl`:``,t.classList.add(`tc-container`),r.isConnected||t.appendChild(r)},destroy:h}}}}function zr(e,t,n){return A(`g`,{key:e,class:[`tc-series`,`tc-series-${e+1}`],style:{"--tc-series-color":t}},n)}function Br(e,t){let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return n&&zr(n.seriesIndex,n.color,A(`path`,{class:`tc-hover-mark`,d:t.d,style:`transform:translate(${l(t.x??0)}px,${l(t.y??0)}px)`}))}function Vr(e,t=!0){let{area:n,highlight:r={kind:`crosshair`}}=e,i=(e,n,r,i)=>t&&A(`line`,{class:`tc-crosshair`,x1:l(e),x2:l(r),y1:l(n),y2:l(i)});return A(`g`,{class:`tc-hover`,"aria-hidden":`true`},r.kind===`halo`?r.under&&Br(e,r):r.kind===`band`?A(`rect`,{class:`tc-hover-band`,x:l(r.x),y:l(r.y),width:l(r.width),height:l(r.height)}):r.kind===`spoke`?i(r.x1,r.y1,r.x2,r.y2):i(e.x,n.y,e.x,n.y+n.height))}function Hr(e,t=4,n){let r=e.highlight;return A(`g`,{class:`tc-hover`,"aria-hidden":`true`},r?.kind===`halo`?!r.under&&Br(e,r):r?.kind!==`band`&&e.items.map(e=>e.y!==null&&zr(e.seriesIndex,e.color,n?A(`path`,{class:`tc-point tc-point-active tc-marker`,d:n(e.seriesIndex,e.x,e.y,t)}):A(`circle`,{class:`tc-point tc-point-active`,cx:l(e.x),cy:l(e.y),r:t}))))}let Ur=/* @__PURE__ */ new WeakSet;function Wr(e){let t=e.element;if(Ur.has(e)||typeof t.addEventListener!=`function`)return;Ur.add(e);let n=n=>{let r=t.querySelector(`svg.tc-chart`);if(!r)return;let{width:i,height:a}=e.size;return vt(r,n.clientX,n.clientY,i,a)},r=e=>!!e.target?.closest?.(`.tc-download,.tc-map-zoom`),i=t=>{t.pointerType!==`touch`&&e.highlightSource===`pointer`&&e.clearHighlight(t)},a=t=>{if(r(t)){i(t);return}let a=n(t);a&&e.highlightAt(a.x,a.y,t)},o=t=>{if(r(t))return;let i=n(t),a=i?e.hitTest(i.x,i.y):null;a&&e.emit(`click`,{hit:a,event:t})};return t.addEventListener(`pointermove`,a),t.addEventListener(`pointerdown`,a),t.addEventListener(`pointerleave`,i),t.addEventListener(`click`,o),()=>{Ur.delete(e),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerdown`,a),t.removeEventListener(`pointerleave`,i),t.removeEventListener(`click`,o)}}function Gr(){return{name:`pointer`,install(e){let t=Wr(e);return t?{destroy:t}:{}}}}function Kr(){return{name:`highlight`,install(e){let t=Wr(e);return{layers:(e,t)=>({under:Vr(e,t.crosshair!==!1),over:Hr(e,4,Je(t))}),...t?{destroy:t}:{}}}}}function qr(e,t){let[n=``,...r]=e.columns;return A(`table`,{class:`tc-table`},t&&A(`caption`,null,t),A(`thead`,null,A(`tr`,null,A(`th`,{scope:`col`},n),r.map((e,t)=>A(`th`,{key:t,scope:`col`},e)))),A(`tbody`,null,e.rows.map(([e=``,...t],n)=>A(`tr`,{key:n},A(`th`,{scope:`row`},e),t.map((e,t)=>A(`td`,{key:t},e))))))}function Jr(e){let t=(e.seriesIndex===void 0?e.items:e.items.filter(t=>t.seriesIndex===e.seriesIndex)).map(e=>`${e.name} ${e.text}`).join(`, `);return e.title?`${e.title}: ${t}`:t}let Yr=e=>e.keyboard??e.type.keyboard??!0;function Xr(){return{name:`keyboard`,install(e){let t=e.element,n,r=()=>(n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-sr-only`,n.setAttribute(`aria-live`,`polite`),n.setAttribute(`aria-atomic`,`true`),t.appendChild(n)),n),i=e=>{r().textContent=e},a=(t,n)=>{let r=e.highlightIndex(t,n);r&&i(Jr(r))},o=t=>{let n=e.interaction;if(!n||n.count===0)return!1;n.reversed&&/^Arrow(L|R)/.test(t)&&(t=t===`ArrowLeft`?`ArrowRight`:`ArrowLeft`);let r=n.rows??1;n.rows&&/^Arrow(U|D)/.test(t)&&(t=t===`ArrowUp`?`ArrowLeft`:`ArrowRight`,r=1);let i=e.highlightSource===`index`?e.active:null,o=n.count-1,s=i?.index,c=i?.seriesIndex,l=i?.items.map(e=>e.seriesIndex)??[],u=c===void 0?-1:l.indexOf(c);switch(t){case`ArrowRight`:return a(s===void 0?0:Math.min(o,s+r),c),!0;case`ArrowLeft`:return a(s===void 0?o:Math.max(0,s-r),c),!0;case`Home`:return a(0,c),!0;case`End`:return a(o,c),!0;case`ArrowDown`:case`ArrowUp`:{if(s===void 0||l.length===0)return a(0),!0;let e=t===`ArrowDown`?1:-1,n=u===-1?e>0?0:l.length-1:u+e;return a(s,n<0||n>=l.length?void 0:l[n]),!0}case`Escape`:return i?(e.clearHighlight(),!0):!1;default:return!1}},s=e=>e?.matches?.(`svg.tc-chart`)===!0,c=t=>{let{key:n}=t;Yr(e.config)&&s(t.target)&&o(n)&&t.preventDefault()},l=t=>{s(t.target)&&e.highlightSource===`index`&&e.clearHighlight()},u=t=>{Yr(e.config)&&s(t.target)&&r()};return t.addEventListener(`keydown`,c),t.addEventListener(`focusin`,u),t.addEventListener(`focusout`,l),{svgAttrs:e=>Yr(e)?{tabindex:0}:void 0,destroy(){t.removeEventListener(`keydown`,c),t.removeEventListener(`focusin`,u),t.removeEventListener(`focusout`,l),n?.remove()}}}}}let Zr={left:`right`,right:`left`},Qr=`tc-legend-beside`,$r=`tc-legend-start`;function ei(){return{name:`legend`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-legend`)??void 0,r=n?.firstElementChild??null,i=!1,a=t=>{let n=(t.target.closest?.(`.tc-legend-item`))?.getAttribute(`data-key`);n!=null&&e.toggleSeries(n)},o=()=>{n&&(Ot(n,null),n.removeEventListener(`click`,a),i=!1,n.remove(),n=void 0,t.classList.remove(Qr,$r))},s=!1,c=()=>{let e=n?.dataset.position;return e===`left`||e===`right`},l=()=>{if(!n)return;let e=t.querySelector(`:scope > svg.tc-chart`);s?e?e.nextElementSibling!==n&&e.after(n):n.isConnected||t.appendChild(n):n.isConnected&&n.nextElementSibling===e||t.insertBefore(n,e??t.firstChild)},u=e=>{n&&(n.dataset.position=e,s=e===`bottom`||c()&&e===`right`!=(getComputedStyle(t).direction===`rtl`),l(),t.classList.toggle(Qr,c()),t.classList.toggle($r,c()&&!s))},d=()=>Number.parseFloat(getComputedStyle(t).columnGap)||0;return{beforeRender({config:s,legend:c,hidden:l}){if(!c.show||typeof document>`u`){o();return}n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-legend`),i||=(n.addEventListener(`click`,a),!0),n.dir=e.rtl?`rtl`:``,Ot(n,yt(c.items,l,E(s)),r),r=null;let{position:f}=c,p=f===`auto`?`right`:f;u(e.rtl&&Zr[p]||p),f===`auto`&&(n.offsetWidth+d())*3>t.clientWidth&&u(`bottom`)},reservedHeight(){if(!n?.isConnected||c())return 0;let{marginTop:e,marginBottom:t}=getComputedStyle(n);return n.offsetHeight+(Number.parseFloat(e)||0)+(Number.parseFloat(t)||0)},reservedWidth(){return n?.isConnected&&c()?n.offsetWidth+d():0},afterRender:l,destroy:o}}}}let ti=/* @__PURE__ */ new Map,ni=/* @__PURE__ */ new WeakMap,ri=!1;function ii(e,t){let n=ni.get(e);if(!n){n=/* @__PURE__ */ new Map;for(let t=0;t<e.count;t++){let r=e.hitIndex(t);r&&!n.has(r.label)&&n.set(r.label,t)}ni.set(e,n)}return n.get(t)}function ai(){return{name:`sync`,install(e){let t=new WeakRef(e),n,r,i=()=>{n?.delete(t),r&&n?.size===0&&ti.get(r)===n&&ti.delete(r)},a=()=>{let a=e.config.sync,o=a?ti.get(a)??/* @__PURE__ */ new Set:void 0;o!==n&&(i(),a&&o&&(o.add(t),ti.set(a,o)),n=o,r=a)};a();let o=e.on(`hover`,({hit:t})=>{if(!(ri||!n||t&&e.highlightSource!==`pointer`)){ri=!0;try{for(let r of n){let i=r.deref();if(i||n.delete(r),!i||i===e)continue;let a=t&&i.interaction&&ii(i.interaction,t.label);a==null?i.clearHighlight():i.highlightIndex(a)}}finally{ri=!1}}});return{afterRender:a,destroy(){o(),i()}}}}}let oi=/* @__PURE__ */ new Map,si=!1;function ci(){si=!1;let e=0;for(;oi.size>0;){let t=Array.from(oi.values());oi.clear();for(let n of t)on(n),e++}return e}function li(e,t){cn.idle=ci,oi.set(e,t),si||(si=!0,typeof requestIdleCallback==`function`?requestIdleCallback(ci,{timeout:1e3}):setTimeout(ci,100))}function ui(e){oi.delete(e)}function di(){return{name:`table`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-table-wrap`)??void 0,r=n?.firstElementChild??null,i,a={},o=()=>{ui(a),n&&=(Ot(n,null),n.remove(),void 0)},s=(i,a)=>{let s=i.table??!0,c=typeof s==`object`&&s.maxRows?s.maxRows:1e3,l=s!==!1&&typeof document<`u`?i.type.table?.(hn(i),{locale:i.locale,hidden:a,rtl:e.rtl},c):void 0;if(!l){o();return}let u=s===`visible`||typeof s==`object`&&s.visible===!0,d=i.title,f=l.total??l.rows.length,p=l.rows.length>c?{columns:l.columns,rows:l.rows.slice(0,c)}:l;if(f>p.rows.length){let e=z(i.locale),t=`${e.format(p.rows.length)} of ${e.format(f)} rows`;d=d?`${d} (${t})`:t}n||=t.ownerDocument.createElement(`div`),n.className=u?`tc-table-wrap`:`tc-table-wrap tc-sr-only`,Ot(n,qr(p,d),r),r=null;let m=t.querySelector(`:scope > svg.tc-chart`),h=t.querySelector(`:scope > svg.tc-chart + .tc-legend`)??m;h&&h.nextElementSibling!==n?h.after(n):n.isConnected||t.appendChild(n)};return{afterRender({config:e,hidden:t,changed:r}){if(!r&&n?.isConnected)return;let o=e.table??!0,c=i===o;i=o,c&&n?.isConnected&&n.classList.contains(`tc-sr-only`)?li(a,()=>s(e,t)):(ui(a),s(e,t))},destroy:o}}}}function fi(e,t){if(t)return t;let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return e.highlight?.kind===`spoke`&&n?.y!=null?{x:n.x,y:n.y}:e.axis===`y`?{x:n?.x??e.x,y:e.y??e.area.y}:{x:e.x,y:n?.y??e.area.y+e.area.height/2}}function pi(e,t={},n){return A(`div`,{class:`tc-tooltip-content`},t.format?t.format(e):[e.title&&A(`div`,{class:`tc-tooltip-title`},e.title),e.items.map(t=>A(`div`,{key:t.seriesIndex,class:[`tc-tooltip-item`,`tc-series`,`tc-series-${t.seriesIndex+1}`,e.seriesIndex===t.seriesIndex&&`tc-tooltip-item-active`],style:{"--tc-series-color":t.color,...n?.(t.seriesIndex)}},A(`span`,{class:`tc-tooltip-swatch`}),A(`span`,{class:`tc-tooltip-name`},t.name),A(`span`,{class:`tc-tooltip-value`},t.text))),t.footer&&A(`div`,{class:`tc-tooltip-footer`},t.footer(e))])}function mi(e,t,n,r=12,i=!1){let{x:a=0,y:o=0}=n,s=e.x+r+t.width<=a+n.width,c=e.x-r-t.width>=a,l=(i?c||!s:c&&!s)?`left`:`right`,u=l===`right`?e.x+r:e.x-r-t.width,d=Math.max(a,Math.min(u,a+n.width-t.width)),f=Math.max(o,Math.min(e.y-t.height/2,o+n.height-t.height));return{x:Math.round(d),y:Math.round(f),side:l}}function hi(e){let t=0,n=0,r=innerWidth,i=innerHeight;for(let a=e;a;){let e=getComputedStyle(a);if(e.overflowX!==`visible`||e.overflowY!==`visible`){let e=a.getBoundingClientRect();t=Math.max(t,e.left),n=Math.max(n,e.top),r=Math.min(r,e.right),i=Math.min(i,e.bottom);break}a=a.parentElement??(a.getRootNode().host||null)}return{left:t,top:n,right:r,bottom:i}}let gi=[];function _i(){for(let e of gi.splice(0).map(e=>e()))e?.()}function vi(){return{name:`tooltip`,install(e){let t=Wr(e),n=e.element,r=!n.classList.contains(`tc-container`);n.classList.add(`tc-container`);let i,a=0;return{afterRender(){let t=e.config.tooltip,r=e.active,o=r&&fi(r,e.pointer);if(t===!1||typeof document>`u`||!r||!o||!Number.isFinite(o.x)||!Number.isFinite(o.y)){a++,i?.removeAttribute(`data-visible`);return}i||(i=n.ownerDocument.createElement(`div`),i.className=`tc-tooltip`,i.setAttribute(`aria-hidden`,`true`),n.appendChild(i));let s=typeof t==`object`?t:void 0;i.classList.toggle(`tc-tooltip-light`,s?.theme===`light`);let{rtl:c}=e;i.dir=c?`rtl`:``,Ot(i,pi(r,s,E(e.config)));let l=i,u=++a;gi.push(()=>{let t=n.querySelector(`svg.tc-chart`);if(!t||u!==a)return;let{width:i,height:s}=e.size,d=n.getBoundingClientRect(),f=t.getBoundingClientRect(),p=d.width>0&&n.offsetWidth>0?d.width/n.offsetWidth:1,m=f.width>0?f.width/i/p:1,h=f.height>0?f.height/s/p:1,g={x:(f.left-d.left)/p-n.clientLeft,y:(f.top-d.top)/p-n.clientTop},_=r.axis===`y`||r.highlight?.kind===`spoke`?o.x:r.x,v=r.axis===`y`?r.y??o.y:o.y,y=hi(n),b=mi({x:g.x+_*m,y:g.y+v*h},{width:l.offsetWidth,height:l.offsetHeight},{x:(y.left-d.left)/p-n.clientLeft,y:(y.top-d.top)/p-n.clientTop,width:(y.right-y.left)/p,height:(y.bottom-y.top)/p},12,c);return()=>{l.style.transform=`translate(${b.x}px, ${b.y}px)`,l.dataset.side=b.side,l.hasAttribute(`data-visible`)||(getComputedStyle(l).transform,l.setAttribute(`data-visible`,``))}}),sn(gi,_i)},destroy(){a++,i&&(Ot(i,null),i.remove()),r&&n.classList.remove(`tc-container`),t?.()}}}}}function yi(){return[Kr(),ei(),vi(),di(),Xr(),ai(),Rr()]}var bi=class extends Nn{constructor(e,t){super(e,t,yi())}};function xi(e){return A(`mask`,{id:e,maskContentUnits:`objectBoundingBox`},A(`linearGradient`,{id:`${e}-gradient`,x1:0,y1:0,x2:0,y2:1},A(`stop`,{class:`tc-fade-start`,offset:0}),A(`stop`,{class:`tc-fade-end`,offset:1})),A(`rect`,{width:1,height:1,fill:`url(#${e}-gradient)`}))}function Si(e,t,n={}){let{percent:r=!1,nullAsZero:i=!1,hidden:a}=n,o=e.map(e=>!a?.has(Q(e))),s=e.map(()=>Array(t).fill(null));for(let n=0;n<t;n++){let t=0;r&&e.forEach((e,r)=>{let i=e.values[n];o[r]&&i!=null&&(t+=Math.abs(i))});let a=0,c=0,l,u;for(let d=0;d<e.length;d++){let f=e[d];if(!o[d])continue;let p=f.values[n],m=p!=null;if(!m&&!i)continue;let h=m?p:0;r&&(h=t===0?0:h/t);let g=s[d];if(h<0){let e={y0:c,y1:c+h};g[n]=e,c+=h,u=e}else{let e={y0:a,y1:a+h};g[n]=e,a+=h,l=e}}r&&(l&&Math.abs(a-1)<1e-9&&(l.y1=1),u&&Math.abs(c+1)<1e-9&&(u.y1=-1))}return s}function Ci(e){let t=[];for(let n of e)for(let e of n)e&&t.push(e.y0,e.y1);return t}function wi(e,t,n,r,i,a){let o=[];for(let s=0;s<t;s++){let t=e.values[s];a(t)?o.push([n(s),r(t)]):i||o.push(null)}return o}function Ti(e,t,n){let{curve:r=`monotone`,points:i=`none`,pointRadius:a=4,connectNulls:o=!1,area:s=n,stacked:c=!1,decimate:u,fill:d=c?`solid`:`gradient`}=e,f=i===`none`?2:a+2,{series:p}=e.data,m=Ve(e.data).length,h=Re(e),g=p.filter(e=>h(e).second).map(Q),_=c?Si(p,m,{percent:c===`percent`,nullAsZero:!0,hidden:g.length?/* @__PURE__ */ new Set([...t.hidden,...g]):t.hidden}):null,v=nt(e,t,{scale:`point`,zero:s||_!==null,zero2:s,overhang:f,..._?{values:Ci(_)}:{},...c===`percent`?{tickFormat:{style:`percent`}}:{}}),{x:y,labels:b}=v,x=e=>ze(v,p[e]),S=e=>{let t=x(e);return t(Math.min(Math.max(0,t.domain[0]),t.domain[1]))},C=e=>!h(p[e]).second&&_?.[e]||null,w=at(v,e,t,(e,t,n)=>{let r=C(e);return{x:y.at(t),y:x(e)(r?r[t]?.y1??0:n)}}),T=s&&d===`gradient`,E=`${t.id}-fade`,D=e=>!t.hidden.has(Q(e)),O=p.map((e,t)=>{if(!D(e))return[];let n=x(t),r=C(t);if(r)return r.map((e,t)=>e?[y.at(t),n(e.y1)]:null);let i=h(e).axis;return wi(e,b.length,e=>y.at(e),n,o,e=>He(e,i))}),j=O.map(e=>u!==void 0&&e.length>u?k(`decimate`)(e,u):null),M=e=>{let t=O[e],n=j[e];return n?n.map(e=>t[e]):t},N=e=>{let t=C(e);if(!t)return S(e);let n=x(e),r=t.map(e=>e?n(e.y0):null),i=j[e];return i?i.map(e=>r[e]??null):r},P=s&&A(`g`,{class:`tc-areas`},e.data.series.map((e,t)=>D(e)&&A(`g`,it(e,t),A(`path`,{class:[`tc-area`,T&&`tc-area-gradient`],d:Pr(M(t),N(t),{curve:r}),mask:T?`url(#${E})`:void 0})))),F=Je(e),I=e.data.series.map((e,t)=>{if(!D(e))return null;let n=M(t),o=n.filter(e=>e!=null),s=i===`all`?o:i===`last`?o.slice(-1):[];return A(`g`,it(e,t),A(`path`,{class:`tc-line`,d:Nr(n,{curve:r})}),s.length>0&&A(`g`,{class:`tc-points`},s.map(([e,n])=>Ye(F,t,e,`tc-point`,l(e),l(n),a))))});return{content:[A(`defs`,{key:`defs`},v.clip.def,T&&xi(E)),v.background,A(`g`,{key:`series`,class:`tc-series-list`,"clip-path":v.clip.url},P,I),v.foreground],interaction:w}}let Ei={name:`line`,clean:X(Me),render:(e,t)=>Ti(e,t,!1),legend:e=>Be(e.data),table:(e,t,n)=>ot(e,t,n)},Di={name:`area`,clean:X(Me),render:(e,t)=>Ti(e,t,!0),legend:e=>Be(e.data),table:(e,t,n)=>ot(e,t,n)},Oi=e=>{let t=l(e);return t===0?0:t};function ki(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(n-r),s=Math.max(0,Math.min(i,a/2,o)),c=Oi(e),l=Oi(e+a),u=Oi(n),d=Oi(r),f=r<=n,p=Oi(f?r+s:r-s),m=+!!f,h=Oi(s);return`M${c},${u}L${c},${p}A${h},${h},0,0,${m},${Oi(e+s)},${d}L${Oi(e+a-s)},${d}A${h},${h},0,0,${m},${l},${p}L${l},${u}Z`}function Ai(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(r-n),s=Math.max(0,Math.min(i,a/2,o)),c=Oi(e),l=Oi(e+a),u=Oi(n),d=Oi(r),f=r>=n,p=Oi(f?r-s:r+s),m=+!!f,h=Oi(s);return`M${u},${c}L${p},${c}A${h},${h},0,0,${m},${d},${Oi(e+s)}L${d},${Oi(e+a-s)}A${h},${h},0,0,${m},${p},${l}L${u},${l}Z`}function ji(e,t,n){let r=e.y??{},a=e.x??{},{fontSize:o,width:c}=t,l=n.overhang??0,u=Ve(e.data),d=We(e,t),f=et(e,t,n,Math.round(c/80)),p=f.probe,m=r.show!==!1,h=a.show!==!1&&u.length>0,g=u.map((e,t)=>({value:Ie(e),position:0,label:d(e,t)})),_=e=>m&&e?Math.ceil(s(e.label,o)/2):0,{area:v,side:y,range:b}=i(t,e.padding,e=>({top:e.top+Math.max(l,4),bottom:e.bottom+Math.max((m?_e(`bottom`,p,o):0)+ve(r.title,o),l,4),start:e.start+Math.max((h?_e(`left`,g,o):0)+ve(a.title,o),_(p[0]),l,8),end:e.end+Math.max(_(p[p.length-1]),l,8)})),x=u.map(Ie),S=Se(x,[v.y,v.y+v.height],{paddingInner:n.paddingInner??.3,paddingOuter:n.paddingOuter??.15}),C=f.scale(b()),w=ge(f.ticks(C),`bottom`,o);return tt(e,t,y,l,{area:v,labels:u,x:S,y:C,horizontal:!0,xTicks:h?ge(he(S,(e,t)=>d(u[t],t)),`left`,o):[],yTicks:w},x)}let Mi={name:`bar`,clean:X(Me),render(e,t){let{radius:n=4,maxBarWidth:r=24,gap:i=2,groupPadding:a=.3,stacked:o=!1,orientation:s=`vertical`,curve:c=`monotone`}=e,l=s===`horizontal`,{series:u}=e.data,d=Ve(e.data).length,f=e=>(u[e]?.type??`bar`)!==`bar`,p=u.filter((e,t)=>f(t)).map(Q),m=Re(e),h=e=>m(u[e]).second,g=u.filter((e,t)=>f(t)||h(t)).map(Q),_=g.length?/* @__PURE__ */ new Set([...t.hidden,...g]):t.hidden,v=o?Si(u,d,{percent:o===`percent`,hidden:_}):null,y=e=>!!v&&!f(e)&&!h(e),b={scale:`band`,zero:!0,paddingInner:a,paddingOuter:a/2,zero2:u.some((e,t)=>h(t)&&e.type!==`line`),...v?{values:[...Ci(v),...u.flatMap((e,t)=>f(t)&&!h(t)?e.values:[])]}:{},...o===`percent`?{tickFormat:{style:`percent`}}:{}},x=l?ji(e,t,b):nt(e,t,b),{x:S,labels:C}=x,w=e=>ze(x,u[e]),T=/* @__PURE__ */ new Map,E=0,D=-1;u.forEach((e,n)=>{t.hidden.has(Q(e))||f(n)||(y(n)?(D<0&&(D=E++),T.set(n,D)):T.set(n,E++))});let O=[...T.keys()],j=Math.max(1,E),M=Math.max(0,Math.min(r,(S.bandwidth-i*(j-1))/j)),N=M*j+i*(j-1),P=(S.bandwidth-N)/2,F=e=>S.range[1]<S.range[0]?j-1-e:e,I=(e,t)=>S.at(t)+P+F(T.get(e)??0)*(M+i),L=(e,t)=>{if(y(e))return v?.[e]?.[t]??null;let n=u[e],r=n?.values[t];return He(r,m(n).axis)?{y0:0,y1:r}:null},R=C.map((e,t)=>{let n=-1,r=-1;for(let e of O){if(!y(e))continue;let i=L(e,t);i&&(i.y1>i.y0?n=e:i.y1<i.y0&&(r=e))}return{up:n,down:r}}),z=at(x,e,t,(e,t,n)=>{let r=w(e);if(f(e)){let e=S.at(t)+S.bandwidth/2;return l?{x:r(n),y:e}:{x:e,y:r(n)}}let i=I(e,t),a=L(e,t),o=r(a?.y1??0),s=r(a?.y0??0),c=Math.min(o,s),u=Math.abs(o-s);return l?{x:o,y:i+M/2,box:{x:c,y:i,width:u,height:M}}:{x:i+M/2,y:o,box:{x:i,y:c,width:M,height:u}}},(e,t,n)=>{let r=l?t:e,a=l?e:t,o=F(Math.floor((r-(S.at(n)+P)+i/2)/(M+i)));if(o===D)return O.find(e=>{if(!y(e))return!1;let t=L(e,n);if(!t)return!1;let r=w(e),o=r(t.y0),s=r(t.y1);return a>=Math.min(o,s)-i/2&&a<=Math.max(o,s)+i/2});let s=O.find(e=>T.get(e)===o);return s!==void 0&&L(s,n)?s:void 0}),B=u.map((e,t)=>T.has(t)&&A(`g`,it(e,t),C.map((e,r)=>{let a=L(t,r);if(!a)return null;let o=w(t),s=a.y1<a.y0,c=Math.sign(o(a.y1)-o(a.y0)),u=a.y0===0?0:c*i,d=!y(t)||(s?R[r]?.down:R[r]?.up)===t,f=l?Ai:ki;return A(`path`,{key:Ie(e),class:[`tc-bar`,s&&`tc-bar-negative`,l&&`tc-bar-horizontal`],d:f(I(t,r),M,o(a.y0)+u,o(a.y1),d?n:0)})}))),V=p.length?k(`line`):null,H=u.map((e,n)=>{if(!V||!f(n)||t.hidden.has(Q(e)))return null;let r=w(n),i=m(e).axis,a=r(Math.min(Math.max(0,r.domain[0]),r.domain[1])),o=C.map((t,n)=>{let a=e.values[n];if(!He(a,i))return null;let o=S.at(n)+S.bandwidth/2;return l?[r(a),o]:[o,r(a)]}),s=e.type===`area`&&!l;return A(`g`,it(e,n),s&&A(`path`,{class:`tc-area`,d:V.areaPath(o,a,{curve:c})}),A(`path`,{class:`tc-line`,d:V.linePath(o,{curve:c})}))});return{content:[A(`defs`,{key:`defs`},x.clip.def),x.background,A(`g`,{key:`series`,class:`tc-series-list`,"clip-path":x.clip.url},B,H),x.foreground],interaction:z}},legend:e=>Be(e.data),table:(e,t,n)=>ot(e,t,n)};function Ni(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r/2)),o=l;return`M${o(e+a)},${o(t)}H${o(e+n-a)}A${o(a)},${o(a)},0,0,1,${o(e+n)},${o(t+a)}V${o(t+r-a)}A${o(a)},${o(a)},0,0,1,${o(e+n-a)},${o(t+r)}H${o(e+a)}A${o(a)},${o(a)},0,0,1,${o(e)},${o(t+r-a)}V${o(t+a)}A${o(a)},${o(a)},0,0,1,${o(e+a)},${o(t)}Z`}let Pi=864e5,Fi=[`var(--tc-color-1)`,`var(--tc-grid-color)`,`var(--tc-color-8)`],Ii=3660,Li=e=>typeof e==`string`||typeof e==`number`||e instanceof Date?q(new Date(e).getTime()):null,Ri=(e,t)=>{let n=new Date(e);return Math.floor((t?e:Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()))/Pi)},zi=e=>/* @__PURE__ */ new Date(e*Pi),Bi=e=>((e+4)%7+7)%7,Vi=e=>Array.isArray(e)?[{name:``,values:e}]:e.series,Hi=e=>{let t=Array.isArray(e)?{series:[{name:``,values:e}]}:J(e)?e:{};return{...t,series:Ae(t.series,e=>({...je(e),values:Ae(e.values,e=>({date:Li(e.date),value:q(e.value)})).filter(e=>e.date!==null)}))}};function Ui(e){let t=e.utc===!0,n=(Math.floor(q(e.weekStart)??1)%7+7)%7,r=e=>(Bi(e)-n+7)%7,i=1/0,a=-1/0;for(let n of Vi(e.data))for(let e of n.values){let n=Li(e.date);if(n===null)continue;let r=Ri(n,t);r<i&&(i=r),r>a&&(a=r)}let o=Li(e.to),s=Li(e.from),c=o===null?a:Ri(o,t),l=q(e.weeks),u=s===null?l!==null&&l>0&&Number.isFinite(c)?c-r(c)-(Math.min(Ii/7,Math.floor(l))-1)*7:i:Ri(s,t);c-u>=Ii&&(u=c-Ii+1);let d=Number.isFinite(u)&&Number.isFinite(c)&&c>=u?c-u+1:0,f=[];if(d){let e=zi(u),t=e.getUTCFullYear(),n=e.getUTCMonth(),i=e=>Math.floor(Date.UTC(t,n+e,1)/Pi),a=c<Math.floor(Date.UTC(t+1,n,e.getUTCDate())/Pi)||c+(6-r(c))-(u-r(u))<371;for(let e=u,t=1;e<=c;t++){let n=a?c:Math.min(c,i(t*12)-1),o=e-r(e);f.push({start:e,end:n,gridStart:o,columns:(n+(6-r(n))-o+1)/7}),e=n+1}}return{from:u,count:d,bands:f,columns:f.reduce((e,t)=>Math.max(e,t.columns),0),weekStart:n,row:r}}function Wi(e,n){let{width:i,height:a,fontSize:o,locale:c}=n,{radius:d=2,utc:f=!1}=e,p=Math.min(64,Math.max(1,Math.floor(q(e.levels)??4))),m=Vi(e.data),h=m.filter(e=>!n.hidden.has(Z(e))),g=H(e.format,c),_={timeZone:`UTC`},v=oe(e.dateFormat??{year:`numeric`,month:`short`,day:`numeric`,..._},c),y=e.x?.format??oe({month:`short`,..._},c),b=e.y?.format??oe({weekday:`short`,..._},c),x=oe({year:`numeric`,..._},c),S=oe({year:`2-digit`,..._},c),C=/* @__PURE__ */ new Map,w=h.map(e=>{let t=/* @__PURE__ */ new Map;for(let n of e.values){let e=Li(n.date);if(e===null)continue;let r=Ri(e,f),i=q(n.value);t.set(r,i===null?t.get(r)??null:(t.get(r)??0)+i),C.set(r,i===null?C.get(r)??null:(C.get(r)??0)+i)}return t}),{from:T,count:E,bands:D,columns:O,weekStart:k,row:j}=Ui(e),M=0,N=0;for(let e of C.values())e!==null&&(e<M&&(M=e),e>N&&(N=e));let P=q(e.min)??M,F=Math.max(q(e.max)??N,P),I=e.colors===`diverging`,L=I?Fi:Array.isArray(e.colors)&&e.colors.length>=2?e.colors:void 0,R=q(e.mid)??(I?0:null);if(I&&R!==null){let t=Math.max(F-R,R-P);q(e.min)===null&&(P=R-t),q(e.max)===null&&(F=R+t)}let z=e=>{let t=L&&R!==null&&P<R&&R<F?e<=R?(e-P)/(R-P)*.5:.5+(e-R)/(F-R)*.5:F>P?(e-P)/(F-P):+(e>P);return Math.min(1,Math.max(0,t))},B=e=>L?Math.round(z(e)*p):e<=P?0:Math.min(p,Math.ceil(z(e)*p)||p),V=e=>{if(!L)return`--tc-heat:${l(e/p*100)}%`;let t=e/p*(L.length-1),n=Math.min(L.length-2,Math.floor(t)),r=l((t-n)*100);return{"--tc-cell-fill":r<=0?L[n]:r>=100?L[n+1]:`color-mix(in oklab,${L[n+1]} ${r}%,${L[n]})`}},U=t(e.padding,0),ee=e.x?.show!==!1&&E>0,te=e.y?.show!==!1&&E>0,ne=e.scale!==!1&&E>0,W=typeof e.scale==`object`?e.scale:{},re=W.low??(L?g(P):`Less`),ie=W.high??(L?g(F):`More`),ae=Array.from({length:7},(e,t)=>b(zi(3+(k+t)%7))),se=te?_e(`left`,ae.map((e,t)=>({value:t,position:0,label:e})),o):0,ce=ee?_e(`top`,[{value:0,position:0,label:`M`}],o):0,le=D.length>1,ue=D.map(e=>{let t=zi(e.start),n=zi(e.end);return t.getUTCFullYear()===n.getUTCFullYear()?x(t):`${x(t)}–${S(n)}`}),de=le&&ee,fe=de?Math.ceil(ue.reduce((e,t)=>Math.max(e,s(t,o)),0))+8:0,pe=ne?Math.ceil(o*u)+6:0,G=r(i,a,{top:U.top,right:U.right,bottom:U.bottom+pe,left:U.left+Math.max(se,fe)}),me=D.length,he=G.height-me*ce-(me-1)*10,K=O?Math.max(0,Math.min(G.width/O,he/(7*me))):0,ve=Math.max(0,Math.min(q(e.gap)??2,K/4)),ye=Math.max(0,K-ve),xe=e=>G.y+e*(ce+K*7+10)+ce,Se=e=>G.x+e*K+ve/2,Ce={x:G.x,y:G.y,width:K*O,height:me?xe(me-1)+K*7-G.y:0},we=e=>{let t=Math.max(0,D.findIndex(t=>e<=t.end)),n=Math.floor((e-D[t].gridStart)/7);return{x:Se(n),y:xe(t)+j(e)*K+ve/2}},Te=(e,t)=>{if(e<0||e>=E)return null;let n=T+e,r=we(n),i=r.x+ye/2,a=r.y+ye/2,o={x:r.x,y:r.y,width:ye,height:ye},s=h.map((e,t)=>{let r=w[t]?.get(n)??null;return{name:e.name,seriesIndex:m.indexOf(e),value:r,text:r===null?`–`:g(r),x:i,y:a,box:o,color:e.color}});return{index:e,label:zi(n).toISOString().slice(0,10),title:v(zi(n)),x:i,area:Ce,items:s,seriesIndex:t,highlight:{kind:`halo`,d:Ni(o.x-2,o.y-2,ye+4,ye+4,d+2)}}},Ee={count:E,rows:7,hitIndex:Te,hitTest(e,t){if(!K||e<Ce.x)return null;let n=Math.floor((e-Ce.x)/K);for(let e=0;e<me;e++){let r=D[e],i=Math.floor((t-xe(e))/K);if(t<xe(e)||i>6||n>=r.columns)continue;let a=r.gridStart+n*7+i;return a<r.start||a>r.end?null:Te(a-T)}return null}},J=[];for(let e=T;e<T+E;e++){let t=C.get(e)??null,n=we(e);J.push(A(`rect`,{key:e,class:[`tc-cell`,t===null&&`tc-cell-empty`],x:l(n.x),y:l(n.y),width:l(ye),height:l(ye),rx:l(Math.min(d,ye/2)),style:t===null?void 0:V(B(t))}))}let De=D.map((e,t)=>{let n=[];for(let t=0;t<e.columns;t++){let r=Math.max(e.start,e.gridStart+t*7),i=zi(r).getUTCMonth();(t===0||i!==zi(Math.max(e.start,r-7)).getUTCMonth())&&n.push({value:r,position:G.x+t*K+K/2,label:y(zi(r))})}let r=ae.map((e,n)=>({value:n,position:xe(t)+n*K+K/2,label:e})),i={x:G.x,y:xe(t),width:K*e.columns,height:K*7};return A(`g`,{key:`band-${e.start}`,class:`tc-calendar-band`},ee&&be({position:`top`,ticks:ge(n,`top`,o),area:i}),te&&be({position:`left`,ticks:ge(r,`left`,o),area:i}),de&&A(`text`,{class:`tc-tick-label tc-calendar-year`,x:l(G.x-8),y:l(xe(t)-8),"text-anchor":`end`,"aria-hidden":`true`},ue[t]))}),Y=Math.min(ye,o),Oe=Ce.y+Ce.height+6+Y/2,ke=s(re,o),Ae=s(ie,o),je=p+1,Me=ke+6+je*(Y+ve)+6+Ae,X=Math.max(G.x,G.x+Ce.width-Me);return{content:[A(`g`,{key:`cells`,class:`tc-calendar-cells`},J),De,ne&&A(`g`,{key:`scale`,class:`tc-calendar-scale`,"aria-hidden":`true`},A(`text`,{class:`tc-tick-label`,x:l(X),y:l(Oe),dy:`0.32em`},re),Array.from({length:je},(e,t)=>A(`rect`,{key:t,class:`tc-cell`,x:l(X+ke+6+t*(Y+ve)),y:l(Oe-Y/2),width:l(Y),height:l(Y),rx:l(Math.min(d,Y/2)),style:V(t)})),A(`text`,{class:`tc-tick-label`,x:l(X+ke+6+je*(Y+ve)+6),y:l(Oe),dy:`0.32em`},ie))],interaction:Ee}}function Gi(e){let{bands:t,columns:n}=Ui(e),r=t.length;if(!r)return;let i=e.x?.show===!1?0:23,a=e.y?.show===!1?0:36,o=r*i+(r-1)*10+(e.scale===!1?0:21);return{left:a,fixed:o,rows:7*r,columns:n,width:a+n*13,height:o+r*7*13}}function Ki(e){let t=Gi(e);return t&&Math.max(2,l(t.width/t.height))}function qi(e,t){let n=Gi(e);if(!n||e.aspectRatio!==e.autoRatio||t>=n.width)return;let r=Math.max(0,t-n.left)/n.columns*n.rows;return Math.min(t/2,n.fixed+r)}let Ji=e=>Array.isArray(e.data)?[]:Pe(Vi(e.data));function Yi(e,t,n){let r=Vi(e.data).filter(e=>!t.hidden.has(Z(e))),i=e.utc===!0,a=H(e.format,t.locale),o=oe(e.dateFormat??{year:`numeric`,month:`short`,day:`numeric`,timeZone:`UTC`},t.locale),s=/* @__PURE__ */ new Map;r.forEach((e,t)=>{for(let n of e.values){let e=Li(n.date);if(e===null)continue;let a=Ri(e,i),o=s.get(a)??r.map(()=>null),c=q(n.value);c!==null&&(o[t]=(o[t]??0)+c),s.set(a,o)}});let c=[...s.keys()].sort((e,t)=>e-t);return{columns:[``,...r.map(e=>e.name)],total:c.length,rows:c.slice(0,n).map(e=>[o(zi(e)),...(s.get(e)??[]).map(e=>e===null?`–`:a(e))])}}let Xi={name:`calendar`,clean:e=>{let t=X(Hi)(e);if(t.aspectRatio!==void 0&&t.aspectRatio!==t.autoRatio)return t;let n=Ki(t);return{...t,aspectRatio:n,autoRatio:n}},render:Wi,height:qi,legend:Ji,table:Yi,valueLabels:{marks:`cell`,format:e=>e.format}},Zi=(e,t,n,r,i)=>{let a=`A${i},${i},0,0,1,`;return`M${l(e+i)},${t}H${l(e+n-i)}${a}${l(e+n)},${l(t+i)}V${l(t+r-i)}${a}${l(e+n-i)},${l(t+r)}H${l(e+i)}${a}${e},${l(t+r-i)}V${l(t+i)}${a}${l(e+i)},${t}Z`},Qi=(e,t)=>[e.open,e.high,e.low,e.close].every(e=>He(e,t));function $i(e){let t=t=>e.data.map(n=>Qi(n,e.y)?n[t]:null),n={data:{labels:e.data.map(e=>e.x),series:[{name:`Open`,values:t(`open`)},{name:`High`,values:t(`high`)},{name:`Low`,values:t(`low`)},{name:`Close`,values:t(`close`)}]}};return e.x&&(n.x=e.x),e.y&&(n.y=e.y),e.padding!==void 0&&(n.padding=e.padding),e.annotations&&(n.annotations=e.annotations),n}let ea={name:`candlestick`,clean:X(e=>Ae(e,e=>({...e,x:Oe(e.x),open:q(e.open),high:q(e.high),low:q(e.low),close:q(e.close)}))),render(e,t){let{maxCandleWidth:n=16,groupPadding:r=.3,radius:i=1}=e,a=$i(e),o=nt(a,t,{scale:`band`,zero:!1,paddingInner:r,paddingOuter:r/2}),{x:s,y:c,labels:u}=o,d=Math.max(1,Math.min(n,s.bandwidth)),f=e=>s.at(e)+s.bandwidth/2,p=e=>e.close>=e.open,m=at(o,a,t,(e,t,n)=>({x:f(t),y:c(n)})),h=t=>{let n=t?e.data[t.index]:void 0;if(!t||!n)return t;let r=p(n)?`var(--tc-up-color,var(--tc-color-6))`:`var(--tc-negative-color,var(--tc-color-8))`;return{...t,items:t.items.map(e=>({...e,color:r}))}},g={count:m.count,hitIndex:(e,t)=>h(m.hitIndex(e,t)),hitTest:(e,t)=>h(m.hitTest(e,t))},_=e.data.map((t,n)=>{if(!Qi(t,e.y))return null;let r=l(f(n)),a=c(Math.max(t.open,t.close)),o=Math.max(c(Math.min(t.open,t.close)),a+1),s=l(f(n)-d/2),m=l(Math.min(i,d/2,(o-a)/2));return A(`g`,{key:Ie(u[n]),class:[`tc-candle`,p(t)?`tc-candle-up`:`tc-candle-down`]},A(`path`,{class:`tc-candle-wick`,d:`M${r},${l(c(t.high))}V${l(c(t.low))}`}),A(`path`,{class:`tc-candle-body`,d:Zi(s,l(a),l(d),l(o-a),m)}))});return{content:[A(`defs`,{key:`defs`},o.clip.def),o.background,A(`g`,{key:`series`,class:`tc-series-list tc-candles`,"clip-path":o.clip.url},_),o.foreground],interaction:g}},table:(e,t,n)=>ot($i(e),t,n)};function ta(e,t,n){if(s(e,n)<=t)return e;let r=[...e];for(;r.length>2;){r.pop();let e=`${r.join(``).trimEnd()}…`;if(s(e,n)<=t)return e}return``}let na=(e,t)=>t>0?e/t:0;function ra(e){let t=e.data[0]?.value??0;return e.data.map((n,r)=>({data:n,value:n.value,ofFirst:r===0?1:na(n.value,t),ofPrevious:r===0?1:na(n.value,e.data[r-1].value)}))}let ia=(e,t)=>l((t>1?.3+.7*e/(t-1):1)*100),aa=(e,t,n)=>Math.max(0,Math.min(e,t/2,n/2));function oa(e,t,n,r,i,a){let o=t-e,s=r-n,c=aa(a,o,i-n),u=aa(a,o,i-r),d=o>0?c/o:0,f=o>0?u/o:0,p=l;return`M${p(e)},${p(n+c)}Q${p(e)},${p(n)},${p(e+o*d)},${p(n+s*d)}L${p(t-o*f)},${p(r-s*f)}Q${p(t)},${p(r)},${p(t)},${p(r+u)}L${p(t)},${p(i)}L${p(e)},${p(i)}Z`}function sa(e,n){let{width:i,height:a,fontSize:o,locale:c}=n,u=Math.max(0,e.radius??4),d=r(i,a,t(e.padding,0)),f=ra(e),p=f.length;if(p===0)return{content:null};let m=H(e.format,c),h=z(c,{style:`percent`,maximumFractionDigits:1}),g=typeof e.format==`function`?m:H({...e.format,notation:`compact`},c),_=o*1.3,v=e.labels===!1?0:Math.min(d.height,_*3+8),y=d.y+d.height,b=d.height-v,x=d.width/p,S=e=>d.x+e*x,C=Math.max(0,...f.map(e=>e.value)),w=e=>y-(C>0?e/C*b:0),T=e=>f[e].data.color??`color-mix(in oklab,var(--tc-funnel-color,var(--tc-color-1)) ${ia(e,p)}%,var(--tc-surface))`,E=e=>{let t=f[e],n=S(e)+x/2,r=[{name:t.data.name,seriesIndex:0,value:t.value,text:m(t.value),x:n,y:w(t.value),color:T(e)}],i=(e,t,i)=>r.push({name:`of ${t.data.name}`,seriesIndex:e,value:i,text:h.format(i),x:n,y:null,color:`transparent`});return e>0&&i(1,f[0],t.ofFirst),e>1&&i(2,f[e-1],t.ofPrevious),{index:e,label:t.data.name,title:``,x:n,area:d,highlight:{kind:`band`,x:S(e),y:d.y,width:x,height:d.height},items:r}},D={count:p,hitIndex:e=>e>=0&&e<p?E(e):null,hitTest(e,t){return e<d.x||e>d.x+d.width||t<d.y||t>y?null:E(Math.min(p-1,Math.floor((e-d.x)/(x||1))))}},O=f.slice(1).map((e,t)=>A(`line`,{key:Z(e.data),class:`tc-grid-line tc-funnel-divider`,x1:l(S(t+1)),x2:l(S(t+1)),y1:l(d.y),y2:l(y)})),k=f.map((e,t)=>A(`path`,{key:Z(e.data),class:[`tc-funnel-stage`,e.data.class],"data-series":e.data.name,d:oa(S(t),S(t+1),w(e.value),w((f[t+1]??e).value),y,u),style:{"--tc-funnel-color":e.data.color,"--tc-funnel-shade":`${e.data.color?100:ia(t,p)}%`}})),j=v>=_*3&&f.flatMap((e,t)=>{let n=t===0?0:10,r=x-n-10,i=l(S(t)+n),a=d.y+o*.85,c=Z(e.data),u=e=>s(e,o)<=r,f=ta(e.data.name,r,o),p=m(e.value),v=u(p)?p:g(e.value),y=t>0?h.format(e.ofFirst):``;return[f&&A(`text`,{key:c,class:`tc-funnel-name`,x:i,y:l(a)},f),u(v)&&A(`text`,{key:`${c}/value`,class:`tc-funnel-value`,x:i,y:l(a+_)},v),y&&u(y)&&A(`text`,{key:`${c}/share`,class:`tc-funnel-share`,x:i,y:l(a+_*2)},y)]});return{content:[A(`g`,{class:`tc-funnel-dividers`,"aria-hidden":`true`},O),A(`g`,{class:`tc-funnel-stages`},k),j&&A(`g`,{class:`tc-funnel-labels`,"aria-hidden":`true`},j)],interaction:D}}function ca(e,t,n){let r=H(e.format,t.locale),i=z(t.locale,{style:`percent`,maximumFractionDigits:1}),a=ra(e).map(e=>[e.data.name,r(e.value),i.format(e.ofFirst),i.format(e.ofPrevious)]),o={columns:[``,`Value`,`Of first`,`Of previous`],rows:a};return a.length>n&&(o.rows=a.slice(0,n),o.total=a.length),o}let la={name:`funnel`,clean:X(e=>Ae(e,e=>({...je(e),value:q(e.value)})).filter(e=>e.value!==null&&e.value>=0)),render:sa,table:ca},$=1e-12,ua=Math.PI,da=ua/2,fa=2*ua,pa=Math.PI/180,ma=e=>e>=1?da:e<=-1?-da:Math.asin(e),ha=e=>e>1?0:e<-1?ua:Math.acos(e);function ga(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<$))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function _a(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function va(e,t,n,r,i,a,o){let s=r,c=i,l=r,u=i,d=a,f=a,p=(e.padAngle??0)/2,m=p>$?e.padRadius??Math.sqrt(t*t+n*n):0,h=Math.min(Math.abs(n-t)/2,e.cornerRadius??0),g=h,_=h;if(m>$){let e=ma(m/t*Math.sin(p)),a=ma(m/n*Math.sin(p));d-=e*2,d>$?(e*=o?1:-1,l+=e,u-=e):(d=0,l=u=(r+i)/2),f-=a*2,f>$?(a*=o?1:-1,s+=a,c-=a):(f=0,s=c=(r+i)/2)}let v=n*Math.cos(s),y=n*Math.sin(s),b=t*Math.cos(u),x=t*Math.sin(u),S=n*Math.cos(c),C=n*Math.sin(c),w=t*Math.cos(l),T=t*Math.sin(l);if(h>$&&a<ua){let e=ga(v,y,w,T,S,C,b,x);if(e){let r=v-e[0],i=y-e[1],a=S-e[0],o=C-e[1],s=(r*a+i*o)/(Math.sqrt(r*r+i*i)*Math.sqrt(a*a+o*o)),c=1/Math.sin(ha(s)/2),l=Math.sqrt(e[0]*e[0]+e[1]*e[1]);g=Math.min(h,(t-l)/(c-1)),_=Math.min(h,(n-l)/(c+1))}else g=_=0}return{a00:l,a01:s,a10:u,a11:c,da0:d,da1:f,rc:h,rc0:g,rc1:_,x01:v,y01:y,x10:b,y10:x,x11:S,y11:C,x00:w,y00:T}}function ya(e){let t=(e.innerRadius+e.outerRadius)/2,n=(e.startAngle+e.endAngle)/2-da;return[Math.cos(n)*t,Math.sin(n)*t]}function ba(e,t,n){let r=Math.sqrt(t*t+n*n);return r>0?2*Math.asin(Math.min(1,e/2/r)):0}let xa=(e,t)=>Math.atan2(t,e);function Sa(e){let t=10**Math.max(0,Math.min(12,Math.floor(e.precision??2))),n=e=>{let n=Math.round(e*t)/t;return String(n===0?0:n)},r=``,i=(e,t)=>{r+=`M${n(e)},${n(t)}`},a=(e,t)=>{r+=`L${n(e)},${n(t)}`},o=(e,t,i,a)=>{r+=`A${n(e)},${n(e)},0,0,${t},${n(i)},${n(a)}`},s=(e,t,n,r)=>{let i=r?t-n:n-t;i=(i%fa+fa)%fa,i<$&&Math.abs(n-t)>$&&(i=fa);let a=r?t-i/2:t+i/2,s=+!r;o(e,s,e*Math.cos(a),e*Math.sin(a)),o(e,s,e*Math.cos(n),e*Math.sin(n))},c=Math.max(0,e.innerRadius),l=Math.max(0,e.outerRadius);l<c&&([c,l]=[l,c]);let u=e.startAngle-da,d=e.endAngle-da,f=Math.abs(d-u),p=d>u,m=+!!p;if(!(l>$)){i(0,0);for(let e=0;e<4;e++)o(0,m,0,0);a(0,0);for(let e=0;e<4;e++)o(0,m,0,0);return`${r}Z`}if(f>fa-$){let e=l*Math.cos(u),t=l*Math.sin(u);i(e,t),o(l,m,e,t),s(l,u,u+(p?fa:-fa)*(1-1e-9),!p),o(l,m,e,t);let n=c*Math.cos(u),d=c*Math.sin(u);if(a(n,d),o(c,m,n,d),c>$)s(c,u,u+(p?-fa:fa)*(1-1e-9),p);else for(let e=0;e<2;e++)o(0,m,0,0);return o(c,m,n,d),`${r}Z`}let{a00:h,a01:g,a10:_,a11:v,da0:y,da1:b,rc:x,rc0:S,rc1:C,x01:w,y01:T,x10:E,y10:D,x11:O,y11:k,x00:A,y00:j}=va(e,c,l,u,d,f,p);if(b>$&&C>$){let e=_a(A,j,w,T,l,C,p),t=_a(O,k,E,D,l,C,p);if(i(e.cx+e.x01,e.cy+e.y01),C<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(C,m,e,n),o(l,m,e,n),o(l,m,e,n),o(C,m,e,n)}else o(C,m,e.cx+e.x11,e.cy+e.y11),s(l,xa(e.cx+e.x11,e.cy+e.y11),xa(t.cx+t.x11,t.cy+t.y11),!p),o(C,m,t.cx+t.x01,t.cy+t.y01)}else{if(i(w,T),o(l,m,w,T),b>$)s(l,g,v,!p);else for(let e=0;e<2;e++)o(l,m,w,T);o(l,m,O,k)}if(!(c>$)||!(y>$)){a(E,D);for(let e=0;e<4;e++)o(c,m,E,D)}else if(S>$){let e=_a(E,D,O,k,c,-S,p),t=_a(w,T,A,j,c,-S,p);if(a(e.cx+e.x01,e.cy+e.y01),S<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(S,m,e,n),o(c,m,e,n),o(c,m,e,n),o(S,m,e,n)}else o(S,m,e.cx+e.x11,e.cy+e.y11),s(c,xa(e.cx+e.x11,e.cy+e.y11),xa(t.cx+t.x11,t.cy+t.y11),p),o(S,m,t.cx+t.x01,t.cy+t.y01)}else a(E,D),o(c,m,E,D),s(c,_,h,p),o(c,m,A,j);return`${r}Z`}function Ca(e,t){let n=A(`path`,{class:e,d:Sa(t)});return n.arc=[t.innerRadius,t.outerRadius,t.startAngle,t.endAngle,t.padAngle??0,t.cornerRadius??0],n}function wa(e,t,n){let{arc:r,attrs:i}=n;if(!r||t.attrs.d===i.d)return;let a=mr(e)??t.arc,o=Number.parseFloat(getComputedStyle(e).transitionDuration)*1e3;if(a&&o>0)return hr(e,a,r,o,([e,t,n,r,i,a])=>Sa({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,padAngle:i,cornerRadius:a}),String(i.d)),{...i,d:t.attrs.d}}let Ta=Math.PI/2;function Ea(e){let{data:t}=e;return typeof t==`number`?[{name:``,value:t}]:Array.isArray(t)?t:[t]}function Da(e,t){let n=e.max??100;return Ea(e).map((e,t)=>({data:e,index:t,max:e.max??n})).filter(e=>!t.has(Z(e.data))).map((e,t)=>({...e,position:t,value:Math.min(e.max,Math.max(0,e.data.value||0))}))}function Oa(e,t,n,r,i){let a=[[0,0]],o=t+n;a.push([Math.sin(t),-Math.cos(t)],[Math.sin(o),-Math.cos(o)]);for(let e=Math.ceil(t/Ta)*Ta,n=0;n<5&&e<=o+1e-9;n++)a.push([Math.sin(e),-Math.cos(e)]),e+=Ta;let s=Math.min(e.width,e.height)/2,c={x0:0,y0:0,x1:0,y1:0};for(let t=0;t<4;t++){c={x0:0,y0:r,x1:0,y1:i};for(let[e,t]of a)c.x0=Math.min(c.x0,e*s),c.x1=Math.max(c.x1,e*s),c.y0=Math.min(c.y0,t*s),c.y1=Math.max(c.y1,t*s);let t=Math.min(e.width/(c.x1-c.x0),e.height/(c.y1-c.y0));if(Math.abs(t-1)<.001)break;s=Math.max(0,s*t)}return{outer:s,cx:e.x+(e.width-(c.x1-c.x0))/2-c.x0,cy:e.y+(e.height-(c.y1-c.y0))/2-c.y0}}function ka(e,n){let{width:i,height:a,locale:o}=n,s=Math.max(1,e.thickness??12),c=Math.max(0,e.gap??4),l=e.cornerRadius??s/2,u=t(e.padding,0),d=r(i,a,{top:u.top+8,right:u.right+8,bottom:u.bottom+8,left:u.left+8}),f=(e.startAngle??0)*pa,p=Math.min(360,Math.max(0,e.angle??360))*pa,m=Da(e,n.hidden),h=e.center,g=m[0],_=h!==!1&&g!==void 0,v=_?h?.label??(g.data.name||void 0):void 0,{outer:y,cx:b,cy:x}=Oa(d,f,p,_?-1.4*n.fontSize:0,_?(v?2:.7)*n.fontSize:0),S=H(e.format,o),C=z(o,{style:`percent`,maximumFractionDigits:1}),w=(e,t=0)=>{let n=Math.max(0,y-e.position*(s+c));return{innerRadius:Math.max(0,n-s-t),outerRadius:n+t}},T=e=>e.max>0?e.value/e.max:0,E=(e,t=0)=>({...w(e,t),startAngle:f,endAngle:f+p*T(e),cornerRadius:l}),D=e=>{let[t,n]=ya(E(e)),r={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${S(e.value)} (${C.format(T(e))})`,x:b+t,y:x+n};return e.data.color&&(r.color=e.data.color),{index:e.position,label:e.data.name,title:``,x:b+t,area:{x:b-y,y:x-y,width:y*2,height:y*2},items:[r],seriesIndex:e.index,highlight:{kind:`halo`,d:Sa(E(e,2)),x:b,y:x}}},O={count:m.length,hitIndex:e=>{let t=m[e];return t?D(t):null},hitTest(e,t){let n=Math.hypot(e-b,t-x),r=m.find(e=>{let{innerRadius:t,outerRadius:r}=w(e,2);return n>=t&&n<=r});return r?D(r):null}},k=m.map(e=>A(`g`,Fe(e.data,e.index),Ca(`tc-gauge-track`,{...E(e),endAngle:f+p}),Ca(`tc-gauge-arc`,E(e)))),j=_?h?.value??C.format(T(g)):``;return{content:[A(`g`,{class:`tc-gauge`,style:`transform:translate(${b}px,${x}px)`},A(`g`,{class:`tc-gauge-rings`},k)),_&&A(`g`,{class:`tc-gauge-center`,"aria-hidden":`true`},A(`text`,{class:`tc-gauge-value`,x:b,y:x,dy:v?`0`:`0.35em`,"text-anchor":`middle`},j),v&&A(`text`,{class:`tc-gauge-label`,x:b,y:x,dy:`1.6em`,"text-anchor":`middle`},v))],interaction:O}}function Aa(e,t){let n=H(e.format,t.locale),r=z(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:Da(e,t.hidden).map(e=>[e.data.name,n(e.value),r.format(e.max>0?e.value/e.max:0)])}}let ja={name:`gauge`,clean:X(e=>Ne(typeof e==`number`?[{name:``,value:e}]:J(e)?[e]:e)),render:ka,sweep:wa,legend:e=>Pe(Ea(e)),table:Aa},Ma=`var(--tc-heat-empty,var(--tc-grid-color))`,Na=(e,t=`var(--tc-heat-color,var(--tc-color-1))`)=>`color-mix(in oklab,${t} ${l(e*100)}%,${Ma})`,Pa=(e,t)=>e.name??`range-${t+1}`,Fa=(e,t)=>e.findIndex(e=>(e.from===void 0||t>=e.from)&&(e.to===void 0||t<e.to)),Ia=(e,t)=>e.color??(t<8?`var(--tc-color-${t+1})`:`var(--tc-color-other)`);function La(e,t){let{width:n,fontSize:r,locale:a}=t,{gap:o=2,radius:c=3}=e,u=Ve(e.data),d=e.x?.format??(e=>String(e)),f=H(e.format,a),[p,m]=we(e.data.series.flatMap(e=>e.values))??[0,1],h=e.min??Math.min(0,p),g=e.max??m,_=t=>{let{mid:n}=e,r;return r=n!==void 0&&e.colors&&h<n&&n<g?t<=n?(t-h)/(n-h)*.5:.5+(t-n)/(g-n)*.5:g>h?(t-h)/(g-h):+(t>h),Math.min(1,Math.max(0,r))},v=e=>.08+.92*_(e),y=e.ranges?.length?e.ranges:void 0,b=!y&&e.colors&&e.colors.length>=2?e.colors:void 0,x=!y&&!b&&e.colorBy===`series`,S=x?e.data.series.filter(e=>!t.hidden.has(Q(e))):e.data.series,C=t=>e.data.series.indexOf(t),w=(e,n)=>{if(y){let n=Fa(y,e),r=y[n];return!r||t.hidden.has(Pa(r,n))?{color:Ma,empty:!0}:{style:{"--tc-cell-fill":r.color},color:r.color}}if(b){let t=_(e)*(b.length-1),n=Math.min(b.length-2,Math.floor(t)),r=l((t-n)*100),i=b[n],a=r<=0?i:r>=100?b[n+1]:`color-mix(in oklab,${b[n+1]} ${r}%,${i})`;return{style:{"--tc-cell-fill":a},color:a}}let r=v(e);return{style:`--tc-heat:${l(r*100)}%`,color:x?Na(r,Ia(n,C(n))):Na(r)}},{rtl:T}=t,E=e.x?.show!==!1&&u.length>0,D=e.y?.show!==!1&&S.length>0,O=S.map((e,t)=>({value:t,position:0,label:e.name})),k=D?_e(`left`,O,r):0,j=E?_e(`bottom`,[{value:0,position:0,label:`M`}],r):0,M=E?s(d(u[u.length-1],u.length-1),r):0,{area:N,side:P,range:F}=i(t,e.padding,e=>{let t=(n-e.start-e.end-k)/Math.max(1,u.length)/2;return{top:e.top,bottom:e.bottom+j,start:e.start+k,end:e.end+Math.max(0,Math.ceil(M/2-t))}}),I=Se(u.map((e,t)=>t),F()),L=Se(S.map((e,t)=>t),[N.y,N.y+N.height]),R=Math.max(0,I.bandwidth-o),z=Math.max(0,L.bandwidth-o),B=e=>I.at(e)+o/2,V=e=>L.at(e)+o/2,U=(e,t)=>{let n=S[t]?.values[e];return n!=null&&Number.isFinite(n)?n:null},ee=(e,t=0)=>{if(e<0||e>=u.length||S.length===0)return null;let n=Math.max(0,Math.min(S.length-1,t)),r=S.map((t,n)=>{let r=U(e,n),i=y&&r!==null?y[Fa(y,r)]:void 0;return{name:t.name,seriesIndex:n,value:r,text:r===null?`–`:i?.name?`${f(r)} · ${i.name}`:f(r),x:B(e)+R/2,y:V(n)+z/2,box:{x:B(e),y:V(n),width:R,height:z},color:r===null?`var(--tc-grid-color)`:w(r,t).color}});return{index:e,label:Ie(u[e]),title:d(u[e],e),x:B(e)+R/2,area:N,items:r,seriesIndex:n,highlight:{kind:`halo`,d:Ni(B(e)-2,V(n)-2,R+4,z+4,c+2)}}},te={count:u.length,reversed:T===!0,hitIndex:(e,t)=>ee(e,t),hitTest(e,t){if(e<N.x||e>N.x+N.width||t<N.y||t>N.y+N.height)return null;let n=Math.min(u.length-1,Math.floor((e-N.x)/(I.step||1))),r=T?u.length-1-n:n,i=Math.min(S.length-1,Math.floor((t-N.y)/(L.step||1)));return ee(r,i)}},ne=S.map((e,t)=>A(`g`,{key:Q(e),class:[`tc-heatmap-row`,x&&[`tc-series`,`tc-series-${C(e)+1}`]],"data-series":e.name,style:x?{"--tc-series-color":e.color}:void 0},u.map((n,r)=>{let i=U(r,t),a=i===null?void 0:w(i,e);return A(`rect`,{key:Ie(n),class:[`tc-cell`,(i===null||a?.empty)&&`tc-cell-empty`],x:l(B(r)),y:l(V(t)),width:l(R),height:l(z),rx:l(Math.min(c,R/2,z/2)),style:a?.style})}))),W=E?ge(he(I,(e,t)=>d(u[t],t)),`bottom`,r):[],re=D?he(L,(e,t)=>S[t]?.name??``):[];return{content:[A(`g`,{class:`tc-heatmap-cells`},ne),E&&be({position:`bottom`,ticks:W,area:N}),D&&be({position:P,ticks:re,area:N})],interaction:te}}function Ra(e){let{ranges:t}=e;if(t?.length){let n=H(e.format,e.locale);return t.map((e,t)=>({key:Pa(e,t),name:e.name??(e.from===void 0?`< ${n(e.to??0)}`:e.to===void 0?`≥ ${n(e.from)}`:`${n(e.from)}–${n(e.to)}`),index:t,color:e.color}))}return e.colors&&e.colors.length>=2?[]:e.colorBy===`series`?Be(e.data):[]}let za={name:`heatmap`,clean:X(Me),render:La,legend:Ra,valueLabels:{marks:`cell`,format:e=>e.format},table:(e,t,n)=>ot({data:e.data,...e.x?{x:e.x}:{},y:{format:e.format}},t,n)};function Ba(e,t){let n=Math.min(t.max,Math.max(1,q(e?.scale)??1)),r=t.k*n,i=(e,t,n)=>{let i=n/r;return i>=t?(t-i)/2:Math.min(t-i,Math.max(0,e??0))};return r>0?{x:i(q(e?.x),t.mapWidth,t.width),y:i(q(e?.y),t.mapHeight,t.height),scale:n}:{x:0,y:0,scale:n}}let Va=`http://www.w3.org/2000/svg`,Ha=[`M12 5v14M5 12h14`,`M5 12h14`];function Ua(){return{name:`map`,install(e){let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,r=n.defaultView,i=()=>e.config,a=()=>e.config.type.name===`map`,o=()=>a()&&!!i().zoom,s=()=>e.interaction?.map,c=()=>t.querySelector(`:scope > svg.tc-chart`),l=e=>e.target?.closest?.(`svg.tc-chart`)===c()&&!!c(),u=0,d=/* @__PURE__ */ new Map,f=!1,p,m=!t.classList.contains(`tc-container`),h=()=>r?.cancelAnimationFrame(u),g=()=>{let e=s();return e&&Ba(i().view,e)},_=t=>{let n=s();n&&e.update({view:Ba(t,n)})},v=(t,n)=>{let r=c(),{width:i,height:a}=e.size,o=r?vt(r,t,n,i,a):{x:0,y:0};return[o.x,o.y]},y=(e,t)=>{let n=s(),r=g();if(!n||!r)return null;let i=n.k*r.scale,[a,o]=v(e,t);return[r.x+(a-n.x)/i,r.y+(o-n.y)/i]},b=e=>{h();let t=s(),n=g();if(!t||!n)return;let a=Ba(e,t);if(i().animate===!1||!r?.requestAnimationFrame||r.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){_(a);return}let o=performance.now(),c=e=>{let t=Math.min((e-o)/200,1),i=1-(1-t)**3,s=(e,t)=>e+(t-e)*i;_({x:s(n.x,a.x),y:s(n.y,a.y),scale:1/s(1/n.scale,1/a.scale)}),t<1&&(u=r.requestAnimationFrame(c))};u=r.requestAnimationFrame(c)},x=(e,t,n=!1)=>{let r=s(),i=g();if(!r||!i||!(r.k>0))return;let a=Math.min(r.max,Math.max(1,i.scale*e)),o=r.k*i.scale,[c,l]=t??[i.x+r.width/o/2,i.y+r.height/o/2],u={x:c-(c-i.x)*i.scale/a,y:l-(l-i.y)*i.scale/a,scale:a};n?b(u):(h(),_(u))},S=t=>{let n=i(),r=t?.region;if(!a()||!n.select||!r)return;let o=[...n.selected??[]],s=o.filter(e=>e!==r),c=s.length<o.length?s:n.select===`multiple`?[...o,r]:[r];e.update({selected:c}),n.onSelect?.(c,r)},C=t=>{d.delete(t.pointerId),d.size===0&&(n.removeEventListener(`pointerup`,C),n.removeEventListener(`pointercancel`,C),f&&e.update({}))},w=e=>{o()&&l(e)&&(e.pointerType!==`mouse`||e.button===0)&&(d.size===0&&(f=!1),d.set(e.pointerId,[e.clientX,e.clientY]),h(),n.addEventListener(`pointerup`,C),n.addEventListener(`pointercancel`,C))},T=t=>{let n=d.get(t.pointerId),r=g(),i=s();if(!n||!r||!i)return;let a=[t.clientX,t.clientY];if(!f){if(d.size===1&&Math.hypot(a[0]-n[0],a[1]-n[1])<4)return;f=!0;try{c()?.setPointerCapture(t.pointerId)}catch{}}if(t.stopPropagation(),e.clearHighlight(),d.set(t.pointerId,a),d.size===1){let e=i.k*r.scale,[t,o]=v(n[0],n[1]),[s,c]=v(a[0],a[1]);_({x:r.x-(s-t)/e,y:r.y-(c-o)/e,scale:r.scale});return}let o=[...d].find(([e])=>e!==t.pointerId)?.[1];if(!o)return;let l=Math.hypot(n[0]-o[0],n[1]-o[1]),u=Math.hypot(a[0]-o[0],a[1]-o[1]);l>0&&u>0&&x(u/l,y((a[0]+o[0])/2,(a[1]+o[1])/2))},E=e=>{let{zoom:t}=i();o()&&(typeof t!=`object`||t.wheel!==!1)&&l(e)&&(e.preventDefault(),x(Math.exp(-e.deltaY*(e.ctrlKey?.01:.002)),y(e.clientX,e.clientY)))},D=e=>{o()&&l(e)&&x(2,y(e.clientX,e.clientY),!0)},O=e=>{f&&e.stopPropagation(),f=!1},k=t=>{if(t.target!==c()||!a())return;let{key:n}=t;if(o()&&(n===`+`||n===`=`))x(2,null,!0);else if(o()&&n===`-`)x(1/2,null,!0);else if(o()&&n===`0`)b({x:0,y:0,scale:1});else if(i().select&&(n===`Enter`||n===` `)&&e.active)S(e.active);else return;t.preventDefault()},A=e=>{let t=e.target.closest(`button`);t&&x(t.value===`in`?2:1/2,null,!0)};t.addEventListener(`pointermove`,T,!0),t.addEventListener(`click`,O,!0),t.addEventListener(`pointerdown`,w),t.addEventListener(`wheel`,E,{passive:!1}),t.addEventListener(`dblclick`,D),t.addEventListener(`keydown`,k);let j=e.on(`click`,({hit:e})=>S(e));return{svgAttrs:()=>o()?{"data-zoom":f&&d.size?`drag`:``}:void 0,afterRender:()=>{if(!o()){p?.remove(),p=void 0;return}if(!p){p=n.createElement(`div`),p.className=`tc-map-zoom`;for(let[e,t]of Ha.entries()){let r=n.createElement(`button`);r.type=`button`,r.className=`tc-download-toggle`,r.value=e?`out`:`in`;let i=n.createElementNS(Va,`svg`);i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`width`,`16`),i.setAttribute(`height`,`16`),i.setAttribute(`aria-hidden`,`true`);let a=n.createElementNS(Va,`path`);a.setAttribute(`d`,t),i.append(a),r.append(i),p.append(r)}p.addEventListener(`click`,A),t.classList.add(`tc-container`)}p.isConnected||t.append(p);let{zoom:e}=i(),r=typeof e==`object`?e.labels:void 0,a=g(),c=s()?.max??1,[l,u]=p.querySelectorAll(`button`);l&&u&&a&&(l.setAttribute(`aria-label`,r?.in??`Zoom in`),u.setAttribute(`aria-label`,r?.out??`Zoom out`),l.disabled=a.scale>=c,u.disabled=a.scale<=1)},destroy(){h(),j(),t.removeEventListener(`pointermove`,T,!0),t.removeEventListener(`click`,O,!0),t.removeEventListener(`pointerdown`,w),t.removeEventListener(`wheel`,E),t.removeEventListener(`dblclick`,D),t.removeEventListener(`keydown`,k),n.removeEventListener(`pointerup`,C),n.removeEventListener(`pointercancel`,C),p?.remove(),p&&m&&t.classList.remove(`tc-container`)}}}}}let Wa=e=>e.select===`multiple`?e.selected??[]:e.select===`single`?(e.selected??[]).slice(0,1):[],Ga=`var(--tc-heat-empty,var(--tc-grid-color))`,Ka=.2,qa=Math.PI/180,Ja={};function Ya(e,t){Ja[e]=t}let Xa=e=>J(e)&&J(e.regions)&&(q(e.width)??0)>0&&(q(e.height)??0)>0;function Za(e){let t=[],n=[],r=0,i=0;for(let[,a=``,o=``]of e.matchAll(/([MLHVZ])([^MLHVZ]*)/gi)){let e=(o.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi)??[]).map(Number),s=a>=`a`,c=a.toUpperCase();if(c===`Z`){n.length&&(r=n[0],i=n[1]);continue}let l=c===`H`||c===`V`?1:2;for(let a=0;a+l<=e.length;a+=l){let o=e[a],l=e[a+1];c===`H`?r=s?r+o:o:c===`V`?i=s?i+o:o:(r=s?r+o:o,i=s?i+l:l),c===`M`&&a===0&&(n=[],t.push(n)),n.push(r,i)}}return t}let Qa=/* @__PURE__ */ new WeakMap;function $a(e){let t=Qa.get(e);if(t)return t;t=/* @__PURE__ */ new Map;for(let[n,r]of Object.entries(e.regions)){if(!J(r)||typeof r.path!=`string`)continue;let e=Za(r.path).filter(e=>e.every(Number.isFinite)),i=[1/0,1/0,-1/0,-1/0],a=0,o=0,s=-1;for(let t of e){let e=1/0,n=1/0,r=-1/0,c=-1/0;for(let i=0;i<t.length;i+=2)e=Math.min(e,t[i]),r=Math.max(r,t[i]),n=Math.min(n,t[i+1]),c=Math.max(c,t[i+1]);i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],n),i[2]=Math.max(i[2],r),i[3]=Math.max(i[3],c);let l=(r-e)*(c-n);l>s&&(s=l,a=(e+r)/2,o=(n+c)/2)}s<0||t.set(n,{code:n,name:Y(r.name)||n,path:r.path,point:r.point===!0,rings:e,box:i,x:a,y:o})}return Qa.set(e,t),t}function eo(e,t,n){let r=!1;for(let i of e)for(let e=0,a=i.length-2;e<i.length;a=e,e+=2){let o=i[e],s=i[e+1],c=i[a],l=i[a+1];s>n!=l>n&&t<(c-o)*(n-s)/(l-s)+o&&(r=!r)}return r}let to=(e,t,n)=>`M${l(e-n)} ${l(t)}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0Z`;function no(e,n){let{width:i,height:a,fontSize:o,locale:c}=n;if(typeof e.map==`string`&&!Ja[e.map])throw Error(`[tabler-charts] Map "${e.map}" is not registered. Import it (e.g. from '@tabler/charts/maps/world') and call addMap('${e.map}', data).`);let d=typeof e.map==`string`?Ja[e.map]:e.map;if(!Xa(d))return{content:null};let f=$a(d),p=e.data??{},m=H(e.format,c),h=Math.max(0,q(e.markerRadius)??4),g=[],_=/* @__PURE__ */ new Map,v=1/0,y=-1/0;for(let e of Object.keys(p)){let t=f.get(e),n=q(p[e]);t&&n!==null&&(_.set(t,g.length),g.push({shape:t,value:n}),n<v&&(v=n),n>y&&(y=n))}let b=g.length,x=q(e.min)??(b?Math.min(0,v):0),S=q(e.max)??(b?y:1),C=e.colors&&e.colors.length>=2?e.colors:void 0,w=q(e.mid),T=e=>{let t=C&&w!==null&&x<w&&w<S?e<=w?(e-x)/(w-x)*.5:.5+(e-w)/(S-w)*.5:S>x?(e-x)/(S-x):+(e>x);return Math.min(1,Math.max(0,t))},E=e=>{if(C){let t=e*(C.length-1),n=Math.min(C.length-2,Math.floor(t)),r=l((t-n)*100),i=C[n],a=r<=0?i:r>=100?C[n+1]:`color-mix(in oklab,${C[n+1]} ${r}%,${i})`;return{style:{"--tc-cell-fill":a},color:a}}let t=l((.1+.9*e)*100);return{style:`--tc-heat:${t}%`,color:`color-mix(in oklab,var(--tc-heat-color,var(--tc-color-1)) ${t}%,${Ga})`}},D=t(e.padding,0),O=e.scale!==!1&&b>0,k=O?Math.ceil(o*u)+8:0,j=r(i,a,{...D,bottom:D.bottom+k}),M=typeof e.zoom==`object`?e.zoom:{},N={...j,k:Math.max(0,Math.min(j.width/d.width,j.height/d.height)),mapWidth:d.width,mapHeight:d.height,max:Math.max(1,q(M.max)??8)},P=Ba(e.view,N),F=Math.round(N.k*P.scale*1e4)/1e4,I=l(j.x-P.x*F),L=l(j.y-P.y*F),R=e=>I+e*F,z=e=>L+e*F,B=P.scale>1,V=new Set(Wa(e)),{projection:U}=d,ee=J(U)&&q(U.scale)!==null&&Array.isArray(U.translate)&&U.translate.slice(0,2).every(e=>q(e)!==null)?(e,t)=>[R(e*qa*U.scale+U.translate[0]),z(U.translate[1]-1.25*Math.log(Math.tan(Math.PI/4+.4*t*qa))*U.scale)]:void 0,te=[];if(ee&&F>0)for(let t of e.markers??[]){let[e,n]=ee(t.lng,t.lat);Number.isFinite(e)&&Number.isFinite(n)&&te.push({name:t.name??``,x:e,y:n})}let ne=g.length;for(let e of te)g.push({marker:e,value:null});let W=g.length;for(let e of f.values())e.point||_.has(e)||(_.set(e,g.length),g.push({shape:e,value:null}));let re=e=>{let t=g[e];if(!t)return null;let{shape:n,marker:r}=t,i=r??(n?.point?{x:R(n.x),y:z(n.y)}:void 0),a=i?.x??R(n?.x??0),o=i?.y??z(n?.y??0),s=r?.name??n?.name??``,c=t.value;return{index:e,label:n?.code??s,...n?{region:n.code}:{marker:s},title:``,x:a,area:j,items:[{name:s,seriesIndex:0,value:c,text:c===null?``:m(c),x:a,y:o,color:r?`var(--tc-map-marker-color,var(--tc-color-1))`:c===null?Ga:E(T(c)).color}],highlight:{kind:`halo`,d:i?to(i.x,i.y,h+3):(n?.rings??[]).map(e=>{let t=``;for(let n=0;n<e.length;n+=2)t+=`${n?`L`:`M`}${Math.round(R(e[n])*10)/10} ${Math.round(z(e[n+1])*10)/10}`;return`${t}Z`}).join(``)}}},ie={count:W,map:N,hitIndex:re,hitTest(e,t){if(!(F>0)||e<j.x||e>j.x+j.width||t<j.y||t>j.y+j.height)return null;let n=n=>Math.hypot(n.x-e,n.y-t)<=h+4;for(let e=W-1;e>=ne;e--)if(n(g[e]?.marker))return re(e);for(let e=0;e<b;e++){let t=g[e]?.shape;if(t.point&&n({x:R(t.x),y:z(t.y)}))return re(e)}let r=(e-I)/F,i=(t-L)/F;for(let[e,t]of _){let[n,a,o,s]=e.box;if(!(e.point||r<n||r>o||i<a||i>s)&&eo(e.rings,r,i))return re(t)}return null}},ae=[],oe=[],se=[];for(let e of f.values()){let t=_.get(e),n=t===void 0?null:g[t]?.value??null,r=n===null?void 0:E(T(n)).style,i=V.has(e.code)&&`tc-region-selected`;e.point?n!==null&&se.push(A(`circle`,{key:e.code,class:[`tc-region tc-region-point tc-cell`,i],"data-region":e.code,cx:l(R(e.x)),cy:l(z(e.y)),r:h,style:r})):(i?oe:ae).push(A(`path`,{key:e.code,class:[`tc-region`,n===null?`tc-region-empty`:`tc-cell`,i],"data-region":e.code,d:e.path,style:r}))}let ce=new Map(te.map(e=>[e.name,e])),le=(e.lines??[]).flatMap((e,t)=>{let n=ce.get(e.from),r=ce.get(e.to);if(!n||!r)return[];let i=(n.x+r.x)/2+(r.y-n.y)*Ka,a=(n.y+r.y)/2-(r.x-n.x)*Ka;return A(`path`,{key:`${e.from}›${e.to}›${t}`,class:`tc-map-line`,d:`M${l(n.x)} ${l(n.y)}Q${l(i)} ${l(a)} ${l(r.x)} ${l(r.y)}`})}),ue=typeof e.scale==`object`?e.scale:{},de=ue.low??m(x),fe=ue.high??m(S),pe=s(de,o),G=pe+8+120+8+s(fe,o),me=Math.round(j.x+Math.max(0,(j.width-G)/2)),he=Math.round(me+pe+8),K=j.y+j.height+8+(k-8)/2,ge=e.select===`single`||e.select===`multiple`,_e=`${n.id}-map`;return{content:[B&&A(`clipPath`,{key:`clip`,id:_e},A(`rect`,{x:j.x,y:j.y,width:j.width,height:j.height})),A(`g`,{key:`map`,class:[`tc-map`,ge&&`tc-map-selectable`],"clip-path":B?`url(#${_e})`:void 0},F>0&&A(`g`,{key:`regions`,class:`tc-map-regions`,transform:`translate(${I} ${L}) scale(${F})`},ae,oe),A(`g`,{key:`points`,class:`tc-map-points`},se),A(`g`,{key:`lines`,class:`tc-map-lines`},le),A(`g`,{key:`markers`,class:`tc-map-markers`},te.map((e,t)=>A(`circle`,{key:`${e.name}›${t}`,class:`tc-map-marker`,"data-marker":e.name,cx:l(e.x),cy:l(e.y),r:h})))),O&&A(`g`,{key:`scale`,class:`tc-map-scale`,"aria-hidden":`true`,"shape-rendering":`crispEdges`},A(`text`,{class:`tc-tick-label`,x:me,y:l(K),dy:`0.32em`},de),Array.from({length:24},(e,t)=>A(`rect`,{key:t,class:`tc-cell`,x:he+t*5,y:l(K-4),width:5,height:8,style:E(t/23).style})),A(`text`,{class:`tc-tick-label`,x:he+120+8,y:l(K),dy:`0.32em`},fe))],interaction:ie}}function ro(e,t,n){let r=typeof e.map==`string`?Ja[e.map]:e.map,i=Xa(r)?$a(r):void 0,a=H(e.format,t.locale),o=[];for(let[t,n]of Object.entries(e.data??{})){let e=q(n),r=i?.get(t);r&&e!==null&&o.push([r.name,a(e)])}return{columns:[``,`Value`],total:o.length,rows:o.slice(0,n)}}function io(e){let t=typeof e.map==`string`?Ja[e.map]:e.map;if(!Xa(t))return;let n=e.scale!==!1&&Object.keys(e.data??{}).length>0;return l(600/(600*t.height/t.width+(n?23:0)))}let ao=e=>{let t=e,n={};if(J(t.data))for(let[e,r]of Object.entries(t.data)){let t=q(r);t!==null&&(n[e]=t)}return{...e,map:typeof t.map==`string`||Xa(t.map)?t.map:void 0,data:n,colors:De(t.colors).filter(e=>typeof e==`string`&&e.trim()!==``),markers:Ae(t.markers,e=>({lat:q(e.lat),lng:q(e.lng),...typeof e.name==`string`?{name:e.name}:{}})).filter(e=>e.lat!==null&&e.lng!==null),lines:Ae(t.lines,e=>({from:Y(e.from),to:Y(e.to)})),select:t.select===`single`||t.select===`multiple`?t.select:void 0,selected:De(t.selected).filter(e=>typeof e==`string`),view:J(t.view)?t.view:void 0,onSelect:typeof t.onSelect==`function`?t.onSelect:void 0}},oo={name:`map`,clean:e=>{let t=ao(e);if(t.aspectRatio!==void 0&&t.aspectRatio!==t.autoRatio)return t;let n=io(t);return{...t,aspectRatio:n,autoRatio:n}},render:no,table:ro,plugins:[Ua()]},so=5e3;function co(e,t){return e.data.map((e,t)=>({data:e,index:t,seats:Math.min(so,Math.max(0,Math.round(e.seats||0)))})).filter(e=>!t.has(Z(e.data))).map((e,t)=>({...e,position:t}))}function lo(e,t){let n=Math.min(so,t.reduce((e,t)=>e+t.seats,0)),r=Math.min(so,Math.round(e.total??0));return{taken:n,total:Math.max(n,r>0?r:0)}}function uo(e,t){let n=t.reduce((e,t)=>e+t,0),r=t.map(t=>Math.floor(e*t/n)),i=e-r.reduce((e,t)=>e+t,0),a=t.map((t,i)=>({i,lost:e*t/n-r[i]})).sort((e,t)=>t.lost-e.lost||t.i-e.i);for(let{i:e}of a){if(i<=0)break;r[e]=r[e]+1,i--}return r}function fo(e,t,n,r,i,a){let o={x0:0,y0:0,x1:0,y1:0};if(e<=0)return{seats:[],dot:0,box:o};let s=1-i,c=r>=Math.PI*2-1e-9,l=e=>Array.from({length:e},(t,n)=>e>1?i+n*s/(e-1):1),u=e=>e>1?s/(e-1):s,d=e=>{let t=u(e);return l(e).reduce((e,n)=>e+Math.floor(n*r/t)+ +!c,0)},f=t&&t>0?Math.min(Math.round(t),e):1;if(!t)for(;f<e&&d(f)<e;)f++;let p=l(f),m=u(f),h=uo(e,p),g=[],_=f>1?m:1/0;p.forEach((e,t)=>{let i=h[t],a=i>1?r/(c?i:i-1):0;i>1&&(_=Math.min(_,e*a));for(let o=0;o<i;o++){let s=i>1?n+o*a:n+r/2;g.push({x:e*Math.sin(s),y:-e*Math.cos(s),angle:s,row:t})}}),g.sort((e,t)=>e.angle-t.angle||e.row-t.row);let v=(Number.isFinite(_)?_:s)*(1-a)*.5;for(let e of g)o.x0=Math.min(o.x0,e.x-v),o.x1=Math.max(o.x1,e.x+v),o.y0=Math.min(o.y0,e.y-v),o.y1=Math.max(o.y1,e.y+v);return{seats:g,dot:v,box:o}}function po(e,n){let{width:i,height:a,locale:o}=n,s=r(i,a,t(e.padding,0)),c=Math.min(360,Math.max(0,e.angle??180))*pa,u=(e.startAngle??-(c/pa)/2)*pa,d=Math.min(.95,Math.max(0,e.innerRadius??.45)),f=Math.min(.9,Math.max(0,e.gap??.35)),p=co(e,n.hidden),{taken:m,total:h}=lo(e,p),g=fo(h,e.rows,u,c,d,f),_=e.center,v=_!==!1,y=v?_?.label:void 0,b=c<=Math.PI+1e-9&&Math.abs(u+c/2)<1e-9,x=n.fontSize,S=v?b?-(y?3.4:2.1)*x:-1.4*x:0,C=v?b?0:(y?2:.7)*x:0,w=Math.min(s.width,s.height)/2,T={x0:0,y0:0,x1:0,y1:0};for(let e=0;e<4&&w>0;e++){T={x0:Math.min(g.box.x0*w,0),y0:Math.min(g.box.y0*w,S),x1:Math.max(g.box.x1*w,0),y1:Math.max(g.box.y1*w,C)};let e=Math.min(s.width/(T.x1-T.x0),s.height/(T.y1-T.y0));if(Math.abs(e-1)<.001)break;w=Math.max(0,w*e)}let E=s.x+(s.width-(T.x1-T.x0))/2-T.x0,D=s.y+(s.height-(T.y1-T.y0))/2-T.y0,O=l(g.dot*w),k=e=>[E+e.x*w,D+e.y*w],j=0,M=p.map(e=>{let t=j;return j+=e.seats,g.seats.slice(t,j)}),N=g.seats.slice(m,h),P=p.filter(e=>e.seats>0),F=H(e.format,o),I=z(o,{style:`percent`,maximumFractionDigits:1}),L=(e,t)=>{let n=M[e.position],r=0,i=0;if(t)[r,i]=k(t);else for(let e of n){let[t,a]=k(e);r+=t/n.length,i+=a/n.length}let a={name:e.data.name,seriesIndex:e.index,value:e.seats,text:`${F(e.seats)} (${I.format(h>0?e.seats/h:0)})`,x:r,y:i};e.data.color&&(a.color=e.data.color);let o=O+3,s=n.map(e=>{let[t,n]=k(e);return`M${l(t+o)},${l(n)}A${o},${o},0,1,1,${l(t-o)},${l(n)}A${o},${o},0,1,1,${l(t+o)},${l(n)}Z`}).join(``);return{index:P.indexOf(e),label:e.data.name,title:``,x:r,area:{x:E-w,y:D-w,width:w*2,height:w*2},items:[a],seriesIndex:e.index,highlight:{kind:`halo`,d:s}}},R={count:P.length,hitIndex:e=>{let t=P[e];return t?L(t):null},hitTest(e,t){let n=O+2,r;for(let i of P)for(let a of M[i.position]){let[o,s]=k(a),c=Math.hypot(e-o,t-s);c<=n&&(!r||c<r.d)&&(r={party:i,seat:a,d:c})}return r?L(r.party,r.seat):null}},B=(e,t,n)=>{let[r,i]=k(e);return A(`circle`,{key:t,class:n,r:O,style:`transform:translate(${l(r-E)}px,${l(i-D)}px)`})},V=p.map(e=>A(`g`,Fe(e.data,e.index),M[e.position].map((e,t)=>B(e,t,`tc-seat`)))),U=v?_?.value??F(h):``;return{content:[A(`g`,{class:`tc-parliament`,style:`transform:translate(${l(E)}px,${l(D)}px)`},A(`g`,{class:`tc-parliament-seats`},V,N.length>0&&A(`g`,{key:`vacant`,class:`tc-parliament-vacant`},N.map((e,t)=>B(e,t,`tc-seat tc-seat-vacant`))))),v&&A(`g`,{class:`tc-parliament-center`,"aria-hidden":`true`},y&&A(`text`,{class:`tc-parliament-label`,x:l(E),y:l(D),dy:b?`-2.5em`:`1.6em`,"text-anchor":`middle`},y),A(`text`,{class:`tc-parliament-value`,x:l(E),y:l(D),dy:b?`-0.4em`:y?`0`:`0.35em`,"text-anchor":`middle`},U))],interaction:R}}function mo(e,t){let n=co(e,t.hidden),{total:r}=lo(e,n),i=H(e.format,t.locale),a=z(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Seats`,`Share`],rows:n.map(e=>[e.data.name,i(e.seats),a.format(r>0?e.seats/r:0)])}}let ho={name:`parliament`,clean:X(e=>Ae(e,e=>({...je(e),seats:q(e.seats)??0}))),render:po,legend:e=>Pe(e.data),table:mo};function go(e,t,n=`Others`){let r=e.map((e,t)=>({data:e,index:t,value:Math.max(0,e.value||0)})),i=Number.isFinite(t)&&t>=0?t:9,a=i?Math.max(1,Math.round(i)):1/0;if(r.length<=a)return r;let o=new Set([...r].sort((e,t)=>t.value-e.value||e.index-t.index).slice(0,a-1)),s=r.reduce((e,t)=>o.has(t)?e:e+t.value,0);return[...r.filter(e=>o.has(e)),{data:{name:n,id:`__others__`,value:s},index:Math.max(8,r.length),value:s,others:!0}]}function _o(e){return e.map(({data:e,index:t})=>{let n={key:Z(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}let vo=e=>({...e,slices:go(e.data,e.maxSlices,e.othersLabel)}),yo=e=>_o(e.slices);function bo(e,t){let n=e.slices.filter(e=>!t.has(Z(e.data)));return e.order===`size`&&n.sort((e,t)=>Number(!!e.others)-Number(!!t.others)||t.value-e.value||e.index-t.index),{segments:n,total:n.reduce((e,t)=>e+t.value,0)}}function xo(e,n){let{width:i,height:a,locale:o}=n,s=Math.max(0,e.gap??2),c=Math.max(0,e.radius??4),u=r(i,a,t(e.padding,0)),{segments:d,total:f}=bo(e,n.hidden),p=d.filter(e=>e.value>0),m=u.x,h=p.map((e,t)=>{let r=e.value/f*u.width,i=t===0?0:s/2,a=t===p.length-1?0:s/2,o=Math.max(0,r-i-a),c=m+i,l={x:n.rtl?u.x*2+u.width-c-o:c,y:u.y,width:o,height:u.height};return m+=r,l}),g=H(e.format,o),_=z(o,{style:`percent`,maximumFractionDigits:1}),v=e=>{let t=p[e],n=h[e],r=n.x+n.width/2,i={name:t.data.name,seriesIndex:t.index,value:t.value,text:`${g(t.value)} (${_.format(t.value/f)})`,x:r,y:n.y+n.height/2,box:n};t.data.color&&(i.color=t.data.color);let a=l;return{index:e,label:t.data.name,title:``,x:r,area:u,items:[i],seriesIndex:t.index,highlight:{kind:`halo`,d:`M${a(n.x+1)},${a(n.y+1)}h${a(n.width-2)}v${a(n.height-2)}h${a(2-n.width)}Z`}}},y={count:p.length,reversed:n.rtl===!0,hitIndex:e=>p[e]?v(e):null,hitTest(e,t){if(t<u.y||t>u.y+u.height)return null;let n=h.findIndex(t=>e>=t.x-s/2&&e<=t.x+t.width+s/2);return n<0?null:v(n)}};return{content:A(`g`,{class:`tc-percentage-bar`},p.length===0&&A(`rect`,{key:`track`,class:`tc-percentage-bar-track`,x:l(u.x),y:l(u.y),width:l(u.width),height:l(u.height),rx:l(Math.min(c,u.width/2,u.height/2))}),d.map(e=>{let t=h[p.indexOf(e)];return A(`g`,Fe(e.data,e.index),t&&A(`rect`,{class:`tc-segment`,x:l(t.x),y:l(t.y),width:l(t.width),height:l(t.height),rx:l(Math.min(c,t.width/2,t.height/2))}))})),interaction:y}}function So(e,t){let{segments:n,total:r}=bo(e,t.hidden),i=H(e.format,t.locale),a=z(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}let Co={name:`percentage-bar`,clean:e=>{let t=e;return{...t,data:Ne(t.data),height:t.height??(t.aspectRatio?void 0:16)}},prepare:vo,render:xo,legend:yo,table:So,valueLabels:{marks:`cell`}};function wo(e,t){let n=e.slices.filter(e=>!t.has(Z(e.data))),r=n.reduce((e,t)=>e+t.value,0),i=(e.startAngle??0)*pa;return{slices:n.map(e=>{let t=r>0?e.value/r*Math.PI*2:0,n={...e,startAngle:i,endAngle:i+t};return i+=t,n}),total:r}}function To(e,n,i){let{width:a,height:o,locale:s}=n,c=e.gap??2,l=r(a,o,t(e.padding,0)),u=Math.max(0,Math.min(l.width,l.height)/2-8),d=u*Math.min(.95,Math.max(0,e.innerRadius??i.inner)),f=e.cornerRadius??i.corner,p=l.x+l.width/2,m=l.y+l.height/2,{slices:h,total:g}=wo(e,n.hidden),_=h.filter(e=>e.value>0),v=d===0&&_.length>1?c:0,y=d>0&&_.length>1?ba(c,d,u):0,b=H(e.format,s),x=z(s,{style:`percent`,maximumFractionDigits:1}),S=(e,t=d,n=u)=>({innerRadius:t,outerRadius:n,startAngle:e.startAngle,endAngle:e.endAngle,padAngle:y,cornerRadius:f}),C=(e,t)=>{let[n,r]=ya(S(e)),i={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${b(e.value)} (${x.format(g>0?e.value/g:0)})`,x:p+n,y:m+r};return e.data.color&&(i.color=e.data.color),{index:t,label:e.data.name,title:``,x:p+n,area:{x:p-u,y:m-u,width:u*2,height:u*2},items:[i],seriesIndex:e.index,highlight:{kind:`halo`,d:Sa({...S(e,u+2,u+6),cornerRadius:2}),x:p,y:m}}},w={count:_.length,hitIndex:e=>{let t=_[e];return t?C(t,e):null},hitTest(t,n){let r=t-p,i=n-m,a=Math.hypot(r,i);if(a<d-2||a>u+8)return null;let o=(e.startAngle??0)*pa,s=Math.PI*2,c=Math.atan2(r,-i);c=o+((c-o)%s+s)%s;let l=_.findIndex(e=>c>=e.startAngle&&c<e.endAngle);return l===-1?null:C(_[l],l)}},T=h.map(e=>A(`g`,Fe(e.data,e.index),Ca(`tc-slice`,S(e)))),E=e.center,D=d>0&&E!==!1,O=D?E?.value??b(g):``,k=D?E?.label:void 0;return{content:[A(`g`,{class:`tc-pie`,style:`transform:translate(${p}px,${m}px)`},g===0&&A(`path`,{class:`tc-pie-track`,d:Sa({innerRadius:d,outerRadius:u,startAngle:0,endAngle:Math.PI*2})}),A(`g`,{class:`tc-pie-slices`,style:v>0?`--tc-pie-gap:${v}px`:void 0},T)),D&&A(`g`,{class:`tc-pie-center`,"aria-hidden":`true`},A(`text`,{class:`tc-pie-value`,x:p,y:m,dy:k?`0`:`0.35em`,"text-anchor":`middle`},O),k&&A(`text`,{class:`tc-pie-label`,x:p,y:m,dy:`1.6em`,"text-anchor":`middle`},k))],interaction:w}}function Eo(e,t){let{slices:n,total:r}=wo(e,t.hidden),i=H(e.format,t.locale),a=z(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}function Do(e,t){return{name:e,clean:X(Ne),prepare:vo,render:(e,n)=>To(e,n,t),sweep:wa,legend:yo,table:Eo,valueLabels:{marks:`slice`}}}let Oo=Do(`pie`,{inner:0,corner:0}),ko=Do(`donut`,{inner:.62,corner:4});function Ao(e,t,n){if(s(e,n)<=t)return e;let r=e.length;for(;r>0&&s(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}function jo(e,t,n){let r=[],i=``;for(let a of e.split(` `)){let e=i?`${i} ${a}`:a;!i||s(e,n)<=t?i=e:(r.push(i),i=a)}return r.push(i),r.length>3&&r.splice(2,r.length,r.slice(2).join(` `)),r}let Mo=e=>e>.1?1:e<-.1?-1:0;function No(e,t,n,r){let i=Math.min(e.width,e.height)/2;return t.forEach((t,a)=>{let o=Math.sin(t),c=Math.cos(t),l=n[a]??[],u=Math.max(0,...l.map(e=>s(e,r))),d=Po(l.length,r),f=Mo(o),p=f===0?u/2:u+8;if(Math.abs(o)>1e-6&&(i=Math.min(i,(e.width/2-p)/Math.abs(o))),Math.abs(c)>1e-6){let t=(f===0?d+8:d/2)/Math.abs(c);i=Math.min(i,e.height/2/Math.abs(c)-t)}}),Math.max(0,i)}let Po=(e,t)=>t*(1+Math.max(0,e-1)*u);function Fo(e,n){let{width:i,height:a,fontSize:o,locale:s}=n,c=e.r??{},{fill:d=!0,points:f=!1,pointRadius:p=4}=e,m=e.data.series,h=Ve(e.data),g=h.length,_=m.filter(e=>!n.hidden.has(Q(e))),v=e.format??(e=>String(e)),y=W(c.format,s),b=t(e.padding),x=r(i,a,{top:b.top+8,right:b.right+8,bottom:b.bottom+8,left:b.left+8}),S=x.x+x.width/2,C=x.y+x.height/2,w=h.map((e,t)=>t/Math.max(1,g)*Math.PI*2),T=h.map((e,t)=>v(e,t)),E=e.labelWidth??x.width/4,D=T.map(e=>jo(e,E,o)),O=Math.max(No(x,w,D,o),Math.min(x.width,x.height)/2*.5),k=D.map((e,t)=>{let n=Math.sin(w[t]),r=Mo(n)===0?x.width:x.width/2-O*Math.abs(n)-8;return e.map(e=>Ao(e,r,o))}),j=Xe(c,Math.max(2,Math.round(O/40))),M=Te(Qe(_.flatMap(e=>e.values),c,!0,j),[0,O],{clamp:!0}),N=me(M,{count:j,format:c.format,locale:s}),P=(e,t)=>[S+t*Math.sin(w[e]),C-t*Math.cos(w[e])],F=e=>`${e.map((e,t)=>`${t?`L`:`M`}${P(t,e).map(l).join(`,`)}`).join(``)}Z`,I=t=>e.grid===`circle`?`M${l(S)},${l(C-t)}A${l(t)},${l(t)},0,1,1,${l(S)},${l(C+t)}A${l(t)},${l(t)},0,1,1,${l(S)},${l(C-t)}Z`:F(h.map(()=>t)),L=e=>e!=null&&Number.isFinite(e)?M(e):0,R=e=>{let t=[];m.forEach((r,i)=>{if(n.hidden.has(Q(r)))return;let a=r.values[e],o=a!=null&&Number.isFinite(a)?a:null,[s,c]=P(e,L(o)),l={name:r.name,seriesIndex:i,value:o,text:o===null?`–`:y(o),x:s,y:o===null?null:c};r.color&&(l.color=r.color),t.push(l)});let[r,i]=P(e,O);return{index:e,label:Ie(h[e]),title:T[e],x:r,area:{x:S-O,y:C-O,width:O*2,height:O*2},items:t,highlight:{kind:`spoke`,x1:S,y1:C,x2:r,y2:i}}},z={count:g,hitTest(e,t){if(g===0||Math.hypot(e-S,t-C)>O+8)return null;let n=Math.atan2(e-S,C-t),r=(n<0?n+Math.PI*2:n)/(Math.PI*2);return R(Math.round(r*g)%g)},hitIndex(e,t){if(e<0||e>=g)return null;let n=R(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}},B=A(`g`,{key:`grid`,class:`tc-radar-grid`,"aria-hidden":`true`},N.filter(e=>e.position>0).map(e=>A(`path`,{key:e.value,class:`tc-radar-ring`,d:I(e.position)})),h.map((e,t)=>{let[n,r]=P(t,O);return A(`line`,{key:Ie(e),class:`tc-radar-spoke`,x1:l(S),y1:l(C),x2:l(n),y2:l(r)})})),V=Je(e),H=m.map((e,t)=>{if(n.hidden.has(Q(e)))return null;let r=F(h.map((t,n)=>L(e.values[n])));return A(`g`,it(e,t),d&&A(`path`,{class:`tc-area`,d:r}),A(`path`,{class:`tc-line`,d:r}),f&&A(`g`,{class:`tc-points`},h.map((n,r)=>{let i=e.values[r];if(i==null||!Number.isFinite(i))return null;let[a,o]=P(r,M(i));return Ye(V,t,Ie(n),`tc-point`,l(a),l(o),p)})))}),U=A(`g`,{key:`labels`,class:`tc-radar-labels`,"aria-hidden":`true`},h.map((e,t)=>{let n=w[t],r=Mo(Math.sin(n)),i=Math.cos(n),[a,o]=P(t,O+8),[s=``,...c]=k[t]??[],d=c.length*u,f=r===0?i>0?`${l(-d)}em`:`0.71em`:`${l(.35-d/2)}em`;return A(`text`,{key:Ie(e),class:`tc-tick-label tc-radar-label`,x:l(a),y:l(o),"text-anchor":r>0?`start`:r<0?`end`:`middle`,dy:f},s,c.map((e,t)=>A(`tspan`,{key:t,x:l(a),dy:`${u}em`},e)))})),ee=c.show!==!1&&A(`g`,{key:`values`,class:`tc-radar-values`,"aria-hidden":`true`},N.filter(e=>e.position>0).map(e=>A(`text`,{key:e.value,class:`tc-tick-label tc-radar-value`,x:l(S+4),y:l(C-e.position),dy:`0.35em`},e.label)));return{content:[B,A(`g`,{key:`series`,class:`tc-series-list tc-radar-series`,style:`transform-origin:${l(S)}px ${l(C)}px`},H),U,ee],interaction:z}}let Io={name:`radar`,clean:X(Me),render:Fo,legend:e=>Be(e.data),table:(e,t,n)=>ot({data:e.data,...e.r?.format?{y:{format:e.r.format}}:{},...e.format?{x:{format:e.format}}:{}},t,n)};function Lo(e,t,n){if(s(e,n)<=t)return e;let r=e.length;for(;r>0&&s(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}let Ro=e=>e.data.color??`var(--tc-color-${e.slot})`;function zo(e,t,n){let r=/* @__PURE__ */ new Map,i=[],a=(e,t)=>{let n=r.get(e);return n||(n={data:t??{name:e},index:i.length,slot:1,column:0,value:0,x:0,y:0,height:0,ins:[],outs:[]},r.set(e,n),i.push(n)),n},o=new Map((e.nodes??[]).map(e=>[e.name,e])),s=n=>{let r=o.get(n);return t.has(n)||r?.color!==void 0&&t.has(Bo(e,r.color))},c=[];e.links.forEach((e,t)=>{if(e.from===e.to||s(e.from)||s(e.to))return;let n=a(e.from,o.get(e.from)),r=a(e.to,o.get(e.to)),i={data:e,index:t,source:n,target:r,sy:0,ty:0,width:0};c.push(i),e.value<=0||(n.outs.push(i),r.ins.push(i))});for(let e of i)e.value=Math.max(e.outs.reduce((e,t)=>e+t.data.value,0),e.ins.reduce((e,t)=>e+t.data.value,0));for(let e=0;e<i.length;e++){let e=!1;for(let t of c)t.data.value>0&&t.target.column<=t.source.column&&(t.target.column=t.source.column+1,e=!0);if(!e)break}let l=i.reduce((e,t)=>Math.max(e,t.column),0);if(n)for(let e of i)e.outs.length===0&&(e.column=l);let u=[...o.keys()];i.sort((e,t)=>{if(e.column!==t.column)return e.column-t.column;let n=u.indexOf(e.data.name),r=u.indexOf(t.data.name);return n!==-1&&r!==-1?n-r:n===r?e.index-t.index:n===-1?1:-1});let d=/* @__PURE__ */ new Map;return i.forEach((e,t)=>{e.index=t;let n=(d.get(e.column)??0)+1;d.set(e.column,n),e.slot=(n-1)%8+1}),{nodes:i,links:c,columns:l+1}}let Bo=(e,t)=>(e.nodes??[]).find(e=>e.color===t)?.name??t;function Vo(e,i){let{width:a,height:o,fontSize:c,locale:l}=i,u=Math.max(1,e.nodeWidth??12),d=Math.max(0,e.nodePadding??16),{rtl:f}=i,p=r(a,o,n(t(e.padding),f)),{nodes:m,links:h,columns:g}=zo(e.data,i.hidden,e.align!==`left`),_=W(e.format,l),v=m.map(e=>[e.data.name,_(e.value)]),y=e=>m.reduce((t,n,r)=>{if(!e(n))return t;let[i,a]=v[r];return Math.max(t,s(i,c),s(a,c))},0),b=p.width*.3,x=g>1?Math.min(b,y(e=>e.column===0)):0,S=Math.min(b,y(e=>e.column===g-1)),C={x:p.x+(x?x+8:0),y:p.y,width:Math.max(0,p.width-(x?x+8:0)-(S?S+8:0)),height:p.height},w=g>1?(C.width-u)/(g-1):0,T=Array.from({length:g},()=>[]);for(let e of m)T[e.column]?.push(e);let E=T.reduce((e,t)=>t.length>1?Math.min(e,C.height/2/(t.length-1)):e,d),D=1/0;for(let e of T){let t=e.reduce((e,t)=>e+t.value,0);t>0&&(D=Math.min(D,(C.height-(e.length-1)*E)/t))}(!Number.isFinite(D)||D<0)&&(D=0),T.forEach((e,t)=>{let n=e.reduce((e,t)=>e+t.value*D,0)+(e.length-1)*E,r=C.y+(C.height-n)/2;for(let n of e){let e=C.x+(g>1?t*w:(C.width-u)/2);n.x=f?a-e-u:e,n.y=r,n.height=n.value*D,r+=n.height+E}});for(let e of m){let t=e.y;for(let n of[...e.outs].sort((e,t)=>e.target.y-t.target.y))n.sy=t,n.width=n.data.value*D,t+=n.width;t=e.y;for(let n of[...e.ins].sort((e,t)=>e.source.y-t.source.y))n.ty=t,t+=n.data.value*D}let O=m.map((e,t)=>{let[n,r]=v[t],i=e.column===0&&g>1?`left`:`right`,a=i===`left`?x:e.column===g-1?S:w-u-16,o=T[e.column],s=o.indexOf(e),l=[o[s-1],o[s+1]].filter(e=>!!e).reduce((t,n)=>Math.min(t,(e.height+n.height)/2+E),1/0)>=c*2.25;return{side:i,name:Lo(n,a,c),value:l?Lo(r,a,c):``}});return f&&(C.x=a-C.x-C.width),{nodes:m,links:h,plot:C,nodeWidth:u,labels:O}}let Ho=(e,t)=>e.source.x>e.target.x?[e.source.x,e.target.x+t]:[e.source.x+t,e.target.x];function Uo(e,t){let[n,r]=Ho(e,t),i=(n+r)/2,{sy:a,ty:o,width:s}=e,c=(...e)=>e.map(l).join(`,`);return`M${c(n,a)}C${c(i,a,i,o,r,o)}L${c(r,o+s)}C${c(i,o+s,i,a+s,n,a+s)}Z`}let Wo=(e,t,n,r,i)=>{let a=1-i;return a*a*a*e+3*a*a*i*t+3*a*i*i*n+i*i*i*r};function Go(e,t,n,r){let[i,a]=Ho(e,t);if(n<Math.min(i,a)||n>Math.max(i,a)||i===a)return!1;let o=(i+a)/2,s=0,c=1;for(let e=0;e<20;e++){let e=(s+c)/2;Wo(i,o,o,a,e)<n==a>i?s=e:c=e}let l=Wo(e.sy,e.sy,e.ty,e.ty,(s+c)/2);return r>=l&&r<=l+e.width}function Ko(e,t){let{nodes:n,links:r,plot:i,nodeWidth:a,labels:o}=Vo(e,t),s=r.filter(e=>e.data.value>0),c=W(e.format,t.locale),u=e=>({kind:`halo`,d:`M0,0h${l(a)}v${l(e.height)}h${l(-a)}Z`,x:e.x,y:e.y,under:!0}),d=e=>({kind:`halo`,d:Uo(e,a),under:!0}),f=e=>({name:`${e.source.data.name} ${t.rtl?`←`:`→`} ${e.target.data.name}`,seriesIndex:e.index,color:Ro(e.source),value:e.data.value,text:c(e.data.value),x:(e.source.x+a+e.target.x)/2,y:Wo(e.sy,e.sy,e.ty,e.ty,.5)+e.width/2}),p=(e,t)=>{let n={name:e.data.name,seriesIndex:r.length+e.index,color:Ro(e),value:e.value,text:c(e.value),x:e.x+a/2,y:e.y+e.height/2},o=[...e.ins,...e.outs].map(f),l=o.find(e=>e.seriesIndex===t),p=l&&s.find(e=>e.index===t);return{index:e.index,label:e.data.name,title:``,x:n.x,area:i,items:[n,...o],seriesIndex:l?t:n.seriesIndex,highlight:p?d(p):u(e)}},m=e=>{let t=f(e);return{index:e.source.index,label:e.source.data.name,title:``,x:t.x,area:i,items:[t],seriesIndex:e.index,highlight:d(e)}},h={count:n.length,hitTest(e,t){let r=n.find(n=>e>=n.x-2&&e<=n.x+a+2&&t>=n.y-2&&t<=n.y+n.height+2);if(r)return p(r);let i=s.find(n=>Go(n,a,e,t));return i?m(i):null},hitIndex(e,t){let r=n[e];return r?p(r,t):null}};return{content:[A(`g`,{key:`links`,class:`tc-sankey-links`},s.map(e=>A(`path`,{key:`${e.source.data.name}→${e.target.data.name}#${e.index}`,class:[`tc-series`,`tc-series-${e.source.slot}`,`tc-sankey-link`],style:{"--tc-series-color":e.source.data.color},d:Uo(e,a)}))),A(`g`,{key:`nodes`,class:`tc-sankey-nodes`},n.map(e=>A(`g`,{key:e.data.name,class:[`tc-series`,`tc-series-${e.slot}`],"data-series":e.data.name,style:{"--tc-series-color":e.data.color}},A(`rect`,{class:`tc-sankey-node`,x:l(e.x),y:l(e.y),width:l(a),height:l(e.height)})))),A(`g`,{key:`labels`,class:`tc-sankey-labels`,"aria-hidden":`true`},n.map((e,n)=>{let r=o[n];if(!r.name&&!r.value)return null;let i=r.side===`left`!=(t.rtl===!0),s=l(i?e.x-8:e.x+a+8),c=l(e.y+e.height/2),u=i?`end`:`start`;return A(`g`,{key:e.data.name,class:`tc-sankey-label`},A(`text`,{class:`tc-value-label tc-sankey-name`,x:s,y:c,dy:r.value?`-0.25em`:`0.35em`,"text-anchor":u},r.name),r.value&&A(`text`,{class:`tc-tick-label tc-sankey-value`,x:s,y:c,dy:`0.95em`,"text-anchor":u},r.value))}))],interaction:h}}function qo(e){let t=/* @__PURE__ */ new Map;for(let n of e.data.nodes??[])if(n.color&&!t.has(n.color)){let e={key:n.name,name:n.name,index:t.size,color:n.color};n.hidden&&(e.hidden=!0),t.set(n.color,e)}return[...t.values()]}function Jo(e,t){let{links:n}=zo(e.data,t.hidden,!0),r=W(e.format,t.locale);return{columns:[`From`,`To`,`Value`],rows:n.map(e=>[e.data.from,e.data.to,r(e.data.value)])}}let Yo={name:`sankey`,clean:X(e=>{let t=J(e)?e:{};return{...t,nodes:Array.isArray(t.nodes)?Ae(t.nodes,e=>je(e)):void 0,links:Ae(t.links,e=>({from:Y(e.from),to:Y(e.to),value:Math.max(0,q(e.value)??0)}))}}),render:Ko,legend:qo,table:Jo},Xo=e=>`M${e},0A${e},${e},0,1,1,${-e},0A${e},${e},0,1,1,${e},0Z`,Zo=e=>e.size!=null&&Number.isFinite(e.size)&&e.size>0?e.size:void 0;function Qo(e,t){let{width:n,height:r,fontSize:a,locale:o}=t,c=e.x??{},d=e.y??{},f=e.radius??4,p=e.data.series.filter(e=>!t.hidden.has(Z(e))).flatMap(e=>e.points),m=p.map(Zo).filter(e=>e!==void 0),h=we(m)?.[1]??0,g=e.size?.min??4,_=e.size?.max??24,v=e=>e!=null&&e>0&&h>0?g+(_-g)*Math.sqrt(e/h):f,y=Math.max(f,m.length?_:0)+2,b=Xe(d,Math.max(2,Math.round(r/60))),x=Xe(c,Math.max(2,Math.round(n/80))),S=e=>He(e.x,c)&&He(e.y,d),C=p.filter(S),w=Qe(C.map(e=>e.x),c,!1,x),T=Qe(C.map(e=>e.y),d,!1,b),E=c.show!==!1,D=d.show!==!1,O=(e,t,n)=>qe(e,t,n,t.format,o),k=O(Ke(T,[1,0],d),d,b),j=O(Ke(w,[0,1],c),c,x),M=e=>E&&e?Math.ceil(s(e.label,a)/2):0,N=c.reverse??t.rtl===!0,P=N===(t.rtl===!0)?0:j.length-1,{area:F,side:I,range:L}=i(t,e.padding,e=>({top:e.top+Math.max(D?Math.ceil(a*u/2):0,y,4),bottom:e.bottom+Math.max((E?_e(`bottom`,j,a):0)+ve(c.title,a),y,4),start:e.start+Math.max((D?_e(`left`,k,a):0)+ve(d.title,a),M(j[P]),y),end:e.end+Math.max(M(j[j.length-1-P]),y,8)})),R=Ke(w,L(N),c),z=Ke(T,[F.y+F.height,F.y],d),B=ge(O(R,c,x),`bottom`,a),V=ge(O(z,d,b),`left`,a,4),U=[];e.data.series.forEach((e,n)=>{t.hidden.has(Z(e))||e.points.forEach((e,t)=>{S(e)&&U.push({seriesIndex:n,pointIndex:t,point:e,cx:R(e.x),cy:z(e.y),r:v(Zo(e))})})}),U.sort((e,t)=>e.cx-t.cx);let ee=W(c.format,o),te=W(d.format,o),ne=H(void 0,o),re=(t,n)=>{let r=e.data.series[t.seriesIndex],i=Zo(t.point),a=i===void 0?``:` · ${ne(i)}`,o={name:r.name,seriesIndex:t.seriesIndex,value:t.point.y,text:`${ee(t.point.x)}, ${te(t.point.y)}${a}`,x:t.cx,y:t.cy};return r.color&&(o.color=r.color),{index:n,label:t.point.label??r.name,title:t.point.label??``,x:t.cx,area:F,items:[o],seriesIndex:t.seriesIndex,highlight:{kind:`halo`,d:Xo(l(t.r+4)),x:t.cx,y:t.cy}}},ie={count:U.length,hitIndex:e=>{let t=U[e];return t?re(t,e):null},hitTest(e,t){let n=0,r=U.length,i=24+_;for(;n<r;){let t=n+r>>1;U[t].cx<e-i?n=t+1:r=t}let a=-1,o=1/0;for(let r=n;r<U.length;r++){let n=U[r];if(n.cx>e+i)break;let s=Math.hypot(n.cx-e,n.cy-t)-n.r;s<o&&s<=24&&(a=r,o=s)}return a===-1?null:re(U[a],a)}},ae=Je(e),oe=(e,t)=>{if(!e.length)return null;let n=l(f),r=``;for(let i of e)r+=ae?ae(t,R(i.x),z(i.y),n):`M${l(R(i.x)-f)},${l(z(i.y))}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,${-2*n},0`;return A(`path`,{key:`dots`,class:[`tc-point tc-dots`,ae&&`tc-marker`],d:r})},se=[];d.grid!==!1&&se.push(xe({direction:`y`,ticks:V,area:F})),c.grid&&se.push(xe({direction:`x`,ticks:B,area:F}));let ce=rt(t,F,m.length?0:y),le=e.data.series.map((e,n)=>!t.hidden.has(Z(e))&&A(`g`,Fe(e,n),oe(e.points.filter(e=>S(e)&&Zo(e)===void 0),n),e.points.map((e,t)=>S(e)&&Zo(e)!==void 0&&A(`circle`,{key:t,class:`tc-point tc-bubble`,cx:l(R(e.x)),cy:l(z(e.y)),r:l(v(Zo(e)))}))));return{content:[A(`defs`,null,ce.def),se,A(`g`,{key:`series`,class:`tc-series-list`,"clip-path":ce.url},le),D&&be({position:I,ticks:V,area:F}),E&&be({position:`bottom`,ticks:B,area:F}),!!d.title&&ye(I,D?V:[],F,d.title,a),!!c.title&&ye(`bottom`,E?B:[],F,c.title,a)],interaction:ie}}function $o(e,t,n=1/0){let r=W(e.x?.format,t.locale),i=W(e.y?.format,t.locale),a=H(void 0,t.locale),o=e.data.series.filter(e=>!t.hidden.has(Z(e))),s=o.some(e=>e.points.some(e=>e.size!=null)),c=o.some(e=>e.points.some(e=>e.label!=null)),l=o.reduce((e,t)=>e+t.points.length,0),u=n;return{columns:[``,...c?[`Label`]:[],`x`,`y`,...s?[`Size`]:[]],total:l,rows:o.flatMap(e=>{let t=e.points.slice(0,Math.max(0,u));return u-=t.length,t.map(t=>[e.name,...c?[t.label??``]:[],r(t.x),i(t.y),...s?[Zo(t)===void 0?`–`:a(Zo(t))]:[]])})}}let es={name:`scatter`,clean:X(e=>({...J(e)?e:{},series:Ae(J(e)&&e.series,e=>({...je(e),points:Ae(e.points,e=>({...e,x:q(e.x),y:q(e.y),size:q(e.size)??void 0,label:e.label==null?void 0:Y(e.label)})).filter(e=>e.x!==null&&e.y!==null)}))})),render:Qo,legend:e=>Pe(e.data.series),table:$o,valueLabels:{format:e=>e.y?.format}};function ts(e,n){let{variant:i=`line`,curve:a=`monotone`,point:o=`last`,markers:s=`none`,pointRadius:c=3,name:u=`Value`}=e,d=e.data.map(e=>e==null||!Number.isFinite(e)?null:e),f=d.length,p=o===`last`||s===`minmax`?c+2:2,m=t(e.padding,0),h=r(n.width,n.height,{top:m.top+p,right:m.right+p,bottom:m.bottom+p,left:m.left+p}),g=i===`tristate`,_=e.zero??i!==`line`,v=g?[-1,1]:Qe(d,{nice:!1},_,2),y=i===`bar`||g,b=f>0?h.width/f:0,x=e=>n.rtl?f-1-e:e,S=e=>y?h.x+b*x(e)+b/2:h.x+(f>1?h.width*x(e)/(f-1):h.width/2),C=Te(v,[h.y+h.height,h.y]),w=C(Math.min(Math.max(0,v[0]),v[1])),T=d.map((e,t)=>e===null?null:[S(t),C(e)]),E=H(e.format,n.locale),D=t=>{let n=e.labels?.[t];return n===void 0?``:String(n)},O=e=>C(g?Math.sign(e):e),k=t=>{let n=d[t];if(n===void 0)return null;let r=S(t),i={name:u,seriesIndex:0,value:n,text:n===null?`–`:E(n),x:r,y:n===null?null:O(n)},a={index:t,label:Ie(e.labels?.[t]??t+1),title:D(t),x:r,area:h,items:[i]};return n!==null&&(a.highlight={kind:`halo`,d:Xo(c+3),x:r,y:O(n)}),a},j={count:f,reversed:n.rtl===!0,hitIndex:e=>k(e),hitTest(e,t){if(f===0||t<h.y-p||t>h.y+h.height+p)return null;let n=y?Math.floor((e-h.x)/b):Math.round((e-h.x)/Math.max(1,h.width)*(f-1));return k(x(Math.max(0,Math.min(f-1,n))))}},M=[];if(g){let e=Math.max(1,b-1);M.push(A(`line`,{class:`tc-sparkline-zero`,x1:h.x,x2:h.x+h.width,y1:l(w),y2:l(w)})),d.forEach((t,n)=>{if(t===null)return;let r=Math.sign(t),i=Math.min(2,h.height/2),[a,o]=r===0?[w+i/2,w-i/2]:[w,C(r)];M.push(A(`path`,{key:n,class:[`tc-bar`,r<0&&`tc-bar-negative`,r<0?`tc-tristate-loss`:r>0?`tc-tristate-win`:`tc-tristate-draw`],d:ki(S(n)-e/2,e,a,o,r===0?0:Math.min(2,e/2))}))})}else if(y){let e=Math.max(1,b-1);d.forEach((t,n)=>{t!==null&&M.push(A(`path`,{key:n,class:[`tc-bar`,t<0&&`tc-bar-negative`],d:ki(S(n)-e/2,e,w,C(t),Math.min(2,e/2))}))})}else i===`area`&&M.push(A(`path`,{class:`tc-area tc-area-gradient`,d:Pr(T,w,{curve:a}),mask:`url(#${n.id}-fade)`})),M.push(A(`path`,{class:`tc-line`,d:Nr(T,{curve:a})}));let N=Je(e),P=(e,t)=>{let n=d[e];return n==null?null:Ye(N,0,`${t}-${e}`,[`tc-point`,t],l(S(e)),l(C(n)),c)},F=[];if(s===`minmax`){let e=-1,t=-1;d.forEach((n,r)=>{n!==null&&((e===-1||n<d[e])&&(e=r),(t===-1||n>d[t])&&(t=r))}),e!==-1&&F.push(P(e,`tc-point-min`)),t!==-1&&t!==e&&F.push(P(t,`tc-point-max`))}let I=-1;if(o===`last`){for(let e=f-1;e>=0;e--)if(d[e]!==null){I=e;break}}return{content:[i===`area`&&A(`defs`,null,xi(`${n.id}-fade`)),A(`g`,{class:`tc-series tc-series-1 tc-sparkline`},M,F,I!==-1&&!y&&P(I,`tc-point-last`))],interaction:j}}let ns={name:`sparkline`,clean:e=>({...X(ke)(e),labels:Array.isArray(e.labels)?e.labels.map(Oe):void 0}),render:ts,keyboard:!1};function rs(e){return e.map(e=>{if(e.children?.length){let t=rs(e.children);return{node:e,children:t,value:t.reduce((e,t)=>e+t.value,0)}}return{node:e,value:Math.max(0,e.value??0)}})}function is(e,t){return e.sized.map((e,t)=>({entry:e,index:t})).filter(({entry:e})=>!t.has(Z(e.node)))}function as(e,t,n,r,i,a){let o=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value),s=o.reduce((e,t)=>e+t.value,0),c=0;for(;c<o.length&&r>0&&i>0;){let e=Math.min(r,i),l=r*i/s,u=o[c].value,d=0,f=1/0,p=c;for(;p<o.length;p++){let t=d+o[p].value,n=(t*l/e)**2,r=Math.max(n/(o[p].value*l),u*l/n);if(r>f)break;f=r,d=t}let m=d*l/e,h=0;for(;c<p;c++){let e=o[c],s=e.value*l/m;r>=i?a(e,t,n+h,m,s):a(e,t+h,n,s,m),h+=s}r>=i?(t+=m,r-=m):(n+=m,i-=m),s-=d}}function os(e,t,n,r,i,a,o,s,c,l){as(e,t,n,r,i,(u,d,f,p,m)=>{let h=c?.index??l?.[e.indexOf(u)],g=c?`${c.key}/${Z(u.node)}`:Z(u.node),_=c?.trail??[],v=.01,y=[d-t<v?s[0]:1,f-n<v?s[1]:1,t+r-d-p<v?s[2]:1,n+i-f-m<v?s[3]:1];if(u.children)os(u.children,d,f,p,m,a,o,y,{index:h,key:g,trail:[..._,u.node.name]});else{let e=a/2;o.push({node:u.node,key:g,top:h,trail:_,value:u.value,x:d+y[0]*e,y:f+y[1]*e,width:Math.max(0,p-(y[0]+y[2])*e),height:Math.max(0,m-(y[1]+y[3])*e)})}})}function ss(e,n){let{width:i,height:a,fontSize:o,locale:c}=n,u=Math.max(0,e.gap??2),d=Math.max(0,e.radius??3),f=r(i,a,t(e.padding,0)),p=is(e,n.hidden),m=p.reduce((e,{entry:t})=>e+t.value,0),h=[];os(p.map(({entry:e})=>e),f.x,f.y,f.width,f.height,u,h,[0,0,0,0],void 0,p.map(({index:e})=>e));let g=H(e.format,c),_=z(c,{style:`percent`,maximumFractionDigits:1}),v=(t,n)=>{let r=t.x+t.width/2,i={name:t.node.name,seriesIndex:t.top,value:t.value,text:`${g(t.value)} (${_.format(m>0?t.value/m:0)})`,x:r,y:t.y+t.height/2},a=t.node.color??e.data[t.top]?.color;return a&&(i.color=a),{index:n,label:[...t.trail,t.node.name].join(` › `),title:t.trail.join(` › `),x:r,area:f,items:[i],seriesIndex:t.top,highlight:{kind:`halo`,d:Ni(t.x+1,t.y+1,t.width-2,t.height-2,d-1)}}},y={count:h.length,hitIndex:e=>{let t=h[e];return t?v(t,e):null},hitTest(e,t){let n=h.findIndex(n=>e>=n.x-u/2&&e<=n.x+n.width+u/2&&t>=n.y-u/2&&t<=n.y+n.height+u/2);return n<0?null:v(h[n],n)}},b=p.map(({entry:e,index:t})=>A(`g`,Fe(e.node,t),h.filter(e=>e.top===t).map(e=>A(`rect`,{key:e.key,class:[`tc-tile`,e.trail.length>0&&e.node.class],x:l(e.x),y:l(e.y),width:l(e.width),height:l(e.height),rx:l(Math.min(d,e.width/2,e.height/2)),style:e.trail.length>0?{"--tc-series-color":e.node.color}:void 0})))),x=o*1.3,S=e.labels!==!1&&h.flatMap(e=>{let t=e.width-12,n=e.height>=x+6?ta(e.node.name,t,o):``;if(!n)return[];let r=g(e.value),i=l(e.x+6),a=e.y+6+o*.85;return[A(`text`,{key:e.key,class:`tc-treemap-label`,x:i,y:l(a)},n),e.height>=x*2+9&&s(r,o)<=t&&A(`text`,{key:`${e.key}/value`,class:`tc-treemap-label tc-treemap-value`,x:i,y:l(a+x)},r)]});return{content:[A(`g`,{class:`tc-treemap-tiles`},b),S&&A(`g`,{class:`tc-treemap-labels`,"aria-hidden":`true`},S)],interaction:y}}function cs(e,t,n){let r=is(e,t.hidden),i=r.reduce((e,{entry:t})=>e+t.value,0),a=H(e.format,t.locale),o=z(t.locale,{style:`percent`,maximumFractionDigits:1}),s=[],c=(e,t)=>{for(let n of e){let e=[...t,n.node.name];n.children?c(n.children,e):s.push([e.join(` › `),a(n.value),o.format(i>0?n.value/i:0)])}};c(r.map(({entry:e})=>e),[]);let l={columns:[``,`Value`,`Share`],rows:s};return s.length>n&&(l.rows=s.slice(0,n),l.total=s.length),l}function ls(e,t=0,n={left:5e3}){let r=[];for(let i of De(e)){if(!J(i)||n.left<=0)continue;n.left--;let e=t<8&&Array.isArray(i.children)?ls(i.children,t+1,n):void 0;r.push({...je(i),value:q(i.value)??0,children:e})}return r}let us={name:`treemap`,clean:X(e=>ls(e)),prepare:e=>({...e,sized:rs(e.data)}),render:ss,legend:e=>Pe(e.data),table:cs},ds={line:Ei,area:Di,bar:Mi,pie:Oo,donut:ko,scatter:es,sparkline:ns,gauge:ja,heatmap:za,calendar:Xi,map:oo,candlestick:ea,radar:Io,sankey:Yo,parliament:ho,treemap:us,"percentage-bar":Co,funnel:la};T({time:{scale:er,points:tr,axis:nr},dates:pt,log:{scale:mt,domain:ht,ticks:gt},decimate:yr,line:{linePath:Nr,areaPath:Pr},annotations:{layers:ft,values:dt},patterns:zn,"point-shapes":Vn,swatch:Hn,hydrate:fr,morph:vr}),O(lr);let fs=`[data-tc-chart]`,ps=/* @__PURE__ */ new Set([`chart`,`src`,`data`,`options`]),ms=/* @__PURE__ */ new Set([`title`,`description`,`locale`,`sync`,`id`,`class`]),hs=/* @__PURE__ */ new WeakMap,gs=/* @__PURE__ */ new WeakSet;function _s(e){return hs.get(e)}function vs(e){hs.get(e)?.destroy(),hs.delete(e)}function ys(e){return e===`true`||e===``?!0:e===`false`?!1:e!==``&&Number.isFinite(Number(e))?Number(e):/^\s*[[{]/.test(e)?bs(e,`a data-tc-* attribute`):e}function bs(e,t){try{return JSON.parse(e)}catch(e){throw SyntaxError(`@tabler/charts-bootstrap: invalid JSON in ${t}: ${e.message}`)}}function xs(e){let t={},n=e.dataset.tcOptions;n&&Object.assign(t,bs(n,`data-tc-options`));for(let[n,r]of Object.entries(e.dataset)){if(!n.startsWith(`tc`)||r===void 0)continue;let e=n.charAt(2).toLowerCase()+n.slice(3);ps.has(e)||(t[e]=e===`legend`&&/^(top|bottom|left|right|auto)$/.test(r)?{position:r}:e===`tooltip`&&r===`light`?{theme:`light`}:e===`download`&&/^[a-z]/i.test(r)&&!/^(true|false)$/.test(r)?r.split(/[\s,]+/).filter(Boolean):ms.has(e)?r:ys(r))}return t}function Ss(e){let t=e.dataset.tcData;if(t)return bs(t,`data-tc-data`);let n=e.querySelector(`:scope > script[type="application/json"]`)?.textContent?.trim();return n?bs(n,`the inline <script type="application/json">`):void 0}function Cs(e,t,n){e.dispatchEvent(new CustomEvent(`tc-${t}`,{detail:n,bubbles:!0}))}function ws(e,t,n){let r=new bi(e,{...xs(e),type:t,data:n});for(let t of kn)r.on(t,n=>Cs(e,t,n));return hs.set(e,r),Cs(e,`render`,{size:r.size}),r}function Ts(e,t){let n=hs.get(e);if(n||gs.has(e))return n;let r=e.dataset.tcChart??``,i=t[r];if(!i){let e=Object.keys(t).join(`, `);throw Error(`@tabler/charts-bootstrap: unknown chart type "${r}". Known types: ${e}.`)}let a=e.dataset.tcSrc;return a?(gs.add(e),e.setAttribute(`aria-busy`,`true`),fetch(a).then(e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`.trim());return e.json()}).then(t=>e.isConnected?ws(e,i,t):void 0,t=>{Cs(e,`error`,{error:t,src:a}),console.error(`@tabler/charts-bootstrap: could not load ${a}:`,t)}).finally(()=>{gs.delete(e),e.removeAttribute(`aria-busy`)})):ws(e,i,Ss(e)??[])}function Es(e=document,t={}){let n={...ds,...t.types},r=[...e.querySelectorAll(fs)];e instanceof Element&&e.matches(fs)&&r.unshift(e);let i=r.map(e=>{try{return Ts(e,n)}catch(t){Cs(e,`error`,{error:t}),console.error(t);return}});return Promise.all(i).then(e=>e.filter(e=>e!==void 0))}function Ds(e=document.body,t={}){Es(e,t);let n=new MutationObserver(e=>{for(let n of e){let e=n.target.closest?.(fs);if(!(e&&hs.has(e))){for(let e of n.removedNodes)if(e instanceof Element){hs.has(e)&&vs(e);for(let t of e.querySelectorAll(fs))vs(t)}for(let e of n.addedNodes)e instanceof Element&&!e.isConnected||e instanceof Element&&Es(e,t)}}});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()}if(typeof document<`u`){let e=document.currentScript;if(!e?.hasAttribute(`data-no-styles`)&&!document.getElementById(`tc-styles`)){let t=document.createElement(`style`);t.id=`tc-styles`,t.textContent=`/*! @tabler/charts | MIT */
2
- :where(:root),:where([data-theme=light]){--tc-color-1:var(--tblr-primary,#2a78d6);--tc-color-2:var(--tblr-orange,#eb6834);--tc-color-3:var(--tblr-teal,#1baf7a);--tc-color-4:var(--tblr-yellow,#eda100);--tc-color-5:var(--tblr-pink,#e87ba4);--tc-color-6:var(--tblr-green,#008300);--tc-color-7:var(--tblr-indigo,#4a3aa7);--tc-color-8:var(--tblr-red,#e34948);--tc-color-other:var(--tblr-secondary,#8a8983);--tc-surface:var(--tblr-bg-surface,#fff);--tc-text-color:var(--tblr-body-color,#0b0b0b);--tc-text-muted:var(--tblr-secondary,#6f6e69);--tc-grid-color:var(--tblr-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--tblr-border-color,#c3c2b7);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,11, 11, 11), .04);--tc-tooltip-bg:var(--tblr-dark,#0b0b0b);--tc-tooltip-color:#fff;--tc-tooltip-muted:#ffffffb3;--tc-tooltip-border:#ffffff1f;--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--tblr-border-radius,6px);--tc-tooltip-light-bg:#fff;--tc-tooltip-light-color:#0b0b0b;--tc-tooltip-light-muted:#6f6e69;--tc-tooltip-light-border:#0b0b0b1a;--tc-focus-color:var(--tc-color-1);--tc-font-family:var(--tblr-body-font-family,inherit);--tc-font-size:12px;--tc-stroke-width:2px;--tc-grid-width:1px;--tc-area-opacity:.1;--tc-area-gradient-start:.24;--tc-area-gradient-end:0;--tc-pie-value-size:1.75em;--tc-bubble-opacity:.7;--tc-point-ring:2px;--tc-duration:.4s;--tc-duration-fast:.12s;--tc-easing:cubic-bezier(.4, 0, .2, 1)}@media (prefers-color-scheme:dark){:where(:root:not([data-theme=light])){--tc-color-1:var(--tblr-primary,#3987e5);--tc-color-2:var(--tblr-orange,#d95926);--tc-color-3:var(--tblr-teal,#199e70);--tc-color-4:var(--tblr-yellow,#c98500);--tc-color-5:var(--tblr-pink,#d55181);--tc-color-6:var(--tblr-green,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}}:where([data-theme=dark]){--tc-color-1:var(--tblr-primary,#3987e5);--tc-color-2:var(--tblr-orange,#d95926);--tc-color-3:var(--tblr-teal,#199e70);--tc-color-4:var(--tblr-yellow,#c98500);--tc-color-5:var(--tblr-pink,#d55181);--tc-color-6:var(--tblr-green,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}.tc-chart{max-width:100%;height:auto;font-family:var(--tc-font-family);font-size:var(--tc-font-size);letter-spacing:normal;word-spacing:normal;text-transform:none;color:var(--tc-text-color);-webkit-tap-highlight-color:transparent;direction:ltr;display:block;overflow:visible}.tc-chart :where(text){font:inherit}.tc-series{--tc-series-color:var(--tc-color-other);--tc-series-pattern:var(--tc-pattern-other);--tc-pattern-dash:1 3;--tc-pattern-ink:var(--tc-pattern-color,var(--tc-surface));--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 3px)}.tc-series-1{--tc-series-color:var(--tc-color-1);--tc-series-pattern:var(--tc-pattern-1);--tc-pattern-dash:none;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-2{--tc-series-color:var(--tc-color-2);--tc-series-pattern:var(--tc-pattern-2);--tc-pattern-dash:6 3;--tc-swatch-pattern:radial-gradient(var(--tc-pattern-ink) .8px, #0000 1.2px) 0 0 / 4px 4px}.tc-series-3{--tc-series-color:var(--tc-color-3);--tc-series-pattern:var(--tc-pattern-3);--tc-pattern-dash:2 3;--tc-swatch-pattern:repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-4{--tc-series-color:var(--tc-color-4);--tc-series-pattern:var(--tc-pattern-4);--tc-pattern-dash:10 3 2 3;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-5{--tc-series-color:var(--tc-color-5);--tc-series-pattern:var(--tc-pattern-5);--tc-pattern-dash:4 4;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-6{--tc-series-color:var(--tc-color-6);--tc-series-pattern:var(--tc-pattern-6);--tc-pattern-dash:12 4;--tc-swatch-pattern:repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-7{--tc-series-color:var(--tc-color-7);--tc-series-pattern:var(--tc-pattern-7);--tc-pattern-dash:2 2 6 2;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-8{--tc-series-color:var(--tc-color-8);--tc-series-pattern:var(--tc-pattern-8);--tc-pattern-dash:8 2 2 2;--tc-swatch-pattern:linear-gradient(90deg, #0000 50%, var(--tc-series-color) 0) 0 0 / 4px 4px, repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-tick-label{fill:var(--tc-text-muted);font-variant-numeric:tabular-nums}.tc-axis-title{fill:var(--tc-text-muted)}.tc-grid-line,.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-crosshair,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-baseline-color);stroke-width:var(--tc-grid-width);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-grid-line,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-grid-color)}.tc-grid-line-zero{stroke:var(--tc-baseline-color)}.tc-line{fill:none;stroke:var(--tc-series-color);stroke-width:var(--tc-series-width,var(--tc-stroke-width));stroke-dasharray:var(--tc-series-dash,none);stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}.tc-area{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-pie-slices{--tc-pie-gap:0px}.tc-slice{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-pie-gap);stroke-linejoin:round}.tc-pie-track,.tc-gauge-track{fill:var(--tc-grid-color)}.tc-gauge-arc{fill:var(--tc-series-color)}.tc-pie-value,.tc-gauge-value,.tc-parliament-value{font-size:var(--tc-pie-value-size);fill:var(--tc-text-color);font-variant-numeric:tabular-nums;font-weight:600}.tc-pie-label,.tc-gauge-label,.tc-parliament-label{fill:var(--tc-text-muted)}.tc-seat{fill:var(--tc-series-color);transition:transform var(--tc-duration) var(--tc-easing), r var(--tc-duration) var(--tc-easing)}.tc-seat-vacant{fill:var(--tc-grid-color)}.tc-chart-parliament .tc-hover-mark{opacity:.25}.tc-segment{fill:var(--tc-series-color);transition:var(--tc-duration) var(--tc-easing);transition-property:x,width}.tc-percentage-bar-track{fill:var(--tc-grid-color)}.tc-tile{fill:var(--tc-series-color);fill-opacity:var(--tc-treemap-opacity,1);transition:var(--tc-duration) var(--tc-easing);transition-property:x,y,width,height}.tc-treemap-value{font-weight:400}.tc-funnel-stage{fill:var(--tc-funnel-color,var(--tc-color-1));transition:d var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-funnel-stage{fill:color-mix(in oklab, var(--tc-funnel-color,var(--tc-color-1)) var(--tc-funnel-shade,100%), var(--tc-surface))}}.tc-funnel-name,.tc-funnel-share{fill:var(--tc-text-muted)}.tc-funnel-value{fill:var(--tc-text-color);font-weight:600}.tc-funnel-value,.tc-funnel-share{font-variant-numeric:tabular-nums}.tc-sankey-node{fill:var(--tc-series-color)}.tc-sankey-link{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-chart-sankey{--tc-area-opacity:.35}.tc-sankey-value{font-size:.92em}.tc-chart-sankey .tc-hover-mark{opacity:.5}.tc-radar-ring,.tc-radar-spoke,.tc-chart-radar .tc-crosshair{fill:none;shape-rendering:auto}.tc-area-gradient{fill-opacity:1}.tc-fade-start{stop-color:#fff;stop-opacity:var(--tc-area-gradient-start)}.tc-fade-end{stop-color:#fff;stop-opacity:var(--tc-area-gradient-end)}.tc-chart-sparkline{--tc-stroke-width:1.5px;--tc-area-gradient-start:.3}.tc-bubble{fill-opacity:var(--tc-bubble-opacity)}.tc-point{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-point-ring);paint-order:stroke;transition:cx var(--tc-duration) var(--tc-easing), cy var(--tc-duration) var(--tc-easing)}.tc-point-min,.tc-point-max{fill:var(--tc-text-muted)}.tc-annotation{--tc-annotation-color:var(--tc-text-muted)}.tc-annotation-line{stroke:var(--tc-annotation-color);stroke-width:1px;stroke-dasharray:4 3;shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-annotation-band{fill:var(--tc-annotation-color);fill-opacity:.1}.tc-annotation-label{fill:var(--tc-annotation-color);font-weight:500}.tc-annotation-label,.tc-radar-value{paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;font-size:.92em}.tc-annotations{pointer-events:none}.tc-value-label,.tc-treemap-label{fill:var(--tc-text-color);font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;transition:transform var(--tc-duration) var(--tc-easing);animation:tc-fade-in var(--tc-duration) var(--tc-easing);font-weight:500}.tc-marker{transition:d var(--tc-duration) var(--tc-easing)}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-series-color);border-radius:var(--tc-shape-radius,50%);width:10px;height:10px;clip-path:var(--tc-shape,none)}.tc-pattern-bg{fill:var(--tc-series-color)}.tc-pattern-ink{fill:none;stroke:var(--tc-pattern-ink);stroke-width:1.5px;stroke-linecap:round}.tc-patterned :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,var(--tc-series-color))}.tc-patterned .tc-area{fill-opacity:max(var(--tc-area-opacity), .4)}.tc-patterned .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>.tc-patterned)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-swatch-pattern), var(--tc-series-color)}@keyframes tc-reveal{0%{clip-path:inset(0 var(--tc-reveal,100% 0 0))}to{clip-path:inset(0)}}@keyframes tc-grow{0%{transform:scaleY(0)}}@keyframes tc-grow-x{0%{transform:scaleX(0)}}@keyframes tc-fade-in{0%{opacity:0}}.tc-line,.tc-area,.tc-bar,.tc-radar-ring,.tc-dots{transition:d var(--tc-duration) var(--tc-easing)}.tc-slice,.tc-gauge-arc,.tc-gauge-track{transition:none var(--tc-duration)}.tc-rtl{--tc-reveal:0 0 100%}.tc-chart-line .tc-series-list,.tc-chart-area .tc-series-list{animation:tc-reveal calc(var(--tc-duration) * 2) var(--tc-easing)}.tc-series-list .tc-series,.tc-areas .tc-series,.tc-sankey-links .tc-sankey-link,.tc-sankey-nodes .tc-series,.tc-parliament-seats .tc-series,.tc-parliament-seats .tc-seat,.tc-series-list .tc-point,.tc-heatmap-cells,.tc-calendar-cells,.tc-map-regions,.tc-treemap-tiles,.tc-percentage-bar,.tc-funnel-stages,.tc-candles,.tc-tick,.tc-grid-line{animation:tc-fade-in var(--tc-duration) var(--tc-easing)}.tc-bar{fill:var(--tc-series-color);transform-box:fill-box;transform-origin:50% 100%;animation:tc-grow var(--tc-duration) var(--tc-easing)}.tc-bar-negative{transform-origin:50% 0}.tc-cell{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition:fill var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-cell{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-heatmap-row.tc-series{--tc-heat-color:var(--tc-series-color)}.tc-cell-empty{fill:var(--tc-heat-empty,var(--tc-grid-color));opacity:.5}.tc-region{stroke:var(--tc-surface);stroke-width:.5px;vector-effect:non-scaling-stroke}.tc-region-empty{fill:var(--tc-heat-empty,var(--tc-grid-color))}.tc-region-point,.tc-map-marker{stroke-width:2px}.tc-map-marker{fill:var(--tc-map-marker-color,var(--tc-color-1));stroke:var(--tc-surface)}.tc-region-selected{stroke:var(--tc-text-color);stroke-width:1.5px}.tc-map-selectable .tc-region{cursor:pointer}.tc-chart-map[data-zoom]{touch-action:none;cursor:grab;user-select:none}.tc-chart-map[data-zoom=drag]{cursor:grabbing}.tc-map-zoom{z-index:10;background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:6px;position:absolute;top:0;right:0}.tc-download~.tc-map-zoom{top:28px}.tc-map-zoom svg{fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round}.tc-map-zoom :disabled{opacity:.4;pointer-events:none}.tc-map-line{fill:none;stroke:var(--tc-map-line-color,var(--tc-color-1));stroke-width:1.5px;stroke-dasharray:4;animation:tc-map-line calc(var(--tc-duration) * 3) linear infinite}@keyframes tc-map-line{to{stroke-dashoffset:-8px}}.tc-candle{--tc-candle-color:var(--tc-up-color,var(--tc-color-6))}.tc-candle-down{--tc-candle-color:var(--tc-negative-color,var(--tc-color-8))}.tc-candle-body{fill:var(--tc-candle-color);transition:d var(--tc-duration) var(--tc-easing), fill var(--tc-duration) var(--tc-easing)}.tc-candle-wick{fill:none;stroke:var(--tc-candle-color);stroke-width:1px;vector-effect:non-scaling-stroke;transition:d var(--tc-duration) var(--tc-easing), stroke var(--tc-duration) var(--tc-easing)}.tc-tristate-loss{fill:var(--tc-negative-color,var(--tc-color-8))}.tc-tristate-draw{fill:var(--tc-baseline-color)}.tc-bar-horizontal{transform-origin:0;animation-name:tc-grow-x}.tc-bar-horizontal.tc-bar-negative,.tc-rtl .tc-bar-horizontal{transform-origin:100%}.tc-rtl .tc-bar-horizontal.tc-bar-negative{transform-origin:0}.tc-tick,.tc-grid-line{transition:transform var(--tc-duration) var(--tc-easing)}@keyframes tc-pie-in{0%{opacity:0;transform:scale(.85)}}.tc-pie-slices,.tc-gauge-rings,.tc-parliament-seats,.tc-radar-series{animation:tc-pie-in calc(var(--tc-duration) * 1.5) var(--tc-easing)}.tc-hover .tc-point{transition:none;animation:none}.tc-static,.tc-chart[data-resizing]{--tc-duration:0s}:where(.tc-container){position:relative}.tc-hover{pointer-events:none}.tc-hover-band{fill:var(--tc-hover-color)}.tc-hover-mark{fill:var(--tc-series-color);opacity:.35}.tc-chart-heatmap .tc-hover-mark,.tc-chart-calendar .tc-hover-mark,.tc-chart-map .tc-hover-mark,.tc-chart-treemap .tc-hover-mark,.tc-chart-percentage-bar .tc-hover-mark{fill:none;stroke:var(--tc-text-color);stroke-width:2px;opacity:.6}.tc-tooltip{z-index:10;pointer-events:none;opacity:0;min-width:120px;max-width:min(280px,100%);font-family:var(--tc-font-family);font-size:var(--tc-font-size);overflow-wrap:anywhere;color:var(--tc-tooltip-color);background:var(--tc-tooltip-bg);border:1px solid var(--tc-tooltip-border);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);transition:opacity var(--tc-duration-fast) var(--tc-easing);padding:8px 10px;line-height:1.4;position:absolute;top:0;left:0}.tc-tooltip-light{--tc-tooltip-bg:var(--tc-tooltip-light-bg);--tc-tooltip-color:var(--tc-tooltip-light-color);--tc-tooltip-muted:var(--tc-tooltip-light-muted);--tc-tooltip-border:var(--tc-tooltip-light-border)}.tc-tooltip .tc-series{--tc-pattern-ink:var(--tc-pattern-color,var(--tc-tooltip-bg))}.tc-tooltip[data-visible]{opacity:1;transition:opacity var(--tc-duration-fast) var(--tc-easing), transform var(--tc-duration-fast) var(--tc-easing)}.tc-tooltip-title{margin-bottom:4px;font-weight:600}.tc-tooltip-item{align-items:center;gap:8px;display:flex}.tc-tooltip-swatch,.tc-legend-swatch{background:var(--tc-series-color);border-radius:50%;flex:none;width:8px;height:8px}.tc-tooltip-name{color:var(--tc-tooltip-muted);flex:1}.tc-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:500}.tc-tooltip-footer{border-top:1px solid var(--tc-tooltip-border);margin-top:4px;padding-top:4px}.tc-tooltip-item-active .tc-tooltip-name{color:var(--tc-tooltip-color)}.tc-legend{font-family:var(--tc-font-family);font-size:var(--tc-font-size);margin-bottom:8px;line-height:1.4}.tc-legend[data-position=bottom]{margin:8px 0 0}:where(.tc-legend-beside){grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:16px;display:grid}:where(.tc-legend-beside.tc-legend-start){grid-template-columns:auto minmax(0,1fr)}:where(.tc-legend-beside)>:not(.tc-legend,svg.tc-chart){grid-column:1/-1}.tc-legend:is([data-position=left],[data-position=right]){justify-self:start;max-width:16em;margin:0}.tc-legend:is([data-position=left],[data-position=right]) .tc-legend-items{flex-flow:column}.tc-legend-items{flex-wrap:wrap;gap:4px 12px;display:flex}.tc-legend-item{appearance:none;font:inherit;text-align:start;color:var(--tc-text-color);cursor:pointer;transition:color var(--tc-duration-fast) var(--tc-easing);background:0 0;border:0;border-radius:4px;align-items:center;gap:6px;margin:0;padding:2px 4px;display:inline-flex}.tc-legend-item:hover{background:var(--tc-hover-color)}.tc-legend-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-legend-item-hidden{color:var(--tc-text-muted)}.tc-legend-item-hidden .tc-legend-swatch{box-shadow:inset 0 0 0 1.5px var(--tc-series-color);background:0 0}.tc-download{z-index:11;font-family:var(--tc-font-family);font-size:var(--tc-font-size);line-height:1.4;position:absolute;top:0;right:0}.tc-download-toggle,.tc-download-item{appearance:none;font:inherit;color:var(--tc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;margin:0;display:flex}.tc-download-toggle{justify-content:center;width:24px;height:24px;padding:0}.tc-download-toggle:hover,.tc-download-toggle[aria-expanded=true],.tc-download-item:hover{color:var(--tc-text-color);background:var(--tc-hover-color)}.tc-download-toggle:focus-visible,.tc-download-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-download-menu{min-width:80px;color:var(--tc-text-color);background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);margin-top:2px;padding:4px;position:absolute;top:100%;right:0}.tc-download[dir=rtl],[dir=rtl]>*>.tc-download-menu{left:0;right:auto}.tc-download-item{text-align:start;white-space:nowrap;width:100%;padding:4px 8px}.tc-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tc-chart:focus{outline:none}.tc-chart:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:2px;border-radius:2px}.tc-table-wrap:not(.tc-sr-only){margin-top:12px;overflow-x:auto}.tc-table{border-collapse:collapse;width:100%;font-family:var(--tc-font-family);font-size:var(--tc-font-size);font-variant-numeric:tabular-nums;color:var(--tc-text-color)}.tc-table caption{text-align:start;margin-bottom:4px;font-weight:600}.tc-table th,.tc-table td{text-align:end;border-bottom:1px solid var(--tc-grid-color);padding:4px 8px}.tc-table th[scope=row],.tc-table thead th:first-child{text-align:start}.tc-table thead th{color:var(--tc-text-muted);border-bottom-color:var(--tc-baseline-color);font-weight:600}@media (prefers-reduced-motion:reduce){.tc-chart,.tc-tooltip{--tc-duration:0s;--tc-duration-fast:0s}}@media (forced-colors:active){.tc-value-label,.tc-treemap-label{fill:canvastext;stroke:canvas}.tc-tick-label,.tc-axis-title,.tc-funnel-labels{fill:canvastext}.tc-grid-line,.tc-radar-ring,.tc-radar-spoke{stroke:graytext}.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-line{stroke:canvastext}.tc-area{fill:graytext}.tc-bar,.tc-funnel-stage,.tc-point{fill:canvastext;stroke:canvas}.tc-crosshair{stroke:highlight}.tc-tooltip{border-color:canvastext}.tc-legend-swatch{background:canvastext}.tc-legend-item-hidden .tc-legend-swatch{background:0 0;box-shadow:inset 0 0 0 1.5px canvastext}.tc-pattern-bg{fill:canvas}.tc-pattern-ink{stroke:canvastext}:is(.tc-patterned,.tc-patterns-auto) :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,CanvasText);fill-opacity:1;stroke:canvastext;stroke-width:1px}.tc-patterns-auto .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) .tc-series{--tc-pattern-color:CanvasText;--tc-series-color:Canvas}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){forced-color-adjust:none;background:var(--tc-swatch-pattern), Canvas;box-shadow:inset 0 0 0 1px canvastext}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){box-shadow:none;background:canvastext}}:where(:root,[data-bs-theme]){--tc-color-1:var(--bs-primary,#2a78d6);--tc-focus-color:var(--bs-primary,#2a78d6);--tc-surface:var(--bs-body-bg,#fff);--tc-text-color:var(--bs-body-color,#0b0b0b);--tc-text-muted:var(--bs-secondary-color,#6f6e69);--tc-grid-color:var(--bs-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--bs-border-color,#c3c2b7);--tc-hover-color:rgba(var(--bs-emphasis-color-rgb,11, 11, 11), .05);--tc-tooltip-bg:var(--bs-emphasis-color,#0b0b0b);--tc-tooltip-color:var(--bs-body-bg,#fff);--tc-tooltip-muted:rgba(var(--bs-body-bg-rgb,255, 255, 255), .7);--tc-tooltip-border:rgba(var(--bs-body-bg-rgb,255, 255, 255), .12);--tc-tooltip-shadow:var(--bs-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--bs-border-radius,6px);--tc-font-family:var(--bs-body-font-family,inherit)}:where(:root,[data-bs-theme=light]){--tc-color-2:#eb6834;--tc-color-3:#1baf7a;--tc-color-4:#eda100;--tc-color-5:#e87ba4;--tc-color-6:#008300;--tc-color-7:#4a3aa7;--tc-color-8:#e34948}:where([data-bs-theme=dark]){--tc-color-2:#d95926;--tc-color-3:#199e70;--tc-color-4:#c98500;--tc-color-5:#d55181;--tc-color-6:#008300;--tc-color-7:#9085e9;--tc-color-8:#e66767}`,t.nonce=e?.nonce??``,document.head.prepend(t)}let t=e?.hasAttribute(`data-observe`)??!1,n=()=>t?Ds(document.body):void Es(document);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,n):n()}return e.Chart=bi,e.LINE_HEIGHT=u,e.VERSION=`0.3.0`,e.addMap=Ya,e.arcCentroid=ya,e.arcPathStable=Sa,e.area=Di,e.areaPath=Pr,e.axis=be,e.axisSize=_e,e.band=Se,e.bandTicks=he,e.bar=Mi,e.barPath=ki,e.buildChart=Dn,e.calendar=Xi,e.cancel=ln,e.candlestick=ea,e.categoryInteraction=at,e.chartEvents=kn,e.chartLabel=Sn,e.chartModel=hn,e.chartToString=On,e.dataTable=di,e.defaultHidden=bt,e.defaultPlugins=yi,e.describeHit=Jr,e.dispose=vs,e.domainOf=Qe,e.donut=ko,e.download=Rr,e.downloadChart=C,e.escapeAttr=Xt,e.escapeText=Yt,e.estimateTextWidth=s,e.exportImage=S,e.exportSVG=x,e.extent=we,e.feature=k,e.features=w,e.flush=un,e.formatDate=oe,e.formatDetail=W,e.formatNumber=H,e.formatTicks=ae,e.funnel=la,e.gauge=ja,e.getChart=_s,e.getDateFormat=B,e.getNumberFormat=z,e.grid=xe,e.h=A,e.hbarPath=Ai,e.heatmap=za,e.highlight=Kr,e.hitAnchor=fi,e.hoverOverlay=Hr,e.hoverUnderlay=Vr,e.init=Es,e.innerRect=r,e.insets=t,e.keyboard=Xr,e.legend=ei,e.legendContent=yt,e.line=Ei,e.linePath=Nr,e.linear=Te,e.linearTicks=me,e.log=mt,e.lttb=xr,e.lttbIndices=yr,e.map=oo,e.niceDomain=G,e.normalizeClass=j,e.normalizeStyle=N,e.observe=Ds,e.padAngleForGap=ba,e.parliament=ho,e.percentageBar=Co,e.pie=Oo,e.placeTooltip=mi,e.point=Ce,e.pointer=Gr,e.radar=Io,e.register=T,e.render=Ot,e.renderChart=En,e.renderContext=_n,e.renderToString=Vt,e.resolveLegend=xn,e.resolveSize=pn,e.sankey=Yo,e.scatter=es,e.schedule=sn,e.seriesKey=Q,e.seriesLegend=Be,e.seriesTable=ot,e.sparkline=ns,e.stepPrecision=re,e.sync=ai,e.tableContent=qr,e.thinTicks=ge,e.tickIncrement=fe,e.tickStep=pe,e.ticks=de,e.time=er,e.timePointScale=tr,e.tooltip=vi,e.tooltipContent=pi,e.treemap=us,e.types=ds,e})({});
1
+ var TablerCharts=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let t={};function n(e){Object.assign(t,e)}let r=e=>e.shapes??e.patterns===!0?t.swatch:void 0,i=/* @__PURE__ */ new Set;function a(e){i.add(e),t.post=(e,t,n,r)=>{for(let a of i)t=a(e,t,n,r);return t}}function o(e){let n=t[e];if(!n)throw Error(`@tabler/charts: Import "@tabler/charts/${e===`dates`?`time`:e}" for ${e}.`);return n}function s(e){return e?`${e.index}:${e.seriesIndex??``}`:``}function c(e,t,n,r,i){let a=e.getBoundingClientRect(),o=a.width>0?r/a.width:1,s=a.height>0?i/a.height:1;return{x:(t-a.left)*o,y:(n-a.top)*s}}function l(e,t,...n){let r={},i;if(t)for(let e in t){let n=t[e];if(e===`key`)n!=null&&(i=n);else if(e===`class`){let e=u(n);e&&(r.class=e)}else if(e===`style`){let e=f(n);e&&(r.style=e)}else n===!0?r[e]=``:(typeof n==`string`||typeof n==`number`&&Number.isFinite(n))&&(r[e]=n)}let a=[];return p(n,a),{tag:e,attrs:r,children:a,key:i}}function u(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n of e){let e=u(n);e&&(t=t?`${t} ${e}`:e)}return t}let d=/[;{}<>"'\\]|\/\*|\b(?:url(?!\(#[\w-]+\))|src|attr|image|image-set|cross-fade|element|expression)\s*\(/i;function f(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n in e){let r=e[n];r==null||r===``||d.test(String(r))||(t+=`${t?`;`:``}${n}:${r}`)}return t}function p(e,t){for(let n of e){if(n==null||typeof n==`boolean`)continue;if(Array.isArray(n)){p(n,t);continue}if(typeof n==`object`){t.push(n);continue}let e=String(n);if(e===``)continue;let r=t.length-1;r>=0&&typeof t[r]==`string`?t[r]+=e:t.push(e)}}function m(e,t,n){return l(`div`,{class:`tc-legend-items`},e.map(e=>{let r=t.has(e.key);return l(`button`,{key:e.key,type:`button`,class:[`tc-legend-item`,`tc-series`,`tc-series-${e.index+1}`,r&&`tc-legend-item-hidden`],style:{"--tc-series-color":e.color,...n?.(e.index)},"aria-pressed":r?`false`:`true`,"data-key":e.key},l(`span`,{class:`tc-legend-swatch`,"aria-hidden":`true`}),l(`span`,{class:`tc-legend-name`},e.name))}))}function h(e){return new Set(e.filter(e=>e.hidden).map(e=>e.key))}let g=/^[a-zA-Z_][\w:.-]*$/,_=/^on/i;function v(e){return g.test(e)}function y(e){return g.test(e)&&!_.test(e)}let b=`http://www.w3.org/2000/svg`,x=/* @__PURE__ */ new WeakMap,S=/* @__PURE__ */ new WeakMap;function C(e,n,r){let i=S.get(e)??(r?.parentNode===e?r:void 0);if(n===null||!v(n.tag))return i&&(i.remove(),S.delete(e)),null;if(i&&k(i,n))return j(i,n),S.set(e,i),i;if(i&&t.hydrate?.(i,n,w(e,n.tag)))return S.set(e,i),i;let a=O(n,w(e,n.tag),e.ownerDocument);return i?i.replaceWith(a):e.appendChild(a),S.set(e,a),a}let w=(e,t)=>t===`svg`?b:T(e);function T(e){return e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?b:`http://www.w3.org/1999/xhtml`}function E(e,t,n){if(typeof e==`string`){let t=n.createTextNode(e);return x.set(t,e),t}return v(e.tag)?O(e,e.tag===`svg`?b:t,n):null}function D(e,t,n){t===`style`?e.style.cssText=n:e.setAttribute(t,n)}function O(e,t,n){let r=n.createElementNS(t,e.tag),{attrs:i}=e;for(let e in i)y(e)&&D(r,e,String(i[e]));let a=T(r);for(let t of e.children){let e=E(t,a,n);e&&r.appendChild(e)}return x.set(r,e),r}function k(e,t){let n=x.get(e);return n===void 0?!1:typeof t==`string`?typeof n==`string`:typeof n!=`string`&&n.tag===t.tag&&n.key===t.key}function A(e,t){typeof t==`string`?x.get(e)!==t&&(e.data=t,x.set(e,t)):j(e,t)}function j(e,n){let r=x.get(e);r!==n&&(M(e,r.attrs,t.sweep?.(e,r,n)??n.attrs,!0),N(e,n.children),x.set(e,n))}function M(e,n,r,i=!1){for(let a in r){let o=r[a];n[a]!==o&&y(a)&&(i&&a===`d`&&t.morph?.(e,String(n[a]??``),String(o))||D(e,a,String(o)))}for(let t in n)!(t in r)&&y(t)&&e.removeAttribute(t)}function N(e,t){if(t.length===0&&e.firstChild===null)return;let n=Array.from(e.childNodes),r=/* @__PURE__ */ new Map,i=[];for(let e of n){let t=x.get(e);t!==void 0&&(typeof t!=`string`&&t.key!==void 0?r.set(t.key,e):i.push(e))}let a=Array(t.length),o=/* @__PURE__ */ new Set,s=0;for(let e=0;e<t.length;e++){let n=t[e],c;typeof n!=`string`&&n.key!==void 0?c=r.get(n.key):s<i.length&&(c=i[s]),c&&!o.has(c)&&k(c,n)&&(a[e]=c,o.add(c),c===i[s]&&s++)}for(let t of n)o.has(t)||e.removeChild(t);let c=T(e),l=e.ownerDocument,u=null;for(let n=t.length-1;n>=0;n--){let r=t[n],i=a[n];if(i)A(i,r);else if(i=E(r,c,l)??void 0,!i)continue;(i.parentNode!==e||i.nextSibling!==u)&&e.insertBefore(i,u),u=i}}let P=/* @__PURE__ */ new Set([`a`,`b`,`button`,`caption`,`div`,`em`,`i`,`label`,`li`,`ol`,`p`,`section`,`small`,`span`,`strong`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`]),F=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]);function I(e,t={}){return typeof e==`string`?ie(e):L(t.xmlns!==!1&&e.tag===`svg`&&e.attrs.xmlns===void 0?{...e,attrs:{xmlns:`http://www.w3.org/2000/svg`,...e.attrs}}:e,t.namespace?t.namespace===`svg`:!P.has(e.tag))}function L(e,t){let{tag:n,attrs:r,children:i}=e;if(!v(n))return``;let a=t||n===`svg`,o=`<${n}`;for(let e in r)y(e)&&(o+=` ${e}="${ae(String(r[e]))}"`);if(i.length===0){if(a)return`${o}/>`;if(F.has(n.toLowerCase()))return`${o}>`}o+=`>`;let s=a&&n!==`foreignObject`;for(let e of i)o+=typeof e==`string`?ie(e):L(e,s);return`${o}</${n}>`}let R=/[&<>]/,ee=/[&"<>]/,z=/[&<>]/g,te=/[&"<>]/g,ne={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`},re=e=>ne[e];function ie(e){return R.test(e)?e.replace(z,re):e}function ae(e){return ee.test(e)?e.replace(te,re):e}let oe=/* @__PURE__ */ new WeakMap,se=/* @__PURE__ */ new WeakSet,ce;function le(){return ce||typeof ResizeObserver!=`function`||(ce=new ResizeObserver(e=>{for(let{target:t,contentRect:n}of e)t.isConnected?(se.add(t),oe.get(t)?.(n.width,n.height)):se.has(t)&&(se.delete(t),ce?.unobserve(t))})),ce}function ue(e,t){let n=le();return n?(oe.set(e,t),n.observe(e),()=>{oe.get(e)===t&&(oe.delete(e),n.unobserve(e))}):()=>{}}let de=/* @__PURE__ */ new Map,B=!1,fe=e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)};function pe(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function V(e,t){de.set(e,t),B||(B=!0,fe(ge))}let me={};function he(e){de.delete(e)}function ge(){B=!1;let e=0,t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;do{for(let[r,i]of de)de.delete(r),t.has(r)?n.set(r,i):(t.add(r),pe(i),e++);e+=me.idle?.()??0}while(de.size>0);for(let[e,t]of n)V(e,t);return e}let _e=e=>typeof e.crosshair==`object`&&e.crosshair?.value===!0,ve=0,ye=()=>`tc-${++ve}`;function be(e,t){let n=t?.width??0,r=Math.max(0,Math.round(Number.isFinite(e.width)?e.width:n>0?n:600)),i=e.aspectRatio&&e.aspectRatio>0?e.aspectRatio:2,a=Number.isFinite(e.height)?e.height:e.height===`container`&&(t?.height??0)>0?t?.height:e.type?.height?.(Se(e),r)??r/i;return{width:r,height:Math.max(0,Math.round(a))}}let xe=/* @__PURE__ */ new WeakMap;function Se(e){let{prepare:t}=e.type;if(!t)return e;let n=xe.get(e)??t(e);return xe.set(e,n),n}function Ce(e,n){let r=e.type.render(Se(e),n),i=r?.content===void 0?{content:r}:r;return t.post&&(i.content=t.post(e,i.content,i.interaction,n)),i}function we(e,{size:t,id:n,hidden:r,fontSize:i,rtl:a=e.rtl===!0}){return{rtl:a,width:t.width,height:t.height,fontSize:e.fontSize??i??12,locale:e.locale,id:n,hidden:r}}function Te(e){let t={...e.type?.clean?e.type.clean(e):e};for(let e in t)typeof t[e]==`number`&&!Number.isFinite(t[e])&&delete t[e];return t}function Ee(e){if(!e.type||typeof e.type.render!=`function`)throw TypeError("@tabler/charts: `type` must be a chart type such as line.")}let De=[`top`,`bottom`,`left`,`right`,`auto`];function Oe(e){let t=e.type.legend?.(Se(e))??[],n=e.legend,r=n===void 0?t.length>=2:n!==!1&&t.length>0,i=typeof n==`object`?n.position:void 0;return{items:t,show:r,position:i&&De.includes(i)?i:`top`}}function ke(e){if(e.title)return e.title;let t=Oe(e).items.map(e=>e.name).filter(Boolean),n=t.slice(0,6).join(`, `);return`${e.type.name} chart${t.length?`: ${n}${t.length>6?`, …`:``}`:``}`}let Ae=e=>Array.isArray(e)?e.reduce((e,t)=>e+Ae(t),0):e&&typeof e==`object`?1+Ae(e.children):0,je=(e,t)=>e.animate===!1||e.animate!==!0&&Ae(t)>1e3;function Me(e,n,r,i,a,s,c,u,d=e.rtl===!0){let{width:f,height:p}=n,m=e.description?`${r}-desc`:void 0,{patterns:h}=e,g=h===!1?void 0:(h===!0?o(`patterns`):t.patterns)?.(e,r);return l(`svg`,{class:[`tc-chart`,`tc-chart-${e.type.name}`,i&&`tc-static`,d&&`tc-rtl`,g?.[0],e.class],style:g?.[1],viewBox:`0 0 ${f} ${p}`,width:f,height:p,role:`img`,"aria-label":ke(e),"aria-describedby":m,...u},m&&l(`desc`,{key:`desc`,id:m},e.description),g?.[2],s&&l(`g`,{key:`hover-under`,class:`tc-hover-layer`},s),a,c&&l(`g`,{key:`hover-over`,class:`tc-hover-layer`},c))}function Ne(e,t,n=e.id??`tc`){Ee(e);let r=Te(e),{content:i,interaction:a}=Ce(r,we(r,{size:t,id:n,hidden:h(Oe(r).items)}));return{svg:Me(r,t,n,je(r,i),i),interaction:a}}function Pe(e,t,n){return Ne(e,t,n).svg}function Fe(e,t){return I(Ne(e,t).svg)}let Ie=[`hover`,`click`,`legend-toggle`,`render`],Le=`:scope > svg.tc-chart`,Re=e=>typeof getComputedStyle==`function`?getComputedStyle(e):void 0,ze=/* @__PURE__ */ new WeakMap;var Be=class{element;id;#e;#t=(e,t)=>{let n=this.#e.height===`container`,r=e!==this.#n.width||n&&t!==this.#n.height;this.#n={width:e,height:t},r&&(e||t)&&(this.#h=void 0,this.#S(),this.#C())};#n={};#r=/* @__PURE__ */ new Map;#i;#a=[];#o=!1;#s;#c;#l=``;#u=null;#d;#f;#p=/* @__PURE__ */ new Map;#m;#h;#g=!1;constructor(e,t,n=[]){let r=typeof e==`string`?document.querySelector(e):e;if(!r)throw Error(`@tabler/charts: element "${String(e)}" not found.`);ze.get(r)?.destroy(),ze.set(r,this),this.element=r,this.#e=Te(t),this.id=t.id??ye(),this.#m=r.querySelector(Le),this.#T(),this.#i=ue(r,this.#t);try{for(let e of[...n,...t.type.plugins??[],...t.plugins??[]])this.#a.push(e.install(this));this.render()}catch(e){throw this.destroy(),e}}get config(){return this.#e}get size(){let e=this.#n,t=0;for(let e of this.#a)t+=e.reservedWidth?.()??0;t&&e.width&&(e={...e,width:e.width-t});let{height:n,legend:r}=this.#e,i=Number.isFinite(n)&&typeof r==`object`&&r?.withinHeight===!0,a=0;if(i||n===`container`&&e.height)for(let e of this.#a)a+=e.reservedHeight?.()??0;a&&!i&&(e={...e,height:e.height-a});let o=be(this.#e,e);return i&&(o.height=Math.max(0,o.height-Math.round(a))),o}get rtl(){let e=this.#e;return this.#h===void 0&&(this.#g=e.rtl===`auto`?Re(this.element)?.direction===`rtl`:e.rtl===!0,this.#h=e.fontSize??this.#w()),this.#g}get fontSize(){return this.#d?.fontSize??this.#e.fontSize??12}get interaction(){return this.#s}get active(){return this.#u}get pointer(){let e=this.#c;return this.#u&&e?.kind===`pointer`?{x:e.x,y:e.y}:void 0}get highlightSource(){return this.#u?this.#c?.kind:void 0}highlightIndex(e,t){let n=this.#s?.hitIndex(e,t)??null;return n?(this.#c={kind:`index`,index:e,seriesIndex:t},this.#b(n),n):null}highlightAt(e,t,n){let r=this.hitTest(e,t);return this.#c={kind:`pointer`,x:e,y:t},this.#b(r,n),r}clearHighlight(e){this.#c=void 0,this.#b(null,e)}toggleSeries(e,t){let{items:n}=Oe(this.#e),r=typeof e==`number`?n.find(t=>t.index===e):n.find(t=>t.key===e)??n.find(t=>t.name===e);if(!r)return this;let i=t??!this.#x(n).has(r.key);return this.#p.set(r.key,i),this.emit(`legend-toggle`,{key:r.key,name:r.name,index:r.index,hidden:i}),this.#C(),this}isHidden(e){return this.#x(Oe(this.#e).items).has(e)}update(e){this.#e=Te({...this.#e,...e});for(let t in e)t!==`data`&&(this.#h=void 0);return this.#C(),this}setConfig(e){return this.#e=Te(e),this.#h=void 0,this.#C(),this}setData(e){return this.update({data:e})}resize(){return this.#o||(this.#i=ue(this.element,this.#t)),this.#T(),this.#h=void 0,this.#C(),this}render(){if(this.#o)return this;he(this);let e=this.#e,t=e;Ee(t);let n=Oe(e),r=this.#x(n.items);for(let e of this.#a)e.beforeRender?.({config:t,legend:n,hidden:r});let i=this.size,{content:a,stale:o,changed:s}=this.#_(i,r);o&&this.#v();let c=this.#m;C(this.element,this.#y(a,i),c),this.#m=null,c&&this.#S();for(let e of this.#a)e.afterRender?.({config:t,legend:n,hidden:r,size:i,stale:o,changed:s});return o&&this.emit(`render`,{size:i}),this}#_(e,n){let r=this.#e,i=[...n].sort().join(`\0`),a=this.rtl,o=r.fontSize??this.#h,s=this.#d,c=!s||s.cfg!==r||s.hidden!==i,l=c||s?.width!==e.width||s.height!==e.height||s.fontSize!==o||s.rtl!==a;if(!s||l){r.type.sweep&&(t.sweep=r.type.sweep);let{content:c,interaction:l}=Ce(r,we(r,{size:e,id:this.id,hidden:n,fontSize:o,rtl:a}));this.#s=l,s={cfg:r,width:e.width,height:e.height,hidden:i,fontSize:o,rtl:a,content:c,still:je(r,c)},this.#d=s}return{content:s,stale:l,changed:c}}#v(){let e=this.#c;if(!e)return;let t=e.kind===`pointer`?this.hitTest(e.x,e.y):this.#s?.hitIndex(e.index,e.seriesIndex)??null;this.#b(t,void 0,!0,!1)}#y(e,t){let n=this.#e,r=this.#u,i=[],a=[],o;for(let e of this.#a){if(r&&e.layers){let t=e.layers(r,n);i.push(t.under),a.push(t.over)}let t=e.svgAttrs?.(n);t&&(o={...o,...t})}return Me(n,t,this.id,e.still,e.content,i.length?i:void 0,a.length?a:void 0,o,e.rtl)}hitTest(e,t){return this.#s?.hitTest(e,t)??null}on(e,t){let n=this.#r.get(e);return n||(n=/* @__PURE__ */ new Set,this.#r.set(e,n)),n.add(t),()=>{n.delete(t)}}destroy(){if(!this.#o){this.#o=!0,ze.get(this.element)===this&&ze.delete(this.element),he(this),clearTimeout(this.#f),this.#i();for(let e of this.#a)e.destroy?.();this.#r.clear(),C(this.element,null)}}#b(e,t,n=!1,r=!0){let i=s(e);!n&&i===this.#l?e?.cursor&&_e(this.#e)&&e.cursor.position!==this.#u?.cursor?.position&&(this.#u=e,r&&this.#C()):n&&i===``&&this.#l===``||(this.#l=i,this.#u=e,this.emit(`hover`,t?{hit:e,event:t}:{hit:e}),r&&this.#C())}#x(e){let t=/* @__PURE__ */ new Set;for(let n of e)(this.#p.get(n.key)??n.hidden)&&t.add(n.key);return t}#S(){let e=this.element.querySelector(Le);e&&(e.setAttribute(`data-resizing`,``),clearTimeout(this.#f),this.#f=setTimeout(()=>e.removeAttribute(`data-resizing`),200))}#C(){this.#o||V(this,()=>this.render())}#w(){let e=Number.parseFloat(Re(this.element)?.getPropertyValue(`--tc-font-size`)??``);return Number.isFinite(e)&&e>0?e:void 0}#T(){let e=this.element,t=Re(e),n=e=>Number.parseFloat(e??``)||0;this.#n={width:e.clientWidth-n(t?.paddingLeft)-n(t?.paddingRight),height:e.clientHeight-n(t?.paddingTop)-n(t?.paddingBottom)}}emit(e,t){let n=this.#r.get(e);if(n)for(let e of n)e(t)}};function Ve(e,t=0){let n=n=>{let r=typeof e==`number`?e:e?.[n];return Number.isFinite(r)?r:t};return{top:n(`top`),right:n(`right`),bottom:n(`bottom`),left:n(`left`)}}let He=(e,t)=>t?{...e,left:e.right,right:e.left}:e;function Ue(e,t,n){return{x:n.left,y:n.top,width:Math.max(0,e-n.left-n.right),height:Math.max(0,t-n.top-n.bottom)}}function We(e,t,n){let{width:r,height:i,rtl:a}=e,o=Ve(t),s=n({...o,start:a?o.right:o.left,end:a?o.left:o.right}),c=Ue(r,i,{...s,left:a?s.end:s.start,right:a?s.start:s.end}),l=c.x+c.width;return{area:c,side:a?`right`:`left`,range:(e=a)=>e?[l,c.x]:[c.x,l]}}let Ge=e=>e>=4352&&(e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=127744);function Ke(e){return e>=`0`&&e<=`9`?e===`1`?.45:.63:" !'.,:;|ijlI`".includes(e)?.27:`()[]{}-/frt`.includes(e)?.38:`%@MWmw`.includes(e)?.88:`CDGHNOQU`.includes(e)?.76:e>=`A`&&e<=`Z`?.66:.57}function H(e,t){let n=0;for(let t=0;t<e.length;t++){let r=e.codePointAt(t);n+=qe[r]??(Ge(r)?1:.57),r>65535&&t++}return n*t}let qe=/* @__PURE__ */ Array.from({length:128},(e,t)=>Ke(String.fromCharCode(t))),U=e=>Math.round(e*100)/100,W=1.25,Je=`http://www.w3.org/2000/svg`,Ye={fill:`rgb(0, 0, 0)`,"fill-opacity":`1`,stroke:`none`,"stroke-width":`1px`,"stroke-opacity":`1`,"stroke-dasharray":`none`,"stroke-dashoffset":`0px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"paint-order":`normal`,"shape-rendering":`auto`,"vector-effect":`none`,opacity:`1`,visibility:`visible`},Xe={...Ye,"font-family":``,"font-size":``,"font-weight":`400`,"font-style":`normal`,"font-variant-numeric":`normal`,"letter-spacing":`normal`},Ze={"stop-color":``,"stop-opacity":`1`},Qe={opacity:`1`},$e=/* @__PURE__ */ new Set([`path`,`line`,`rect`,`circle`,`ellipse`,`polygon`,`polyline`]);function et(e){let t=`element`in e&&!(e instanceof Element)?e.element:e,n=t.localName===`svg`?t:t.querySelector(`:scope > svg.tc-chart`);if(!n)throw Error(`@tabler/charts: no rendered chart to export.`);return n}function tt(e){let t=e.transform;if(!t||t===`none`)return;let n=t.replace(/px/g,``);if(n.startsWith(`translate`))return n;let[r=0,i=0]=(e.transformOrigin||`0 0`).split(` `).map(Number.parseFloat);return r||i?`translate(${r} ${i}) ${n} translate(${-r} ${-i})`:n}function nt(e,t){let n=getComputedStyle(e);if(n.display===`none`)return!1;let r=e.localName,i=r===`text`?Xe:r===`stop`?Ze:$e.has(r)?Ye:Qe,a=[];for(let e in i){let t=n.getPropertyValue(e);t&&t!==i[e]&&a.push(`${e}:${t}`)}t.removeAttribute(`style`),a.length&&t.setAttribute(`style`,a.join(`;`));let o=tt(n);o&&t.setAttribute(`transform`,o);let s=Array.from(e.children),c=Array.from(t.children);return s.forEach((e,t)=>{let n=c[t];(e.classList.contains(`tc-hover-layer`)||!nt(e,n))&&n.remove()}),!0}function rt(e){let t=e.querySelector(`:scope > .tc-legend`),n=t?Array.from(t.querySelectorAll(`.tc-legend-item`)):[];if(!t||!n.length)return;let r=e.ownerDocument,i=e.querySelector(`:scope > svg.tc-patterned`),a=t.getBoundingClientRect(),o=r.createElementNS(Je,`g`);for(let e of n){let t=e.querySelector(`.tc-legend-swatch`),n=e.querySelector(`.tc-legend-name`);if(!t||!n)continue;let s=t.getBoundingClientRect(),c=n.getBoundingClientRect(),l=getComputedStyle(t).getPropertyValue(`--tc-series-color`).trim(),u=/\btc-series-([1-8])\b/.exec(e.getAttribute(`class`)??``)?.[1]??`other`,d=i?getComputedStyle(i).getPropertyValue(`--tc-pattern-${u}`).trim():``,f=e.classList.contains(`tc-legend-item-hidden`),p=r.createElementNS(Je,`circle`);p.setAttribute(`cx`,String(U(s.left-a.left+s.width/2))),p.setAttribute(`cy`,String(U(s.top-a.top+s.height/2))),p.setAttribute(`r`,String(U(s.width/2-(f?.75:0)))),p.setAttribute(`style`,f?`fill:none;stroke:${l};stroke-width:1.5px`:`fill:${d.startsWith(`url(`)?d:l}`);let m=getComputedStyle(n),h=r.createElementNS(Je,`text`);h.setAttribute(`x`,String(U(c.left-a.left))),h.setAttribute(`y`,String(U(c.top-a.top+c.height/2))),h.setAttribute(`dy`,`0.35em`),h.setAttribute(`style`,`fill:${m.color};font-family:${m.fontFamily};font-size:${m.fontSize};font-weight:${m.fontWeight}`),h.textContent=n.textContent,o.append(p,h)}return{svg:o,box:a}}function it(e,t={}){let n=et(e);for(let e of n.getAnimations?.({subtree:!0})??[])e.finish();let r=n.cloneNode(!0);nt(n,r);let i=n.ownerDocument,a=Number(n.getAttribute(`width`)),o=Number(n.getAttribute(`height`));r.setAttribute(`xmlns`,Je),r.removeAttribute(`class`),r.removeAttribute(`tabindex`),r.removeAttribute(`data-resizing`),r.removeAttribute(`aria-describedby`),r.removeAttribute(`aria-activedescendant`);let s=getComputedStyle(n),c=n.parentElement,l=t.legend!==!1&&c?rt(c):void 0,u=a,d=o;if(l){let{box:e}=l,t=n.getBoundingClientRect(),s=Math.min(t.left,e.left),c=Math.min(t.top,e.top),f=i.createElementNS(Je,`g`);f.append(...Array.from(r.childNodes));let p=(e,t,n)=>{(t||n)&&e.setAttribute(`transform`,`translate(${U(t)} ${U(n)})`)};p(f,t.left-s,t.top-c),p(l.svg,e.left-s,e.top-c),r.append(f,l.svg),u=U(Math.max(t.left+a,e.right)-s),d=U(Math.max(t.top+o,e.bottom)-c)}r.setAttribute(`width`,String(u)),r.setAttribute(`height`,String(d)),r.setAttribute(`viewBox`,`0 0 ${u} ${d}`);let f=n.getAttribute(`aria-label`);if(f){let e=i.createElementNS(Je,`title`);e.textContent=f,r.prepend(e)}let p=t.background===void 0||t.background===`auto`?s.getPropertyValue(`--tc-surface`).trim()||void 0:t.background||void 0;if(p){let e=i.createElementNS(Je,`rect`);e.setAttribute(`width`,`100%`),e.setAttribute(`height`,`100%`),e.setAttribute(`fill`,p),r.insertBefore(e,r.querySelector(`:scope > title`)?.nextSibling??r.firstChild)}return new XMLSerializer().serializeToString(r)}async function at(e,t={}){let{type:n=`image/png`,scale:r=2,quality:i}=t,a=it(e,{...t,...n===`image/jpeg`&&t.background===!1?{background:`#fff`}:{}}),o=et(e).ownerDocument,s=new Image;s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(a)}`,await s.decode();let c=o.createElement(`canvas`);c.width=Math.round(s.width*r),c.height=Math.round(s.height*r);let l=c.getContext(`2d`);if(!l)throw Error(`@tabler/charts: no 2d canvas to draw the image.`);return l.drawImage(s,0,0,c.width,c.height),new Promise((e,t)=>{c.toBlob(n=>n?e(n):t(/* @__PURE__ */ Error(`@tabler/charts: could not encode.`)),n,i)})}function ot(e){let{config:t,interaction:n}=e,{data:r,x:i}=t,a=r?.series;if(!n||!Array.isArray(a)||!a.every(e=>Array.isArray(e?.values)))return;let o=Array.from({length:n.count},(e,t)=>n.hitIndex(t)),s=/* @__PURE__ */ new Map;for(let e of o)for(let t of e?.items??[])s.set(t.seriesIndex,t.name);let c=[...s.keys()].sort((e,t)=>e-t),l=[[``,...c.map(e=>s.get(e))]];for(let e of o){if(!e)continue;let t=r?.labels?.[e.index],n=t instanceof Date?t:i?.type===`time`&&typeof e.label==`number`&&new Date(e.label);l.push([n&&Number.isFinite(n.getTime())?n.toISOString():String(e.label),...c.map(t=>{let n=e.items.find(e=>e.seriesIndex===t)?.value;return n==null?``:String(n)})])}return l}function st(e){let{config:t}=e,n=Se(t),r=new Set((t.type.legend?.(n)??[]).map(e=>e.key).filter(t=>e.isHidden(t))),i=t.type.table?.(n,{locale:t.locale,hidden:r,rtl:e.rtl},1/0);if(!i)throw Error(`@tabler/charts: this chart type has no data for a CSV.`);return[i.columns,...i.rows]}function ct(e,t={}){if(!e?.config?.type)throw Error(`@tabler/charts: exportCSV() takes the chart, not its element.`);let n=t.delimiter??`,`,r=e=>{let t=/^[=+\-@\t\r]/.test(e)&&!Number.isFinite(Number(e))?`'${e}`:e;return t.includes(n)||/["\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t};return(ot(e)??st(e)).map(e=>e.map(r).join(n)).join(`\r
2
+ `)}async function lt(e,t={}){let{format:n=`png`}=t,r=et(e),i=n===`csv`?new Blob([`${ct(e,t)}`],{type:`text/csv;charset=utf-8`}):n===`svg`?new Blob([it(e,t)],{type:`image/svg+xml`}):await at(e,{...t,type:`image/${n}`}),a=(t.filename??r.getAttribute(`aria-label`)??`chart`).replace(/[\\/:*?"<>|]+/g,``).trim(),o=r.ownerDocument.createElement(`a`);o.href=URL.createObjectURL(i),o.download=`${a||`chart`}.${n===`jpeg`?`jpg`:n}`,o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)}n({export:lt});let ut=/* @__PURE__ */ new Map,dt=/* @__PURE__ */ new Map;function ft(e,t,n){let r=e.get(t);return r===void 0&&(e.size>=64&&e.clear(),r=n(),e.set(t,r)),r}function pt(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function G(e,t={}){return ft(ut,pt(e,t),()=>new Intl.NumberFormat(e,t))}function mt(e,t={}){return ft(dt,pt(e,t),()=>new Intl.DateTimeFormat(e,t))}let ht=e=>e===0?0:e;function K(e,t){if(typeof e==`function`)return e;let{compactSymbols:n,...r}=e??{};if(n)return _t(n===!0?gt:n,r,t);let i=G(t,r);return e=>i.format(ht(e))}let gt=[`K`,`M`,`B`,`T`];function _t(e,{notation:t,compactDisplay:n,...r},i){let a=yt(r),o=G(i,a?r:{...r,maximumSignificantDigits:2}),s=a?o:G(i,{...r,maximumFractionDigits:0});return t=>{for(let n=0;;n++){let r=ht(t/1e3**n),i=(Math.abs(r)<10?o:s).formatToParts(r),a=``,c;for(let e of i)e.type===`integer`&&(a+=e.value),(e.type===`integer`||e.type===`fraction`)&&(c=e);if(a.length<4||n>=e.length)return n&&c&&(c.value+=e[n-1]),i.map(e=>e.value).join(``)}}}let vt=e=>e.notation===`compact`||!!e.compactSymbols,yt=e=>(e.minimumFractionDigits??e.maximumFractionDigits??e.minimumSignificantDigits??e.maximumSignificantDigits)!==void 0;function bt(e,t){return K(typeof e==`object`&&vt(e)&&!yt(e)?{...e,maximumSignificantDigits:3}:e,t)}function xt(e){let t=Math.abs(e);return!Number.isFinite(t)||t===0?0:Math.max(0,-Math.floor(Math.log10(t)+1e-9))}function St(e){return yt(e)||!!e.compactSymbols||(e.notation??`standard`)!==`standard`}function Ct(e,t,n){if(typeof t==`function`)return t;let r=t??{};if(St(r))return K(r,n);let i=xt(e);r.style===`percent`&&(i=Math.max(0,i-2));let a=K({...r,minimumFractionDigits:i,maximumFractionDigits:i},n),o=Math.abs(e)*1e-9;return e=>a(Math.abs(e)<o?0:e)}function wt(e,t){if(typeof e==`function`)return t=>e(typeof t==`number`?new Date(t):t);let n=mt(t,e);return e=>n.format(e)}let Tt=Math.sqrt(50),Et=Math.sqrt(10),Dt=Math.sqrt(2);function Ot(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Tt?10:a>=Et?5:a>=Dt?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&n>=.5&&n<2?Ot(e,t,n*2):[s,c,l]}function kt(e,t,n=5){if(!(n>0)||!Number.isFinite(e)||!Number.isFinite(t))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?Ot(t,e,n):Ot(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);for(let e=0;e<s;e++){let t=r?a-e:i+e;c[e]=o<0?t/-o:t*o}return c}function At(e,t,n){return Ot(e,t,n)[2]}function jt(e,t,n=5){let r=t<e,i=r?At(t,e,n):At(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Mt(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||e===t||!(n>0))return[e,t];let r=t<e,i=r?t:e,a=r?e:t,o;for(let e=0;e<10;e++){let e=At(i,a,n);if(e===o)return r?[a,i]:[i,a];if(e>0)i=Math.floor(i/e)*e,a=Math.ceil(a/e)*e;else if(e<0)i=Math.ceil(i*e)/e,a=Math.floor(a*e)/e;else break;o=e}return[e,t]}function Nt(e,t={}){let{count:n=5,format:r,locale:i}=t,[a,o]=e.domain,s=Ct(jt(a,o,n),r,i);return e.ticks(n).map(t=>({value:t,position:e(t),label:s(t)}))}function Pt(e,t=String){return e.domain.map((n,r)=>({value:n,position:e.at(r)+e.bandwidth/2,label:t(n,r)}))}let Ft=e=>e===`top`||e===`bottom`;function It(e,t,n,r=8){if(e.length<2)return e.slice();let i=e.map(e=>Ft(t)?H(e.label,n):n*W),a=(t,n)=>Math.abs(e[n].position-e[t].position)>=(i[t]+i[n])/2+r,o=e.length-1,s=Math.abs(e[o].position-e[0].position),c=i.reduce((e,t)=>e+t+r,0),l=s>0?Math.max(1,Math.floor(c/s)):o;for(let t=l;t<=o;t++){let n=!0;for(let e=t;e<=o&&n;e+=t)n=a(e-t,e);if(!n)continue;let r=[];for(let e=0;e<=o;e+=t)r.push(e);let i=r[r.length-1];return i!==o&&(a(i,o)?r.push(o):r.length>1&&a(r[r.length-2],o)&&(r[r.length-1]=o)),r.map(t=>e[t])}return e.slice(0,1)}function q(e,t,n,r={}){let{tickSize:i=0,tickPadding:a=8,rotate:o}=r;if(t.length===0)return 0;let s=Ft(e)&&!o?n*W:t.reduce((e,t)=>Math.max(e,H(t.label,n)),0)+3;return Math.ceil(s+i+a)}let Lt=(e,t)=>e?Math.ceil(t*W)+6:0;function Rt(e,t,n,r,i,a){let o=q(e,t,i,{rotate:a})+6,s=e===`left`?-1:1,c=o+i*W/2;return l(`text`,{key:`axis-title-${e}`,class:`tc-axis-title tc-axis-title-${e}`,transform:e===`bottom`?`translate(${U(n.x+n.width/2)},${U(n.y+n.height+o)})`:`translate(${U(e===`left`?n.x-c:n.x+n.width+c)},${U(n.y+n.height/2)}) rotate(${s*90})`,dy:e===`bottom`?`0.71em`:`0.32em`,"text-anchor":`middle`,"aria-hidden":`true`},r)}function zt(e){let{position:t,ticks:n,area:r,tickSize:i=0,tickPadding:a=8,line:o=!1,rotate:s}=e,c=Ft(t),u=t===`top`||t===`left`?-1:1,d=u*(i+a),f=t===`top`?r.y:t===`bottom`?r.y+r.height:t===`left`?r.x:r.x+r.width,p=s?{transform:`rotate(-90)`,x:-d,dy:`0.32em`,"text-anchor":`end`}:c?{y:d,dy:t===`top`?`0em`:`0.71em`,"text-anchor":`middle`}:{x:d,dy:`0.32em`,"text-anchor":t===`left`?`end`:`start`},m=c?{y2:u*i}:{x2:u*i};return l(`g`,{key:`axis-${t}`,class:[`tc-axis`,c?`tc-axis-x`:`tc-axis-y`,`tc-axis-${t}`],"aria-hidden":`true`},o&&l(`line`,c?{class:`tc-axis-line`,x1:r.x,x2:r.x+r.width,y1:f,y2:f}:{class:`tc-axis-line`,x1:f,x2:f,y1:r.y,y2:r.y+r.height}),n.map(e=>l(`g`,{key:e.value,class:`tc-tick`,style:c?`transform:translate(${U(e.position)}px,${U(f)}px)`:`transform:translate(${U(f)}px,${U(e.position)}px)`},i>0&&l(`line`,{class:`tc-tick-line`,...m}),l(`text`,{class:`tc-tick-label`,...p},e.label))))}function Bt(e){let{direction:t,ticks:n,area:r}=e;return l(`g`,{key:`grid-${t}`,class:[`tc-grid`,`tc-grid-${t}`],"aria-hidden":`true`},n.map(e=>{let n=U(e.position);return l(`line`,{key:e.value,class:[`tc-grid-line`,e.value===0&&`tc-grid-line-zero`],...t===`y`?{x1:r.x,x2:r.x+r.width,y1:0,y2:0,style:`transform:translateY(${n}px)`}:{x1:0,x2:0,y1:r.y,y2:r.y+r.height,style:`transform:translateX(${n}px)`}})}))}function Vt(e,t,n={}){let{paddingInner:r=0,paddingOuter:i=0,align:a=.5}=n,o=Math.min(1,Math.max(0,r)),s=e.length,[c,l]=t,u=l<c,d=u?l:c,f=u?c:l,p=(f-d)/Math.max(1,s-o+i*2),m=d+(f-d-p*(s-o))*a,h=p*(1-o),g=/* @__PURE__ */ new Map;for(let t=0;t<s;t++){let n=e[t];g.has(n)||g.set(n,t)}let _=e=>m+p*(u?s-1-e:e),v=e=>{let t=g.get(e);return t===void 0?void 0:_(t)};return Object.assign(v,{domain:e.slice(),range:[c,l],bandwidth:h,step:p,at:_,center(e){let t=v(e);return t===void 0?void 0:t+h/2},indexAt(e){if(s===0)return-1;let t=p===0?0:Math.round((e-m-h/2)/p),n=Math.min(s-1,Math.max(0,t));return u?s-1-n:n}})}function Ht(e,t,n={}){let{padding:r=0,align:i}=n;return Vt(e,t,{paddingInner:1,paddingOuter:r,...i===void 0?{}:{align:i}})}function Ut(e){let t=1/0,n=-1/0;for(let r of e)r!=null&&Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t<=n?[t,n]:void 0}function Wt(e,t,n={}){let[r,i]=e,[a,o]=t,s=i-r,c=s===0?0:(o-a)/s,l=(a+o)/2,{clamp:u=!1}=n,d=Math.min(a,o),f=Math.max(a,o),p=Math.min(r,i),m=Math.max(r,i);return Object.assign(e=>{if(s===0)return l;let t=a+(e-r)*c;return u?Math.min(f,Math.max(d,t)):t},{domain:[r,i],range:[a,o],invert(e){if(s===0||o===a)return r;let t=r+(e-a)/c;return u?Math.min(m,Math.max(p,t)):t},ticks(e){return kt(r,i,e)},nice(e){return Wt(Mt(r,i,e),t,n)}})}let J=e=>typeof e==`number`&&Math.abs(e)<=1e300?Math.abs(e)<1e-300?0:e:null,Gt=e=>J(e)??void 0,Y=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Kt=e=>Array.isArray(e)?e:[],qt=e=>typeof e==`string`?e:J(e)===null?``:String(e),Jt=e=>typeof e==`string`||J(e instanceof Date?+e:e)!==null?e:``,Yt=e=>{let t=Kt(e);return t.every(e=>e==null||J(e)===e)?t:t.map(J)},Xt=(e,t)=>Kt(e).filter(Y).map(t),Zt=e=>({...e,name:qt(e.name),id:typeof e.id==`string`?e.id:void 0,color:typeof e.color==`string`?e.color:void 0}),Qt=e=>{let t=Y(e)?e:{};return{...t,labels:Array.isArray(t.labels)?t.labels.map(Jt):void 0,series:Xt(t.series,e=>({...Zt(e),values:Yt(e.values)}))}},$t=e=>t=>({...t,data:e(t.data)}),en=e=>Xt(e,e=>({...Zt(e),value:J(e.value)??0,max:Gt(e.max)})),X=e=>e.id??e.name;function tn(e){return e.map((e,t)=>{let n={key:X(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}function nn(e,t){return{key:X(e),class:[`tc-series`,`tc-series-${t+1}`,e.class],"data-series":e.name,style:{"--tc-series-color":e.color}}}let Z=e=>e instanceof Date?e.getTime():e,rn=e=>e.view||e.zoom?o(`zoom`).window(e):e,Q=X,an=e=>e.orientation!==`horizontal`&&e.data.series.some(e=>e.axis===`y2`);function on(e){let t=an(e),n={second:!1,axis:e.y??{}},r={second:!0,axis:e.y2??{}};return e=>t&&e?.axis===`y2`?r:n}let sn=(e,t)=>e.y2&&t?.axis===`y2`?e.y2:e.y,cn=e=>tn(e.series);function ln(e){if(e.labels)return e.labels.slice();let t=Math.max(0,...e.series.map(e=>e.values.length));return Array.from({length:t},(e,t)=>t+1)}function un(e,t){return e==null||!Number.isFinite(e)?!1:t?.scale!==`log`||e>0}let dn=e=>e.x?.type===`time`&&ln(e.data).every(e=>Number.isFinite(pn(e)));function fn(e,t){return e.x?.format?e.x.format:dn(e)?o(`dates`)(ln(e.data),e.x?.utc,t.locale):e=>String(e)}let pn=e=>new Date(e).getTime();function mn(e,t,n){return n.scale===`log`?o(`log`).scale(e,t):Wt(e,t)}function hn(e,t,n,r,i){return t.scale===`log`?o(`log`).ticks(e,n,r,i):Nt(e,{count:n,format:r,locale:i})}let gn=e=>{let{shapes:n,patterns:r}=e;return n??r===!0?t[`point-shapes`]:void 0};function _n(e,t,n,r,i,a,o){return e?l(`path`,{key:n,class:[r,`tc-marker`],d:e(t,i,a,o)}):l(`circle`,{key:n,class:r,cx:i,cy:a,r:o})}let vn=(e,t)=>Math.min(J(e?.ticks)??t,100);function yn(e,t,n,r,i=/* @__PURE__ */ new Set,a,o=[]){let s=a??e.series.filter(e=>!i.has(Q(e))).flatMap(e=>e.values);return bn(o.length?[...s,...o]:s,t,n,r)}function bn(e,t,n,r){if(t.scale===`log`)return o(`log`).domain(e,t);let i=J(t.min),a=J(t.max),[s,c]=Ut(e)??[0,1];if((t.zero??n)&&(s=Math.min(s,0),c=Math.max(c,0)),s===c){if(s===0)c=1;else{let e=Math.abs(s)*.1;s-=e,c+=e}}if(i!==null&&(s=i),a!==null&&(c=a),t.nice!==!1){let[e,t]=Mt(s,c,r);i===null&&(s=e),a===null&&(c=t)}return[s,c]}function xn(e){return e.annotations?.length?o(`annotations`):void 0}function Sn(e,t,n,r,i){let a=i===`y2`,o=(a?e.y2:e.y)??{},s=vn(o,Math.max(2,r)),c;if(a){let r=e.data.series.filter(e=>e.axis===`y2`),i=r.filter(e=>!t.hidden.has(Q(e)));c=bn((i.length?i:r).flatMap(e=>e.values),o,n.zero2??n.zero,s)}else c=yn(i===`y`?{...e.data,series:e.data.series.filter(e=>e.axis!==`y2`)}:e.data,o,n.zero,s,t.hidden,n.values,xn(e)?.values(e.annotations));let l=a?o.format:n.tickFormat??o.format,u=e=>mn(c,e,o),d=e=>hn(e,o,s,l,t.locale);return{scale:u,ticks:d,probe:d(u([0,1]))}}function Cn(e,t,n,r,i,a,o){let{area:s,x:c,y:l,xTicks:u,yTicks:d,y2Ticks:f,horizontal:p}=i,m=e.x??{},h=wn(e,!p&&!o&&m.show!==!1),g=n===`left`?`right`:`left`,_=xn(e)?.layers(e.annotations,{area:s,horizontal:p,fontSize:t.fontSize,value:l,band:c,keys:a,time:o}),v=e.y?.show!==!1&&[zt({position:p?`bottom`:n,ticks:d,area:s})],y=(m.show!==!1&&i.labels.length>0||m.line)&&[zt({position:p?n:`bottom`,ticks:u,area:s,line:m.line===!0,rotate:h})],b=!!f&&e.y2?.show!==!1&&[zt({position:g,ticks:f,area:s})],x=(e,n,r)=>!!e&&Rt(n,r||[],s,e,t.fontSize,n===`bottom`&&h),S=[x(e.y?.title,p?`bottom`:n,!!v&&d),x(m.title,p?n:`bottom`,u),!!f&&x(e.y2?.title,g,!!b&&f)],C=e=>e.flatMap(e=>e||[]);return{...i,background:C([e.y?.grid!==!1&&Bt({direction:p?`x`:`y`,ticks:d,area:s}),m.grid&&Bt({direction:p?`y`:`x`,ticks:u,area:s}),_?.under]),foreground:C([_?.over,p?y:v,p?v:y,b,...S]),clip:En(t,s,r)}}let wn=(e,t)=>t&&e.x?.rotate===!0;function Tn(e,t,n){let{data:r}=e,i=e.y??{},a=e.x??{},{fontSize:s,locale:c,width:l,height:u}=t,d=n.overhang??0,f=t.rtl===!0,p=a.reverse??f,m=ln(r),h=fn(e,t),g=i.show!==!1,_=a.show!==!1&&m.length>0,v=dn(e)&&n.scale===`point`,y=Math.round(u/60),b=an(e),x=Sn(e,t,n,y,b?`y`:void 0),S=x.probe,C=e.y2??{},w=b?Sn(e,t,n,y,`y2`):null,T=!!w&&C.show!==!1,E=Math.max(2,Math.round(l/80)),D=m.map(Z),O=e=>h(m[e],e),k=v?o(`time`).axis(m,D,a,E,c):{edges:m.length?[O(0),O(m.length-1)]:[],scale:e=>n.scale===`point`?Ht(D,e):Vt(D,e,{paddingInner:n.paddingInner??.3,paddingOuter:n.paddingOuter??.15}),ticks:e=>Pt(e,(e,t)=>O(t))},A=k.edges,j=wn(e,_&&!v),M=j?m.map((e,t)=>({value:t,position:0,label:O(t)})):[],N=Math.ceil(s*W/2),P=e=>j?s*W:_?H(A[e?A.length-1:0]??``,s):0,F=P(p!==f),I=P(p===f),L=n.scale===`point`,R=(g?q(`left`,S,s):0)+Lt(i.title,s),ee=w?(T?q(`right`,w.probe,s):0)+Lt(C.title,s):0,{area:z,side:te,range:ne}=We(t,e.padding,e=>{let t=t=>{let n=e=>L?Math.ceil(e/2):Math.max(0,Math.ceil(e/2-t));return{start:e.start+Math.max(R,n(F),d,g?0:8),end:e.end+Math.max(ee,n(I),d,8)}},n=Math.max(1,m.length)*2,r=t((l-e.start-e.end-R-ee)/n);return L||(r=t((l-r.start-r.end)/n)),{top:e.top+Math.max(g||T?N:0,d,4),bottom:e.bottom+Math.max((j?q(`bottom`,M,s,{rotate:j}):_?q(`bottom`,[S[0]],s):g?N:0)+Lt(a.title,s),d,4),...r}}),re=k.scale(ne(p)),ie=x.scale([z.y+z.height,z.y]),ae=w?.scale([z.y+z.height,z.y]),oe=It(x.ticks(ie),`left`,s,4),se={area:z,labels:m,x:re,y:ie,horizontal:!1,xTicks:_?j?It(k.ticks(re),`left`,s/W,2):It(k.ticks(re),`bottom`,s):[],yTicks:oe};return w&&ae&&(se.y2=ae,se.y2Ticks=It(w.ticks(ae),`right`,s,4)),Cn(e,t,te,d,se,D,k.time)}function En(e,t,n){let r=`${e.id}-clip`,i=n+1;return{def:l(`clipPath`,{id:r},l(`rect`,{x:t.x-i,y:t.y-i,width:t.width+i*2,height:t.height+i*2})),url:`url(#${r})`}}function Dn(e,t){let{dash:n,width:r}=e;return{...nn(e,t),style:{"--tc-series-color":e.color,"--tc-series-dash":Number.isFinite(n)?`${n}px`:n,"--tc-series-width":Number.isFinite(r)?`${r}px`:void 0}}}function On(e,t,n,r,i){let{area:a,x:o,labels:s,horizontal:c}=e,{data:l}=t,u=fn(t,n),d=on(t),f=l.series.map(e=>d(e).axis),p=f.map(e=>bt(e.format,n.locale)),m=t.y??{},[h,g]=e.y.domain,[_,v]=e.y.range,y=m.scale===`log`||_===v?bt(m.format,n.locale):Ct(Math.abs((g-h)/(v-_)),m.format,n.locale),b=(t,r)=>{let i=c?t:r,a=Math.min(_,v),o=Math.max(_,v),s=e.y.invert(i);if(i<a||i>o||!Number.isFinite(s))return;let l={value:s,text:y(s),position:i,side:c?`bottom`:n.rtl?`right`:`left`};return m.show===!1&&(l.inside=!0),l},x=e=>{let t=o.at(e),i=t+o.bandwidth/2,d=s[e],m=c?{x:a.x,y:i}:{x:i,y:null},h=[];l.series.forEach((t,i)=>{if(n.hidden.has(Q(t)))return;let a=t.values[e],o=un(a,f[i])?a:null,s=o===null?m:r(i,e,o),c={name:t.name,seriesIndex:i,value:o,text:o===null?`–`:p[i](o),...s};t.color&&(c.color=t.color),h.push(c)});let g={index:e,label:Z(d),title:u(d,e),x:c?a.x+a.width/2:i,area:a,items:h};return c&&(g.y=i,g.axis=`y`),o.bandwidth>0&&(g.highlight=c?{kind:`band`,x:a.x,y:t,width:a.width,height:o.bandwidth}:{kind:`band`,x:t,y:a.y,width:o.bandwidth,height:a.height}),g};return{count:s.length,reversed:o.range[1]<o.range[0],hitTest(e,t){if(s.length===0||e<a.x-8||e>a.x+a.width+8||t<a.y-8||t>a.y+a.height+8)return null;let n=o.indexAt(c?t:e),r=x(n),l=i?.(e,t,n);l!==void 0&&(r.seriesIndex=l);let u=b(e,t);return u&&(r.cursor=u),r},hitIndex(e,t){if(e<0||e>=s.length)return null;let n=x(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}}}function kn(e,t,n=1/0){let r=ln(e.data),i=r.length>n?r.slice(0,n):r,a=fn(e,t),o=on(e),s=e.data.series.filter(e=>!t.hidden.has(Q(e))),c=s.map(e=>bt(o(e).axis.format,t.locale));return{columns:[``,...s.map(e=>e.name)],total:r.length,rows:i.map((e,t)=>[a(e,t),...s.map((e,n)=>{let r=e.values[t];return r==null||!Number.isFinite(r)?`–`:c[n](r)})])}}let An=e=>Array.isArray(e)?e.length:ln(e).length;function jn(e,t){let n=Math.max(0,t-1),r=(e,t)=>Math.min(n,Math.max(t,Math.round(e))),i=r(J(e?.start)??0,0);return[i,r(J(e?.end)??n,i)]}function Mn(e){let{data:t,view:n,x:r}=e,[i,a]=jn(n,An(t));if(i===0&&a>=An(t)-1)return e;let o=e=>e.slice(i,a+1),s={...e},c=r?.format;if(c&&(s.x={...r,format:(e,t)=>c(e,t+i)}),Array.isArray(t))return s.data=o(t),s;let l=t,u=ln(l),d=u.map(Z);return s.data={...l,labels:o(u),series:l.series.map(e=>{let t={...e,values:o(e.values)},n=e.dashFrom==null?-1:d.indexOf(Z(e.dashFrom));return n>=0&&n<i&&(t.dashFrom=u[i]),t})},s}let Nn=/* @__PURE__ */ new Set([`line`,`area`,`bar`,`candlestick`]),Pn=`http://www.w3.org/2000/svg`;function Fn(e){let t=e.element,n=()=>t.querySelector(`:scope > svg.tc-chart`),r=()=>{let t=e.interaction,n=t?.hitIndex(0);if(!n||!t)return;let r=n.axis===`y`,i=e=>r?e.y:e.x,a=t.count-1,o=t.hitIndex(a),s=o&&a>0&&Math.abs(i(o)-i(n))/a||(r?n.area.height:n.area.width)||1;return{area:n.area,vertical:r,reversed:!!t.reversed,step:s,at:e=>{let n=t.hitIndex(e);return n?i(n):void 0}}},i=(t,i)=>{let a=n(),o=r()?.area;if(!a||!o)return;let{width:s,height:l}=e.size,u=c(a,t,i,s,l),d=u.x>=o.x&&u.x<=o.x+o.width&&u.y>=o.y&&u.y<=o.y+o.height,f=(e,t,n)=>Math.min(t+n,Math.max(t,e));return{at:[f(u.x,o.x,o.width),f(u.y,o.y,o.height)],inside:d}};return{svg:n,plot:r,locate:i,onPlot:e=>e.target?.closest?.(`svg.tc-chart`)===n()&&!!i(e.clientX,e.clientY)?.inside}}let In=/* @__PURE__ */ new Map,Ln=e=>e.config,Rn=e=>!!Ln(e).brush,zn=e=>Rn(e)?`selection`:`view`,Bn=e=>An(Ln(e).data),Vn=e=>jn(Ln(e)[zn(e)],Bn(e)),Hn=(e,[t,n])=>t===0&&n>=Bn(e)-1,Un=/* @__PURE__ */ new WeakMap,Wn=/* @__PURE__ */ new WeakMap,Gn=e=>Fn(e).plot()?.vertical,Kn=e=>{let{brush:t}=Ln(e);return Nn.has(e.config.type.name)&&(typeof t!=`object`||t.align!==!1)};function qn(e,t){let n=Fn(e).plot()?.area;if(!n)return;let{width:r,height:i}=e.size;return(t?[n.y,i-n.y-n.height]:[n.x,r-n.x-n.width]).map((t,n)=>t-(Wn.get(e)?.[n]??0))}let Jn=/* @__PURE__ */ new WeakMap,Yn=e=>`${zn(e)} ${Vn(e)}`,Xn=/* @__PURE__ */ new WeakMap;function Zn(e){let{data:t}=Ln(e),n=Xn.get(t);return n||(n=(Array.isArray(t)?t.map(e=>e.x):ln(t)).map(Z),Xn.set(t,n)),n}function Qn(e,[t,n]){let[r,i]=Vn(e);if(t===r&&n===i)return;let a=Hn(e,[t,n])?void 0:{start:t,end:n};e.update({[zn(e)]:a})}function $n(e,t,n){if(Hn(e,n))return;let r=Zn(e),i=Zn(t),a=e=>{let t=i.indexOf(r[e]);return t<0?e:t};return jn({start:a(n[0]),end:a(n[1])},i.length)}let er=e=>{let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,{svg:r,plot:i,locate:a,onPlot:o}=Fn(e),s=()=>Nn.has(e.config.type.name),c=()=>s()&&Rn(e),l=()=>{let{brush:t}=Ln(e),n=typeof t==`object`?J(t.min):null;return Math.max(0,Math.min(Bn(e),Math.round(n??2))-1)},u=(t,n)=>{let r=Math.max(0,Bn(e)-1),i=Math.min(r,Math.max(l(),n-t)),a=Math.min(r-i,Math.max(0,t));Qn(e,[a,a+i])},d,f,p=()=>{d?.delete(e),f&&d?.size===0&&In.get(f)===d&&In.delete(f),d=void 0},m=()=>{let t=s()?Ln(e).sync:void 0;t===f&&d||(p(),f=t,t&&(d=In.get(t)??/* @__PURE__ */ new Set,d.add(e),In.set(t,d)))},h=()=>{if(m(),!d)return;let t=Vn(e),n=Yn(e),r=!Jn.has(e);if(n===Jn.get(e))return;Jn.set(e,n);let i=[...d].filter(t=>Rn(t)!==Rn(e));if(r&&Hn(e,t))for(let t of i){let n=$n(t,e,Vn(t));if(n)return Qn(e,n)}else for(let n of i)Qn(n,$n(e,n,t)??[0,Bn(n)-1]),Rn(n)||Jn.set(n,Yn(n))},g=Ln(e).padding,_=g,v;Un.set(e,t=>{let n=Ln(e).padding!==_;if(!t&&(v||n))return;n?(g=Ln(e).padding,_=g,Wn.delete(e)):v&&Wn.set(e,v),v=void 0;let r=Wn.get(e)??[0,0],a=Kn(e)?i()?.vertical:void 0,o=[0,0];if(a!==void 0&&d){let t=[...d].filter(e=>Kn(e)&&Gn(e)===a),n=qn(e,a);if(n&&t.some(Rn)){let e=t.map(e=>qn(e,a));o=n.map((t,n)=>Math.max(0,...e.map(e=>e?e[n]-t:0)))}}if(o.every((e,t)=>Math.abs(e-r[t])<.5))return;v=o;let s=Ve(g),[c,l]=a?[`top`,`bottom`]:[`left`,`right`];_=o.some(Boolean)?{...s,[c]:s[c]+o[0],[l]:s[l]+o[1]}:g,e.update({padding:_})});let y,b=()=>{y?.[0].remove(),y=void 0},x=()=>{let t=r(),a=i();if(!c()||!t||!a){b();return}if(!y){let e=e=>{let t=n.createElementNS(Pn,`rect`);return t.setAttribute(`class`,e),t},t=n.createElementNS(Pn,`g`);t.setAttribute(`class`,`tc-brush`),y=[t,e(`tc-brush-selection`),e(`tc-brush-handle`),e(`tc-brush-handle`)],t.append(y[1],y[2],y[3])}y[0].parentNode!==t&&t.append(y[0]);let[o,s]=Vn(e),l=a.vertical?a.area.y:a.area.x,u=a.vertical?a.area.height:a.area.width,d=e=>Math.min(l+u,Math.max(l,e)),f=a.at(o)??l,p=a.at(s)??l+u,m=d(Math.min(f,p)-a.step/2),h=d(Math.max(f,p)+a.step/2),g=(e,t,n)=>{let r=a.vertical?{x:a.area.x,y:t,width:a.area.width,height:n}:{x:t,y:a.area.y,width:n,height:a.area.height};for(let[t,n]of Object.entries(r))e.setAttribute(t,`${n}`)};g(y[1],m,h-m);let _=f<=p?[m,h]:[h,m];g(y[2],_[0]-3,6),g(y[3],_[1]-3,6)},S,C,w=!1,T=([t,n])=>e.interaction?.hitTest(t,n)?.index,E=e=>{e.pointerId===C&&(S=void 0,C=void 0,n.removeEventListener(`pointerup`,E),n.removeEventListener(`pointercancel`,E))},D=t=>{if(!c()||S||!o(t)||t.pointerType===`mouse`&&t.button!==0)return;let r=a(t.clientX,t.clientY)?.at,i=r&&T(r);if(!r||i===void 0)return;let s=t.target,l=s===y?.[2]?0:s===y?.[3]?1:s===y?.[1]?`move`:`new`;S={from:r,range:Vn(e),mode:l,index:i},C=t.pointerId,w=!1,n.addEventListener(`pointerup`,E),n.addEventListener(`pointercancel`,E)},O=t=>{let n=i(),o=S&&t.pointerId===C&&a(t.clientX,t.clientY)?.at;if(!S||!o||!n)return;let s=+!!n.vertical;if(!w){if(Math.abs(o[s]-S.from[s])<4)return;w=!0;try{r()?.setPointerCapture(t.pointerId)}catch{}}t.stopPropagation(),e.clearHighlight();let[c,d]=S.range,f=T(o);if(S.mode===`move`){let t=(o[s]-S.from[s])/n.step,r=Math.round(n.reversed?-t:t),i=Math.max(0,Bn(e)-1),a=Math.min(i-d,Math.max(-c,r));u(c+a,d+a)}else if(f===void 0)return;else S.mode===`new`?u(Math.min(S.index,f),Math.max(S.index,f)):S.mode===0?u(Math.min(f,d-l()),d):u(c,Math.max(f,c+l()))},k=e=>{w&&e.stopPropagation(),w=!1},A=t=>{c()&&o(t)&&u(0,Bn(e)-1)},j=t=>{if(t.target!==r()||!c())return;let{key:n}=t,a=n===`ArrowLeft`?-1:+(n===`ArrowRight`),[o,s]=Vn(e);if(n===`0`)u(0,Bn(e)-1);else if(t.shiftKey&&a){let t=i()?.reversed?-a:a,n=Math.max(0,Bn(e)-1),r=Math.min(n-s,Math.max(-o,t));u(o+r,s+r)}else return;t.stopPropagation(),t.preventDefault()};return t.addEventListener(`pointermove`,O,!0),t.addEventListener(`click`,k,!0),t.addEventListener(`keydown`,j,!0),t.addEventListener(`pointerdown`,D),t.addEventListener(`dblclick`,A),{svgAttrs:()=>c()?{"data-zoom-axis":i()?.vertical?`y`:`x`}:void 0,afterRender(){x(),h();for(let t of d??[e])Un.get(t)?.(t===e)},destroy(){t.removeEventListener(`pointermove`,O,!0),t.removeEventListener(`click`,k,!0),t.removeEventListener(`keydown`,j,!0),t.removeEventListener(`pointerdown`,D),t.removeEventListener(`dblclick`,A),n.removeEventListener(`pointerup`,E),n.removeEventListener(`pointercancel`,E),b();let e=d;p();for(let t of e??[])Un.get(t)?.()}}},tr=[[`in`,`Zoom in`,`M12 5v14M5 12h14`],[`out`,`Zoom out`,`M5 12h14`],[`reset`,`Reset zoom`,`M20 11a8.1 8.1 0 0 0-15.5-2M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2M20 19v-4h-4`]],nr=e=>{let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,r=()=>e.config,i=()=>Nn.has(e.config.type.name)&&!!r().zoom&&!r().brush,a=()=>{let{zoom:e}=r();return typeof e==`object`?e:{}},o=()=>An(r().data),s=()=>jn(r().view,o()),c=()=>Math.max(0,Math.min(o(),Math.round(J(a().min)??2))-1),{svg:l,plot:u,locate:d,onPlot:f}=Fn(e),p=[0,0],m=([t,n])=>{let r=e.interaction?.hitTest(t,n);return r?p[0]+r.index:void 0},h,g=()=>{let[e,t]=s();return(h?.start!==e||h.end!==t)&&(h={a:e,b:t,start:e,end:t}),[h.a,h.b]},_=(t,n)=>{let r=Math.max(0,o()-1),i=Math.min(r,Math.max(c(),n-t));t+=(n-t-i)/2,t=Math.min(r-i,Math.max(0,t)),n=t+i;let a=Math.round(t),l=Math.round(n);l-a<c()&&(l=Math.min(r,a+c()),a=l-c());let[u,d]=s();return h={a:t,b:n,start:a,end:l},a===u&&l===d?!1:(e.update({view:a===0&&l===r?void 0:{start:a,end:l}}),!0)},v=(t,n)=>{let[r,i]=g(),a=e.active,o=n??(a?p[0]+a.index:(r+i)/2);return _(o-(o-r)/t,o+(i-o)/t)},y=e=>{let[t,n]=g(),r=Math.max(0,o()-1),i=Math.min(r-n,Math.max(-t,e));return _(t+i,n+i)},b=()=>_(0,o()-1),x=/* @__PURE__ */ new Map,S,C=!1,w,T,E=!t.classList.contains(`tc-container`),D=()=>{w?.remove(),w=void 0},O=(e,t)=>{let r=l(),i=u();if(!r||!i)return;w||(w=n.createElementNS(Pn,`rect`),w.setAttribute(`class`,`tc-zoom-selection`)),w.parentNode!==r&&r.append(w);let a=+!!i.vertical,o=Math.min(e[a],t[a]),s=Math.abs(e[a]-t[a]),c=i.vertical?{x:i.area.x,y:o,width:i.area.width,height:s}:{x:o,y:i.area.y,width:s,height:i.area.height};for(let[e,t]of Object.entries(c))w.setAttribute(e,`${t}`)},k=e=>{let t=x.get(e.pointerId);if(x.delete(e.pointerId),S&&!S.pan&&C&&t&&e.type===`pointerup`){let e=m(S.from),n=m(t);e!==void 0&&n!==void 0&&e!==n&&_(Math.min(e,n),Math.max(e,n))}x.size===0&&(S=void 0,D(),n.removeEventListener(`pointerup`,k),n.removeEventListener(`pointercancel`,k))},A=e=>{if(!i()||!f(e)||e.pointerType===`mouse`&&e.button!==0)return;let t=d(e.clientX,e.clientY)?.at;t&&(x.size===0?(C=!1,S={from:t,range:p,pan:e.shiftKey}):(S=void 0,D()),x.set(e.pointerId,t),n.addEventListener(`pointerup`,k),n.addEventListener(`pointercancel`,k))},j=t=>{let n=x.get(t.pointerId),r=d(t.clientX,t.clientY)?.at,i=u();if(!n||!r||!i)return;let a=+!!i.vertical;if(!C){if(x.size===1&&Math.abs(r[a]-n[a])<4)return;C=!0;try{l()?.setPointerCapture(t.pointerId)}catch{}}if(t.stopPropagation(),e.clearHighlight(),x.set(t.pointerId,r),x.size>1){let e=[...x].find(([e])=>e!==t.pointerId)?.[1];if(!e)return;let i=Math.abs(n[a]-e[a]),o=Math.abs(r[a]-e[a]);i>0&&o>0&&v(o/i,m([(r[0]+e[0])/2,(r[1]+e[1])/2]))}else if(S?.pan){let[e,t]=S.range,n=(r[a]-S.from[a])/i.step,s=Math.round(i.reversed?n:-n),c=Math.max(0,o()-1),l=Math.min(c-t,Math.max(-e,s));_(e+l,t+l)}else S&&O(S.from,r)},M=e=>{if(!i()||a().wheel===!1||!f(e))return;let t=u(),n=d(e.clientX,e.clientY)?.at;if(!t||!n)return;let[r,o]=g(),s=e.shiftKey||Math.abs(e.deltaX)>Math.abs(e.deltaY),c=s&&e.deltaX||e.deltaY,l=s?y((t.reversed?-c:c)/t.step):v(Math.exp(-c*(e.ctrlKey?.01:.002)),m(n)),p=h&&(h.a!==r||h.b!==o);(l||p)&&e.preventDefault()},N=e=>{i()&&f(e)&&b()},P=e=>{C&&e.stopPropagation(),C=!1},F=e=>{if(e.target!==l()||!i())return;let{key:t}=e,n=t===`ArrowLeft`?-1:+(t===`ArrowRight`);if(t===`+`||t===`=`)v(2);else if(t===`-`)v(1/2);else if(t===`0`)b();else if(e.shiftKey&&n)y(u()?.reversed?-n:n);else return;e.stopPropagation(),e.preventDefault()},I=e=>{let t=e.target.closest(`button`)?.value;t===`reset`?b():t&&v(t===`in`?2:1/2)};t.addEventListener(`pointermove`,j,!0),t.addEventListener(`click`,P,!0),t.addEventListener(`keydown`,F,!0),t.addEventListener(`pointerdown`,A),t.addEventListener(`wheel`,M,{passive:!1}),t.addEventListener(`dblclick`,N);let L=()=>{if(!i()||a().controls===!1){T?.remove(),T=void 0;return}if(!T){T=n.createElement(`div`),T.className=`tc-zoom`;for(let[e,,t]of tr){let r=n.createElement(`button`);r.type=`button`,r.className=`tc-download-toggle`,r.value=e;let i=n.createElementNS(Pn,`svg`);i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`width`,`16`),i.setAttribute(`height`,`16`),i.setAttribute(`aria-hidden`,`true`);let a=n.createElementNS(Pn,`path`);a.setAttribute(`d`,t),i.append(a),r.append(i),T.append(r)}T.addEventListener(`click`,I),t.classList.add(`tc-container`)}T.isConnected||t.append(T),T.dir=e.rtl?`rtl`:``;let[r,l]=s(),u=r===0&&l>=o()-1,d={in:l-r<=c(),out:u,reset:u},f=a().labels;for(let[e,t]of[...T.querySelectorAll(`button`)].entries()){let[n,r]=tr[e];t.setAttribute(`aria-label`,f?.[n]??r),t.disabled=d[n]}};return{svgAttrs:()=>i()?{"data-zoom-axis":u()?.vertical?`y`:`x`}:void 0,afterRender(){i()&&(p=s()),w&&l()?.append(w),L()},destroy(){t.removeEventListener(`pointermove`,j,!0),t.removeEventListener(`click`,P,!0),t.removeEventListener(`keydown`,F,!0),t.removeEventListener(`pointerdown`,A),t.removeEventListener(`wheel`,M),t.removeEventListener(`dblclick`,N),n.removeEventListener(`pointerup`,k),n.removeEventListener(`pointercancel`,k),D(),T?.remove(),T&&E&&t.classList.remove(`tc-container`)}}};n({zoom:{window:Mn,install:e=>{let t=[nr(e),er(e)];return{svgAttrs:e=>t[0]?.svgAttrs?.(e)??t[1]?.svgAttrs?.(e),afterRender(e){for(let n of t)n.afterRender?.(e)},destroy(){for(let e of t)e.destroy?.()}}}}});function rr(e,t){if(e.time){let n=e.time(new Date(pn(t)));return Number.isFinite(n)?[n,n]:void 0}let n=e.keys.indexOf(Z(t));return n<0?void 0:[e.band.at(n),e.band.at(n)+e.band.bandwidth]}let ir=(e,t)=>{if(!Array.isArray(e))return t(e);let n=e.map(t);return n.length===2&&!n.includes(null)?n:null},ar=e=>e===void 0?e:Xt(e,e=>({...e,y:e.y===void 0?e.y:ir(e.y,J),x:e.x===void 0?e.x:ir(e.x,Jt),label:e.label==null?void 0:qt(e.label),color:typeof e.color==`string`?e.color:void 0})).filter(e=>e.y!==null&&e.x!==null&&(e.x??e.y)!==void 0),or=e=>Array.isArray(e);function sr(e){let t=[];for(let n of ar(e)??[])if(n.y!==void 0)for(let e of or(n.y)?n.y:[n.y])Number.isFinite(e)&&t.push(e);return t}function cr(e,t){if(e=ar(e),!e?.length)return{under:null,over:null};let{area:n,horizontal:r,fontSize:i}=t,a=[],o=[],s=n.x,c=n.x+n.width,u=n.y,d=n.y+n.height,f=(e,t,n)=>e>=t-.5&&e<=n+.5,p=e=>{let n,i;if(e.y!==void 0){let[a,o]=or(e.y)?e.y:[e.y,e.y];if(!Number.isFinite(a)||!Number.isFinite(o))return;n=[t.value(a),t.value(o)],i=r}else if(e.x!==void 0){let[a,o]=or(e.x)?e.x:[e.x,e.x],s=rr(t,a),c=rr(t,o);if(!s||!c)return;n=or(e.x)?[Math.min(s[0],c[0]),Math.max(s[1],c[1])]:[(s[0]+s[1])/2,(s[0]+s[1])/2],i=!r}else return;let a=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]),[l,p]=i?[s,c]:[u,d];if(f(a,l,p)||f(o,l,p)||a<l&&o>p)return{a0:Math.max(a,l),a1:Math.min(o,p),vertical:i}},m=e=>{if(e.x===void 0||e.y===void 0||or(e.x)||or(e.y))return;let n=rr(t,e.x),i=t.value(e.y);if(!n||!Number.isFinite(i))return;let a=(n[0]+n[1])/2,[o,l]=r?[i,a]:[a,i];return f(o,s,c)&&f(l,u,d)?[o,l]:void 0},h=e=>e.x!==void 0&&e.y!==void 0&&!or(e.x)&&!or(e.y),g=e.map(m),_=e.map(e=>h(e)?void 0:p(e)),v=[],y=[];_.forEach((e,t)=>{if(!e||e.a1-e.a0>.5)return;let n=e.a0;y.push([t,e.vertical?[n-1.5,u,n+1.5,d]:[s,n-1.5,c,n+1.5]])}),g.forEach((e,t)=>{e&&y.push([t,[e[0]-4,e[1]-4,e[0]+4,e[1]+4]])});let b=(e,[t,n,r,i])=>e[2]<=t||e[0]>=r||e[3]<=n||e[1]>=i,x=e=>v.every(t=>b(e,t)),S=(e,t)=>x(e)&&y.every(([n,r])=>n===t||b(e,r));return e.forEach((e,t)=>{let n=e.id??t,r=t=>({key:t?`${n}-${t}`:n,class:[`tc-annotation`,h(e)?`tc-annotation-point`:e.y===void 0?`tc-annotation-x`:`tc-annotation-y`,e.class],style:{"--tc-annotation-color":e.color,"--tc-annotation-dash":Number.isFinite(e.dash)?`${e.dash}px`:e.dash}}),f=(t,n)=>{let r=i*.92,a=l(`text`,{class:`tc-annotation-label`,x:U(t[0]),y:U(t[1])},e.label);return e.labelBackground?[l(`rect`,{class:`tc-annotation-label-bg`,x:U(t[0]-3),y:U(t[1]-r),width:U(n+6),height:U(r*1.35),rx:2}),a]:[a]},p=e.position!==`start`,m=g[t];if(m){let[n,a]=m,u;if(e.label){let r=H(e.label,i*.92),o=a+i*.35,l=[[n+8,o],[n-8-r,o],[n-r/2,a-8],[n-r/2,a+8+i*.8],[n+8,a+8+i*.8],[n+8,a-8],[n-8-r,a+8+i*.8],[n-8-r,a-8]],d=([e,t])=>[e,t-i,e+r,t+i*.25],p=e=>e[0]>=s&&e[0]+r<=c,m=l.find(e=>p(e)&&S(d(e),t))??l.find(e=>p(e)&&x(d(e)));m&&(v.push(d(m)),u=f(m,r))}o.push(l(`g`,r(),l(`circle`,{class:`tc-annotation-dot`,cx:U(n),cy:U(a),r:4}),u));return}let y=_[t];if(!y)return;let{a0:b,a1:C,vertical:w}=y,T;if(e.label){let n=H(e.label,i*.92),r=C-b<=.5,a=[];if(w){let e=b+4,t=r?b-4-n:Math.max(s,C-4-n),o=e+n<=c?[e,t]:[t,e],l=p?u+i:d-4,f=(p?1:-1)*i*1.2;for(let e of o)if(!(e<s||e+n>c))for(let t=0;t<3;t++)a.push([e,l+t*f]);a.length||a.push([Math.max(s+4,o[0]),l])}else{let e=p?c-4-n:s+4,t=p?s+4:c-4-n;for(let n of[e,t])r?a.push([n,b-4],[n,b+i]):a.push([n,b+i],[n,C-4])}let o=([e,t])=>[e,t-i,e+n,t+i*.25],l=a.find(e=>S(o(e),t))??a.find(e=>x(o(e)))??a[0];v.push(o(l)),T=f(l,n)}if(C-b>.5){let e=w?`M${U(b)},${U(u)}H${U(C)}V${U(d)}H${U(b)}Z`:`M${U(s)},${U(b)}H${U(c)}V${U(C)}H${U(s)}Z`;a.push(l(`g`,r(),l(`path`,{class:`tc-annotation-band`,d:e}))),T&&o.push(l(`g`,r(`label`),T));return}let E=U(b);o.push(l(`g`,r(),l(`line`,w?{class:`tc-annotation-line`,x1:E,x2:E,y1:U(u),y2:U(d)}:{class:`tc-annotation-line`,x1:U(s),x2:U(c),y1:E,y2:E}),T))}),{under:a.length?l(`g`,{key:`annotations-under`,class:`tc-annotations`,"aria-hidden":`true`},a):null,over:o.length?l(`g`,{key:`annotations-over`,class:`tc-annotations`,"aria-hidden":`true`},o):null}}function lr(e,t,n){let r=e[0],i=e[e.length-1],a=r!==void 0&&i!==void 0?Math.abs(pn(i)-pn(r)):0,o=wt({year:`numeric`,month:`short`,day:`numeric`,...a>0&&a<2592e5?{hour:`numeric`,minute:`2-digit`}:{},...t?{timeZone:`UTC`}:{}},n);return e=>Number.isFinite(pn(e))?o(pn(e)):String(e)}function ur(e,t){let n=typeof e.endLabels==`object`?e.endLabels:{},r=on(e);return e.data.series.flatMap((e,i)=>{let{axis:a}=r(e),o=e.values.filter(e=>un(e,a)).pop();if(o==null||t.hidden.has(Q(e)))return[];let s=n.format?K(n.format,t.locale):bt(a.format,t.locale);return{index:i,key:Q(e),name:e.name,value:n.value===!1?``:s(o),color:e.color}})}let dr=(e,t)=>{let n=e.value?6+H(e.value,t)*1.06:0;return H(e.name,t)+n},fr=(e,t)=>e.length?Math.ceil(14+Math.max(...e.map(e=>dr(e,t)))):0;function pr(e,t,n,r,i){let a=Math.ceil(r*W),o=e.flatMap(e=>e.point?{...e,point:e.point,y:e.point[1]}:[]).sort((e,t)=>e.point[1]-t.point[1]);if(!o.length)return null;let s=t.y;for(let e of o)e.y=Math.max(e.y,s),s=e.y+a;let c=Math.max(t.y+t.height,(o[0]?.y??0)+(o.length-1)*a);for(let e of o.slice().reverse())e.y=Math.min(e.y,c),c=e.y-a;let u=n?-1:1,d=(n?t.x-i:t.x+t.width+i)+u*14;return l(`g`,{key:`end-labels`,class:`tc-end-labels`,"aria-hidden":`true`},o.map(e=>{let[t,r]=e.point,a=Math.abs(e.y-r)>1;return l(`g`,{key:e.key,class:[`tc-end-label`,`tc-series`,`tc-series-${e.index+1}`],style:{"--tc-series-color":e.color}},a&&l(`path`,{class:`tc-end-label-line`,d:`M${U(t+u*(i+2))},${U(r)}L${U(d-u*3)},${U(e.y)}`}),l(`text`,{class:`tc-end-label-text`,style:`transform:translate(${U(d)}px,${U(e.y)}px)`,"text-anchor":n?`end`:`start`,dy:`0.35em`},n?[e.value&&l(`tspan`,{class:`tc-end-label-value`},e.value),l(`tspan`,{dx:e.value?6:void 0},e.name)]:[e.name,e.value&&l(`tspan`,{class:`tc-end-label-value`,dx:6},e.value)]))}))}function mr(e,t,n){let r=ur(e,t),i=e.x?.reverse??t.rtl===!0,a=i?`left`:`right`,o=Ve(e.padding);return{options:{...e,padding:{...o,[a]:o[a]+fr(r,t.fontSize)}},layer:(e,a)=>pr(r.map(t=>({...t,point:(e[t.index]??[]).filter(e=>e!=null).pop()??null})),a,i,t.fontSize,n)}}function hr(e,t,n={}){let r=n.base&&n.base>1?n.base:10,i=n.clamp===!0,a=e[0]<0||e[1]<0?-1:1,o=e=>Math.max(Number.MIN_VALUE,e*a),s=Math.log(r),c=r===10?Math.log10:r===2?Math.log2:e=>Math.log(e)/s,l=e=>c(o(e)),u=e=>a*r**e,d=l(e[0]),f=l(e[1]),[p,m]=t,h=f-d,g=h===0?0:(m-p)/h,_=Math.min(p,m),v=Math.max(p,m);return Object.assign(e=>{if(h===0)return(p+m)/2;let t=p+(l(e)-d)*g;return i?Math.min(v,Math.max(_,t)):t},{domain:[e[0],e[1]],range:[p,m],invert(t){return h===0||m===p?e[0]:u(d+(t-p)/g)},ticks(e=5){let t=Math.min(d,f),n=Math.max(d,f);if(!Number.isFinite(t)||!Number.isFinite(n))return[];let i=Math.floor(t),o=Math.ceil(n),s=o-i,c=e=>{let r=l(e);return r>=t-1e-9&&r<=n+1e-9},u=[];if(s<=e&&Number.isInteger(r)){let t=e=>{let t=[];for(let n=i;n<=o;n++)for(let i=1;i<r;i++){let o=a*i*r**n;e(i)&&c(o)&&t.push(o)}return t};u=t(()=>!0),u.length>e*2&&(u=t(e=>e===1||e===2||e===5)),u.length>e*2&&(u=t(e=>e===1))}else{let i=Math.max(1,Math.ceil(s/Math.max(1,e)));for(let e=Math.ceil(t/i)*i;e<=n+1e-9;e+=i){let t=a*r**e;c(t)&&u.push(t)}}return f<d?u.reverse():u},nice(){let e=u(Math.floor(Math.min(d,f))),r=u(Math.ceil(Math.max(d,f)));return hr(f<d?[r,e]:[e,r],t,n)}})}function gr(e,t){let[n,r]=Ut(e.filter(e=>e!=null&&e>0&&Number.isFinite(e)))??[1,10],i=J(t.min),a=J(t.max);if(i!==null&&i>0&&(n=i),a!==null&&a>0&&(r=a),n===r&&(r=n*10),t.nice!==!1){let e=hr([n,r],[0,1]).nice().domain;i===null&&(n=e[0]),a===null&&(r=e[1])}return[n,r]}function _r(e,t,n,r){let i=K(n,r);return e.ticks(t).map(t=>({value:t,position:e(t),label:i(t)}))}let vr=[`M-2,2L2,-2M0,8L8,0M6,10L10,6`,`M2,2h.01M6,6h.01`,`M-2,6L2,10M0,0L8,8M6,-2L10,2`,`M0,4H8`,`M0,8L8,0M0,0L8,8`,`M4,0V8`,`M0,4H8M4,0V8`,`M1,2H4M5,6H8`],yr=vr.length,br=e=>e<yr?[`${e+1}`,`tc-series-${e+1}`]:[`other`,``];function xr(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let[e,i]=br(r.index);n.has(e)||n.set(e,l(`pattern`,{key:e,id:`${t}-pattern-${e}`,class:[`tc-pattern`,`tc-series`,i],width:8,height:8,patternUnits:`userSpaceOnUse`,style:{"--tc-series-color":r.color}},l(`rect`,{class:`tc-pattern-bg`,width:8,height:8}),l(`path`,{class:`tc-pattern-ink`,d:vr[r.index%yr]})))}return[...n.values()]}function Sr(e,t){let n={};for(let r of e){let[e]=br(r.index);n[`--tc-pattern-${e}`]=`url(#${t}-pattern-${e})`}return n}function Cr(e,t){let{items:n}=Oe(e);if(n.length)return[e.patterns===!0?`tc-patterned`:`tc-patterns-auto`,Sr(n,t),l(`defs`,{key:`patterns`},xr(n,t))]}let wr=[[],[-.9,-.9,.9,-.9,.9,.9,-.9,.9],[0,-1.3,1.2,.9,-1.2,.9],[0,-1.3,1.3,0,0,1.3,-1.3,0],[-1.2,-.9,1.2,-.9,0,1.3],[-.4,-1.2,.4,-1.2,.4,-.4,1.2,-.4,1.2,.4,.4,.4,.4,1.2,-.4,1.2,-.4,.4,-1.2,.4,-1.2,-.4,-.4,-.4],[-.7,-1.2,0,-.5,.7,-1.2,1.2,-.7,.5,0,1.2,.7,.7,1.2,0,.5,-.7,1.2,-1.2,.7,-.5,0,-1.2,-.7],[0,-1.4,.32,-.44,1.33,-.43,.52,.17,.82,1.13,0,.55,-.82,1.13,-.52,.17,-1.33,-.43,-.32,-.44]];function Tr(e,t,n,r){let i=wr[e]??[];if(!i.length)return`M${U(t-r)},${U(n)}a${r},${r},0,1,0,${2*r},0a${r},${r},0,1,0,${-2*r},0Z`;let a=``;for(let e=0;e<i.length;e+=2)a+=`${e?`L`:`M`}${U(t+i[e]*r)},${U(n+i[e+1]*r)}`;return`${a}Z`}function Er(e){if(!wr[e]?.length)return;let t=Tr(e,50,50,35.7).slice(1,-1).replace(/,/g,`% `).replace(/L/g,`%,`);return{"--tc-shape":e===1?`inset(10% round 1px)`:`polygon(${t}%)`,"--tc-shape-radius":0}}let Dr=` — `,Or=(e,t)=>H(e.name,t)*1.08+(e.value?H(Dr+e.value,t):0),kr=e=>Math.sin(e.angle)>=0;function Ar(e,t,n){let r=Math.ceil(n*W),i=Math.max(1,Math.floor(t.height/r)),a=[!1,!0].map(t=>e.filter(e=>kr(e)===t).sort((e,t)=>t.weight-e.weight).slice(0,i)),o=a.map(e=>e.length?Math.ceil(30+Math.max(...e.map(e=>Or(e,n)))):0),s=12+Math.ceil(r/2),c={x:t.x+o[0],y:t.y+s,width:t.width-o[0]-o[1],height:t.height-s*2};return Math.min(c.width,c.height)/2<32?null:{area:c,layer:(e,n,i)=>l(`g`,{key:`slice-labels`,class:`tc-slice-labels`,"aria-hidden":`true`},a.flatMap((a,o)=>{let s=o?1:-1,c=a.map(e=>({label:e,y:n-Math.cos(e.angle)*(i+12)})).sort((e,t)=>e.y-t.y),u=t.y+r/2;for(let e of c)e.y=Math.max(e.y,u),u=e.y+r;let d=t.y+t.height-r/2;for(let e of c.slice().reverse())e.y=Math.min(e.y,d),d=e.y-r;let f=e+s*(i+12+12);return c.map(({label:t,y:r})=>{let a=Math.sin(t.angle),c=Math.cos(t.angle),u=i-6;return l(`g`,{key:t.key,class:[`tc-slice-label`,`tc-series`,`tc-series-${t.index+1}`]},l(`path`,{class:`tc-slice-label-line`,d:`M${U(e+a*u)},${U(n-c*u)}L${U(e+a*(i+12))},${U(r)}H${U(f)}`}),l(`text`,{class:`tc-slice-label-text`,style:`transform:translate(${U(f+s*6)}px,${U(r)}px)`,"text-anchor":o?`start`:`end`,dy:`0.35em`},l(`tspan`,{class:`tc-slice-label-name`},t.name),t.value&&Dr+t.value))})}))}}let jr=1e3,Mr=60*jr,Nr=60*Mr,Pr=24*Nr,Fr=30*Pr,Ir=365*Pr,Lr=[{unit:`second`,step:1,ms:jr},{unit:`second`,step:5,ms:5*jr},{unit:`second`,step:15,ms:15*jr},{unit:`second`,step:30,ms:30*jr},{unit:`minute`,step:1,ms:Mr},{unit:`minute`,step:5,ms:5*Mr},{unit:`minute`,step:15,ms:15*Mr},{unit:`minute`,step:30,ms:30*Mr},{unit:`hour`,step:1,ms:Nr},{unit:`hour`,step:3,ms:3*Nr},{unit:`hour`,step:6,ms:6*Nr},{unit:`hour`,step:12,ms:12*Nr},{unit:`day`,step:1,ms:Pr},{unit:`day`,step:2,ms:2*Pr},{unit:`week`,step:1,ms:6048e5},{unit:`month`,step:1,ms:Fr},{unit:`month`,step:3,ms:3*Fr},{unit:`year`,step:1,ms:Ir}];function Rr(e){let t=(t,n)=>{switch(n){case`year`:return e?t.getUTCFullYear():t.getFullYear();case`month`:return e?t.getUTCMonth():t.getMonth();case`day`:case`week`:return e?t.getUTCDate():t.getDate();case`hour`:return e?t.getUTCHours():t.getHours();case`minute`:return e?t.getUTCMinutes():t.getMinutes();default:return e?t.getUTCSeconds():t.getSeconds()}},n=(t,n,r,i=0,a=0,o=0)=>e?new Date(Date.UTC(t,n,r,i,a,o)):new Date(t,n,r,i,a,o),r=t=>e?t.getUTCDay():t.getDay();return{floor:(e,{unit:i,step:a})=>{let o=t(e,`year`),s=t(e,`month`),c=t(e,`day`);switch(i){case`year`:return n(Math.floor(o/a)*a,0,1);case`month`:return n(o,Math.floor(s/a)*a,1);case`week`:return n(o,s,c-(r(e)+6)%7);case`day`:return n(o,s,Math.floor((c-1)/a)*a+1);case`hour`:return n(o,s,c,Math.floor(t(e,`hour`)/a)*a);case`minute`:return n(o,s,c,t(e,`hour`),Math.floor(t(e,`minute`)/a)*a);default:return n(o,s,c,t(e,`hour`),t(e,`minute`),Math.floor(t(e,`second`)/a)*a)}},next:(e,{unit:r,step:i})=>{let a=t(e,`year`),o=t(e,`month`),s=t(e,`day`);switch(r){case`year`:return n(a+i,0,1);case`month`:return n(a,o+i,1);case`week`:return n(a,o,s+7*i);case`day`:{let e=n(a,o,s+i);return t(e,`month`)===o?e:n(a,o+1,1)}case`hour`:return n(a,o,s,t(e,`hour`)+i);case`minute`:return n(a,o,s,t(e,`hour`),t(e,`minute`)+i);default:return n(a,o,s,t(e,`hour`),t(e,`minute`),t(e,`second`)+i)}},boundary:(e,n)=>{switch(n){case`second`:return t(e,`second`)===0;case`minute`:return t(e,`minute`)===0&&t(e,`second`)===0;case`hour`:return t(e,`hour`)===0&&t(e,`minute`)===0;case`day`:case`week`:return t(e,`day`)===1;case`month`:return t(e,`month`)===0;default:return!1}}}}function zr(e,t){let n=Math.abs(e)/Math.max(1,t),r=0;for(;r<Lr.length&&Lr[r].ms<n;)r++;if(r===Lr.length){let e=Math.max(1,jt(0,n/Ir,1));return{unit:`year`,step:e,ms:e*Ir}}if(r===0)return Lr[0];let i=Lr[r-1],a=Lr[r];return n/i.ms<a.ms/n?i:a}let Br=e=>e instanceof Date?e.getTime():e,Vr={second:[{hour:`numeric`,minute:`2-digit`,second:`2-digit`},{hour:`numeric`,minute:`2-digit`}],minute:[{hour:`numeric`,minute:`2-digit`},{hour:`numeric`,minute:`2-digit`}],hour:[{hour:`numeric`,minute:`2-digit`},{month:`short`,day:`numeric`}],day:[{month:`short`,day:`numeric`},null],week:[{month:`short`,day:`numeric`},null],month:[{month:`short`},{year:`numeric`}],year:[{year:`numeric`},null]};function Hr(e,t,n={}){let r=n.utc===!0,i=Br(e[0]),a=Br(e[1]),[o,s]=t,c=a-i,l=c===0?0:(s-o)/c,u=Rr(r),d=n.clamp===!0,f=Math.min(o,s),p=Math.max(o,s),m=e=>{if(c===0)return(o+s)/2;let t=o+(Br(e)-i)*l;return d?Math.min(p,Math.max(f,t)):t},h=(e=5)=>zr(c,e);return Object.assign(m,{domain:[i,a],range:[o,s],utc:r,invert(e){return new Date(c===0||s===o?i:i+(e-o)/l)},ticks(e=5){if(!Number.isFinite(i)||!Number.isFinite(a))return[];let t=Math.min(i,a),n=Math.max(i,a);if(t===n)return[new Date(t)];let r=h(e),o=[],s=u.floor(new Date(t),r);for(s.getTime()<t&&(s=u.next(s,r));s.getTime()<=n&&o.length<1e3;)o.push(s),s=u.next(s,r);return a<i?o.reverse():o},tickFormat(e=5,t){let{unit:n}=h(e),[i,a]=Vr[n],o=r?{timeZone:`UTC`}:{},s=mt(t,{...i,...o}),c=a?mt(t,{...a,...o}):null;return e=>(c&&u.boundary(e,n)?c:s).format(e)},nice(r=5){if(c===0||!Number.isFinite(c))return Hr(e,t,n);let o=h(r),s=u.floor(new Date(Math.min(i,a)),o),l=u.floor(new Date(Math.max(i,a)),o);return l.getTime()<Math.max(i,a)&&(l=u.next(l,o)),Hr(a<i?[l,s]:[s,l],t,n)}})}function Ur(e,t,n,r){let[i,a]=Ut(e)??[0,1],o=e.filter(e=>Number.isFinite(e)),s=Hr([i,a],n,{utc:r}),c=e.map(e=>s(e));return{scale:Object.assign(e=>c[t.indexOf(e)],{domain:t.slice(),range:n,bandwidth:0,step:o.length>1?(n[1]-n[0])/(o.length-1):0,at:e=>c[e]??n[0],center:e=>c[t.indexOf(e)],indexAt(e){if(c.length===0)return-1;let t=n[1]<n[0],r=0,i=c.length-1;for(;r<i;){let n=r+i>>1;c[n]<e===t?i=n:r=n+1}let a=r-1;return a>=0&&Math.abs(e-c[a])<Math.abs(c[r]-e)?a:r}}),time:s}}function Wr(e,t,n,r,i){let a=e.map(pn),o=e=>Ur(a,t,e,n.utc===!0),s=o([0,1]).time,{format:c}=n,l=c?e=>c(e,-1):s.tickFormat(r,i),u=s;return{edges:s.ticks(r).map(l),scale(e){let t=o(e);return u=t.time,t.scale},ticks:()=>u.ticks(r).map(e=>({value:e.getTime(),position:u(e),label:l(e)})),get time(){return u}}}let Gr=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,Kr=(e,t)=>t.x>=e.x-1&&t.y>=e.y-1&&t.x+t.width<=e.x+e.width+1&&t.y+t.height<=e.y+e.height+1,qr=e=>{let t=e.data?.series;return Array.isArray(t)?t.map(e=>e?.valueLabels):[]},Jr=e=>!!e.valueLabels||qr(e).includes(!0);function Yr(e,t,n){let r=e.valueLabels,i=typeof r==`object`?r:{},{fontSize:a,locale:o}=n,s=e.type.valueLabels,c=s?.marks===`slice`,u=s?.marks===`cell`,d=!!e.stacked,f=i.format?K(i.format,o):c?e=>G(o,{style:`percent`,maximumFractionDigits:1}).format(e):s?.format?K(s.format(e),o):void 0,p=a,m=qr(e),h=e=>{let t=m[e];return typeof t==`boolean`?t:!!r},g=[],_=[],v=/* @__PURE__ */ new Map,y=0;for(let e=0;e<t.count;e++){let n=t.hitIndex(e);for(let t of n?.items??[])t.value!==null&&t.y!==null&&n&&(y+=Math.abs(t.value),t.box&&_.push(t.box),h(t.seriesIndex)&&(!c&&!t.box&&i.points!==`all`&&v.set(t.seriesIndex,g.length),g.push([`${e}-${t.seriesIndex}`,t,n])))}let b=[];return g.forEach(([e,t,r],o)=>{let{area:s}=r;if(!c&&!t.box&&i.points!==`all`&&v.get(t.seriesIndex)!==o)return;let l=t.value,m=l/(y||1),h=f?f(c?m:l):t.text,g=H(h,a),x=(n,r,i)=>(!t.box&&!c&&(n=Math.max(s.x+g/2+2,Math.min(n,s.x+s.width-g/2-2))),{key:e,series:t.seriesIndex,text:h,x:n,y:r,inside:i,box:{x:n-g/2-2,y:r-p/2,width:g+4,height:p}}),S=t.y,C=[],{box:w}=t;if(c)C.push(x(t.x,S,!0));else if(w){let e=r.axis===`y`,i=l<0;if(!d&&!u){let r=(e?g/2:p/2)+4,a=i?1:-1,o=S+a*r,s=n.rtl?-a:a;C.push(e?x(t.x-s*r,S,!1):x(t.x,o,!1),...e?[]:[x(w.x+g/2-3,o,!1),x(w.x+w.width-g/2+3,o,!1)],e?x(t.x+s*r,S,!0):x(t.x,S-a*r,!0))}else C.push(x(w.x+w.width/2,w.y+w.height/2,!0))}else{let e=g/2+4+4;C.push(x(t.x,S-p/2-4-2,!1),x(t.x,S+p/2+4+2,!1),x(t.x-e,S,!1),x(t.x+e,S,!1))}let T={...s,y:0,height:s.y+s.height},E=e=>({...e.box,x:e.box.x+5,width:e.box.width-10}),D=(e,n=!1)=>Kr(c?s:T,e.box)&&(!e.inside||!w||Kr(w,e.box))&&(!c||Xr(t,s,m,e.box))&&!b.some(t=>Gr(t.box,e.box))&&(n||!_.some(t=>t!==w&&Gr(t,E(e)))),O=C.find(e=>D(e))??(i.overMarks&&!w&&!c?C.find(e=>D(e,!0)):void 0);O&&b.push(O)}),b.length?l(`g`,{key:`value-labels`,class:`tc-value-labels`,"aria-hidden":`true`},b.map(e=>l(`text`,{key:e.key,class:[`tc-value-label`,`tc-series`,`tc-series-${e.series+1}`,e.inside&&`tc-value-label-inside`],style:`transform:translate(${U(e.x)}px,${U(e.y)}px)`,"text-anchor":`middle`,dy:`0.35em`},e.text))):null}function Xr(e,t,n,r){let i=t.width/2,a=Math.hypot(e.x-t.x-i,e.y-t.y-i),o=2*(i-a);return r.width<=n*2*Math.PI*a&&r.height<=o}let Zr=(e,t,n,r)=>n&&Jr(e)?[t,Yr(e,n,r)]:t;function Qr(e,t,n){return e.nodeType===1&&e.localName===t.tag&&e.namespaceURI===n}function $r(e,t){let n={};for(let t of e.getAttributeNames())n[t]=e.getAttribute(t);n.style&&=``,M(e,n,t.attrs);let r=t.children.some(e=>typeof e==`string`);for(let t of Array.from(e.childNodes))(t.nodeType===8||!r&&t.nodeType===3)&&e.removeChild(t);let i=T(e),a=e.firstChild;for(let n of t.children){let t=a?a.nextSibling:null;if(typeof n==`string`?a?.nodeType===3:a&&Qr(a,n,n.tag===`svg`?`http://www.w3.org/2000/svg`:i))typeof n==`string`?(a.data!==n&&(a.data=n),x.set(a,n)):$r(a,n),a=t;else{let t=E(n,i,e.ownerDocument);t&&e.insertBefore(t,a)}}for(;a;){let t=a;a=a.nextSibling,e.removeChild(t)}x.set(e,t)}function ei(e,t,n){return x.has(e)||!Qr(e,t,n)?!1:($r(e,t),!0)}let ti=/* @__PURE__ */ new WeakMap;function ni(e){let t=ti.get(e);return t&&cancelAnimationFrame(t.frame),ti.delete(e),t?.now}function ri(e,t,n,r,i,a){let o={frame:0,now:t.slice()},s=performance.now(),c=l=>{let u=Math.min(1,Math.max(0,(l-s)/r)),d=1-(1-u)**3;o.now=n.map((e,n)=>t[n]+(e-t[n])*d),e.setAttribute(`d`,u<1?i(o.now):a),u<1?o.frame=requestAnimationFrame(c):ti.delete(e)};ti.set(e,o),o.frame=requestAnimationFrame(c)}let ii=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,ai;function oi(e,t,n){ai??=typeof CSS>`u`||CSS.supports(`d`,`path("M0 0")`);let r=ni(e);if(ai||e.closest(`.tc-static,[data-resizing]`))return!1;let i=getComputedStyle(e),a=i.transitionProperty.split(`, `).findIndex(e=>e===`d`||e===`all`),o=a<0?0:Number.parseFloat(i.transitionDuration.split(`, `)[a]??``)*1e3,s=n.split(ii),c=n.match(ii)?.map(Number)??[],l=t.match(ii)?.map(Number)??[];return!(o>0)||l.length!==c.length||t.split(ii).join()!==s.join()?!1:(ri(e,r?.length===c.length?r:l,c,o,e=>e.reduce((e,t,n)=>e+U(t)+s[n+1],s[0]),n),!0)}function si(e,t){let n=e.length;if(!(t>=3)||n<=t)return e.map((e,t)=>t);let r=[],i=-1;for(let t=0;t<n;t++){let n=e[t]!=null;n&&i===-1&&(i=t),!n&&i!==-1&&(r.push([i,t]),i=-1)}i!==-1&&r.push([i,n]);let a=r.reduce((e,[t,n])=>e+(n-t),0),o=[],s=0;for(let[n,i]of r)n>s&&o.push(s),ci(e,n,i,Math.max(2,Math.round(t*(i-n)/a)),o),s=i;return s<n&&o.push(s),o}function ci(e,t,n,r,i){let a=n-t;if(a<=r){for(let e=t;e<n;e++)i.push(e);return}let o=t=>e[t],s=(a-2)/(r-2),c=t;i.push(c);for(let e=0;e<r-2;e++){let r=t+1+Math.floor((e+1)*s),a=Math.min(n,t+1+Math.floor((e+2)*s)),l=0,u=0;for(let e=r;e<a;e++)l+=o(e)[0],u+=o(e)[1];let d=Math.max(1,a-r);l/=d,u/=d;let f=t+1+Math.floor(e*s),p=Math.min(n-1,t+1+Math.floor((e+1)*s)),[m,h]=o(c),g=f,_=-1;for(let e=f;e<p;e++){let[t,n]=o(e),r=Math.abs((m-l)*(n-h)-(m-t)*(u-h));r>_&&(_=r,g=e)}i.push(g),c=g}i.push(n-1)}function li(e,t){return si(e,t).map(t=>e[t])}function ui(e){let t=10**Math.max(0,Math.min(12,Math.floor(e))),n=e=>Math.round(e*t)/t||0;return(e,t)=>`${n(e)},${n(t)}`}let di=(e,t)=>t===`monotone`?mi(e):e;function fi(e,t,n,r){let i=t[0];if(!i)return``;let a=(r?`M`:`L`)+e(i[0],i[1]);if(n===`monotone`)return a+_i(e,t);let o=pi[n];if(o!==void 0)return a+hi(e,t,o);let s=a;for(let n=1;n<t.length;n++){let r=t[n];s+=`L${e(r[0],r[1])}`}return s}let pi={step:.5,"step-before":0,"step-after":1};function mi(e){return e.filter((t,n)=>{let r=e[n-1];return!r||t[0]!==r[0]||t[1]!==r[1]})}function hi(e,t,n){let r=``;for(let i=1;i<t.length;i++){let[a,o]=t[i-1],[s,c]=t[i];if(n<=0)r+=`L${e(a,c)}L${e(s,c)}`;else if(n>=1)r+=`L${e(s,o)}L${e(s,c)}`;else{let l=a*(1-n)+s*n;r+=`L${e(l,o)}L${e(l,c)}`,i===t.length-1&&(r+=`L${e(s,c)}`)}}return r}let gi=e=>e<0?-1:1;function _i(e,t){let n=t.length;if(n<2)return``;if(n===2){let n=t[1];return`L${e(n[0],n[1])}`}let r=Array(n);for(let e=1;e<n-1;e++){let[n,i]=t[e-1],[a,o]=t[e],[s,c]=t[e+1],l=a-n,u=s-a,d=(o-i)/(l||(u<0?-0:0)),f=(c-o)/(u||(l<0?-0:0)),p=(d*u+f*l)/(l+u);r[e]=(gi(d)+gi(f))*Math.min(Math.abs(d),Math.abs(f),.5*Math.abs(p))||0}r[0]=vi(t[0],t[1],r[1]),r[n-1]=vi(t[n-2],t[n-1],r[n-2]);let i=``;for(let a=1;a<n;a++){let[n,o]=t[a-1],[s,c]=t[a],l=(s-n)/3;i+=`C${e(n+l,o+l*r[a-1])},${e(s-l,c-l*r[a])},${e(s,c)}`}return i}function vi(e,t,n){let r=t[0]-e[0];return r?3*(t[1]-e[1])/r/2-n/2:n}let yi=e=>e!=null&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function bi(e,t=()=>!0){let n=[],r;for(let i=0;i<e.length;i++)yi(e[i])&&t(i)?(r||(r=[],n.push(r)),r.push(i)):r=void 0;return n}function xi(e,t={}){let{curve:n=`linear`,precision:r=2}=t,i=ui(r),a=``;for(let t of bi(e)){let r=di(t.map(t=>e[t]),n);a+=fi(i,r,n,!0),r.length===1&&(a+=`Z`)}return a}function Si(e,t,n={}){let{curve:r=`linear`,precision:i=2}=n,a=ui(i),o=``,s=e=>typeof t==`number`?t:t[e]??NaN;for(let t of bi(e,e=>Number.isFinite(s(e)))){o+=fi(a,di(t.map(t=>e[t]),r),r,!0);let n=t.map(t=>[e[t][0],s(t)]).reverse(),i=r===`step-before`?`step-after`:r===`step-after`?`step-before`:r;o+=`${fi(a,di(n,i),i,!1)}Z`}return o}let Ci={png:`PNG`,svg:`SVG`,jpeg:`JPEG`,webp:`WebP`,csv:`CSV`},wi=[`png`,`svg`];function Ti(e){return e===!0?{}:Array.isArray(e)?{formats:e}:e}function Ei(){return{name:`download`,install(e){let t=e.element,n=t.ownerDocument,r,i={},a=!t.classList.contains(`tc-container`),s=()=>r?.querySelector(`.tc-download-toggle`),c=()=>r?.querySelector(`.tc-download-menu`),u=()=>Array.from(r?.querySelectorAll(`.tc-download-item`)??[]),d=e=>{let t=c();t&&(t.hidden=!e,s()?.setAttribute(`aria-expanded`,String(e)),e?n.addEventListener(`pointerdown`,p,!0):n.removeEventListener(`pointerdown`,p,!0))},f=()=>c()?.hidden===!1,p=e=>{r?.contains(e.target)||d(!1)},m=t=>{let n=t.target;if(n.closest(`.tc-download-toggle`)){d(!f()),f()&&u()[0]?.focus();return}let r=n.closest(`.tc-download-item`)?.getAttribute(`data-format`);r&&(d(!1),s()?.focus(),o(`export`)(e,{...i,format:r}))},h=e=>{if(e.key===`Escape`&&f()){e.preventDefault(),d(!1),s()?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=u();t.length&&(e.preventDefault(),f()||d(!0),t[(t.indexOf(n.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())},g=e=>{r?.contains(e.relatedTarget)||d(!1)},_=()=>{r&&(d(!1),C(r,null),r.remove(),r=void 0,a&&t.classList.remove(`tc-container`))};return{afterRender({config:a,changed:s}){let c=a.download;if(!c||typeof document>`u`){_();return}if(!s&&r?.isConnected)return;o(`export`),i=Ti(c);let u=i.formats?.length?i.formats:wi;r||(r=n.createElement(`div`),r.className=`tc-download`,r.addEventListener(`click`,m),r.addEventListener(`keydown`,h),r.addEventListener(`focusout`,g)),C(r,l(`div`,{class:`tc-download-box`},l(`button`,{type:`button`,class:`tc-download-toggle`,"aria-label":i.label??`Download`,"aria-haspopup":`menu`,"aria-expanded":`false`},l(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},l(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`}))),l(`div`,{class:`tc-download-menu`,role:`menu`,hidden:``},u.map(e=>l(`button`,{key:e,type:`button`,role:`menuitem`,class:`tc-download-item`,"data-format":e},Ci[e]??e))))),r.dir=e.rtl?`rtl`:``,t.classList.add(`tc-container`),r.isConnected||t.appendChild(r)},destroy:_}}}}function Di(e,t,n){return l(`g`,{key:e,class:[`tc-series`,`tc-series-${e+1}`],style:{"--tc-series-color":t}},n)}function Oi(e,t){let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return n&&Di(n.seriesIndex,n.color,l(`path`,{class:`tc-hover-mark`,d:t.d,style:`transform:translate(${U(t.x??0)}px,${U(t.y??0)}px)`}))}function ki(e,t=!0){let{area:n,highlight:r={kind:`crosshair`}}=e,i=(e,n,r,i)=>t&&l(`line`,{class:`tc-crosshair`,x1:U(e),x2:U(r),y1:U(n),y2:U(i)});return l(`g`,{class:`tc-hover`,"aria-hidden":`true`},r.kind===`halo`?r.under&&Oi(e,r):r.kind===`band`?l(`rect`,{class:`tc-hover-band`,x:U(r.x),y:U(r.y),width:U(r.width),height:U(r.height)}):r.kind===`spoke`?i(r.x1,r.y1,r.x2,r.y2):i(e.x,n.y,e.x,n.y+n.height))}function Ai(e,t=4,n,r=!0){let i=e.highlight;return l(`g`,{class:`tc-hover`,"aria-hidden":`true`},i?.kind===`halo`?!i.under&&Oi(e,i):r&&i?.kind!==`band`&&e.items.map(e=>e.y!==null&&Di(e.seriesIndex,e.color,n?l(`path`,{class:`tc-point tc-point-active tc-marker`,d:n(e.seriesIndex,e.x,e.y,t)}):l(`circle`,{class:`tc-point tc-point-active`,cx:U(e.x),cy:U(e.y),r:t}))))}function ji(e,t){let{cursor:n,area:r}=e;if(!n)return;let{position:i,side:a,inside:o}=n,s=r.x+r.width,c=r.y+r.height,u=H(n.text,t)+8,d=Math.round(t*W)+2,f,p;return a===`bottom`?(f=Math.min(Math.max(i-u/2,r.x),s-u),p=o?c-d-2:c+4):(p=Math.min(Math.max(i-d/2,r.y-d/2),c-d/2),f=a===`left`?o?r.x+2:r.x-4-u:o?s-u-2:s+4),l(`g`,{class:`tc-hover tc-crosshair-value`,"aria-hidden":`true`},l(`line`,a===`bottom`?{class:`tc-crosshair`,x1:U(i),x2:U(i),y1:U(r.y),y2:U(c)}:{class:`tc-crosshair`,x1:U(r.x),x2:U(s),y1:U(i),y2:U(i)}),l(`rect`,{class:`tc-crosshair-tag`,x:U(f),y:U(p),width:U(u),height:d,rx:3}),l(`text`,{class:`tc-crosshair-label`,x:U(f+u/2),y:U(p+d/2),dy:`0.32em`,"text-anchor":`middle`},n.text))}let Mi=/* @__PURE__ */ new WeakSet;function Ni(e){let t=e.element;if(Mi.has(e)||typeof t.addEventListener!=`function`)return;Mi.add(e);let n=n=>{let r=t.querySelector(`svg.tc-chart`);if(!r)return;let{width:i,height:a}=e.size;return c(r,n.clientX,n.clientY,i,a)},r=e=>!!e.target?.closest?.(`.tc-download,.tc-map-zoom`),i=t=>{t.pointerType!==`touch`&&e.highlightSource===`pointer`&&e.clearHighlight(t)},a=t=>{if(r(t)){i(t);return}let a=n(t);a&&e.highlightAt(a.x,a.y,t)},o=t=>{if(r(t))return;let i=n(t),a=i?e.hitTest(i.x,i.y):null;a&&e.emit(`click`,{hit:a,event:t})};return t.addEventListener(`pointermove`,a),t.addEventListener(`pointerdown`,a),t.addEventListener(`pointerleave`,i),t.addEventListener(`click`,o),()=>{Mi.delete(e),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerdown`,a),t.removeEventListener(`pointerleave`,i),t.removeEventListener(`click`,o)}}function Pi(){return{name:`pointer`,install(e){let t=Ni(e);return t?{destroy:t}:{}}}}function Fi(){return{name:`highlight`,install(e){let t=Ni(e);return{layers:(t,n)=>({under:ki(t,n.crosshair!==!1),over:[Ai(t,4,gn(n),n.activePoints!==!1),_e(n)&&ji(t,e.fontSize)]}),...t?{destroy:t}:{}}}}}function Ii(e,t){let[n=``,...r]=e.columns;return l(`table`,{class:`tc-table`},t&&l(`caption`,null,t),l(`thead`,null,l(`tr`,null,l(`th`,{scope:`col`},n),r.map((e,t)=>l(`th`,{key:t,scope:`col`},e)))),l(`tbody`,null,e.rows.map(([e=``,...t],n)=>l(`tr`,{key:n},l(`th`,{scope:`row`},e),t.map((e,t)=>l(`td`,{key:t},e))))))}function Li(e){let t=(e.seriesIndex===void 0?e.items:e.items.filter(t=>t.seriesIndex===e.seriesIndex)).map(e=>`${e.name} ${e.text}`).join(`, `);return e.title?`${e.title}: ${t}`:t}let Ri=e=>e.keyboard??e.type.keyboard??!0;function zi(){return{name:`keyboard`,install(e){let t=e.element,n,r=()=>(n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-sr-only`,n.setAttribute(`aria-live`,`polite`),n.setAttribute(`aria-atomic`,`true`),t.appendChild(n)),n),i=e=>{r().textContent=e},a=(t,n)=>{let r=e.highlightIndex(t,n);r&&i(Li(r))},o=t=>{let n=e.interaction;if(!n||n.count===0)return!1;n.reversed&&/^Arrow(L|R)/.test(t)&&(t=t===`ArrowLeft`?`ArrowRight`:`ArrowLeft`);let r=n.rows??1;n.rows&&/^Arrow(U|D)/.test(t)&&(t=t===`ArrowUp`?`ArrowLeft`:`ArrowRight`,r=1);let i=e.highlightSource===`index`?e.active:null,o=n.count-1,s=i?.index,c=i?.seriesIndex,l=i?.items.map(e=>e.seriesIndex)??[],u=c===void 0?-1:l.indexOf(c);switch(t){case`ArrowRight`:return a(s===void 0?0:Math.min(o,s+r),c),!0;case`ArrowLeft`:return a(s===void 0?o:Math.max(0,s-r),c),!0;case`Home`:return a(0,c),!0;case`End`:return a(o,c),!0;case`ArrowDown`:case`ArrowUp`:{if(s===void 0||l.length===0)return a(0),!0;let e=t===`ArrowDown`?1:-1,n=u===-1?e>0?0:l.length-1:u+e;return a(s,n<0||n>=l.length?void 0:l[n]),!0}case`Escape`:return i?(e.clearHighlight(),!0):!1;default:return!1}},s=e=>e?.matches?.(`svg.tc-chart`)===!0,c=t=>{let{key:n}=t;Ri(e.config)&&s(t.target)&&o(n)&&t.preventDefault()},l=t=>{s(t.target)&&e.highlightSource===`index`&&e.clearHighlight()},u=t=>{Ri(e.config)&&s(t.target)&&r()};return t.addEventListener(`keydown`,c),t.addEventListener(`focusin`,u),t.addEventListener(`focusout`,l),{svgAttrs:e=>Ri(e)?{tabindex:0}:void 0,destroy(){t.removeEventListener(`keydown`,c),t.removeEventListener(`focusin`,u),t.removeEventListener(`focusout`,l),n?.remove()}}}}}let Bi={left:`right`,right:`left`},Vi=`tc-legend-beside`,Hi=`tc-legend-start`;function Ui(){return{name:`legend`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-legend`)??void 0,i=n?.firstElementChild??null,a=!1,o=t=>{let n=(t.target.closest?.(`.tc-legend-item`))?.getAttribute(`data-key`);n!=null&&e.toggleSeries(n)},s=()=>{n&&(C(n,null),n.removeEventListener(`click`,o),a=!1,n.remove(),n=void 0,t.classList.remove(Vi,Hi))},c=!1,l=()=>{let e=n?.dataset.position;return e===`left`||e===`right`},u=()=>{if(!n)return;let e=t.querySelector(`:scope > svg.tc-chart`);c?e?e.nextElementSibling!==n&&e.after(n):n.isConnected||t.appendChild(n):n.isConnected&&n.nextElementSibling===e||t.insertBefore(n,e??t.firstChild)},d=e=>{n&&(n.dataset.position=e,c=e===`bottom`||l()&&e===`right`!=(getComputedStyle(t).direction===`rtl`),u(),t.classList.toggle(Vi,l()),t.classList.toggle(Hi,l()&&!c))},f=()=>Number.parseFloat(getComputedStyle(t).columnGap)||0;return{beforeRender({config:c,legend:l,hidden:u}){if(!l.show||typeof document>`u`){s();return}n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-legend`),a||=(n.addEventListener(`click`,o),!0),n.dir=e.rtl?`rtl`:``,C(n,m(l.items,u,r(c)),i),i=null;let{position:p}=l,h=p===`auto`?`right`:p;d(e.rtl&&Bi[h]||h),p===`auto`&&(n.offsetWidth+f())*3>t.clientWidth&&d(`bottom`)},reservedHeight(){if(!n?.isConnected||l())return 0;let{marginTop:e,marginBottom:t}=getComputedStyle(n);return n.offsetHeight+(Number.parseFloat(e)||0)+(Number.parseFloat(t)||0)},reservedWidth(){return n?.isConnected&&l()?n.offsetWidth+f():0},afterRender:u,destroy:s}}}}let Wi=/* @__PURE__ */ new Map,Gi=/* @__PURE__ */ new WeakMap,Ki=!1;function qi(e,t){let n=Gi.get(e);if(!n){n=/* @__PURE__ */ new Map;for(let t=0;t<e.count;t++){let r=e.hitIndex(t);r&&!n.has(r.label)&&n.set(r.label,t)}Gi.set(e,n)}return n.get(t)}function Ji(){return{name:`sync`,install(e){let t=new WeakRef(e),n,r,i=()=>{n?.delete(t),r&&n?.size===0&&Wi.get(r)===n&&Wi.delete(r)},a=()=>{let a=e.config.sync,o=a?Wi.get(a)??/* @__PURE__ */ new Set:void 0;o!==n&&(i(),a&&o&&(o.add(t),Wi.set(a,o)),n=o,r=a)};a();let o=e.on(`hover`,({hit:t})=>{if(!(Ki||!n||t&&e.highlightSource!==`pointer`)){Ki=!0;try{for(let r of n){let i=r.deref();if(i||n.delete(r),!i||i===e)continue;let a=t&&i.interaction&&qi(i.interaction,t.label);a==null?i.clearHighlight():i.highlightIndex(a)}}finally{Ki=!1}}});return{afterRender:a,destroy(){o(),i()}}}}}let Yi=/* @__PURE__ */ new Map,Xi=!1;function Zi(){Xi=!1;let e=0;for(;Yi.size>0;){let t=Array.from(Yi.values());Yi.clear();for(let n of t)pe(n),e++}return e}function Qi(e,t){me.idle=Zi,Yi.set(e,t),Xi||(Xi=!0,typeof requestIdleCallback==`function`?requestIdleCallback(Zi,{timeout:1e3}):setTimeout(Zi,100))}function $i(e){Yi.delete(e)}function ea(){return{name:`table`,install(e){let t=e.element,n=t.querySelector(`:scope > .tc-table-wrap`)??void 0,r=n?.firstElementChild??null,i,a={},o=()=>{$i(a),n&&=(C(n,null),n.remove(),void 0)},s=(i,a)=>{let s=i.table??!0,c=typeof s==`object`&&s.maxRows?s.maxRows:1e3,l=s!==!1&&typeof document<`u`?i.type.table?.(Se(i),{locale:i.locale,hidden:a,rtl:e.rtl},c):void 0;if(!l){o();return}let u=s===`visible`||typeof s==`object`&&s.visible===!0,d=i.title,f=l.total??l.rows.length,p=l.rows.length>c?{columns:l.columns,rows:l.rows.slice(0,c)}:l;if(f>p.rows.length){let e=G(i.locale),t=`${e.format(p.rows.length)} of ${e.format(f)} rows`;d=d?`${d} (${t})`:t}n||=t.ownerDocument.createElement(`div`),n.className=u?`tc-table-wrap`:`tc-table-wrap tc-sr-only`,C(n,Ii(p,d),r),r=null;let m=t.querySelector(`:scope > svg.tc-chart`),h=t.querySelector(`:scope > svg.tc-chart + .tc-legend`)??m;h&&h.nextElementSibling!==n?h.after(n):n.isConnected||t.appendChild(n)};return{afterRender({config:e,hidden:t,changed:r}){if(!r&&n?.isConnected)return;let o=e.table??!0,c=i===o;i=o,c&&n?.isConnected&&n.classList.contains(`tc-sr-only`)?Qi(a,()=>s(e,t)):($i(a),s(e,t))},destroy:o}}}}function ta(e,t){if(t)return t;let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return e.highlight?.kind===`spoke`&&n?.y!=null?{x:n.x,y:n.y}:e.axis===`y`?{x:n?.x??e.x,y:e.y??e.area.y}:{x:e.x,y:n?.y??e.area.y+e.area.height/2}}function na(e,t={},n){return l(`div`,{class:`tc-tooltip-content`},t.format?t.format(e):[e.title&&l(`div`,{class:`tc-tooltip-title`},e.title),e.items.map(t=>l(`div`,{key:t.seriesIndex,class:[`tc-tooltip-item`,`tc-series`,`tc-series-${t.seriesIndex+1}`,e.seriesIndex===t.seriesIndex&&`tc-tooltip-item-active`],style:{"--tc-series-color":t.color,...n?.(t.seriesIndex)}},l(`span`,{class:`tc-tooltip-swatch`}),l(`span`,{class:`tc-tooltip-name`},t.name),l(`span`,{class:`tc-tooltip-value`},t.text))),t.footer&&l(`div`,{class:`tc-tooltip-footer`},t.footer(e))])}function ra(e,t,n,r=12,i=!1){let{x:a=0,y:o=0}=n,s=e.x+r+t.width<=a+n.width,c=e.x-r-t.width>=a,l=(i?c||!s:c&&!s)?`left`:`right`,u=l===`right`?e.x+r:e.x-r-t.width,d=Math.max(a,Math.min(u,a+n.width-t.width)),f=Math.max(o,Math.min(e.y-t.height/2,o+n.height-t.height));return{x:Math.round(d),y:Math.round(f),side:l}}function ia(e){let t=0,n=0,r=innerWidth,i=innerHeight;for(let a=e;a;){let e=getComputedStyle(a);if(e.overflowX!==`visible`||e.overflowY!==`visible`){let e=a.getBoundingClientRect();t=Math.max(t,e.left),n=Math.max(n,e.top),r=Math.min(r,e.right),i=Math.min(i,e.bottom);break}a=a.parentElement??(a.getRootNode().host||null)}return{left:t,top:n,right:r,bottom:i}}let aa=[];function oa(){for(let e of aa.splice(0).map(e=>e()))e?.()}function sa(){return{name:`tooltip`,install(e){let t=Ni(e),n=e.element,i=!n.classList.contains(`tc-container`);n.classList.add(`tc-container`);let a,o=0;return{afterRender(){let t=e.config.tooltip,i=e.active,s=i&&ta(i,e.pointer);if(t===!1||typeof document>`u`||!i||!s||!Number.isFinite(s.x)||!Number.isFinite(s.y)){o++,a?.removeAttribute(`data-visible`);return}a||(a=n.ownerDocument.createElement(`div`),a.className=`tc-tooltip`,a.setAttribute(`aria-hidden`,`true`),n.appendChild(a));let c=typeof t==`object`?t:void 0;a.classList.toggle(`tc-tooltip-light`,c?.theme===`light`);let{rtl:l}=e;a.dir=l?`rtl`:``,C(a,na(i,c,r(e.config)));let u=a,d=++o;aa.push(()=>{let t=n.querySelector(`svg.tc-chart`);if(!t||d!==o)return;let{width:r,height:a}=e.size,c=n.getBoundingClientRect(),f=t.getBoundingClientRect(),p=c.width>0&&n.offsetWidth>0?c.width/n.offsetWidth:1,m=f.width>0?f.width/r/p:1,h=f.height>0?f.height/a/p:1,g={x:(f.left-c.left)/p-n.clientLeft,y:(f.top-c.top)/p-n.clientTop},_=i.axis===`y`||i.highlight?.kind===`spoke`?s.x:i.x,v=i.axis===`y`?i.y??s.y:s.y,y=ia(n),b=ra({x:g.x+_*m,y:g.y+v*h},{width:u.offsetWidth,height:u.offsetHeight},{x:(y.left-c.left)/p-n.clientLeft,y:(y.top-c.top)/p-n.clientTop,width:(y.right-y.left)/p,height:(y.bottom-y.top)/p},12,l);return()=>{u.style.transform=`translate(${b.x}px, ${b.y}px)`,u.dataset.side=b.side,u.hasAttribute(`data-visible`)||(getComputedStyle(u).transform,u.setAttribute(`data-visible`,``))}}),V(aa,oa)},destroy(){o++,a&&(C(a,null),a.remove()),i&&n.classList.remove(`tc-container`),t?.()}}}}}let ca=()=>({name:`zoom`,install:e=>t.zoom?.install(e)??{}});function la(){return[Fi(),Ui(),sa(),ea(),zi(),Ji(),Ei(),ca()]}var ua=class extends Be{constructor(e,t){super(e,t,la())}};function da(e){return l(`mask`,{id:e,maskContentUnits:`objectBoundingBox`},l(`linearGradient`,{id:`${e}-gradient`,x1:0,y1:0,x2:0,y2:1},l(`stop`,{class:`tc-fade-start`,offset:0}),l(`stop`,{class:`tc-fade-end`,offset:1})),l(`rect`,{width:1,height:1,fill:`url(#${e}-gradient)`}))}function fa(e,t,n={}){let{percent:r=!1,nullAsZero:i=!1,hidden:a}=n,o=e.map(e=>!a?.has(Q(e))),s=e.map(()=>Array(t).fill(null));for(let n=0;n<t;n++){let t=0;r&&e.forEach((e,r)=>{let i=e.values[n];o[r]&&i!=null&&(t+=Math.abs(i))});let a=0,c=0,l,u;for(let d=0;d<e.length;d++){let f=e[d];if(!o[d])continue;let p=f.values[n],m=p!=null;if(!m&&!i)continue;let h=m?p:0;r&&(h=t===0?0:h/t);let g=s[d];if(h<0){let e={y0:c,y1:c+h};g[n]=e,c+=h,u=e}else{let e={y0:a,y1:a+h};g[n]=e,a+=h,l=e}}r&&(l&&Math.abs(a-1)<1e-9&&(l.y1=1),u&&Math.abs(c+1)<1e-9&&(u.y1=-1))}return s}function pa(e){let t=[];for(let n of e)for(let e of n)e&&t.push(e.y0,e.y1);return t}function ma(e,t,n,r,i,a){let o=[];for(let s=0;s<t;s++){let t=e.values[s];a(t)?o.push([n(s),r(t)]):i||o.push(null)}return o}function ha(e,t,n){let{curve:r=`monotone`,points:i=`none`,pointRadius:a=4,connectNulls:s=!1,area:c=n,stacked:u=!1,decimate:d,fill:f=u?`solid`:`gradient`}=e,p=i===`none`?2:a+2,{series:m}=e.data,h=ln(e.data).length,g=on(e),_=m.filter(e=>g(e).second).map(Q),v=u?fa(m,h,{percent:u===`percent`,nullAsZero:!0,hidden:_.length?/* @__PURE__ */ new Set([...t.hidden,..._]):t.hidden}):null,y=e.endLabels?o(`end-labels`)(e,t,p):null,b=Tn(y?.options??e,t,{scale:`point`,zero:c||v!==null,zero2:c,overhang:p,...v?{values:pa(v)}:{},...u===`percent`?{tickFormat:{style:`percent`}}:{}}),{x,labels:S}=b,C=e=>sn(b,m[e]),w=e=>{let t=C(e);return t(Math.min(Math.max(0,t.domain[0]),t.domain[1]))},T=e=>!g(m[e]).second&&v?.[e]||null,E=On(b,e,t,(e,t,n)=>{let r=T(e);return{x:x.at(t),y:C(e)(r?r[t]?.y1??0:n)}}),D=c&&f===`gradient`,O=`${t.id}-fade`,k=e=>!t.hidden.has(Q(e)),A=m.map((e,t)=>{if(!k(e))return[];let n=C(t),r=T(t);if(r)return r.map((e,t)=>e?[x.at(t),n(e.y1)]:null);let i=g(e).axis;return ma(e,S.length,e=>x.at(e),n,s,e=>un(e,i))}),j=A.map(e=>d!==void 0&&e.length>d?o(`decimate`)(e,d):null),M=e=>{let t=A[e],n=j[e];return n?n.map(e=>t[e]):t},N=e=>{let t=T(e);if(!t)return w(e);let n=C(e),r=t.map(e=>e?n(e.y0):null),i=j[e];return i?i.map(e=>r[e]??null):r},P=c&&l(`g`,{class:`tc-areas`},e.data.series.map((e,t)=>k(e)&&l(`g`,Dn(e,t),l(`path`,{class:[`tc-area`,D&&`tc-area-gradient`],d:Si(M(t),N(t),{curve:r}),mask:D?`url(#${O})`:void 0})))),F=gn(e),I=S.map(Z),L=[],R=e.data.series.map((e,n)=>{if(!k(e))return null;let o=M(n),s=o.filter(e=>e!=null),c=i===`all`?s:i===`last`?s.slice(-1):[],u=xi(o,{curve:r}),d=e.dashFrom==null?-1:I.indexOf(Z(e.dashFrom)),f=d>0&&d<I.length-1,{dash:p=`5 4`}=e;if(f){let r=U(x.at(d)),i=(i,a)=>l(`clipPath`,{key:`${i}-${Q(e)}`,id:`${t.id}-${i}-${n}`},l(`rect`,{x:a?r-1e5:r,y:-1e5,width:1e5,height:2e5})),a=x.at(0)<=r;L.push(i(`solid`,a),i(`dashed`,!a))}return l(`g`,Dn(f?{...e,dash:void 0}:e,n),l(`path`,{key:`line`,class:`tc-line`,d:u,"clip-path":f?`url(#${t.id}-solid-${n})`:void 0}),f&&l(`path`,{key:`dashed`,class:`tc-line tc-line-dashed`,d:u,"clip-path":`url(#${t.id}-dashed-${n})`,style:{"--tc-series-dash":Number.isFinite(p)?`${p}px`:p}}),c.length>0&&l(`g`,{class:`tc-points`},c.map(([e,t])=>_n(F,n,e,`tc-point`,U(e),U(t),a))))});return{content:[l(`defs`,{key:`defs`},b.clip.def,D&&da(O),L),b.background,l(`g`,{key:`series`,class:`tc-series-list`,"clip-path":b.clip.url},P,R),b.foreground,y?.layer(A,b.area)],interaction:E}}let ga={name:`line`,clean:$t(Qt),prepare:rn,render:(e,t)=>ha(e,t,!1),legend:e=>cn(e.data),table:(e,t,n)=>kn(e,t,n)},_a={name:`area`,clean:$t(Qt),prepare:rn,render:(e,t)=>ha(e,t,!0),legend:e=>cn(e.data),table:(e,t,n)=>kn(e,t,n)},va=e=>{let t=U(e);return t===0?0:t};function ya(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(n-r),s=Math.max(0,Math.min(i,a/2,o)),c=va(e),l=va(e+a),u=va(n),d=va(r),f=r<=n,p=va(f?r+s:r-s),m=+!!f,h=va(s);return`M${c},${u}L${c},${p}A${h},${h},0,0,${m},${va(e+s)},${d}L${va(e+a-s)},${d}A${h},${h},0,0,${m},${l},${p}L${l},${u}Z`}function ba(e,t,n,r,i=0){let a=Math.max(0,t),o=Math.abs(r-n),s=Math.max(0,Math.min(i,a/2,o)),c=va(e),l=va(e+a),u=va(n),d=va(r),f=r>=n,p=va(f?r-s:r+s),m=+!!f,h=va(s);return`M${u},${c}L${p},${c}A${h},${h},0,0,${m},${d},${va(e+s)}L${d},${va(e+a-s)}A${h},${h},0,0,${m},${p},${l}L${u},${l}Z`}function xa(e,t,n){let r=e.y??{},i=e.x??{},{fontSize:a,width:o}=t,s=n.overhang??0,c=ln(e.data),l=fn(e,t),u=Sn(e,t,n,Math.round(o/80)),d=u.probe,f=r.show!==!1,p=i.show!==!1&&c.length>0,m=c.map((e,t)=>({value:Z(e),position:0,label:l(e,t)})),h=e=>f&&e?Math.ceil(H(e.label,a)/2):0,{area:g,side:_,range:v}=We(t,e.padding,e=>({top:e.top+Math.max(s,4),bottom:e.bottom+Math.max((f?q(`bottom`,d,a):0)+Lt(r.title,a),s,4),start:e.start+Math.max((p?q(`left`,m,a):0)+Lt(i.title,a),h(d[0]),s,8),end:e.end+Math.max(h(d[d.length-1]),s,8)})),y=c.map(Z),b=Vt(y,[g.y,g.y+g.height],{paddingInner:n.paddingInner??.3,paddingOuter:n.paddingOuter??.15}),x=u.scale(v()),S=It(u.ticks(x),`bottom`,a);return Cn(e,t,_,s,{area:g,labels:c,x:b,y:x,horizontal:!0,xTicks:p?It(Pt(b,(e,t)=>l(c[t],t)),`left`,a):[],yTicks:S},y)}let Sa={name:`bar`,clean:$t(Qt),prepare:rn,render(e,t){let{radius:n=4,maxBarWidth:r=24,gap:i=2,groupPadding:a=.3,stacked:s=!1,orientation:c=`vertical`,curve:u=`monotone`}=e,d=c===`horizontal`,{series:f}=e.data,p=ln(e.data).length,m=e=>(f[e]?.type??`bar`)!==`bar`,h=f.filter((e,t)=>m(t)).map(Q),g=on(e),_=e=>g(f[e]).second,v=f.filter((e,t)=>m(t)||_(t)).map(Q),y=v.length?/* @__PURE__ */ new Set([...t.hidden,...v]):t.hidden,b=s?fa(f,p,{percent:s===`percent`,hidden:y}):null,x=e=>!!b&&!m(e)&&!_(e),S={scale:`band`,zero:!0,paddingInner:a,paddingOuter:a/2,zero2:f.some((e,t)=>_(t)&&e.type!==`line`),...b?{values:[...pa(b),...f.flatMap((e,t)=>m(t)&&!_(t)?e.values:[])]}:{},...s===`percent`?{tickFormat:{style:`percent`}}:{}},C=d?xa(e,t,S):Tn(e,t,S),{x:w,labels:T}=C,E=e=>sn(C,f[e]),D=/* @__PURE__ */ new Map,O=0,k=-1;f.forEach((e,n)=>{t.hidden.has(Q(e))||m(n)||(x(n)?(k<0&&(k=O++),D.set(n,k)):D.set(n,O++))});let A=[...D.keys()],j=Math.max(1,O),M=Math.max(0,Math.min(r,(w.bandwidth-i*(j-1))/j)),N=M*j+i*(j-1),P=(w.bandwidth-N)/2,F=e=>w.range[1]<w.range[0]?j-1-e:e,I=(e,t)=>w.at(t)+P+F(D.get(e)??0)*(M+i),L=(e,t)=>{if(x(e))return b?.[e]?.[t]??null;let n=f[e],r=n?.values[t];return un(r,g(n).axis)?{y0:0,y1:r}:null},R=T.map((e,t)=>{let n=-1,r=-1;for(let e of A){if(!x(e))continue;let i=L(e,t);i&&(i.y1>i.y0?n=e:i.y1<i.y0&&(r=e))}return{up:n,down:r}}),ee=On(C,e,t,(e,t,n)=>{let r=E(e);if(m(e)){let e=w.at(t)+w.bandwidth/2;return d?{x:r(n),y:e}:{x:e,y:r(n)}}let i=I(e,t),a=L(e,t),o=r(a?.y1??0),s=r(a?.y0??0),c=Math.min(o,s),l=Math.abs(o-s);return d?{x:o,y:i+M/2,box:{x:c,y:i,width:l,height:M}}:{x:i+M/2,y:o,box:{x:i,y:c,width:M,height:l}}},(e,t,n)=>{let r=d?t:e,a=d?e:t,o=F(Math.floor((r-(w.at(n)+P)+i/2)/(M+i)));if(o===k)return A.find(e=>{if(!x(e))return!1;let t=L(e,n);if(!t)return!1;let r=E(e),o=r(t.y0),s=r(t.y1);return a>=Math.min(o,s)-i/2&&a<=Math.max(o,s)+i/2});let s=A.find(e=>D.get(e)===o);return s!==void 0&&L(s,n)?s:void 0}),z=f.map((e,t)=>D.has(t)&&l(`g`,Dn(e,t),T.map((e,r)=>{let a=L(t,r);if(!a)return null;let o=E(t),s=a.y1<a.y0,c=Math.sign(o(a.y1)-o(a.y0)),u=a.y0===0?0:c*i,f=!x(t)||(s?R[r]?.down:R[r]?.up)===t,p=d?ba:ya;return l(`path`,{key:Z(e),class:[`tc-bar`,s&&`tc-bar-negative`,d&&`tc-bar-horizontal`],d:p(I(t,r),M,o(a.y0)+u,o(a.y1),f?n:0)})}))),te=h.length?o(`line`):null,ne=f.map((e,n)=>{if(!te||!m(n)||t.hidden.has(Q(e)))return null;let r=E(n),i=g(e).axis,a=r(Math.min(Math.max(0,r.domain[0]),r.domain[1])),o=T.map((t,n)=>{let a=e.values[n];if(!un(a,i))return null;let o=w.at(n)+w.bandwidth/2;return d?[r(a),o]:[o,r(a)]}),s=e.type===`area`&&!d;return l(`g`,Dn(e,n),s&&l(`path`,{class:`tc-area`,d:te.areaPath(o,a,{curve:u})}),l(`path`,{class:`tc-line`,d:te.linePath(o,{curve:u})}))});return{content:[l(`defs`,{key:`defs`},C.clip.def),C.background,l(`g`,{key:`series`,class:`tc-series-list`,"clip-path":C.clip.url},z,ne),C.foreground],interaction:ee}},legend:e=>cn(e.data),table:(e,t,n)=>kn(e,t,n)};function Ca(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r/2)),o=U;return`M${o(e+a)},${o(t)}H${o(e+n-a)}A${o(a)},${o(a)},0,0,1,${o(e+n)},${o(t+a)}V${o(t+r-a)}A${o(a)},${o(a)},0,0,1,${o(e+n-a)},${o(t+r)}H${o(e+a)}A${o(a)},${o(a)},0,0,1,${o(e)},${o(t+r-a)}V${o(t+a)}A${o(a)},${o(a)},0,0,1,${o(e+a)},${o(t)}Z`}let wa=864e5,Ta=[`var(--tc-color-1)`,`var(--tc-grid-color)`,`var(--tc-color-8)`],Ea=3660,Da=e=>typeof e==`string`||typeof e==`number`||e instanceof Date?J(new Date(e).getTime()):null,Oa=(e,t)=>{let n=new Date(e);return Math.floor((t?e:Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()))/wa)},ka=e=>/* @__PURE__ */ new Date(e*wa),Aa=e=>((e+4)%7+7)%7,ja=e=>Array.isArray(e)?[{name:``,values:e}]:e.series,Ma=e=>{let t=Array.isArray(e)?{series:[{name:``,values:e}]}:Y(e)?e:{};return{...t,series:Xt(t.series,e=>({...Zt(e),values:Xt(e.values,e=>({date:Da(e.date),value:J(e.value)})).filter(e=>e.date!==null)}))}};function Na(e){let t=e.utc===!0,n=(Math.floor(J(e.weekStart)??1)%7+7)%7,r=e=>(Aa(e)-n+7)%7,i=1/0,a=-1/0;for(let n of ja(e.data))for(let e of n.values){let n=Da(e.date);if(n===null)continue;let r=Oa(n,t);r<i&&(i=r),r>a&&(a=r)}let o=Da(e.to),s=Da(e.from),c=o===null?a:Oa(o,t),l=J(e.weeks),u=s===null?l!==null&&l>0&&Number.isFinite(c)?c-r(c)-(Math.min(Ea/7,Math.floor(l))-1)*7:i:Oa(s,t);c-u>=Ea&&(u=c-Ea+1);let d=Number.isFinite(u)&&Number.isFinite(c)&&c>=u?c-u+1:0,f=[];if(d){let e=ka(u),t=e.getUTCFullYear(),n=e.getUTCMonth(),i=e=>Math.floor(Date.UTC(t,n+e,1)/wa),a=c<Math.floor(Date.UTC(t+1,n,e.getUTCDate())/wa)||c+(6-r(c))-(u-r(u))<371;for(let e=u,t=1;e<=c;t++){let n=a?c:Math.min(c,i(t*12)-1),o=e-r(e);f.push({start:e,end:n,gridStart:o,columns:(n+(6-r(n))-o+1)/7}),e=n+1}}return{from:u,count:d,bands:f,columns:f.reduce((e,t)=>Math.max(e,t.columns),0),weekStart:n,row:r}}function Pa(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,{radius:o=2,utc:s=!1}=e,c=Math.min(64,Math.max(1,Math.floor(J(e.levels)??4))),u=ja(e.data),d=u.filter(e=>!t.hidden.has(X(e))),f=K(e.format,a),p={timeZone:`UTC`},m=wt(e.dateFormat??{year:`numeric`,month:`short`,day:`numeric`,...p},a),h=e.x?.format??wt({month:`short`,...p},a),g=e.y?.format??wt({weekday:`short`,...p},a),_=wt({year:`numeric`,...p},a),v=wt({year:`2-digit`,...p},a),y=/* @__PURE__ */ new Map,b=d.map(e=>{let t=/* @__PURE__ */ new Map;for(let n of e.values){let e=Da(n.date);if(e===null)continue;let r=Oa(e,s),i=J(n.value);t.set(r,i===null?t.get(r)??null:(t.get(r)??0)+i),y.set(r,i===null?y.get(r)??null:(y.get(r)??0)+i)}return t}),{from:x,count:S,bands:C,columns:w,weekStart:T,row:E}=Na(e),D=0,O=0;for(let e of y.values())e!==null&&(e<D&&(D=e),e>O&&(O=e));let k=J(e.min)??D,A=Math.max(J(e.max)??O,k),j=e.colors===`diverging`,M=j?Ta:Array.isArray(e.colors)&&e.colors.length>=2?e.colors:void 0,N=J(e.mid)??(j?0:null);if(j&&N!==null){let t=Math.max(A-N,N-k);J(e.min)===null&&(k=N-t),J(e.max)===null&&(A=N+t)}let P=e=>{let t=M&&N!==null&&k<N&&N<A?e<=N?(e-k)/(N-k)*.5:.5+(e-N)/(A-N)*.5:A>k?(e-k)/(A-k):+(e>k);return Math.min(1,Math.max(0,t))},F=e=>M?Math.round(P(e)*c):e<=k?0:Math.min(c,Math.ceil(P(e)*c)||c),I=e=>{if(!M)return`--tc-heat:${U(e/c*100)}%`;let t=e/c*(M.length-1),n=Math.min(M.length-2,Math.floor(t)),r=U((t-n)*100);return{"--tc-cell-fill":r<=0?M[n]:r>=100?M[n+1]:`color-mix(in oklab,${M[n+1]} ${r}%,${M[n]})`}},L=Ve(e.padding,0),R=e.x?.show!==!1&&S>0,ee=e.y?.show!==!1&&S>0,z=e.scale!==!1&&S>0,te=typeof e.scale==`object`?e.scale:{},ne=te.low??(M?f(k):`Less`),re=te.high??(M?f(A):`More`),ie=Array.from({length:7},(e,t)=>g(ka(3+(T+t)%7))),ae=ee?q(`left`,ie.map((e,t)=>({value:t,position:0,label:e})),i):0,oe=R?q(`top`,[{value:0,position:0,label:`M`}],i):0,se=C.length>1,ce=C.map(e=>{let t=ka(e.start),n=ka(e.end);return t.getUTCFullYear()===n.getUTCFullYear()?_(t):`${_(t)}–${v(n)}`}),le=se&&R,ue=le?Math.ceil(ce.reduce((e,t)=>Math.max(e,H(t,i)),0))+8:0,de=z?Math.ceil(i*W)+6:0,B=Ue(n,r,{top:L.top,right:L.right,bottom:L.bottom+de,left:L.left+Math.max(ae,ue)}),fe=C.length,pe=B.height-fe*oe-(fe-1)*10,V=w?Math.max(0,Math.min(B.width/w,pe/(7*fe))):0,me=Math.max(0,Math.min(J(e.gap)??2,V/4)),he=Math.max(0,V-me),ge=e=>B.y+e*(oe+V*7+10)+oe,_e=e=>B.x+e*V+me/2,ve={x:B.x,y:B.y,width:V*w,height:fe?ge(fe-1)+V*7-B.y:0},ye=e=>{let t=Math.max(0,C.findIndex(t=>e<=t.end)),n=Math.floor((e-C[t].gridStart)/7);return{x:_e(n),y:ge(t)+E(e)*V+me/2}},be=(e,t)=>{if(e<0||e>=S)return null;let n=x+e,r=ye(n),i=r.x+he/2,a=r.y+he/2,s={x:r.x,y:r.y,width:he,height:he},c=d.map((e,t)=>{let r=b[t]?.get(n)??null;return{name:e.name,seriesIndex:u.indexOf(e),value:r,text:r===null?`–`:f(r),x:i,y:a,box:s,color:e.color}});return{index:e,label:ka(n).toISOString().slice(0,10),title:m(ka(n)),x:i,area:ve,items:c,seriesIndex:t,highlight:{kind:`halo`,d:Ca(s.x-2,s.y-2,he+4,he+4,o+2)}}},xe={count:S,rows:7,hitIndex:be,hitTest(e,t){if(!V||e<ve.x)return null;let n=Math.floor((e-ve.x)/V);for(let e=0;e<fe;e++){let r=C[e],i=Math.floor((t-ge(e))/V);if(t<ge(e)||i>6||n>=r.columns)continue;let a=r.gridStart+n*7+i;return a<r.start||a>r.end?null:be(a-x)}return null}},Se=[];for(let e=x;e<x+S;e++){let t=y.get(e)??null,n=ye(e);Se.push(l(`rect`,{key:e,class:[`tc-cell`,t===null&&`tc-cell-empty`],x:U(n.x),y:U(n.y),width:U(he),height:U(he),rx:U(Math.min(o,he/2)),style:t===null?void 0:I(F(t))}))}let Ce=C.map((e,t)=>{let n=[];for(let t=0;t<e.columns;t++){let r=Math.max(e.start,e.gridStart+t*7),i=ka(r).getUTCMonth();(t===0||i!==ka(Math.max(e.start,r-7)).getUTCMonth())&&n.push({value:r,position:B.x+t*V+V/2,label:h(ka(r))})}let r=ie.map((e,n)=>({value:n,position:ge(t)+n*V+V/2,label:e})),a={x:B.x,y:ge(t),width:V*e.columns,height:V*7};return l(`g`,{key:`band-${e.start}`,class:`tc-calendar-band`},R&&zt({position:`top`,ticks:It(n,`top`,i),area:a}),ee&&zt({position:`left`,ticks:It(r,`left`,i),area:a}),le&&l(`text`,{class:`tc-tick-label tc-calendar-year`,x:U(B.x-8),y:U(ge(t)-8),"text-anchor":`end`,"aria-hidden":`true`},ce[t]))}),we=Math.min(he,i),Te=ve.y+ve.height+6+we/2,Ee=H(ne,i),De=H(re,i),Oe=c+1,ke=Ee+6+Oe*(we+me)+6+De,Ae=Math.max(B.x,B.x+ve.width-ke);return{content:[l(`g`,{key:`cells`,class:`tc-calendar-cells`},Se),Ce,z&&l(`g`,{key:`scale`,class:`tc-calendar-scale`,"aria-hidden":`true`},l(`text`,{class:`tc-tick-label`,x:U(Ae),y:U(Te),dy:`0.32em`},ne),Array.from({length:Oe},(e,t)=>l(`rect`,{key:t,class:`tc-cell`,x:U(Ae+Ee+6+t*(we+me)),y:U(Te-we/2),width:U(we),height:U(we),rx:U(Math.min(o,we/2)),style:I(t)})),l(`text`,{class:`tc-tick-label`,x:U(Ae+Ee+6+Oe*(we+me)+6),y:U(Te),dy:`0.32em`},re))],interaction:xe}}function Fa(e){let{bands:t,columns:n}=Na(e),r=t.length;if(!r)return;let i=e.x?.show===!1?0:23,a=e.y?.show===!1?0:36,o=r*i+(r-1)*10+(e.scale===!1?0:21);return{left:a,fixed:o,rows:7*r,columns:n,width:a+n*13,height:o+r*7*13}}function Ia(e){let t=Fa(e);return t&&Math.max(2,U(t.width/t.height))}function La(e,t){let n=Fa(e);if(!n||e.aspectRatio!==e.autoRatio||t>=n.width)return;let r=Math.max(0,t-n.left)/n.columns*n.rows;return Math.min(t/2,n.fixed+r)}let Ra=e=>Array.isArray(e.data)?[]:tn(ja(e.data));function za(e,t,n){let r=ja(e.data).filter(e=>!t.hidden.has(X(e))),i=e.utc===!0,a=K(e.format,t.locale),o=wt(e.dateFormat??{year:`numeric`,month:`short`,day:`numeric`,timeZone:`UTC`},t.locale),s=/* @__PURE__ */ new Map;r.forEach((e,t)=>{for(let n of e.values){let e=Da(n.date);if(e===null)continue;let a=Oa(e,i),o=s.get(a)??r.map(()=>null),c=J(n.value);c!==null&&(o[t]=(o[t]??0)+c),s.set(a,o)}});let c=[...s.keys()].sort((e,t)=>e-t);return{columns:[``,...r.map(e=>e.name)],total:c.length,rows:c.slice(0,n).map(e=>[o(ka(e)),...(s.get(e)??[]).map(e=>e===null?`–`:a(e))])}}let Ba={name:`calendar`,clean:e=>{let t=$t(Ma)(e);if(t.aspectRatio!==void 0&&t.aspectRatio!==t.autoRatio)return t;let n=Ia(t);return{...t,aspectRatio:n,autoRatio:n}},render:Pa,height:La,legend:Ra,table:za,valueLabels:{marks:`cell`,format:e=>e.format}},Va=(e,t,n,r,i)=>{let a=`A${i},${i},0,0,1,`;return`M${U(e+i)},${t}H${U(e+n-i)}${a}${U(e+n)},${U(t+i)}V${U(t+r-i)}${a}${U(e+n-i)},${U(t+r)}H${U(e+i)}${a}${e},${U(t+r-i)}V${U(t+i)}${a}${U(e+i)},${t}Z`},Ha=(e,t)=>[e.open,e.high,e.low,e.close].every(e=>un(e,t));function Ua(e){let t=t=>e.data.map(n=>Ha(n,e.y)?n[t]:null),n={data:{labels:e.data.map(e=>e.x),series:[{name:`Open`,values:t(`open`)},{name:`High`,values:t(`high`)},{name:`Low`,values:t(`low`)},{name:`Close`,values:t(`close`)}]}};return e.x&&(n.x=e.x),e.y&&(n.y=e.y),e.padding!==void 0&&(n.padding=e.padding),e.annotations&&(n.annotations=e.annotations),n}let Wa={name:`candlestick`,clean:$t(e=>Xt(e,e=>({...e,x:Jt(e.x),open:J(e.open),high:J(e.high),low:J(e.low),close:J(e.close)}))),prepare:rn,render(e,t){let{maxCandleWidth:n=16,groupPadding:r=.3,radius:i=1}=e,a=Ua(e),o=Tn(a,t,{scale:`band`,zero:!1,paddingInner:r,paddingOuter:r/2}),{x:s,y:c,labels:u}=o,d=Math.max(1,Math.min(n,s.bandwidth)),f=e=>s.at(e)+s.bandwidth/2,p=e=>e.close>=e.open,m=On(o,a,t,(e,t,n)=>({x:f(t),y:c(n)})),h=t=>{let n=t?e.data[t.index]:void 0;if(!t||!n)return t;let r=p(n)?`var(--tc-up-color,var(--tc-color-6))`:`var(--tc-negative-color,var(--tc-color-8))`;return{...t,items:t.items.map(e=>({...e,color:r}))}},g={count:m.count,hitIndex:(e,t)=>h(m.hitIndex(e,t)),hitTest:(e,t)=>h(m.hitTest(e,t))},_=e.data.map((t,n)=>{if(!Ha(t,e.y))return null;let r=U(f(n)),a=c(Math.max(t.open,t.close)),o=Math.max(c(Math.min(t.open,t.close)),a+1),s=U(f(n)-d/2),m=U(Math.min(i,d/2,(o-a)/2));return l(`g`,{key:Z(u[n]),class:[`tc-candle`,p(t)?`tc-candle-up`:`tc-candle-down`]},l(`path`,{class:`tc-candle-wick`,d:`M${r},${U(c(t.high))}V${U(c(t.low))}`}),l(`path`,{class:`tc-candle-body`,d:Va(s,U(a),U(d),U(o-a),m)}))});return{content:[l(`defs`,{key:`defs`},o.clip.def),o.background,l(`g`,{key:`series`,class:`tc-series-list tc-candles`,"clip-path":o.clip.url},_),o.foreground],interaction:g}},table:(e,t,n)=>kn(Ua(e),t,n)};function Ga(e,t,n){if(H(e,n)<=t)return e;let r=[...e];for(;r.length>2;){r.pop();let e=`${r.join(``).trimEnd()}…`;if(H(e,n)<=t)return e}return``}let Ka=(e,t)=>t>0?e/t:0;function qa(e){let t=e.data[0]?.value??0;return e.data.map((n,r)=>({data:n,value:n.value,ofFirst:r===0?1:Ka(n.value,t),ofPrevious:r===0?1:Ka(n.value,e.data[r-1].value)}))}let Ja=(e,t)=>U((t>1?.3+.7*e/(t-1):1)*100),Ya=(e,t,n)=>Math.max(0,Math.min(e,t/2,n/2));function Xa(e,t,n,r,i,a){let o=t-e,s=r-n,c=Ya(a,o,i-n),l=Ya(a,o,i-r),u=o>0?c/o:0,d=o>0?l/o:0,f=U;return`M${f(e)},${f(n+c)}Q${f(e)},${f(n)},${f(e+o*u)},${f(n+s*u)}L${f(t-o*d)},${f(r-s*d)}Q${f(t)},${f(r)},${f(t)},${f(r+l)}L${f(t)},${f(i)}L${f(e)},${f(i)}Z`}function Za(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=Math.max(0,e.radius??4),s=Ue(n,r,Ve(e.padding,0)),c=qa(e),u=c.length;if(u===0)return{content:null};let d=K(e.format,a),f=G(a,{style:`percent`,maximumFractionDigits:1}),p=typeof e.format==`function`?d:K({...e.format,notation:`compact`},a),m=i*1.3,h=e.labels===!1?0:Math.min(s.height,m*3+8),g=s.y+s.height,_=s.height-h,v=s.width/u,y=e=>s.x+e*v,b=Math.max(0,...c.map(e=>e.value)),x=e=>g-(b>0?e/b*_:0),S=e=>c[e].data.color??`color-mix(in oklab,var(--tc-funnel-color,var(--tc-color-1)) ${Ja(e,u)}%,var(--tc-surface))`,C=e=>{let t=c[e],n=y(e)+v/2,r=[{name:t.data.name,seriesIndex:0,value:t.value,text:d(t.value),x:n,y:x(t.value),color:S(e)}],i=(e,t,i)=>r.push({name:`of ${t.data.name}`,seriesIndex:e,value:i,text:f.format(i),x:n,y:null,color:`transparent`});return e>0&&i(1,c[0],t.ofFirst),e>1&&i(2,c[e-1],t.ofPrevious),{index:e,label:t.data.name,title:``,x:n,area:s,highlight:{kind:`band`,x:y(e),y:s.y,width:v,height:s.height},items:r}},w={count:u,hitIndex:e=>e>=0&&e<u?C(e):null,hitTest(e,t){return e<s.x||e>s.x+s.width||t<s.y||t>g?null:C(Math.min(u-1,Math.floor((e-s.x)/(v||1))))}},T=c.slice(1).map((e,t)=>l(`line`,{key:X(e.data),class:`tc-grid-line tc-funnel-divider`,x1:U(y(t+1)),x2:U(y(t+1)),y1:U(s.y),y2:U(g)})),E=c.map((e,t)=>l(`path`,{key:X(e.data),class:[`tc-funnel-stage`,e.data.class],"data-series":e.data.name,d:Xa(y(t),y(t+1),x(e.value),x((c[t+1]??e).value),g,o),style:{"--tc-funnel-color":e.data.color,"--tc-funnel-shade":`${e.data.color?100:Ja(t,u)}%`}})),D=h>=m*3&&c.flatMap((e,t)=>{let n=t===0?0:10,r=v-n-10,a=U(y(t)+n),o=s.y+i*.85,c=X(e.data),u=e=>H(e,i)<=r,h=Ga(e.data.name,r,i),g=d(e.value),_=u(g)?g:p(e.value),b=t>0?f.format(e.ofFirst):``;return[h&&l(`text`,{key:c,class:`tc-funnel-name`,x:a,y:U(o)},h),u(_)&&l(`text`,{key:`${c}/value`,class:`tc-funnel-value`,x:a,y:U(o+m)},_),b&&u(b)&&l(`text`,{key:`${c}/share`,class:`tc-funnel-share`,x:a,y:U(o+m*2)},b)]});return{content:[l(`g`,{class:`tc-funnel-dividers`,"aria-hidden":`true`},T),l(`g`,{class:`tc-funnel-stages`},E),D&&l(`g`,{class:`tc-funnel-labels`,"aria-hidden":`true`},D)],interaction:w}}function Qa(e,t,n){let r=K(e.format,t.locale),i=G(t.locale,{style:`percent`,maximumFractionDigits:1}),a=qa(e).map(e=>[e.data.name,r(e.value),i.format(e.ofFirst),i.format(e.ofPrevious)]),o={columns:[``,`Value`,`Of first`,`Of previous`],rows:a};return a.length>n&&(o.rows=a.slice(0,n),o.total=a.length),o}let $a={name:`funnel`,clean:$t(e=>Xt(e,e=>({...Zt(e),value:J(e.value)})).filter(e=>e.value!==null&&e.value>=0)),render:Za,table:Qa},$=1e-12,eo=Math.PI,to=eo/2,no=2*eo,ro=Math.PI/180,io=e=>e>=1?to:e<=-1?-to:Math.asin(e),ao=e=>e>1?0:e<-1?eo:Math.acos(e);function oo(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<$))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function so(e,t,n,r,i,a,o){let s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function co(e,t,n,r,i,a,o){let s=r,c=i,l=r,u=i,d=a,f=a,p=(e.padAngle??0)/2,m=p>$?e.padRadius??Math.sqrt(t*t+n*n):0,h=Math.min(Math.abs(n-t)/2,e.cornerRadius??0),g=h,_=h;if(m>$){let e=io(m/t*Math.sin(p)),a=io(m/n*Math.sin(p));d-=e*2,d>$?(e*=o?1:-1,l+=e,u-=e):(d=0,l=u=(r+i)/2),f-=a*2,f>$?(a*=o?1:-1,s+=a,c-=a):(f=0,s=c=(r+i)/2)}let v=n*Math.cos(s),y=n*Math.sin(s),b=t*Math.cos(u),x=t*Math.sin(u),S=n*Math.cos(c),C=n*Math.sin(c),w=t*Math.cos(l),T=t*Math.sin(l);if(h>$&&a<eo){let e=oo(v,y,w,T,S,C,b,x);if(e){let r=v-e[0],i=y-e[1],a=S-e[0],o=C-e[1],s=(r*a+i*o)/(Math.sqrt(r*r+i*i)*Math.sqrt(a*a+o*o)),c=1/Math.sin(ao(s)/2),l=Math.sqrt(e[0]*e[0]+e[1]*e[1]);g=Math.min(h,(t-l)/(c-1)),_=Math.min(h,(n-l)/(c+1))}else g=_=0}return{a00:l,a01:s,a10:u,a11:c,da0:d,da1:f,rc:h,rc0:g,rc1:_,x01:v,y01:y,x10:b,y10:x,x11:S,y11:C,x00:w,y00:T}}function lo(e){let t=(e.innerRadius+e.outerRadius)/2,n=(e.startAngle+e.endAngle)/2-to;return[Math.cos(n)*t,Math.sin(n)*t]}function uo(e,t,n){let r=Math.sqrt(t*t+n*n);return r>0?2*Math.asin(Math.min(1,e/2/r)):0}let fo=(e,t)=>Math.atan2(t,e);function po(e){let t=10**Math.max(0,Math.min(12,Math.floor(e.precision??2))),n=e=>{let n=Math.round(e*t)/t;return String(n===0?0:n)},r=``,i=(e,t)=>{r+=`M${n(e)},${n(t)}`},a=(e,t)=>{r+=`L${n(e)},${n(t)}`},o=(e,t,i,a)=>{r+=`A${n(e)},${n(e)},0,0,${t},${n(i)},${n(a)}`},s=(e,t,n,r)=>{let i=r?t-n:n-t;i=(i%no+no)%no,i<$&&Math.abs(n-t)>$&&(i=no);let a=r?t-i/2:t+i/2,s=+!r;o(e,s,e*Math.cos(a),e*Math.sin(a)),o(e,s,e*Math.cos(n),e*Math.sin(n))},c=Math.max(0,e.innerRadius),l=Math.max(0,e.outerRadius);l<c&&([c,l]=[l,c]);let u=e.startAngle-to,d=e.endAngle-to,f=Math.abs(d-u),p=d>u,m=+!!p;if(!(l>$)){i(0,0);for(let e=0;e<4;e++)o(0,m,0,0);a(0,0);for(let e=0;e<4;e++)o(0,m,0,0);return`${r}Z`}if(f>no-$){let e=l*Math.cos(u),t=l*Math.sin(u);i(e,t),o(l,m,e,t),s(l,u,u+(p?no:-no)*(1-1e-9),!p),o(l,m,e,t);let n=c*Math.cos(u),d=c*Math.sin(u);if(a(n,d),o(c,m,n,d),c>$)s(c,u,u+(p?-no:no)*(1-1e-9),p);else for(let e=0;e<2;e++)o(0,m,0,0);return o(c,m,n,d),`${r}Z`}let{a00:h,a01:g,a10:_,a11:v,da0:y,da1:b,rc:x,rc0:S,rc1:C,x01:w,y01:T,x10:E,y10:D,x11:O,y11:k,x00:A,y00:j}=co(e,c,l,u,d,f,p);if(b>$&&C>$){let e=so(A,j,w,T,l,C,p),t=so(O,k,E,D,l,C,p);if(i(e.cx+e.x01,e.cy+e.y01),C<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(C,m,e,n),o(l,m,e,n),o(l,m,e,n),o(C,m,e,n)}else o(C,m,e.cx+e.x11,e.cy+e.y11),s(l,fo(e.cx+e.x11,e.cy+e.y11),fo(t.cx+t.x11,t.cy+t.y11),!p),o(C,m,t.cx+t.x01,t.cy+t.y01)}else{if(i(w,T),o(l,m,w,T),b>$)s(l,g,v,!p);else for(let e=0;e<2;e++)o(l,m,w,T);o(l,m,O,k)}if(!(c>$)||!(y>$)){a(E,D);for(let e=0;e<4;e++)o(c,m,E,D)}else if(S>$){let e=so(E,D,O,k,c,-S,p),t=so(w,T,A,j,c,-S,p);if(a(e.cx+e.x01,e.cy+e.y01),S<x){let e=t.cx+t.x01,n=t.cy+t.y01;o(S,m,e,n),o(c,m,e,n),o(c,m,e,n),o(S,m,e,n)}else o(S,m,e.cx+e.x11,e.cy+e.y11),s(c,fo(e.cx+e.x11,e.cy+e.y11),fo(t.cx+t.x11,t.cy+t.y11),p),o(S,m,t.cx+t.x01,t.cy+t.y01)}else a(E,D),o(c,m,E,D),s(c,_,h,p),o(c,m,A,j);return`${r}Z`}function mo(e,t){let n=l(`path`,{class:e,d:po(t)});return n.arc=[t.innerRadius,t.outerRadius,t.startAngle,t.endAngle,t.padAngle??0,t.cornerRadius??0],n}function ho(e,t,n){let{arc:r,attrs:i}=n;if(!r||t.attrs.d===i.d)return;let a=ni(e)??t.arc,o=Number.parseFloat(getComputedStyle(e).transitionDuration)*1e3;if(a&&o>0)return ri(e,a,r,o,([e,t,n,r,i,a])=>po({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,padAngle:i,cornerRadius:a}),String(i.d)),{...i,d:t.attrs.d}}let go=Math.PI/2;function _o(e){let{data:t}=e;return typeof t==`number`?[{name:``,value:t}]:Array.isArray(t)?t:[t]}function vo(e,t){let n=e.max??100;return _o(e).map((e,t)=>({data:e,index:t,max:e.max??n})).filter(e=>!t.has(X(e.data))).map((e,t)=>({...e,position:t,value:Math.min(e.max,Math.max(0,e.data.value||0))}))}function yo(e,t,n,r,i){let a=[[0,0]],o=t+n;a.push([Math.sin(t),-Math.cos(t)],[Math.sin(o),-Math.cos(o)]);for(let e=Math.ceil(t/go)*go,n=0;n<5&&e<=o+1e-9;n++)a.push([Math.sin(e),-Math.cos(e)]),e+=go;let s=Math.min(e.width,e.height)/2,c={x0:0,y0:0,x1:0,y1:0};for(let t=0;t<4;t++){c={x0:0,y0:r,x1:0,y1:i};for(let[e,t]of a)c.x0=Math.min(c.x0,e*s),c.x1=Math.max(c.x1,e*s),c.y0=Math.min(c.y0,t*s),c.y1=Math.max(c.y1,t*s);let t=Math.min(e.width/(c.x1-c.x0),e.height/(c.y1-c.y0));if(Math.abs(t-1)<.001)break;s=Math.max(0,s*t)}return{outer:s,cx:e.x+(e.width-(c.x1-c.x0))/2-c.x0,cy:e.y+(e.height-(c.y1-c.y0))/2-c.y0}}function bo(e,t){let{width:n,height:r,locale:i}=t,a=Math.max(1,e.thickness??12),o=Math.max(0,e.gap??4),s=e.cornerRadius??a/2,c=Ve(e.padding,0),u=Ue(n,r,{top:c.top+8,right:c.right+8,bottom:c.bottom+8,left:c.left+8}),d=(e.startAngle??0)*ro,f=Math.min(360,Math.max(0,e.angle??360))*ro,p=vo(e,t.hidden),m=e.center,h=p[0],g=m!==!1&&h!==void 0,_=g?m?.label??(h.data.name||void 0):void 0,{outer:v,cx:y,cy:b}=yo(u,d,f,g?-1.4*t.fontSize:0,g?(_?2:.7)*t.fontSize:0),x=K(e.format,i),S=G(i,{style:`percent`,maximumFractionDigits:1}),C=(e,t=0)=>{let n=Math.max(0,v-e.position*(a+o));return{innerRadius:Math.max(0,n-a-t),outerRadius:n+t}},w=e=>e.max>0?e.value/e.max:0,T=(e,t=0)=>({...C(e,t),startAngle:d,endAngle:d+f*w(e),cornerRadius:s}),E=e=>{let[t,n]=lo(T(e)),r={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${x(e.value)} (${S.format(w(e))})`,x:y+t,y:b+n};return e.data.color&&(r.color=e.data.color),{index:e.position,label:e.data.name,title:``,x:y+t,area:{x:y-v,y:b-v,width:v*2,height:v*2},items:[r],seriesIndex:e.index,highlight:{kind:`halo`,d:po(T(e,2)),x:y,y:b}}},D={count:p.length,hitIndex:e=>{let t=p[e];return t?E(t):null},hitTest(e,t){let n=Math.hypot(e-y,t-b),r=p.find(e=>{let{innerRadius:t,outerRadius:r}=C(e,2);return n>=t&&n<=r});return r?E(r):null}},O=p.map(e=>l(`g`,nn(e.data,e.index),mo(`tc-gauge-track`,{...T(e),endAngle:d+f}),mo(`tc-gauge-arc`,T(e)))),k=g?m?.value??S.format(w(h)):``;return{content:[l(`g`,{class:`tc-gauge`,style:`transform:translate(${y}px,${b}px)`},l(`g`,{class:`tc-gauge-rings`},O)),g&&l(`g`,{class:`tc-gauge-center`,"aria-hidden":`true`},l(`text`,{class:`tc-gauge-value`,x:y,y:b,dy:_?`0`:`0.35em`,"text-anchor":`middle`},k),_&&l(`text`,{class:`tc-gauge-label`,x:y,y:b,dy:`1.6em`,"text-anchor":`middle`},_))],interaction:D}}function xo(e,t){let n=K(e.format,t.locale),r=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:vo(e,t.hidden).map(e=>[e.data.name,n(e.value),r.format(e.max>0?e.value/e.max:0)])}}let So={name:`gauge`,clean:$t(e=>en(typeof e==`number`?[{name:``,value:e}]:Y(e)?[e]:e)),render:bo,sweep:ho,legend:e=>tn(_o(e)),table:xo},Co=`var(--tc-heat-empty,var(--tc-grid-color))`,wo=(e,t=`var(--tc-heat-color,var(--tc-color-1))`)=>`color-mix(in oklab,${t} ${U(e*100)}%,${Co})`,To=(e,t)=>e.name??`range-${t+1}`,Eo=(e,t)=>e.findIndex(e=>(e.from===void 0||t>=e.from)&&(e.to===void 0||t<e.to)),Do=(e,t)=>e.color??(t<8?`var(--tc-color-${t+1})`:`var(--tc-color-other)`);function Oo(e,t){let{width:n,fontSize:r,locale:i}=t,{gap:a=2,radius:o=3}=e,s=ln(e.data),c=e.x?.format??(e=>String(e)),u=K(e.format,i),[d,f]=Ut(e.data.series.flatMap(e=>e.values))??[0,1],p=e.min??Math.min(0,d),m=e.max??f,h=t=>{let{mid:n}=e,r;return r=n!==void 0&&e.colors&&p<n&&n<m?t<=n?(t-p)/(n-p)*.5:.5+(t-n)/(m-n)*.5:m>p?(t-p)/(m-p):+(t>p),Math.min(1,Math.max(0,r))},g=e=>.08+.92*h(e),_=e.ranges?.length?e.ranges:void 0,v=!_&&e.colors&&e.colors.length>=2?e.colors:void 0,y=!_&&!v&&e.colorBy===`series`,b=y?e.data.series.filter(e=>!t.hidden.has(Q(e))):e.data.series,x=t=>e.data.series.indexOf(t),S=(e,n)=>{if(_){let n=Eo(_,e),r=_[n];return!r||t.hidden.has(To(r,n))?{color:Co,empty:!0}:{style:{"--tc-cell-fill":r.color},color:r.color}}if(v){let t=h(e)*(v.length-1),n=Math.min(v.length-2,Math.floor(t)),r=U((t-n)*100),i=v[n],a=r<=0?i:r>=100?v[n+1]:`color-mix(in oklab,${v[n+1]} ${r}%,${i})`;return{style:{"--tc-cell-fill":a},color:a}}let r=g(e);return{style:`--tc-heat:${U(r*100)}%`,color:y?wo(r,Do(n,x(n))):wo(r)}},{rtl:C}=t,w=e.x?.show!==!1&&s.length>0,T=e.y?.show!==!1&&b.length>0,E=b.map((e,t)=>({value:t,position:0,label:e.name})),D=T?q(`left`,E,r):0,O=w?q(`bottom`,[{value:0,position:0,label:`M`}],r):0,k=w?H(c(s[s.length-1],s.length-1),r):0,{area:A,side:j,range:M}=We(t,e.padding,e=>{let t=(n-e.start-e.end-D)/Math.max(1,s.length)/2;return{top:e.top,bottom:e.bottom+O,start:e.start+D,end:e.end+Math.max(0,Math.ceil(k/2-t))}}),N=Vt(s.map((e,t)=>t),M()),P=Vt(b.map((e,t)=>t),[A.y,A.y+A.height]),F=Math.max(0,N.bandwidth-a),I=Math.max(0,P.bandwidth-a),L=e=>N.at(e)+a/2,R=e=>P.at(e)+a/2,ee=(e,t)=>{let n=b[t]?.values[e];return n!=null&&Number.isFinite(n)?n:null},z=(e,t=0)=>{if(e<0||e>=s.length||b.length===0)return null;let n=Math.max(0,Math.min(b.length-1,t)),r=b.map((t,n)=>{let r=ee(e,n),i=_&&r!==null?_[Eo(_,r)]:void 0;return{name:t.name,seriesIndex:n,value:r,text:r===null?`–`:i?.name?`${u(r)} · ${i.name}`:u(r),x:L(e)+F/2,y:R(n)+I/2,box:{x:L(e),y:R(n),width:F,height:I},color:r===null?`var(--tc-grid-color)`:S(r,t).color}});return{index:e,label:Z(s[e]),title:c(s[e],e),x:L(e)+F/2,area:A,items:r,seriesIndex:n,highlight:{kind:`halo`,d:Ca(L(e)-2,R(n)-2,F+4,I+4,o+2)}}},te={count:s.length,reversed:C===!0,hitIndex:(e,t)=>z(e,t),hitTest(e,t){if(e<A.x||e>A.x+A.width||t<A.y||t>A.y+A.height)return null;let n=Math.min(s.length-1,Math.floor((e-A.x)/(N.step||1))),r=C?s.length-1-n:n,i=Math.min(b.length-1,Math.floor((t-A.y)/(P.step||1)));return z(r,i)}},ne=b.map((e,t)=>l(`g`,{key:Q(e),class:[`tc-heatmap-row`,y&&[`tc-series`,`tc-series-${x(e)+1}`]],"data-series":e.name,style:y?{"--tc-series-color":e.color}:void 0},s.map((n,r)=>{let i=ee(r,t),a=i===null?void 0:S(i,e);return l(`rect`,{key:Z(n),class:[`tc-cell`,(i===null||a?.empty)&&`tc-cell-empty`],x:U(L(r)),y:U(R(t)),width:U(F),height:U(I),rx:U(Math.min(o,F/2,I/2)),style:a?.style})}))),re=w?It(Pt(N,(e,t)=>c(s[t],t)),`bottom`,r):[],ie=T?Pt(P,(e,t)=>b[t]?.name??``):[];return{content:[l(`g`,{class:`tc-heatmap-cells`},ne),w&&zt({position:`bottom`,ticks:re,area:A}),T&&zt({position:j,ticks:ie,area:A})],interaction:te}}function ko(e){let{ranges:t}=e;if(t?.length){let n=K(e.format,e.locale);return t.map((e,t)=>({key:To(e,t),name:e.name??(e.from===void 0?`< ${n(e.to??0)}`:e.to===void 0?`≥ ${n(e.from)}`:`${n(e.from)}–${n(e.to)}`),index:t,color:e.color}))}return e.colors&&e.colors.length>=2?[]:e.colorBy===`series`?cn(e.data):[]}let Ao={name:`heatmap`,clean:$t(Qt),render:Oo,legend:ko,valueLabels:{marks:`cell`,format:e=>e.format},table:(e,t,n)=>kn({data:e.data,...e.x?{x:e.x}:{},y:{format:e.format}},t,n)};function jo(e,t){let n=Math.min(t.max,Math.max(1,J(e?.scale)??1)),r=t.k*n,i=(e,t,n)=>{let i=n/r;return i>=t?(t-i)/2:Math.min(t-i,Math.max(0,e??0))};return r>0?{x:i(J(e?.x),t.mapWidth,t.width),y:i(J(e?.y),t.mapHeight,t.height),scale:n}:{x:0,y:0,scale:n}}let Mo=`http://www.w3.org/2000/svg`,No=[`M12 5v14M5 12h14`,`M5 12h14`];function Po(){return{name:`map`,install(e){let t=e.element;if(typeof t.addEventListener!=`function`)return{};let n=t.ownerDocument,r=n.defaultView,i=()=>e.config,a=()=>e.config.type.name===`map`,o=()=>a()&&!!i().zoom,s=()=>e.interaction?.map,l=()=>t.querySelector(`:scope > svg.tc-chart`),u=e=>e.target?.closest?.(`svg.tc-chart`)===l()&&!!l(),d=0,f=/* @__PURE__ */ new Map,p=!1,m,h=!t.classList.contains(`tc-container`),g=()=>r?.cancelAnimationFrame(d),_=()=>{let e=s();return e&&jo(i().view,e)},v=t=>{let n=s();n&&e.update({view:jo(t,n)})},y=(t,n)=>{let r=l(),{width:i,height:a}=e.size,o=r?c(r,t,n,i,a):{x:0,y:0};return[o.x,o.y]},b=(e,t)=>{let n=s(),r=_();if(!n||!r)return null;let i=n.k*r.scale,[a,o]=y(e,t);return[r.x+(a-n.x)/i,r.y+(o-n.y)/i]},x=e=>{g();let t=s(),n=_();if(!t||!n)return;let a=jo(e,t);if(i().animate===!1||!r?.requestAnimationFrame||r.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){v(a);return}let o=performance.now(),c=e=>{let t=Math.min((e-o)/200,1),i=1-(1-t)**3,s=(e,t)=>e+(t-e)*i;v({x:s(n.x,a.x),y:s(n.y,a.y),scale:1/s(1/n.scale,1/a.scale)}),t<1&&(d=r.requestAnimationFrame(c))};d=r.requestAnimationFrame(c)},S=(e,t,n=!1)=>{let r=s(),i=_();if(!r||!i||!(r.k>0))return;let a=Math.min(r.max,Math.max(1,i.scale*e)),o=r.k*i.scale,[c,l]=t??[i.x+r.width/o/2,i.y+r.height/o/2],u={x:c-(c-i.x)*i.scale/a,y:l-(l-i.y)*i.scale/a,scale:a};n?x(u):(g(),v(u))},C=t=>{let n=i(),r=t?.region;if(!a()||!n.select||!r)return;let o=[...n.selected??[]],s=o.filter(e=>e!==r),c=s.length<o.length?s:n.select===`multiple`?[...o,r]:[r];e.update({selected:c}),n.onSelect?.(c,r)},w=t=>{f.delete(t.pointerId),f.size===0&&(n.removeEventListener(`pointerup`,w),n.removeEventListener(`pointercancel`,w),p&&e.update({}))},T=e=>{o()&&u(e)&&(e.pointerType!==`mouse`||e.button===0)&&(f.size===0&&(p=!1),f.set(e.pointerId,[e.clientX,e.clientY]),g(),n.addEventListener(`pointerup`,w),n.addEventListener(`pointercancel`,w))},E=t=>{let n=f.get(t.pointerId),r=_(),i=s();if(!n||!r||!i)return;let a=[t.clientX,t.clientY];if(!p){if(f.size===1&&Math.hypot(a[0]-n[0],a[1]-n[1])<4)return;p=!0;try{l()?.setPointerCapture(t.pointerId)}catch{}}if(t.stopPropagation(),e.clearHighlight(),f.set(t.pointerId,a),f.size===1){let e=i.k*r.scale,[t,o]=y(n[0],n[1]),[s,c]=y(a[0],a[1]);v({x:r.x-(s-t)/e,y:r.y-(c-o)/e,scale:r.scale});return}let o=[...f].find(([e])=>e!==t.pointerId)?.[1];if(!o)return;let c=Math.hypot(n[0]-o[0],n[1]-o[1]),u=Math.hypot(a[0]-o[0],a[1]-o[1]);c>0&&u>0&&S(u/c,b((a[0]+o[0])/2,(a[1]+o[1])/2))},D=e=>{let{zoom:t}=i();o()&&(typeof t!=`object`||t.wheel!==!1)&&u(e)&&(e.preventDefault(),S(Math.exp(-e.deltaY*(e.ctrlKey?.01:.002)),b(e.clientX,e.clientY)))},O=e=>{o()&&u(e)&&S(2,b(e.clientX,e.clientY),!0)},k=e=>{p&&e.stopPropagation(),p=!1},A=t=>{if(t.target!==l()||!a())return;let{key:n}=t;if(o()&&(n===`+`||n===`=`))S(2,null,!0);else if(o()&&n===`-`)S(1/2,null,!0);else if(o()&&n===`0`)x({x:0,y:0,scale:1});else if(i().select&&(n===`Enter`||n===` `)&&e.active)C(e.active);else return;t.preventDefault()},j=e=>{let t=e.target.closest(`button`);t&&S(t.value===`in`?2:1/2,null,!0)};t.addEventListener(`pointermove`,E,!0),t.addEventListener(`click`,k,!0),t.addEventListener(`pointerdown`,T),t.addEventListener(`wheel`,D,{passive:!1}),t.addEventListener(`dblclick`,O),t.addEventListener(`keydown`,A);let M=e.on(`click`,({hit:e})=>C(e));return{svgAttrs:()=>o()?{"data-zoom":p&&f.size?`drag`:``}:void 0,afterRender:()=>{if(!o()){m?.remove(),m=void 0;return}if(!m){m=n.createElement(`div`),m.className=`tc-map-zoom`;for(let[e,t]of No.entries()){let r=n.createElement(`button`);r.type=`button`,r.className=`tc-download-toggle`,r.value=e?`out`:`in`;let i=n.createElementNS(Mo,`svg`);i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`width`,`16`),i.setAttribute(`height`,`16`),i.setAttribute(`aria-hidden`,`true`);let a=n.createElementNS(Mo,`path`);a.setAttribute(`d`,t),i.append(a),r.append(i),m.append(r)}m.addEventListener(`click`,j),t.classList.add(`tc-container`)}m.isConnected||t.append(m);let{zoom:e}=i(),r=typeof e==`object`?e.labels:void 0,a=_(),c=s()?.max??1,[l,u]=m.querySelectorAll(`button`);l&&u&&a&&(l.setAttribute(`aria-label`,r?.in??`Zoom in`),u.setAttribute(`aria-label`,r?.out??`Zoom out`),l.disabled=a.scale>=c,u.disabled=a.scale<=1)},destroy(){g(),M(),t.removeEventListener(`pointermove`,E,!0),t.removeEventListener(`click`,k,!0),t.removeEventListener(`pointerdown`,T),t.removeEventListener(`wheel`,D),t.removeEventListener(`dblclick`,O),t.removeEventListener(`keydown`,A),n.removeEventListener(`pointerup`,w),n.removeEventListener(`pointercancel`,w),m?.remove(),m&&h&&t.classList.remove(`tc-container`)}}}}}let Fo=`var(--tc-heat-empty,var(--tc-grid-color))`;function Io(e,t,n,r,i){return{position(i){let a=r&&n!==null&&e<n&&n<t?i<=n?(i-e)/(n-e)*.5:.5+(i-n)/(t-n)*.5:t>e?(i-e)/(t-e):+(i>e);return Math.min(1,Math.max(0,a))},paint(e){if(r){let t=e*(r.length-1),n=Math.min(r.length-2,Math.floor(t)),i=U((t-n)*100),a=r[n],o=i<=0?a:i>=100?r[n+1]:`color-mix(in oklab,${r[n+1]} ${i}%,${a})`;return{style:{"--tc-cell-fill":o},color:o}}let t=U((i+(1-i)*e)*100);return{style:`--tc-heat:${t}%`,color:`color-mix(in oklab,var(--tc-heat-color,var(--tc-color-1)) ${t}%,${Fo})`}}}}let Lo=e=>e.select===`multiple`?e.selected??[]:e.select===`single`?(e.selected??[]).slice(0,1):[],Ro=.2,zo=Math.PI/180,Bo={};function Vo(e,t){Bo[e]=t}let Ho=e=>Y(e)&&Y(e.regions)&&(J(e.width)??0)>0&&(J(e.height)??0)>0;function Uo(e){let t=[],n=[],r=0,i=0;for(let[,a=``,o=``]of e.matchAll(/([MLHVZ])([^MLHVZ]*)/gi)){let e=(o.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi)??[]).map(Number),s=a>=`a`,c=a.toUpperCase();if(c===`Z`){n.length&&(r=n[0],i=n[1]);continue}let l=c===`H`||c===`V`?1:2;for(let a=0;a+l<=e.length;a+=l){let o=e[a],l=e[a+1];c===`H`?r=s?r+o:o:c===`V`?i=s?i+o:o:(r=s?r+o:o,i=s?i+l:l),c===`M`&&a===0&&(n=[],t.push(n)),n.push(r,i)}}return t}let Wo=/* @__PURE__ */ new WeakMap;function Go(e){let t=Wo.get(e);if(t)return t;t=/* @__PURE__ */ new Map;for(let[n,r]of Object.entries(e.regions)){if(!Y(r)||typeof r.path!=`string`)continue;let e=Uo(r.path).filter(e=>e.every(Number.isFinite)),i=[1/0,1/0,-1/0,-1/0],a=0,o=0,s=-1;for(let t of e){let e=1/0,n=1/0,r=-1/0,c=-1/0;for(let i=0;i<t.length;i+=2)e=Math.min(e,t[i]),r=Math.max(r,t[i]),n=Math.min(n,t[i+1]),c=Math.max(c,t[i+1]);i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],n),i[2]=Math.max(i[2],r),i[3]=Math.max(i[3],c);let l=(r-e)*(c-n);l>s&&(s=l,a=(e+r)/2,o=(n+c)/2)}s<0||t.set(n,{code:n,name:qt(r.name)||n,path:r.path,point:r.point===!0,rings:e,box:i,x:a,y:o})}return Wo.set(e,t),t}function Ko(e,t,n){let r=!1;for(let i of e)for(let e=0,a=i.length-2;e<i.length;a=e,e+=2){let o=i[e],s=i[e+1],c=i[a],l=i[a+1];s>n!=l>n&&t<(c-o)*(n-s)/(l-s)+o&&(r=!r)}return r}let qo=(e,t,n)=>`M${U(e-n)} ${U(t)}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0Z`;function Jo(e,t){let{width:n,height:r,fontSize:i,locale:a}=t;if(typeof e.map==`string`&&!Bo[e.map])throw Error(`[tabler-charts] Map "${e.map}" is not registered. Import it (e.g. from '@tabler/charts/maps/world') and call addMap('${e.map}', data).`);let o=typeof e.map==`string`?Bo[e.map]:e.map;if(!Ho(o))return{content:null};let s=Go(o),c=e.data??{},u=K(e.format,a),d=Math.max(0,J(e.markerRadius)??4),f=[],p=/* @__PURE__ */ new Map,m=1/0,h=-1/0;for(let e of Object.keys(c)){let t=s.get(e),n=J(c[e]);t&&n!==null&&(p.set(t,f.length),f.push({shape:t,value:n}),n<m&&(m=n),n>h&&(h=n))}let g=f.length,_=J(e.min)??(g?Math.min(0,m):0),v=J(e.max)??(g?h:1),y=e.colors&&e.colors.length>=2?e.colors:void 0,{position:b,paint:x}=Io(_,v,J(e.mid),y,.1),S=Ve(e.padding,0),C=e.scale!==!1&&g>0,w=C?Math.ceil(i*W)+8:0,T=Ue(n,r,{...S,bottom:S.bottom+w}),E=typeof e.zoom==`object`?e.zoom:{},D={...T,k:Math.max(0,Math.min(T.width/o.width,T.height/o.height)),mapWidth:o.width,mapHeight:o.height,max:Math.max(1,J(E.max)??8)},O=jo(e.view,D),k=Math.round(D.k*O.scale*1e4)/1e4,A=U(T.x-O.x*k),j=U(T.y-O.y*k),M=e=>A+e*k,N=e=>j+e*k,P=O.scale>1,F=new Set(Lo(e)),{projection:I}=o,L=Y(I)&&J(I.scale)!==null&&Array.isArray(I.translate)&&I.translate.slice(0,2).every(e=>J(e)!==null)?(e,t)=>[M(e*zo*I.scale+I.translate[0]),N(I.translate[1]-1.25*Math.log(Math.tan(Math.PI/4+.4*t*zo))*I.scale)]:void 0,R=[];if(L&&k>0)for(let t of e.markers??[]){let[e,n]=L(t.lng,t.lat);Number.isFinite(e)&&Number.isFinite(n)&&R.push({name:t.name??``,x:e,y:n})}let ee=f.length;for(let e of R)f.push({marker:e,value:null});let z=f.length;for(let e of s.values())e.point||p.has(e)||(p.set(e,f.length),f.push({shape:e,value:null}));let te=e=>{let t=f[e];if(!t)return null;let{shape:n,marker:r}=t,i=r??(n?.point?{x:M(n.x),y:N(n.y)}:void 0),a=i?.x??M(n?.x??0),o=i?.y??N(n?.y??0),s=r?.name??n?.name??``,c=t.value;return{index:e,label:n?.code??s,...n?{region:n.code}:{marker:s},title:``,x:a,area:T,items:[{name:s,seriesIndex:0,value:c,text:c===null?``:u(c),x:a,y:o,color:r?`var(--tc-map-marker-color,var(--tc-color-1))`:c===null?Fo:x(b(c)).color}],highlight:{kind:`halo`,d:i?qo(i.x,i.y,d+3):(n?.rings??[]).map(e=>{let t=``;for(let n=0;n<e.length;n+=2)t+=`${n?`L`:`M`}${Math.round(M(e[n])*10)/10} ${Math.round(N(e[n+1])*10)/10}`;return`${t}Z`}).join(``)}}},ne={count:z,map:D,hitIndex:te,hitTest(e,t){if(!(k>0)||e<T.x||e>T.x+T.width||t<T.y||t>T.y+T.height)return null;let n=n=>Math.hypot(n.x-e,n.y-t)<=d+4;for(let e=z-1;e>=ee;e--)if(n(f[e]?.marker))return te(e);for(let e=0;e<g;e++){let t=f[e]?.shape;if(t.point&&n({x:M(t.x),y:N(t.y)}))return te(e)}let r=(e-A)/k,i=(t-j)/k;for(let[e,t]of p){let[n,a,o,s]=e.box;if(!(e.point||r<n||r>o||i<a||i>s)&&Ko(e.rings,r,i))return te(t)}return null}},re=[],ie=[],ae=[];for(let e of s.values()){let t=p.get(e),n=t===void 0?null:f[t]?.value??null,r=n===null?void 0:x(b(n)).style,i=F.has(e.code)&&`tc-region-selected`;e.point?n!==null&&ae.push(l(`circle`,{key:e.code,class:[`tc-region tc-region-point tc-cell`,i],"data-region":e.code,cx:U(M(e.x)),cy:U(N(e.y)),r:d,style:r})):(i?ie:re).push(l(`path`,{key:e.code,class:[`tc-region`,n===null?`tc-region-empty`:`tc-cell`,i],"data-region":e.code,d:e.path,style:r}))}let oe=new Map(R.map(e=>[e.name,e])),se=(e.lines??[]).flatMap((e,t)=>{let n=oe.get(e.from),r=oe.get(e.to);if(!n||!r)return[];let i=(n.x+r.x)/2+(r.y-n.y)*Ro,a=(n.y+r.y)/2-(r.x-n.x)*Ro;return l(`path`,{key:`${e.from}›${e.to}›${t}`,class:`tc-map-line`,d:`M${U(n.x)} ${U(n.y)}Q${U(i)} ${U(a)} ${U(r.x)} ${U(r.y)}`})}),ce=typeof e.scale==`object`?e.scale:{},le=ce.low??u(_),ue=ce.high??u(v),de=H(le,i),B=de+8+120+8+H(ue,i),fe=Math.round(T.x+Math.max(0,(T.width-B)/2)),pe=Math.round(fe+de+8),V=T.y+T.height+8+(w-8)/2,me=e.select===`single`||e.select===`multiple`,he=`${t.id}-map`;return{content:[P&&l(`clipPath`,{key:`clip`,id:he},l(`rect`,{x:T.x,y:T.y,width:T.width,height:T.height})),l(`g`,{key:`map`,class:[`tc-map`,me&&`tc-map-selectable`],"clip-path":P?`url(#${he})`:void 0},k>0&&l(`g`,{key:`regions`,class:`tc-map-regions`,transform:`translate(${A} ${j}) scale(${k})`},re,ie),l(`g`,{key:`points`,class:`tc-map-points`},ae),l(`g`,{key:`lines`,class:`tc-map-lines`},se),l(`g`,{key:`markers`,class:`tc-map-markers`},R.map((e,t)=>l(`circle`,{key:`${e.name}›${t}`,class:`tc-map-marker`,"data-marker":e.name,cx:U(e.x),cy:U(e.y),r:d})))),C&&l(`g`,{key:`scale`,class:`tc-map-scale`,"aria-hidden":`true`,"shape-rendering":`crispEdges`},l(`text`,{class:`tc-tick-label`,x:fe,y:U(V),dy:`0.32em`},le),Array.from({length:24},(e,t)=>l(`rect`,{key:t,class:`tc-cell`,x:pe+t*5,y:U(V-4),width:5,height:8,style:x(t/23).style})),l(`text`,{class:`tc-tick-label`,x:pe+120+8,y:U(V),dy:`0.32em`},ue))],interaction:ne}}function Yo(e,t,n){let r=typeof e.map==`string`?Bo[e.map]:e.map,i=Ho(r)?Go(r):void 0,a=K(e.format,t.locale),o=[];for(let[t,n]of Object.entries(e.data??{})){let e=J(n),r=i?.get(t);r&&e!==null&&o.push([r.name,a(e)])}return{columns:[``,`Value`],total:o.length,rows:o.slice(0,n)}}function Xo(e){let t=typeof e.map==`string`?Bo[e.map]:e.map;if(!Ho(t))return;let n=e.scale!==!1&&Object.keys(e.data??{}).length>0;return U(600/(600*t.height/t.width+(n?23:0)))}let Zo=e=>{let t=e,n={};if(Y(t.data))for(let[e,r]of Object.entries(t.data)){let t=J(r);t!==null&&(n[e]=t)}return{...e,map:typeof t.map==`string`||Ho(t.map)?t.map:void 0,data:n,colors:Kt(t.colors).filter(e=>typeof e==`string`&&e.trim()!==``),markers:Xt(t.markers,e=>({lat:J(e.lat),lng:J(e.lng),...typeof e.name==`string`?{name:e.name}:{}})).filter(e=>e.lat!==null&&e.lng!==null),lines:Xt(t.lines,e=>({from:qt(e.from),to:qt(e.to)})),select:t.select===`single`||t.select===`multiple`?t.select:void 0,selected:Kt(t.selected).filter(e=>typeof e==`string`),view:Y(t.view)?t.view:void 0,onSelect:typeof t.onSelect==`function`?t.onSelect:void 0}},Qo={name:`map`,clean:e=>{let t=Zo(e);if(t.aspectRatio!==void 0&&t.aspectRatio!==t.autoRatio)return t;let n=Xo(t);return{...t,aspectRatio:n,autoRatio:n}},render:Jo,table:Yo,plugins:[Po()]},$o=5e3;function es(e,t){return e.data.map((e,t)=>({data:e,index:t,seats:Math.min($o,Math.max(0,Math.round(e.seats||0)))})).filter(e=>!t.has(X(e.data))).map((e,t)=>({...e,position:t}))}function ts(e,t){let n=Math.min($o,t.reduce((e,t)=>e+t.seats,0)),r=Math.min($o,Math.round(e.total??0));return{taken:n,total:Math.max(n,r>0?r:0)}}function ns(e,t){let n=t.reduce((e,t)=>e+t,0),r=t.map(t=>Math.floor(e*t/n)),i=e-r.reduce((e,t)=>e+t,0),a=t.map((t,i)=>({i,lost:e*t/n-r[i]})).sort((e,t)=>t.lost-e.lost||t.i-e.i);for(let{i:e}of a){if(i<=0)break;r[e]=r[e]+1,i--}return r}function rs(e,t,n,r,i,a){let o={x0:0,y0:0,x1:0,y1:0};if(e<=0)return{seats:[],dot:0,box:o};let s=1-i,c=r>=Math.PI*2-1e-9,l=e=>Array.from({length:e},(t,n)=>e>1?i+n*s/(e-1):1),u=e=>e>1?s/(e-1):s,d=e=>{let t=u(e);return l(e).reduce((e,n)=>e+Math.floor(n*r/t)+ +!c,0)},f=t&&t>0?Math.min(Math.round(t),e):1;if(!t)for(;f<e&&d(f)<e;)f++;let p=l(f),m=u(f),h=ns(e,p),g=[],_=f>1?m:1/0;p.forEach((e,t)=>{let i=h[t],a=i>1?r/(c?i:i-1):0;i>1&&(_=Math.min(_,e*a));for(let o=0;o<i;o++){let s=i>1?n+o*a:n+r/2;g.push({x:e*Math.sin(s),y:-e*Math.cos(s),angle:s,row:t})}}),g.sort((e,t)=>e.angle-t.angle||e.row-t.row);let v=(Number.isFinite(_)?_:s)*(1-a)*.5;for(let e of g)o.x0=Math.min(o.x0,e.x-v),o.x1=Math.max(o.x1,e.x+v),o.y0=Math.min(o.y0,e.y-v),o.y1=Math.max(o.y1,e.y+v);return{seats:g,dot:v,box:o}}function is(e,t){let{width:n,height:r,locale:i}=t,a=Ue(n,r,Ve(e.padding,0)),o=Math.min(360,Math.max(0,e.angle??180))*ro,s=(e.startAngle??-(o/ro)/2)*ro,c=Math.min(.95,Math.max(0,e.innerRadius??.45)),u=Math.min(.9,Math.max(0,e.gap??.35)),d=es(e,t.hidden),{taken:f,total:p}=ts(e,d),m=rs(p,e.rows,s,o,c,u),h=e.center,g=h!==!1,_=g?h?.label:void 0,v=o<=Math.PI+1e-9&&Math.abs(s+o/2)<1e-9,y=t.fontSize,b=g?v?-(_?3.4:2.1)*y:-1.4*y:0,x=g?v?0:(_?2:.7)*y:0,S=Math.min(a.width,a.height)/2,C={x0:0,y0:0,x1:0,y1:0};for(let e=0;e<4&&S>0;e++){C={x0:Math.min(m.box.x0*S,0),y0:Math.min(m.box.y0*S,b),x1:Math.max(m.box.x1*S,0),y1:Math.max(m.box.y1*S,x)};let e=Math.min(a.width/(C.x1-C.x0),a.height/(C.y1-C.y0));if(Math.abs(e-1)<.001)break;S=Math.max(0,S*e)}let w=a.x+(a.width-(C.x1-C.x0))/2-C.x0,T=a.y+(a.height-(C.y1-C.y0))/2-C.y0,E=U(m.dot*S),D=e=>[w+e.x*S,T+e.y*S],O=0,k=d.map(e=>{let t=O;return O+=e.seats,m.seats.slice(t,O)}),A=m.seats.slice(f,p),j=d.filter(e=>e.seats>0),M=K(e.format,i),N=G(i,{style:`percent`,maximumFractionDigits:1}),P=(e,t)=>{let n=k[e.position],r=0,i=0;if(t)[r,i]=D(t);else for(let e of n){let[t,a]=D(e);r+=t/n.length,i+=a/n.length}let a={name:e.data.name,seriesIndex:e.index,value:e.seats,text:`${M(e.seats)} (${N.format(p>0?e.seats/p:0)})`,x:r,y:i};e.data.color&&(a.color=e.data.color);let o=E+3,s=n.map(e=>{let[t,n]=D(e);return`M${U(t+o)},${U(n)}A${o},${o},0,1,1,${U(t-o)},${U(n)}A${o},${o},0,1,1,${U(t+o)},${U(n)}Z`}).join(``);return{index:j.indexOf(e),label:e.data.name,title:``,x:r,area:{x:w-S,y:T-S,width:S*2,height:S*2},items:[a],seriesIndex:e.index,highlight:{kind:`halo`,d:s}}},F={count:j.length,hitIndex:e=>{let t=j[e];return t?P(t):null},hitTest(e,t){let n=E+2,r;for(let i of j)for(let a of k[i.position]){let[o,s]=D(a),c=Math.hypot(e-o,t-s);c<=n&&(!r||c<r.d)&&(r={party:i,seat:a,d:c})}return r?P(r.party,r.seat):null}},I=(e,t,n)=>{let[r,i]=D(e);return l(`circle`,{key:t,class:n,r:E,style:`transform:translate(${U(r-w)}px,${U(i-T)}px)`})},L=d.map(e=>l(`g`,nn(e.data,e.index),k[e.position].map((e,t)=>I(e,t,`tc-seat`)))),R=g?h?.value??M(p):``;return{content:[l(`g`,{class:`tc-parliament`,style:`transform:translate(${U(w)}px,${U(T)}px)`},l(`g`,{class:`tc-parliament-seats`},L,A.length>0&&l(`g`,{key:`vacant`,class:`tc-parliament-vacant`},A.map((e,t)=>I(e,t,`tc-seat tc-seat-vacant`))))),g&&l(`g`,{class:`tc-parliament-center`,"aria-hidden":`true`},_&&l(`text`,{class:`tc-parliament-label`,x:U(w),y:U(T),dy:v?`-2.5em`:`1.6em`,"text-anchor":`middle`},_),l(`text`,{class:`tc-parliament-value`,x:U(w),y:U(T),dy:v?`-0.4em`:_?`0`:`0.35em`,"text-anchor":`middle`},R))],interaction:F}}function as(e,t){let n=es(e,t.hidden),{total:r}=ts(e,n),i=K(e.format,t.locale),a=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Seats`,`Share`],rows:n.map(e=>[e.data.name,i(e.seats),a.format(r>0?e.seats/r:0)])}}let os={name:`parliament`,clean:$t(e=>Xt(e,e=>({...Zt(e),seats:J(e.seats)??0}))),render:is,legend:e=>tn(e.data),table:as};function ss(e,t,n=`Others`){let r=e.map((e,t)=>({data:e,index:t,value:Math.max(0,e.value||0)})),i=Number.isFinite(t)&&t>=0?t:9,a=i?Math.max(1,Math.round(i)):1/0;if(r.length<=a)return r;let o=new Set([...r].sort((e,t)=>t.value-e.value||e.index-t.index).slice(0,a-1)),s=r.reduce((e,t)=>o.has(t)?e:e+t.value,0);return[...r.filter(e=>o.has(e)),{data:{name:n,id:`__others__`,value:s},index:Math.max(8,r.length),value:s,others:!0}]}function cs(e){return e.map(({data:e,index:t})=>{let n={key:X(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}let ls=e=>({...e,slices:ss(e.data,e.maxSlices,e.othersLabel)}),us=e=>cs(e.slices);function ds(e,t){let n=e.slices.filter(e=>!t.has(X(e.data)));return e.order===`size`&&n.sort((e,t)=>Number(!!e.others)-Number(!!t.others)||t.value-e.value||e.index-t.index),{segments:n,total:n.reduce((e,t)=>e+t.value,0)}}function fs(e,t){let{width:n,height:r,locale:i}=t,a=Math.max(0,e.gap??2),o=Math.max(0,e.radius??4),s=Ue(n,r,Ve(e.padding,0)),{segments:c,total:u}=ds(e,t.hidden),d=c.filter(e=>e.value>0),f=s.x,p=d.map((e,n)=>{let r=e.value/u*s.width,i=n===0?0:a/2,o=n===d.length-1?0:a/2,c=Math.max(0,r-i-o),l=f+i,p={x:t.rtl?s.x*2+s.width-l-c:l,y:s.y,width:c,height:s.height};return f+=r,p}),m=K(e.format,i),h=G(i,{style:`percent`,maximumFractionDigits:1}),g=e=>{let t=d[e],n=p[e],r=n.x+n.width/2,i={name:t.data.name,seriesIndex:t.index,value:t.value,text:`${m(t.value)} (${h.format(t.value/u)})`,x:r,y:n.y+n.height/2,box:n};t.data.color&&(i.color=t.data.color);let a=U;return{index:e,label:t.data.name,title:``,x:r,area:s,items:[i],seriesIndex:t.index,highlight:{kind:`halo`,d:`M${a(n.x+1)},${a(n.y+1)}h${a(n.width-2)}v${a(n.height-2)}h${a(2-n.width)}Z`}}},_={count:d.length,reversed:t.rtl===!0,hitIndex:e=>d[e]?g(e):null,hitTest(e,t){if(t<s.y||t>s.y+s.height)return null;let n=p.findIndex(t=>e>=t.x-a/2&&e<=t.x+t.width+a/2);return n<0?null:g(n)}};return{content:l(`g`,{class:`tc-percentage-bar`},d.length===0&&l(`rect`,{key:`track`,class:`tc-percentage-bar-track`,x:U(s.x),y:U(s.y),width:U(s.width),height:U(s.height),rx:U(Math.min(o,s.width/2,s.height/2))}),c.map(e=>{let t=p[d.indexOf(e)];return l(`g`,nn(e.data,e.index),t&&l(`rect`,{class:`tc-segment`,x:U(t.x),y:U(t.y),width:U(t.width),height:U(t.height),rx:U(Math.min(o,t.width/2,t.height/2))}))})),interaction:_}}function ps(e,t){let{segments:n,total:r}=ds(e,t.hidden),i=K(e.format,t.locale),a=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}let ms={name:`percentage-bar`,clean:e=>{let t=e;return{...t,data:en(t.data),height:t.height??(t.aspectRatio?void 0:16)}},prepare:ls,render:fs,legend:us,table:ps,valueLabels:{marks:`cell`}};function hs(e,t){let n=e.slices.filter(e=>!t.has(X(e.data))),r=n.reduce((e,t)=>e+t.value,0),i=(e.startAngle??0)*ro;return{slices:n.map(e=>{let t=r>0?e.value/r*Math.PI*2:0,n={...e,startAngle:i,endAngle:i+t};return i+=t,n}),total:r}}function gs(e,t,n){let{width:r,height:i,locale:a}=t,s=e.gap??2,{slices:c,total:u}=hs(e,t.hidden),d=c.filter(e=>e.value>0),f=K(e.format,a),p=G(a,{style:`percent`,maximumFractionDigits:1}),m=Ue(r,i,Ve(e.padding,0)),h=e.labels===!0?`share`:e.labels?e.labels.value:!1,g=e.labels?o(`slice-labels`)(d.map(e=>({key:X(e.data),index:e.index,name:e.data.name,value:h===!1?``:h===`value`?f(e.value):p.format(e.value/u),angle:(e.startAngle+e.endAngle)/2,weight:e.value})),m,t.fontSize):null,_=g?.area??m,v=Math.max(0,Math.min(_.width,_.height)/2-8),y=v*Math.min(.95,Math.max(0,e.innerRadius??n.inner)),b=e.cornerRadius??n.corner,x=_.x+_.width/2,S=_.y+_.height/2,C=y===0&&d.length>1?s:0,w=y>0&&d.length>1?uo(s,y,v):0,T=(e,t=y,n=v)=>({innerRadius:t,outerRadius:n,startAngle:e.startAngle,endAngle:e.endAngle,padAngle:w,cornerRadius:b}),E=(e,t)=>{let[n,r]=lo(T(e)),i={name:e.data.name,seriesIndex:e.index,value:e.value,text:`${f(e.value)} (${p.format(u>0?e.value/u:0)})`,x:x+n,y:S+r};return e.data.color&&(i.color=e.data.color),{index:t,label:e.data.name,title:``,x:x+n,area:{x:x-v,y:S-v,width:v*2,height:v*2},items:[i],seriesIndex:e.index,highlight:{kind:`halo`,d:po({...T(e,v+2,v+6),cornerRadius:2}),x,y:S}}},D={count:d.length,hitIndex:e=>{let t=d[e];return t?E(t,e):null},hitTest(t,n){let r=t-x,i=n-S,a=Math.hypot(r,i);if(a<y-2||a>v+8)return null;let o=(e.startAngle??0)*ro,s=Math.PI*2,c=Math.atan2(r,-i);c=o+((c-o)%s+s)%s;let l=d.findIndex(e=>c>=e.startAngle&&c<e.endAngle);return l===-1?null:E(d[l],l)}},O=c.map(e=>l(`g`,nn(e.data,e.index),mo(`tc-slice`,T(e)))),k=e.center,A=y>0&&k!==!1,j=A?k?.value??f(u):``,M=A?k?.label:void 0;return{content:[l(`g`,{class:`tc-pie`,style:`transform:translate(${x}px,${S}px)`},u===0&&l(`path`,{class:`tc-pie-track`,d:po({innerRadius:y,outerRadius:v,startAngle:0,endAngle:Math.PI*2})}),l(`g`,{class:`tc-pie-slices`,style:C>0?`--tc-pie-gap:${C}px`:void 0},O)),g?.layer(x,S,v),A&&l(`g`,{class:`tc-pie-center`,"aria-hidden":`true`},l(`text`,{class:`tc-pie-value`,x,y:S,dy:M?`0`:`0.35em`,"text-anchor":`middle`},j),M&&l(`text`,{class:`tc-pie-label`,x,y:S,dy:`1.6em`,"text-anchor":`middle`},M))],interaction:D}}function _s(e,t){let{slices:n,total:r}=hs(e,t.hidden),i=K(e.format,t.locale),a=G(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:n.map(e=>[e.data.name,i(e.value),a.format(r>0?e.value/r:0)])}}function vs(e,t){return{name:e,clean:$t(en),prepare:ls,render:(e,n)=>gs(e,n,t),sweep:ho,legend:us,table:_s,valueLabels:{marks:`slice`}}}let ys=vs(`pie`,{inner:0,corner:0}),bs=vs(`donut`,{inner:.62,corner:4});function xs(e,t,n){if(H(e,n)<=t)return e;let r=e.length;for(;r>0&&H(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}function Ss(e,t,n){let r=[],i=``;for(let a of e.split(` `)){let e=i?`${i} ${a}`:a;!i||H(e,n)<=t?i=e:(r.push(i),i=a)}return r.push(i),r.length>3&&r.splice(2,r.length,r.slice(2).join(` `)),r}let Cs=e=>e>.1?1:e<-.1?-1:0;function ws(e,t,n,r){let i=Math.min(e.width,e.height)/2;return t.forEach((t,a)=>{let o=Math.sin(t),s=Math.cos(t),c=n[a]??[],l=Math.max(0,...c.map(e=>H(e,r))),u=Ts(c.length,r),d=Cs(o),f=d===0?l/2:l+8;if(Math.abs(o)>1e-6&&(i=Math.min(i,(e.width/2-f)/Math.abs(o))),Math.abs(s)>1e-6){let t=(d===0?u+8:u/2)/Math.abs(s);i=Math.min(i,e.height/2/Math.abs(s)-t)}}),Math.max(0,i)}let Ts=(e,t)=>t*(1+Math.max(0,e-1)*W);function Es(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=e.r??{},{fill:s=!0,points:c=!1,pointRadius:u=4}=e,d=e.data.series,f=ln(e.data),p=f.length,m=d.filter(e=>!t.hidden.has(Q(e))),h=e.format??(e=>String(e)),g=bt(o.format,a),_=Ve(e.padding),v=Ue(n,r,{top:_.top+8,right:_.right+8,bottom:_.bottom+8,left:_.left+8}),y=v.x+v.width/2,b=v.y+v.height/2,x=f.map((e,t)=>t/Math.max(1,p)*Math.PI*2),S=f.map((e,t)=>h(e,t)),C=e.labelWidth??v.width/4,w=S.map(e=>Ss(e,C,i)),T=Math.max(ws(v,x,w,i),Math.min(v.width,v.height)/2*.5),E=w.map((e,t)=>{let n=Math.sin(x[t]),r=Cs(n)===0?v.width:v.width/2-T*Math.abs(n)-8;return e.map(e=>xs(e,r,i))}),D=vn(o,Math.max(2,Math.round(T/40))),O=Wt(bn(m.flatMap(e=>e.values),o,!0,D),[0,T],{clamp:!0}),k=Nt(O,{count:D,format:o.format,locale:a}),A=(e,t)=>[y+t*Math.sin(x[e]),b-t*Math.cos(x[e])],j=e=>`${e.map((e,t)=>`${t?`L`:`M`}${A(t,e).map(U).join(`,`)}`).join(``)}Z`,M=t=>e.grid===`circle`?`M${U(y)},${U(b-t)}A${U(t)},${U(t)},0,1,1,${U(y)},${U(b+t)}A${U(t)},${U(t)},0,1,1,${U(y)},${U(b-t)}Z`:j(f.map(()=>t)),N=e=>e!=null&&Number.isFinite(e)?O(e):0,P=e=>{let n=[];d.forEach((r,i)=>{if(t.hidden.has(Q(r)))return;let a=r.values[e],o=a!=null&&Number.isFinite(a)?a:null,[s,c]=A(e,N(o)),l={name:r.name,seriesIndex:i,value:o,text:o===null?`–`:g(o),x:s,y:o===null?null:c};r.color&&(l.color=r.color),n.push(l)});let[r,i]=A(e,T);return{index:e,label:Z(f[e]),title:S[e],x:r,area:{x:y-T,y:b-T,width:T*2,height:T*2},items:n,highlight:{kind:`spoke`,x1:y,y1:b,x2:r,y2:i}}},F={count:p,hitTest(e,t){if(p===0||Math.hypot(e-y,t-b)>T+8)return null;let n=Math.atan2(e-y,b-t),r=(n<0?n+Math.PI*2:n)/(Math.PI*2);return P(Math.round(r*p)%p)},hitIndex(e,t){if(e<0||e>=p)return null;let n=P(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}},I=l(`g`,{key:`grid`,class:`tc-radar-grid`,"aria-hidden":`true`},k.filter(e=>e.position>0).map(e=>l(`path`,{key:e.value,class:`tc-radar-ring`,d:M(e.position)})),f.map((e,t)=>{let[n,r]=A(t,T);return l(`line`,{key:Z(e),class:`tc-radar-spoke`,x1:U(y),y1:U(b),x2:U(n),y2:U(r)})})),L=gn(e),R=d.map((e,n)=>{if(t.hidden.has(Q(e)))return null;let r=j(f.map((t,n)=>N(e.values[n])));return l(`g`,Dn(e,n),s&&l(`path`,{class:`tc-area`,d:r}),l(`path`,{class:`tc-line`,d:r}),c&&l(`g`,{class:`tc-points`},f.map((t,r)=>{let i=e.values[r];if(i==null||!Number.isFinite(i))return null;let[a,o]=A(r,O(i));return _n(L,n,Z(t),`tc-point`,U(a),U(o),u)})))}),ee=l(`g`,{key:`labels`,class:`tc-radar-labels`,"aria-hidden":`true`},f.map((e,t)=>{let n=x[t],r=Cs(Math.sin(n)),i=Math.cos(n),[a,o]=A(t,T+8),[s=``,...c]=E[t]??[],u=c.length*W,d=r===0?i>0?`${U(-u)}em`:`0.71em`:`${U(.35-u/2)}em`;return l(`text`,{key:Z(e),class:`tc-tick-label tc-radar-label`,x:U(a),y:U(o),"text-anchor":r>0?`start`:r<0?`end`:`middle`,dy:d},s,c.map((e,t)=>l(`tspan`,{key:t,x:U(a),dy:`${W}em`},e)))})),z=o.show!==!1&&l(`g`,{key:`values`,class:`tc-radar-values`,"aria-hidden":`true`},k.filter(e=>e.position>0).map(e=>l(`text`,{key:e.value,class:`tc-tick-label tc-radar-value`,x:U(y+4),y:U(b-e.position),dy:`0.35em`},e.label)));return{content:[I,l(`g`,{key:`series`,class:`tc-series-list tc-radar-series`,style:`transform-origin:${U(y)}px ${U(b)}px`},R),ee,z],interaction:F}}let Ds={name:`radar`,clean:$t(Qt),render:Es,legend:e=>cn(e.data),table:(e,t,n)=>kn({data:e.data,...e.r?.format?{y:{format:e.r.format}}:{},...e.format?{x:{format:e.format}}:{}},t,n)},Os=864e5,ks=(e,t)=>{if(!t)return J(e);let n=pn(e);return Number.isFinite(n)?n:null};function As(e){let t=e.x?.type===`time`,n=[],r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=[];for(let o of e.data){let e=ks(o.from,t),s=ks(o.to,t);if(e===null||s===null)continue;let c=r.get(o.name);c===void 0&&(c=n.length,r.set(o.name,c),n.push(o.name));let l=o.id??o.name,u=i.get(l)??0;i.set(l,u+1),a.push({item:o,key:u?`${l}/${u}`:l,row:c,from:Math.min(e,s),to:Math.max(e,s)})}return{...e,timed:t,rows:n,bars:a}}function js(e,t){let{format:n,utc:r}=e.x??{};if(!e.timed)return bt(n,t);if(typeof n==`function`)return n;let[i,a]=Ut(e.bars.flatMap(e=>[e.from,e.to]))??[0,0],s=o(`dates`)([i,a],r,t);return e=>s(e)}function Ms(e){let t=t=>ks(t,e.timed);return Kt(e.annotations).filter(Y).flatMap(e=>{let{x:n,y:r,...i}=e,a={...i};if(n!==void 0){let e=Array.isArray(n)?n.map(t):t(n);if(e===null||Array.isArray(e)&&(e.length!==2||e.includes(null)))return[];a.y=e}return r!==void 0&&(a.x=typeof r==`string`&&(n===void 0||Array.isArray(n))?[r,r]:r),[a]})}function Ns(e,t,n){let r=e.x??{},i=vn(r,Math.max(2,Math.round(t.width/80))),a=[...e.bars.flatMap(e=>[e.from,e.to]),...n],s=ks(r.min,e.timed),c=ks(r.max,e.timed);if(!e.timed){let{format:e}=r,n=bn(a,{...s===null?{}:{min:s},...c===null?{}:{max:c},nice:r.nice!==!1},!1,i);return{domain:n,ticks:r=>Nt(Wt(n,r),{count:i,format:e,locale:t.locale})}}let l=o(`time`).scale,u=r.utc===!0,[d,f]=Ut(a)??[0,Os];if(d===f&&(d-=Os/2,f+=Os/2),s!==null&&(d=s),c!==null&&(f=c),r.nice!==!1)for(let e=0;e<2;e++){let[e,t]=l([d,f],[0,1],{utc:u}).nice(i).domain;s===null&&(d=e),c===null&&(f=t)}let p=[d,f],{format:m}=r;return{domain:p,ticks(e){let n=l(p,e,{utc:u}),r=typeof m==`function`?e=>m(e.getTime()):n.tickFormat(i,t.locale);return n.ticks(i).map(e=>({value:e.getTime(),position:n(e),label:r(e)}))}}}function Ps(e,t){let{radius:n=4,maxBarWidth:r=24,groupPadding:i=.3,rows:a,bars:o}=e,{fontSize:s}=t,c=e.x??{},u=e.y??{},d=Ms(e),f=Ns(e,t,d.flatMap(e=>e.y===void 0?[]:e.y)),p=c.show!==!1,m=u.show!==!1&&a.length>0,h=f.ticks([0,1]),g=a.map(e=>({value:e,position:0,label:e})),_=e=>p&&e?Math.ceil(H(e.label,s)/2):0,{area:v,side:y,range:b}=We(t,e.padding,e=>({top:e.top+4,bottom:e.bottom+Math.max((p?q(`bottom`,h,s):0)+Lt(c.title,s),4),start:e.start+Math.max((m?q(`left`,g,s):0)+Lt(u.title,s),_(h[0]),8),end:e.end+Math.max(_(h[h.length-1]),8)})),x=Vt(a,[v.y,v.y+v.height],{paddingInner:i,paddingOuter:i/2}),S=Wt(f.domain,b()),C=It(f.ticks(S.range),`bottom`,s),w=m?It(Pt(x),`left`,s):[],T=Cn({data:{series:[]},x:{show:u.show!==!1,grid:u.grid===!0,title:u.title},y:{show:p,grid:c.grid!==!1,title:c.title},annotations:d},t,y,0,{area:v,labels:a,x,y:S,horizontal:!0,xTicks:w,yTicks:C},a),E=Math.max(1,Math.min(r,x.bandwidth)),D=e=>x.at(e.row)+(x.bandwidth-E)/2,O=e=>{let t=S(e.from),n=S(e.to),r=Math.min(t,n),i=Math.max(t,n);if(i-r>=2)return[r,i];let a=(r+i)/2;return[a-1,a+1]},k=js(e,t.locale),A=e=>{let n=o[e],[r,i]=O(n),a=D(n),s={name:n.item.name,seriesIndex:0,value:n.to-n.from,text:`${k(n.from)} – ${k(n.to)}`,x:t.rtl?r:i,y:a+E/2,box:{x:r,y:a,width:i-r,height:E}};return n.item.color&&(s.color=n.item.color),{index:e,label:n.item.name,title:``,x:(r+i)/2,y:x.at(n.row)+x.bandwidth/2,axis:`y`,area:v,items:[s],highlight:{kind:`band`,x:v.x,y:x.at(n.row),width:v.width,height:x.bandwidth}}},j={count:o.length,hitIndex:e=>e>=0&&e<o.length?A(e):null,hitTest(e,t){if(e<v.x-8||e>v.x+v.width+8||t<v.y-8||t>v.y+v.height+8)return null;let n=x.indexAt(t),r=-1,i=1/0;if(o.forEach((t,a)=>{if(t.row!==n)return;let[o,s]=O(t),c=Math.max(o-e,e-s,0);c<=i&&(i=c,r=a)}),r<0)return null;let a=A(r);return i===0&&(a.seriesIndex=0),a}},M=o.map(e=>{let[t,r]=O(e);return l(`path`,{key:e.key,class:[`tc-bar`,`tc-bar-horizontal`,`tc-range-bar`,e.item.class],"data-series":e.item.name,d:Ca(t,D(e),r-t,E,Math.max(0,n)),style:{"--tc-series-color":e.item.color}})});return{content:[l(`defs`,{key:`defs`},T.clip.def),T.background,l(`g`,{key:`series`,class:`tc-series-list tc-range-bars`,"clip-path":T.clip.url},l(`g`,{class:`tc-series tc-series-1`},M)),T.foreground],interaction:j}}function Fs(e,t,n){let r=js(e,t.locale),{bars:i}=e,a=i.length>n?i.slice(0,n):i;return{columns:[``,`From`,`To`],total:i.length,rows:a.map(e=>[e.item.name,r(e.from),r(e.to)])}}let Is={name:`range-bar`,clean:$t(e=>Xt(e,e=>({...Zt(e),from:Jt(e.from),to:Jt(e.to)}))),prepare:As,render:Ps,table:Fs};function Ls(e,t,n){if(H(e,n)<=t)return e;let r=e.length;for(;r>0&&H(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}let Rs=e=>e.data.color??`var(--tc-color-${e.slot})`;function zs(e,t,n){let r=/* @__PURE__ */ new Map,i=[],a=(e,t)=>{let n=r.get(e);return n||(n={data:t??{name:e},index:i.length,slot:1,column:0,value:0,x:0,y:0,height:0,ins:[],outs:[]},r.set(e,n),i.push(n)),n},o=new Map((e.nodes??[]).map(e=>[e.name,e])),s=n=>{let r=o.get(n);return t.has(n)||r?.color!==void 0&&t.has(Bs(e,r.color))},c=[];e.links.forEach((e,t)=>{if(e.from===e.to||s(e.from)||s(e.to))return;let n=a(e.from,o.get(e.from)),r=a(e.to,o.get(e.to)),i={data:e,index:t,source:n,target:r,sy:0,ty:0,width:0};c.push(i),e.value<=0||(n.outs.push(i),r.ins.push(i))});for(let e of i)e.value=Math.max(e.outs.reduce((e,t)=>e+t.data.value,0),e.ins.reduce((e,t)=>e+t.data.value,0));for(let e=0;e<i.length;e++){let e=!1;for(let t of c)t.data.value>0&&t.target.column<=t.source.column&&(t.target.column=t.source.column+1,e=!0);if(!e)break}let l=i.reduce((e,t)=>Math.max(e,t.column),0);if(n)for(let e of i)e.outs.length===0&&(e.column=l);let u=[...o.keys()];i.sort((e,t)=>{if(e.column!==t.column)return e.column-t.column;let n=u.indexOf(e.data.name),r=u.indexOf(t.data.name);return n!==-1&&r!==-1?n-r:n===r?e.index-t.index:n===-1?1:-1});let d=/* @__PURE__ */ new Map;return i.forEach((e,t)=>{e.index=t;let n=(d.get(e.column)??0)+1;d.set(e.column,n),e.slot=(n-1)%8+1}),{nodes:i,links:c,columns:l+1}}let Bs=(e,t)=>(e.nodes??[]).find(e=>e.color===t)?.name??t;function Vs(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=Math.max(1,e.nodeWidth??12),s=Math.max(0,e.nodePadding??16),{rtl:c}=t,l=Ue(n,r,He(Ve(e.padding),c)),{nodes:u,links:d,columns:f}=zs(e.data,t.hidden,e.align!==`left`),p=bt(e.format,a),m=u.map(e=>[e.data.name,p(e.value)]),h=e=>u.reduce((t,n,r)=>{if(!e(n))return t;let[a,o]=m[r];return Math.max(t,H(a,i),H(o,i))},0),g=l.width*.3,_=f>1?Math.min(g,h(e=>e.column===0)):0,v=Math.min(g,h(e=>e.column===f-1)),y={x:l.x+(_?_+8:0),y:l.y,width:Math.max(0,l.width-(_?_+8:0)-(v?v+8:0)),height:l.height},b=f>1?(y.width-o)/(f-1):0,x=Array.from({length:f},()=>[]);for(let e of u)x[e.column]?.push(e);let S=x.reduce((e,t)=>t.length>1?Math.min(e,y.height/2/(t.length-1)):e,s),C=1/0;for(let e of x){let t=e.reduce((e,t)=>e+t.value,0);t>0&&(C=Math.min(C,(y.height-(e.length-1)*S)/t))}(!Number.isFinite(C)||C<0)&&(C=0),x.forEach((e,t)=>{let r=e.reduce((e,t)=>e+t.value*C,0)+(e.length-1)*S,i=y.y+(y.height-r)/2;for(let r of e){let e=y.x+(f>1?t*b:(y.width-o)/2);r.x=c?n-e-o:e,r.y=i,r.height=r.value*C,i+=r.height+S}});for(let e of u){let t=e.y;for(let n of[...e.outs].sort((e,t)=>e.target.y-t.target.y))n.sy=t,n.width=n.data.value*C,t+=n.width;t=e.y;for(let n of[...e.ins].sort((e,t)=>e.source.y-t.source.y))n.ty=t,t+=n.data.value*C}let w=u.map((e,t)=>{let[n,r]=m[t],a=e.column===0&&f>1?`left`:`right`,s=a===`left`?_:e.column===f-1?v:b-o-16,c=x[e.column],l=c.indexOf(e),u=[c[l-1],c[l+1]].filter(e=>!!e).reduce((t,n)=>Math.min(t,(e.height+n.height)/2+S),1/0)>=i*2.25;return{side:a,name:Ls(n,s,i),value:u?Ls(r,s,i):``}});return c&&(y.x=n-y.x-y.width),{nodes:u,links:d,plot:y,nodeWidth:o,labels:w}}let Hs=(e,t)=>e.source.x>e.target.x?[e.source.x,e.target.x+t]:[e.source.x+t,e.target.x];function Us(e,t){let[n,r]=Hs(e,t),i=(n+r)/2,{sy:a,ty:o,width:s}=e,c=(...e)=>e.map(U).join(`,`);return`M${c(n,a)}C${c(i,a,i,o,r,o)}L${c(r,o+s)}C${c(i,o+s,i,a+s,n,a+s)}Z`}let Ws=(e,t,n,r,i)=>{let a=1-i;return a*a*a*e+3*a*a*i*t+3*a*i*i*n+i*i*i*r};function Gs(e,t,n,r){let[i,a]=Hs(e,t);if(n<Math.min(i,a)||n>Math.max(i,a)||i===a)return!1;let o=(i+a)/2,s=0,c=1;for(let e=0;e<20;e++){let e=(s+c)/2;Ws(i,o,o,a,e)<n==a>i?s=e:c=e}let l=Ws(e.sy,e.sy,e.ty,e.ty,(s+c)/2);return r>=l&&r<=l+e.width}function Ks(e,t){let{nodes:n,links:r,plot:i,nodeWidth:a,labels:o}=Vs(e,t),s=r.filter(e=>e.data.value>0),c=bt(e.format,t.locale),u=e=>({kind:`halo`,d:`M0,0h${U(a)}v${U(e.height)}h${U(-a)}Z`,x:e.x,y:e.y,under:!0}),d=e=>({kind:`halo`,d:Us(e,a),under:!0}),f=e=>({name:`${e.source.data.name} ${t.rtl?`←`:`→`} ${e.target.data.name}`,seriesIndex:e.index,color:Rs(e.source),value:e.data.value,text:c(e.data.value),x:(e.source.x+a+e.target.x)/2,y:Ws(e.sy,e.sy,e.ty,e.ty,.5)+e.width/2}),p=(e,t)=>{let n={name:e.data.name,seriesIndex:r.length+e.index,color:Rs(e),value:e.value,text:c(e.value),x:e.x+a/2,y:e.y+e.height/2},o=[...e.ins,...e.outs].map(f),l=o.find(e=>e.seriesIndex===t),p=l&&s.find(e=>e.index===t);return{index:e.index,label:e.data.name,title:``,x:n.x,area:i,items:[n,...o],seriesIndex:l?t:n.seriesIndex,highlight:p?d(p):u(e)}},m=e=>{let t=f(e);return{index:e.source.index,label:e.source.data.name,title:``,x:t.x,area:i,items:[t],seriesIndex:e.index,highlight:d(e)}},h={count:n.length,hitTest(e,t){let r=n.find(n=>e>=n.x-2&&e<=n.x+a+2&&t>=n.y-2&&t<=n.y+n.height+2);if(r)return p(r);let i=s.find(n=>Gs(n,a,e,t));return i?m(i):null},hitIndex(e,t){let r=n[e];return r?p(r,t):null}};return{content:[l(`g`,{key:`links`,class:`tc-sankey-links`},s.map(e=>l(`path`,{key:`${e.source.data.name}→${e.target.data.name}#${e.index}`,class:[`tc-series`,`tc-series-${e.source.slot}`,`tc-sankey-link`],style:{"--tc-series-color":e.source.data.color},d:Us(e,a)}))),l(`g`,{key:`nodes`,class:`tc-sankey-nodes`},n.map(e=>l(`g`,{key:e.data.name,class:[`tc-series`,`tc-series-${e.slot}`],"data-series":e.data.name,style:{"--tc-series-color":e.data.color}},l(`rect`,{class:`tc-sankey-node`,x:U(e.x),y:U(e.y),width:U(a),height:U(e.height)})))),l(`g`,{key:`labels`,class:`tc-sankey-labels`,"aria-hidden":`true`},n.map((e,n)=>{let r=o[n];if(!r.name&&!r.value)return null;let i=r.side===`left`!=(t.rtl===!0),s=U(i?e.x-8:e.x+a+8),c=U(e.y+e.height/2),u=i?`end`:`start`;return l(`g`,{key:e.data.name,class:`tc-sankey-label`},l(`text`,{class:`tc-value-label tc-sankey-name`,x:s,y:c,dy:r.value?`-0.25em`:`0.35em`,"text-anchor":u},r.name),r.value&&l(`text`,{class:`tc-tick-label tc-sankey-value`,x:s,y:c,dy:`0.95em`,"text-anchor":u},r.value))}))],interaction:h}}function qs(e){let t=/* @__PURE__ */ new Map;for(let n of e.data.nodes??[])if(n.color&&!t.has(n.color)){let e={key:n.name,name:n.name,index:t.size,color:n.color};n.hidden&&(e.hidden=!0),t.set(n.color,e)}return[...t.values()]}function Js(e,t){let{links:n}=zs(e.data,t.hidden,!0),r=bt(e.format,t.locale);return{columns:[`From`,`To`,`Value`],rows:n.map(e=>[e.data.from,e.data.to,r(e.data.value)])}}let Ys={name:`sankey`,clean:$t(e=>{let t=Y(e)?e:{};return{...t,nodes:Array.isArray(t.nodes)?Xt(t.nodes,e=>Zt(e)):void 0,links:Xt(t.links,e=>({from:qt(e.from),to:qt(e.to),value:Math.max(0,J(e.value)??0)}))}}),render:Ks,legend:qs,table:Js},Xs=e=>`M${e},0A${e},${e},0,1,1,${-e},0A${e},${e},0,1,1,${e},0Z`;function Zs(e){return e.labels?e.labels.map(String):e.series.some(e=>e.points.some(e=>typeof e.x==`string`))?[...new Set(e.series.flatMap(e=>e.points.map(e=>String(e.x))))]:null}let Qs=e=>e.size!=null&&Number.isFinite(e.size)&&e.size>0?e.size:void 0;function $s(e,t){let n=bt(e.x?.format,t),r=!!Zs(e.data);return e=>r||typeof e==`string`?String(e):n(e)}function ec(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=e.x??{},s=e.y??{},c=e.radius??4,u=e.data.series.filter(e=>!t.hidden.has(X(e))).flatMap(e=>e.points),d=u.map(Qs).filter(e=>e!==void 0),f=Ut(d)?.[1]??0,p=e.size?.min??4,m=e.size?.max??24,h=e=>e!=null&&e>0&&f>0?p+(m-p)*Math.sqrt(e/f):c,g=Math.max(c,d.length?m:0)+2,_=vn(s,Math.max(2,Math.round(r/60))),v=vn(o,Math.max(2,Math.round(n/80))),y=Zs(e.data),b=new Map((y??[]).map((e,t)=>[e,t]).reverse()),x=e=>(y?b.has(String(e.x)):typeof e.x==`number`&&un(e.x,o))&&un(e.y,s),S=u.filter(x),C=bn(y?[]:S.map(e=>e.x),o,!1,v),w=bn(S.map(e=>e.y),s,!1,_),T=o.show!==!1,E=s.show!==!1,D=(e,t,n)=>hn(e,t,n,t.format,a),O=D(mn(w,[1,0],s),s,_),k=y?y.map(e=>({value:e,position:0,label:e})):D(mn(C,[0,1],o),o,v),A=(e,t=0)=>T&&e?Math.max(0,Math.ceil(H(e.label,i)/2-t)):0,j=o.reverse??t.rtl===!0,M=j===(t.rtl===!0)?0:k.length-1,N=(E?q(`left`,O,i):0)+Lt(s.title,i),{area:P,side:F,range:I}=We(t,e.padding,e=>{let t=t=>({start:e.start+Math.max(N,A(k[M],t),g),end:e.end+Math.max(A(k[k.length-1-M],t),g,8)}),r=t(0);return y?.length&&(r=t((n-r.start-r.end)/(y.length*2))),{top:e.top+Math.max(E?Math.ceil(i*W/2):0,g,4),bottom:e.bottom+Math.max((T?q(`bottom`,k,i):0)+Lt(o.title,i),g,4),...r}}),L=mn(w,[P.y+P.height,P.y],s),R,ee;if(y){let[e,t]=I(j),n=n=>e+(t-e)*(n+.5)/y.length;R=e=>n(b.get(String(e))),ee=y.map((e,t)=>({value:e,position:n(t),label:e}))}else{let e=mn(C,I(j),o);R=t=>e(t),ee=D(e,o,v)}let z=It(ee,`bottom`,i),te=It(D(L,s,_),`left`,i,4),ne=[];e.data.series.forEach((e,n)=>{t.hidden.has(X(e))||e.points.forEach((e,t)=>{x(e)&&ne.push({seriesIndex:n,pointIndex:t,point:e,cx:R(e.x),cy:L(e.y),r:h(Qs(e))})})}),ne.sort((e,t)=>e.cx-t.cx);let re=$s(e,a),ie=bt(s.format,a),ae=K(void 0,a),oe=(t,n)=>{let r=e.data.series[t.seriesIndex],i=Qs(t.point),a=i===void 0?``:` · ${ae(i)}`,o={name:r.name,seriesIndex:t.seriesIndex,value:t.point.y,text:`${re(t.point.x)}, ${ie(t.point.y)}${a}`,x:t.cx,y:t.cy};return r.color&&(o.color=r.color),{index:n,label:t.point.label??r.name,title:t.point.label??``,x:t.cx,area:P,items:[o],seriesIndex:t.seriesIndex,highlight:{kind:`halo`,d:Xs(U(t.r+4)),x:t.cx,y:t.cy}}},se={count:ne.length,hitIndex:e=>{let t=ne[e];return t?oe(t,e):null},hitTest(e,t){let n=0,r=ne.length,i=24+m;for(;n<r;){let t=n+r>>1;ne[t].cx<e-i?n=t+1:r=t}let a=-1,o=1/0;for(let r=n;r<ne.length;r++){let n=ne[r];if(n.cx>e+i)break;let s=Math.hypot(n.cx-e,n.cy-t)-n.r;s<o&&s<=24&&(a=r,o=s)}return a===-1?null:oe(ne[a],a)}},ce=gn(e),le=(e,t)=>{if(!e.length)return null;let n=U(c),r=``;for(let i of e)r+=ce?ce(t,R(i.x),L(i.y),n):`M${U(R(i.x)-c)},${U(L(i.y))}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,${-2*n},0`;return l(`path`,{key:`dots`,class:[`tc-point tc-dots`,ce&&`tc-marker`],d:r})},ue=[];s.grid!==!1&&ue.push(Bt({direction:`y`,ticks:te,area:P})),o.grid&&ue.push(Bt({direction:`x`,ticks:z,area:P}));let de=En(t,P,d.length?0:g),B=e.data.series.map((e,n)=>!t.hidden.has(X(e))&&l(`g`,nn(e,n),le(e.points.filter(e=>x(e)&&Qs(e)===void 0),n),e.points.map((e,t)=>x(e)&&Qs(e)!==void 0&&l(`circle`,{key:t,class:`tc-point tc-bubble`,cx:U(R(e.x)),cy:U(L(e.y)),r:U(h(Qs(e)))}))));return{content:[l(`defs`,null,de.def),ue,l(`g`,{key:`series`,class:`tc-series-list`,"clip-path":de.url},B),E&&zt({position:F,ticks:te,area:P}),T&&zt({position:`bottom`,ticks:z,area:P}),!!s.title&&Rt(F,E?te:[],P,s.title,i),!!o.title&&Rt(`bottom`,T?z:[],P,o.title,i)],interaction:se}}function tc(e,t,n=1/0){let r=$s(e,t.locale),i=bt(e.y?.format,t.locale),a=K(void 0,t.locale),o=e.data.series.filter(e=>!t.hidden.has(X(e))),s=o.some(e=>e.points.some(e=>e.size!=null)),c=o.some(e=>e.points.some(e=>e.label!=null)),l=o.reduce((e,t)=>e+t.points.length,0),u=n;return{columns:[``,...c?[`Label`]:[],`x`,`y`,...s?[`Size`]:[]],total:l,rows:o.flatMap(e=>{let t=e.points.slice(0,Math.max(0,u));return u-=t.length,t.map(t=>[e.name,...c?[t.label??``]:[],r(t.x),i(t.y),...s?[Qs(t)===void 0?`–`:a(Qs(t))]:[]])})}}let nc={name:`scatter`,clean:$t(e=>({...Y(e)?e:{},labels:Y(e)&&Array.isArray(e.labels)?e.labels.map(qt):void 0,series:Xt(Y(e)&&e.series,e=>({...Zt(e),points:Xt(e.points,e=>({...e,x:typeof e.x==`string`?e.x:J(e.x),y:J(e.y),size:J(e.size)??void 0,label:e.label==null?void 0:qt(e.label)})).filter(e=>e.x!==null&&e.y!==null)}))})),render:ec,legend:e=>tn(e.data.series),table:tc,valueLabels:{format:e=>e.y?.format}};function rc(e,t){let{variant:n=`line`,curve:r=`monotone`,point:i=`last`,markers:a=`none`,pointRadius:o=3,name:s=`Value`}=e,c=e.data.map(e=>e==null||!Number.isFinite(e)?null:e),u=c.length,d=i===`last`||a===`minmax`?o+2:2,f=Ve(e.padding,0),p=Ue(t.width,t.height,{top:f.top+d,right:f.right+d,bottom:f.bottom+d,left:f.left+d}),m=n===`tristate`,h=e.zero??n!==`line`,g=m?[-1,1]:bn(c,{nice:!1},h,2),_=n===`bar`||m,v=u>0?p.width/u:0,y=e=>t.rtl?u-1-e:e,b=e=>_?p.x+v*y(e)+v/2:p.x+(u>1?p.width*y(e)/(u-1):p.width/2),x=Wt(g,[p.y+p.height,p.y]),S=x(Math.min(Math.max(0,g[0]),g[1])),C=c.map((e,t)=>e===null?null:[b(t),x(e)]),w=K(e.format,t.locale),T=t=>{let n=e.labels?.[t];return n===void 0?``:String(n)},E=e=>x(m?Math.sign(e):e),D=t=>{let n=c[t];if(n===void 0)return null;let r=b(t),i={name:s,seriesIndex:0,value:n,text:n===null?`–`:w(n),x:r,y:n===null?null:E(n)},a={index:t,label:Z(e.labels?.[t]??t+1),title:T(t),x:r,area:p,items:[i]};return n!==null&&(a.highlight={kind:`halo`,d:Xs(o+3),x:r,y:E(n)}),a},O={count:u,reversed:t.rtl===!0,hitIndex:e=>D(e),hitTest(e,t){if(u===0||t<p.y-d||t>p.y+p.height+d)return null;let n=_?Math.floor((e-p.x)/v):Math.round((e-p.x)/Math.max(1,p.width)*(u-1));return D(y(Math.max(0,Math.min(u-1,n))))}},k=[];if(m){let e=Math.max(1,v-1);k.push(l(`line`,{class:`tc-sparkline-zero`,x1:p.x,x2:p.x+p.width,y1:U(S),y2:U(S)})),c.forEach((t,n)=>{if(t===null)return;let r=Math.sign(t),i=Math.min(2,p.height/2),[a,o]=r===0?[S+i/2,S-i/2]:[S,x(r)];k.push(l(`path`,{key:n,class:[`tc-bar`,r<0&&`tc-bar-negative`,r<0?`tc-tristate-loss`:r>0?`tc-tristate-win`:`tc-tristate-draw`],d:ya(b(n)-e/2,e,a,o,r===0?0:Math.min(2,e/2))}))})}else if(_){let e=Math.max(1,v-1);c.forEach((t,n)=>{t!==null&&k.push(l(`path`,{key:n,class:[`tc-bar`,t<0&&`tc-bar-negative`],d:ya(b(n)-e/2,e,S,x(t),Math.min(2,e/2))}))})}else n===`area`&&k.push(l(`path`,{class:`tc-area tc-area-gradient`,d:Si(C,S,{curve:r}),mask:`url(#${t.id}-fade)`})),k.push(l(`path`,{class:`tc-line`,d:xi(C,{curve:r})}));let A=gn(e),j=(e,t)=>{let n=c[e];return n==null?null:_n(A,0,`${t}-${e}`,[`tc-point`,t],U(b(e)),U(x(n)),o)},M=[];if(a===`minmax`){let e=-1,t=-1;c.forEach((n,r)=>{n!==null&&((e===-1||n<c[e])&&(e=r),(t===-1||n>c[t])&&(t=r))}),e!==-1&&M.push(j(e,`tc-point-min`)),t!==-1&&t!==e&&M.push(j(t,`tc-point-max`))}let N=-1;if(i===`last`){for(let e=u-1;e>=0;e--)if(c[e]!==null){N=e;break}}return{content:[n===`area`&&l(`defs`,null,da(`${t.id}-fade`)),l(`g`,{class:`tc-series tc-series-1 tc-sparkline`},k,M,N!==-1&&!_&&j(N,`tc-point-last`))],interaction:O}}let ic={name:`sparkline`,clean:e=>({...$t(Yt)(e),labels:Array.isArray(e.labels)?e.labels.map(Jt):void 0}),render:rc,keyboard:!1};function ac(e){return e.map(e=>{if(e.children?.length){let t=ac(e.children);return{node:e,children:t,value:t.reduce((e,t)=>e+t.value,0)}}return{node:e,value:Math.max(0,e.value??0)}})}let oc=e=>Array.isArray(e.colors)&&e.colors.length>=2?e.colors:void 0,sc=e=>e.colorBy===`value`||oc(e)!==void 0;function cc(e){let t=0,n=e=>{for(let r of e)r.children?n(r.children):t=Math.max(t,r.value)};n(e.sized);let{position:r,paint:i}=Io(J(e.min)??0,J(e.max)??t,J(e.mid),oc(e),.08);return e=>i(r(e))}function lc(e,t){let n=sc(e);return e.sized.map((e,t)=>({entry:e,index:t})).filter(({entry:e})=>!t.has(X(e.node))&&!(n&&e.node.hidden))}function uc(e,t,n,r,i,a){let o=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value),s=o.reduce((e,t)=>e+t.value,0),c=0;for(;c<o.length&&r>0&&i>0;){let e=Math.min(r,i),l=r*i/s,u=o[c].value,d=0,f=1/0,p=c;for(;p<o.length;p++){let t=d+o[p].value,n=(t*l/e)**2,r=Math.max(n/(o[p].value*l),u*l/n);if(r>f)break;f=r,d=t}let m=d*l/e,h=0;for(;c<p;c++){let e=o[c],s=e.value*l/m;r>=i?a(e,t,n+h,m,s):a(e,t+h,n,s,m),h+=s}r>=i?(t+=m,r-=m):(n+=m,i-=m),s-=d}}function dc(e,t,n,r,i,a,o,s,c,l){uc(e,t,n,r,i,(u,d,f,p,m)=>{let h=c?.index??l?.[e.indexOf(u)],g=c?`${c.key}/${X(u.node)}`:X(u.node),_=c?.trail??[],v=.01,y=[d-t<v?s[0]:1,f-n<v?s[1]:1,t+r-d-p<v?s[2]:1,n+i-f-m<v?s[3]:1];if(u.children)dc(u.children,d,f,p,m,a,o,y,{index:h,key:g,trail:[..._,u.node.name]});else{let e=a/2;o.push({node:u.node,key:g,top:h,trail:_,value:u.value,x:d+y[0]*e,y:f+y[1]*e,width:Math.max(0,p-(y[0]+y[2])*e),height:Math.max(0,m-(y[1]+y[3])*e)})}})}function fc(e,t){let{width:n,height:r,fontSize:i,locale:a}=t,o=Math.max(0,e.gap??2),s=Math.max(0,e.radius??3),c=Ue(n,r,Ve(e.padding,0)),u=lc(e,t.hidden),d=u.reduce((e,{entry:t})=>e+t.value,0),f=[];dc(u.map(({entry:e})=>e),c.x,c.y,c.width,c.height,o,f,[0,0,0,0],void 0,u.map(({index:e})=>e));let p=sc(e)?cc(e):void 0,m=K(e.format,a),h=G(a,{style:`percent`,maximumFractionDigits:1}),g=(t,n)=>{let r=t.x+t.width/2,i={name:t.node.name,seriesIndex:t.top,value:t.value,text:`${m(t.value)} (${h.format(d>0?t.value/d:0)})`,x:r,y:t.y+t.height/2},a=p?p(t.value).color:t.node.color??e.data[t.top]?.color;return a&&(i.color=a),{index:n,label:[...t.trail,t.node.name].join(` › `),title:t.trail.join(` › `),x:r,area:c,items:[i],seriesIndex:t.top,highlight:{kind:`halo`,d:Ca(t.x+1,t.y+1,t.width-2,t.height-2,s-1)}}},_={count:f.length,hitIndex:e=>{let t=f[e];return t?g(t,e):null},hitTest(e,t){let n=f.findIndex(n=>e>=n.x-o/2&&e<=n.x+n.width+o/2&&t>=n.y-o/2&&t<=n.y+n.height+o/2);return n<0?null:g(f[n],n)}},v=u.map(({entry:e,index:t})=>l(`g`,nn(e.node,t),f.filter(e=>e.top===t).map(e=>l(`rect`,{key:e.key,class:[`tc-tile`,p&&`tc-tile-shaded`,e.trail.length>0&&e.node.class],x:U(e.x),y:U(e.y),width:U(e.width),height:U(e.height),rx:U(Math.min(s,e.width/2,e.height/2)),style:p?p(e.value).style:e.trail.length>0?{"--tc-series-color":e.node.color}:void 0})))),y=i*1.3,b=e.labels!==!1&&f.flatMap(e=>{let t=e.width-12,n=e.height>=y+6?Ga(e.node.name,t,i):``;if(!n)return[];let r=m(e.value),a=U(e.x+6),o=e.y+6+i*.85;return[l(`text`,{key:e.key,class:`tc-treemap-label`,x:a,y:U(o)},n),e.height>=y*2+9&&H(r,i)<=t&&l(`text`,{key:`${e.key}/value`,class:`tc-treemap-label tc-treemap-value`,x:a,y:U(o+y)},r)]});return{content:[l(`g`,{class:`tc-treemap-tiles`},v),b&&l(`g`,{class:`tc-treemap-labels`,"aria-hidden":`true`},b)],interaction:_}}function pc(e,t,n){let r=lc(e,t.hidden),i=r.reduce((e,{entry:t})=>e+t.value,0),a=K(e.format,t.locale),o=G(t.locale,{style:`percent`,maximumFractionDigits:1}),s=[],c=(e,t)=>{for(let n of e){let e=[...t,n.node.name];n.children?c(n.children,e):s.push([e.join(` › `),a(n.value),o.format(i>0?n.value/i:0)])}};c(r.map(({entry:e})=>e),[]);let l={columns:[``,`Value`,`Share`],rows:s};return s.length>n&&(l.rows=s.slice(0,n),l.total=s.length),l}function mc(e,t=0,n={left:5e3}){let r=[];for(let i of Kt(e)){if(!Y(i)||n.left<=0)continue;n.left--;let e=t<8&&Array.isArray(i.children)?mc(i.children,t+1,n):void 0;r.push({...Zt(i),value:J(i.value)??0,children:e})}return r}let hc={name:`treemap`,clean:$t(e=>mc(e)),prepare:e=>({...e,sized:ac(e.data)}),render:fc,legend:e=>sc(e)?[]:tn(e.data),table:pc},gc={line:ga,area:_a,bar:Sa,pie:ys,donut:bs,scatter:nc,sparkline:ic,gauge:So,heatmap:Ao,calendar:Ba,map:Qo,candlestick:Wa,radar:Ds,sankey:Ys,parliament:os,treemap:hc,"percentage-bar":ms,funnel:$a,"range-bar":Is};n({time:{scale:Hr,points:Ur,axis:Wr},dates:lr,log:{scale:hr,domain:gr,ticks:_r},decimate:si,line:{linePath:xi,areaPath:Si},annotations:{layers:cr,values:sr},"end-labels":mr,"slice-labels":Ar,patterns:Cr,"point-shapes":Tr,swatch:Er,hydrate:ei,morph:oi}),a(Zr);let _c=`[data-tc-chart]`,vc=/* @__PURE__ */ new Set([`chart`,`src`,`data`,`options`]),yc=/* @__PURE__ */ new Set([`title`,`description`,`locale`,`sync`,`id`,`class`]),bc=/* @__PURE__ */ new WeakMap,xc=/* @__PURE__ */ new WeakSet;function Sc(e){return bc.get(e)}function Cc(e){bc.get(e)?.destroy(),bc.delete(e)}function wc(e){return e===`true`||e===``?!0:e===`false`?!1:e!==``&&Number.isFinite(Number(e))?Number(e):/^\s*[[{]/.test(e)?Tc(e,`a data-tc-* attribute`):e}function Tc(e,t){try{return JSON.parse(e)}catch(e){throw SyntaxError(`@tabler/charts-bootstrap: invalid JSON in ${t}: ${e.message}`)}}function Ec(e){let t={},n=e.dataset.tcOptions;n&&Object.assign(t,Tc(n,`data-tc-options`));for(let[n,r]of Object.entries(e.dataset)){if(!n.startsWith(`tc`)||r===void 0)continue;let e=n.charAt(2).toLowerCase()+n.slice(3);vc.has(e)||(t[e]=e===`legend`&&/^(top|bottom|left|right|auto)$/.test(r)?{position:r}:e===`tooltip`&&r===`light`?{theme:`light`}:e===`download`&&/^[a-z]/i.test(r)&&!/^(true|false)$/.test(r)?r.split(/[\s,]+/).filter(Boolean):yc.has(e)?r:wc(r))}return t}function Dc(e){let t=e.dataset.tcData;if(t)return Tc(t,`data-tc-data`);let n=e.querySelector(`:scope > script[type="application/json"]`)?.textContent?.trim();return n?Tc(n,`the inline <script type="application/json">`):void 0}function Oc(e,t,n){e.dispatchEvent(new CustomEvent(`tc-${t}`,{detail:n,bubbles:!0}))}function kc(e,t,n){let r=new ua(e,{...Ec(e),type:t,data:n});for(let t of Ie)r.on(t,n=>Oc(e,t,n));return bc.set(e,r),Oc(e,`render`,{size:r.size}),r}function Ac(e,t){let n=bc.get(e);if(n||xc.has(e))return n;let r=e.dataset.tcChart??``,i=t[r];if(!i){let e=Object.keys(t).join(`, `);throw Error(`@tabler/charts-bootstrap: unknown chart type "${r}". Known types: ${e}.`)}let a=e.dataset.tcSrc;return a?(xc.add(e),e.setAttribute(`aria-busy`,`true`),fetch(a).then(e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`.trim());return e.json()}).then(t=>e.isConnected?kc(e,i,t):void 0,t=>{Oc(e,`error`,{error:t,src:a}),console.error(`@tabler/charts-bootstrap: could not load ${a}:`,t)}).finally(()=>{xc.delete(e),e.removeAttribute(`aria-busy`)})):kc(e,i,Dc(e)??[])}function jc(e=document,t={}){let n={...gc,...t.types},r=[...e.querySelectorAll(_c)];e instanceof Element&&e.matches(_c)&&r.unshift(e);let i=r.map(e=>{try{return Ac(e,n)}catch(t){Oc(e,`error`,{error:t}),console.error(t);return}});return Promise.all(i).then(e=>e.filter(e=>e!==void 0))}function Mc(e=document.body,t={}){jc(e,t);let n=new MutationObserver(e=>{for(let n of e){let e=n.target.closest?.(_c);if(!(e&&bc.has(e))){for(let e of n.removedNodes)if(e instanceof Element){bc.has(e)&&Cc(e);for(let t of e.querySelectorAll(_c))Cc(t)}for(let e of n.addedNodes)e instanceof Element&&!e.isConnected||e instanceof Element&&jc(e,t)}}});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()}if(typeof document<`u`){let e=document.currentScript;if(!e?.hasAttribute(`data-no-styles`)&&!document.getElementById(`tc-styles`)){let t=document.createElement(`style`);t.id=`tc-styles`,t.textContent=`/*! @tabler/charts | MIT */
3
+ :where(:root),:where([data-theme=light]){--tc-color-1:var(--tblr-chart-1,var(--tblr-primary,#2a78d6));--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#eb6834));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#1baf7a));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#eda100));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#e87ba4));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#4a3aa7);--tc-color-8:var(--tblr-red,#e34948);--tc-color-other:var(--tblr-secondary,#8a8983);--tc-surface:var(--tblr-bg-surface,#fff);--tc-text-color:var(--tblr-body-color,#0b0b0b);--tc-text-muted:var(--tblr-secondary,#6f6e69);--tc-grid-color:var(--tblr-border-color-translucent,#e1e0d9);--tc-baseline-color:var(--tblr-border-color,#c3c2b7);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,11, 11, 11), .04);--tc-tooltip-bg:var(--tblr-dark,#0b0b0b);--tc-tooltip-color:#fff;--tc-tooltip-muted:#ffffffb3;--tc-tooltip-border:#ffffff1f;--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0b0b0b1f);--tc-tooltip-radius:var(--tblr-border-radius,6px);--tc-tooltip-light-bg:#fff;--tc-tooltip-light-color:#0b0b0b;--tc-tooltip-light-muted:#6f6e69;--tc-tooltip-light-border:#0b0b0b1a;--tc-focus-color:var(--tc-color-1);--tc-font-family:var(--tblr-body-font-family,inherit);--tc-font-size:12px;--tc-stroke-width:2px;--tc-grid-width:1px;--tc-area-opacity:.1;--tc-area-gradient-start:.24;--tc-area-gradient-end:0;--tc-pie-value-size:1.75em;--tc-bubble-opacity:.7;--tc-point-ring:2px;--tc-duration:.4s;--tc-duration-fast:.12s;--tc-easing:cubic-bezier(.4, 0, .2, 1)}@media (prefers-color-scheme:dark){:where(:root:not([data-theme=light])){--tc-color-1:var(--tblr-chart-1,var(--tblr-primary,#3987e5));--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#d95926));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#199e70));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#c98500));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#d55181));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}}:where([data-theme=dark]){--tc-color-1:var(--tblr-chart-1,var(--tblr-primary,#3987e5));--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#d95926));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#199e70));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#c98500));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#d55181));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767);--tc-color-other:var(--tblr-secondary,#7c7b76);--tc-surface:var(--tblr-bg-surface,#1a1a19);--tc-text-color:var(--tblr-body-color,#fff);--tc-text-muted:var(--tblr-secondary,#a3a29c);--tc-grid-color:var(--tblr-border-color-translucent,#2c2c2a);--tc-baseline-color:var(--tblr-border-color,#4a4a46);--tc-hover-color:rgba(var(--tblr-emphasis-color-rgb,255, 255, 255), .06);--tc-tooltip-bg:var(--tblr-dark,#262625);--tc-tooltip-shadow:var(--tblr-box-shadow,0 4px 16px #0006);--tc-focus-color:var(--tc-color-1)}.tc-chart{max-width:100%;height:auto;font-family:var(--tc-font-family);font-size:var(--tc-font-size);letter-spacing:normal;word-spacing:normal;text-transform:none;color:var(--tc-text-color);-webkit-tap-highlight-color:transparent;direction:ltr;display:block;overflow:visible}.tc-chart :where(text){font:inherit}.tc-series{--tc-series-color:var(--tc-color-other);--tc-series-pattern:var(--tc-pattern-other);--tc-pattern-dash:1 3;--tc-pattern-ink:var(--tc-pattern-color,var(--tc-surface));--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 3px)}.tc-series-1{--tc-series-color:var(--tc-color-1);--tc-series-pattern:var(--tc-pattern-1);--tc-pattern-dash:none;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-2{--tc-series-color:var(--tc-color-2);--tc-series-pattern:var(--tc-pattern-2);--tc-pattern-dash:6 3;--tc-swatch-pattern:radial-gradient(var(--tc-pattern-ink) .8px, #0000 1.2px) 0 0 / 4px 4px}.tc-series-3{--tc-series-color:var(--tc-color-3);--tc-series-pattern:var(--tc-pattern-3);--tc-pattern-dash:2 3;--tc-swatch-pattern:repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-4{--tc-series-color:var(--tc-color-4);--tc-series-pattern:var(--tc-pattern-4);--tc-pattern-dash:10 3 2 3;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-5{--tc-series-color:var(--tc-color-5);--tc-series-pattern:var(--tc-pattern-5);--tc-pattern-dash:4 4;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-6{--tc-series-color:var(--tc-color-6);--tc-series-pattern:var(--tc-pattern-6);--tc-pattern-dash:12 4;--tc-swatch-pattern:repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-7{--tc-series-color:var(--tc-color-7);--tc-series-pattern:var(--tc-pattern-7);--tc-pattern-dash:2 2 6 2;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-8{--tc-series-color:var(--tc-color-8);--tc-series-pattern:var(--tc-pattern-8);--tc-pattern-dash:8 2 2 2;--tc-swatch-pattern:linear-gradient(90deg, #0000 50%, var(--tc-series-color) 0) 0 0 / 4px 4px, repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-tick-label{fill:var(--tc-text-muted);font-variant-numeric:tabular-nums}.tc-axis-title{fill:var(--tc-text-muted)}.tc-grid-line,.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-crosshair,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-baseline-color);stroke-width:var(--tc-grid-width);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-grid-line,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-grid-color)}.tc-grid-line-zero{stroke:var(--tc-baseline-color)}.tc-line{fill:none;stroke:var(--tc-series-color);stroke-width:var(--tc-series-width,var(--tc-stroke-width));stroke-dasharray:var(--tc-series-dash,none);stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}.tc-area{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-pie-slices{--tc-pie-gap:0px}.tc-slice{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-pie-gap);stroke-linejoin:round}.tc-pie-track,.tc-gauge-track{fill:var(--tc-grid-color)}.tc-gauge-arc{fill:var(--tc-series-color)}.tc-pie-value,.tc-gauge-value,.tc-parliament-value{font-size:var(--tc-pie-value-size);fill:var(--tc-text-color);font-variant-numeric:tabular-nums;font-weight:600}.tc-pie-label,.tc-gauge-label,.tc-parliament-label{fill:var(--tc-text-muted)}.tc-seat{fill:var(--tc-series-color);transition:transform var(--tc-duration) var(--tc-easing), r var(--tc-duration) var(--tc-easing)}.tc-seat-vacant{fill:var(--tc-grid-color)}.tc-chart-parliament .tc-hover-mark{opacity:.25}.tc-segment{fill:var(--tc-series-color);transition:var(--tc-duration) var(--tc-easing);transition-property:x,width}.tc-percentage-bar-track{fill:var(--tc-grid-color)}.tc-tile{fill:var(--tc-series-color);fill-opacity:var(--tc-treemap-opacity,1);transition:var(--tc-duration) var(--tc-easing);transition-property:x,y,width,height}.tc-tile-shaded{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition-property:x,y,width,height,fill}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-tile-shaded{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-treemap-value{font-weight:400}.tc-funnel-stage{fill:var(--tc-funnel-color,var(--tc-color-1));transition:d var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-funnel-stage{fill:color-mix(in oklab, var(--tc-funnel-color,var(--tc-color-1)) var(--tc-funnel-shade,100%), var(--tc-surface))}}.tc-funnel-name,.tc-funnel-share{fill:var(--tc-text-muted)}.tc-funnel-value{fill:var(--tc-text-color);font-weight:600}.tc-funnel-value,.tc-funnel-share{font-variant-numeric:tabular-nums}.tc-sankey-node{fill:var(--tc-series-color)}.tc-sankey-link{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-chart-sankey{--tc-area-opacity:.35}.tc-sankey-value{font-size:.92em}.tc-chart-sankey .tc-hover-mark{opacity:.5}.tc-radar-ring,.tc-radar-spoke,.tc-chart-radar .tc-crosshair{fill:none;shape-rendering:auto}.tc-area-gradient{fill-opacity:1}.tc-fade-start{stop-color:#fff;stop-opacity:var(--tc-area-gradient-start)}.tc-fade-end{stop-color:#fff;stop-opacity:var(--tc-area-gradient-end)}.tc-chart-sparkline{--tc-stroke-width:1.5px;--tc-area-gradient-start:.3}.tc-bubble{fill-opacity:var(--tc-bubble-opacity)}.tc-point{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-point-ring);paint-order:stroke;transition:cx var(--tc-duration) var(--tc-easing), cy var(--tc-duration) var(--tc-easing)}.tc-point-min,.tc-point-max{fill:var(--tc-text-muted)}.tc-annotation{--tc-annotation-color:var(--tc-text-muted)}.tc-annotation-line{stroke:var(--tc-annotation-color);stroke-width:1px;stroke-dasharray:var(--tc-annotation-dash,4 3);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-annotation-dot{fill:var(--tc-annotation-color);stroke:var(--tc-surface);stroke-width:1.5px}.tc-annotation-band{fill:var(--tc-annotation-color);fill-opacity:.1}.tc-annotation-label{fill:var(--tc-annotation-color);font-weight:500}.tc-annotation-label,.tc-radar-value{paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;font-size:.92em}.tc-annotation-label-bg{fill:var(--tc-surface)}.tc-annotations{pointer-events:none}.tc-value-label,.tc-treemap-label{fill:var(--tc-text-color);font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;transition:transform var(--tc-duration) var(--tc-easing);animation:tc-fade-in var(--tc-duration) var(--tc-easing);font-weight:500}.tc-end-label-text{fill:var(--tc-text-color);transition:transform var(--tc-duration) var(--tc-easing)}.tc-end-label-value{font-variant-numeric:tabular-nums;font-weight:600}.tc-end-label-line{fill:none;stroke:var(--tc-series-color);stroke-width:1px;transition:d var(--tc-duration) var(--tc-easing)}.tc-slice-label-text{fill:var(--tc-text-color);transition:transform var(--tc-duration) var(--tc-easing)}.tc-slice-label-name{font-weight:600}.tc-slice-label-line{fill:none;stroke:var(--tc-baseline-color);stroke-width:1px;transition:d var(--tc-duration) var(--tc-easing)}.tc-marker{transition:d var(--tc-duration) var(--tc-easing)}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-series-color);border-radius:var(--tc-shape-radius,50%);width:10px;height:10px;clip-path:var(--tc-shape,none)}.tc-pattern-bg{fill:var(--tc-series-color)}.tc-pattern-ink{fill:none;stroke:var(--tc-pattern-ink);stroke-width:1.5px;stroke-linecap:round}.tc-patterned :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,var(--tc-series-color))}.tc-patterned .tc-area{fill-opacity:max(var(--tc-area-opacity), .4)}.tc-patterned .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>.tc-patterned)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-swatch-pattern), var(--tc-series-color)}@keyframes tc-reveal{0%{clip-path:inset(0 var(--tc-reveal,100% 0 0))}to{clip-path:inset(0)}}@keyframes tc-grow{0%{transform:scaleY(0)}}@keyframes tc-grow-x{0%{transform:scaleX(0)}}@keyframes tc-fade-in{0%{opacity:0}}.tc-line,.tc-area,.tc-bar,.tc-radar-ring,.tc-dots{transition:d var(--tc-duration) var(--tc-easing)}.tc-slice,.tc-gauge-arc,.tc-gauge-track{transition:none var(--tc-duration)}.tc-rtl{--tc-reveal:0 0 100%}.tc-chart-line .tc-series-list,.tc-chart-area .tc-series-list{animation:tc-reveal calc(var(--tc-duration) * 2) var(--tc-easing)}.tc-series-list .tc-series,.tc-areas .tc-series,.tc-sankey-links .tc-sankey-link,.tc-sankey-nodes .tc-series,.tc-parliament-seats .tc-series,.tc-parliament-seats .tc-seat,.tc-series-list .tc-point,.tc-heatmap-cells,.tc-calendar-cells,.tc-map-regions,.tc-treemap-tiles,.tc-percentage-bar,.tc-funnel-stages,.tc-candles,.tc-tick,.tc-grid-line{animation:tc-fade-in var(--tc-duration) var(--tc-easing)}.tc-bar{fill:var(--tc-series-color);transform-box:fill-box;transform-origin:50% 100%;animation:tc-grow var(--tc-duration) var(--tc-easing)}.tc-bar-negative{transform-origin:50% 0}.tc-cell{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition:fill var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-cell{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-heatmap-row.tc-series{--tc-heat-color:var(--tc-series-color)}.tc-cell-empty{fill:var(--tc-heat-empty,var(--tc-grid-color));opacity:.5}.tc-region{stroke:var(--tc-surface);stroke-width:.5px;vector-effect:non-scaling-stroke}.tc-region-empty{fill:var(--tc-heat-empty,var(--tc-grid-color))}.tc-region-point,.tc-map-marker{stroke-width:2px}.tc-map-marker{fill:var(--tc-map-marker-color,var(--tc-color-1));stroke:var(--tc-surface)}.tc-region-selected{stroke:var(--tc-text-color);stroke-width:1.5px}.tc-map-selectable .tc-region{cursor:pointer}.tc-chart-map[data-zoom]{touch-action:none;cursor:grab;user-select:none}.tc-chart-map[data-zoom=drag]{cursor:grabbing}.tc-map-zoom,.tc-zoom{z-index:10;background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:6px;position:absolute;top:0;right:0}.tc-download~.tc-map-zoom{top:28px}.tc-map-zoom svg,.tc-zoom svg{fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round}.tc-map-zoom :disabled,.tc-zoom :disabled{opacity:.4;pointer-events:none}.tc-chart[data-zoom-axis]{user-select:none}.tc-chart[data-zoom-axis=x]{touch-action:pan-y}.tc-chart[data-zoom-axis=y]{touch-action:pan-x}.tc-zoom-selection,.tc-brush-selection{fill:var(--tc-focus-color);fill-opacity:.12;stroke:var(--tc-focus-color);stroke-opacity:.4}.tc-zoom-selection{pointer-events:none}.tc-brush-selection{cursor:grab}.tc-brush-handle{fill:var(--tc-focus-color);rx:2px;cursor:ew-resize}[data-zoom-axis=y] .tc-brush-handle{cursor:ns-resize}.tc-zoom{display:flex}.tc-download~.tc-zoom{right:28px}.tc-zoom[dir=rtl]{left:0;right:auto}.tc-download~.tc-zoom[dir=rtl]{left:28px}.tc-map-line{fill:none;stroke:var(--tc-map-line-color,var(--tc-color-1));stroke-width:1.5px;stroke-dasharray:4;animation:tc-map-line calc(var(--tc-duration) * 3) linear infinite}@keyframes tc-map-line{to{stroke-dashoffset:-8px}}.tc-candle{--tc-candle-color:var(--tc-up-color,var(--tc-color-6))}.tc-candle-down{--tc-candle-color:var(--tc-negative-color,var(--tc-color-8))}.tc-candle-body{fill:var(--tc-candle-color);transition:d var(--tc-duration) var(--tc-easing), fill var(--tc-duration) var(--tc-easing)}.tc-candle-wick{fill:none;stroke:var(--tc-candle-color);stroke-width:1px;vector-effect:non-scaling-stroke;transition:d var(--tc-duration) var(--tc-easing), stroke var(--tc-duration) var(--tc-easing)}.tc-tristate-loss{fill:var(--tc-negative-color,var(--tc-color-8))}.tc-tristate-draw{fill:var(--tc-baseline-color)}.tc-bar-horizontal{transform-origin:0;animation-name:tc-grow-x}.tc-bar-horizontal.tc-bar-negative,.tc-rtl .tc-bar-horizontal{transform-origin:100%}.tc-rtl .tc-bar-horizontal.tc-bar-negative{transform-origin:0}.tc-tick,.tc-grid-line{transition:transform var(--tc-duration) var(--tc-easing)}@keyframes tc-pie-in{0%{opacity:0;transform:scale(.85)}}.tc-pie-slices,.tc-gauge-rings,.tc-parliament-seats,.tc-radar-series{animation:tc-pie-in calc(var(--tc-duration) * 1.5) var(--tc-easing)}.tc-hover .tc-point{transition:none;animation:none}.tc-static,.tc-chart[data-resizing]{--tc-duration:0s}:where(.tc-container){position:relative}.tc-hover{pointer-events:none}.tc-hover-band{fill:var(--tc-hover-color)}.tc-crosshair-tag{fill:var(--tc-tooltip-bg)}.tc-crosshair-label{fill:var(--tc-tooltip-color);font-variant-numeric:tabular-nums}.tc-hover-mark{fill:var(--tc-series-color);opacity:.35}.tc-chart-heatmap .tc-hover-mark,.tc-chart-calendar .tc-hover-mark,.tc-chart-map .tc-hover-mark,.tc-chart-treemap .tc-hover-mark,.tc-chart-percentage-bar .tc-hover-mark{fill:none;stroke:var(--tc-text-color);stroke-width:2px;opacity:.6}.tc-tooltip{z-index:10;pointer-events:none;opacity:0;min-width:120px;max-width:min(280px,100%);font-family:var(--tc-font-family);font-size:var(--tc-font-size);overflow-wrap:anywhere;color:var(--tc-tooltip-color);background:var(--tc-tooltip-bg);border:1px solid var(--tc-tooltip-border);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);transition:opacity var(--tc-duration-fast) var(--tc-easing);padding:8px 10px;line-height:1.4;position:absolute;top:0;left:0}.tc-tooltip-light{--tc-tooltip-bg:var(--tc-tooltip-light-bg);--tc-tooltip-color:var(--tc-tooltip-light-color);--tc-tooltip-muted:var(--tc-tooltip-light-muted);--tc-tooltip-border:var(--tc-tooltip-light-border)}.tc-tooltip .tc-series{--tc-pattern-ink:var(--tc-pattern-color,var(--tc-tooltip-bg))}.tc-tooltip[data-visible]{opacity:1;transition:opacity var(--tc-duration-fast) var(--tc-easing), transform var(--tc-duration-fast) var(--tc-easing)}.tc-tooltip-title{margin-bottom:4px;font-weight:600}.tc-tooltip-item{align-items:center;gap:8px;display:flex}.tc-tooltip-swatch,.tc-legend-swatch{background:var(--tc-series-color);border-radius:50%;flex:none;width:8px;height:8px}.tc-tooltip-name{color:var(--tc-tooltip-muted);flex:1}.tc-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:500}.tc-tooltip-footer{border-top:1px solid var(--tc-tooltip-border);margin-top:4px;padding-top:4px}.tc-tooltip-item-active .tc-tooltip-name{color:var(--tc-tooltip-color)}.tc-legend{font-family:var(--tc-font-family);font-size:var(--tc-font-size);margin-bottom:8px;line-height:1.4}.tc-legend[data-position=bottom]{margin:8px 0 0}:where(.tc-legend-beside){grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:16px;display:grid}:where(.tc-legend-beside.tc-legend-start){grid-template-columns:auto minmax(0,1fr)}:where(.tc-legend-beside)>:not(.tc-legend,svg.tc-chart){grid-column:1/-1}.tc-legend:is([data-position=left],[data-position=right]){justify-self:start;max-width:16em;margin:0}.tc-legend:is([data-position=left],[data-position=right]) .tc-legend-items{flex-flow:column}.tc-legend-items{flex-wrap:wrap;gap:4px 12px;display:flex}.tc-legend-item{appearance:none;font:inherit;text-align:start;color:var(--tc-text-color);cursor:pointer;transition:color var(--tc-duration-fast) var(--tc-easing);background:0 0;border:0;border-radius:4px;align-items:center;gap:6px;margin:0;padding:2px 4px;display:inline-flex}.tc-legend-item:hover{background:var(--tc-hover-color)}.tc-legend-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-legend-item-hidden{color:var(--tc-text-muted)}.tc-legend-item-hidden .tc-legend-swatch{box-shadow:inset 0 0 0 1.5px var(--tc-series-color);background:0 0}.tc-download{z-index:11;font-family:var(--tc-font-family);font-size:var(--tc-font-size);line-height:1.4;position:absolute;top:0;right:0}.tc-download-toggle,.tc-download-item{appearance:none;font:inherit;color:var(--tc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;margin:0;display:flex}.tc-download-toggle{justify-content:center;width:24px;height:24px;padding:0}.tc-download-toggle:hover,.tc-download-toggle[aria-expanded=true],.tc-download-item:hover{color:var(--tc-text-color);background:var(--tc-hover-color)}.tc-download-toggle:focus-visible,.tc-download-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-download-menu{min-width:80px;color:var(--tc-text-color);background:var(--tc-surface);border:1px solid var(--tc-grid-color);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);margin-top:2px;padding:4px;position:absolute;top:100%;right:0}.tc-download[dir=rtl],[dir=rtl]>*>.tc-download-menu{left:0;right:auto}.tc-download-item{text-align:start;white-space:nowrap;width:100%;padding:4px 8px}.tc-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tc-chart:focus{outline:none}.tc-chart:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:2px;border-radius:2px}.tc-table-wrap:not(.tc-sr-only){margin-top:12px;overflow-x:auto}.tc-table{border-collapse:collapse;width:100%;font-family:var(--tc-font-family);font-size:var(--tc-font-size);font-variant-numeric:tabular-nums;color:var(--tc-text-color)}.tc-table caption{text-align:start;margin-bottom:4px;font-weight:600}.tc-table th,.tc-table td{text-align:end;border-bottom:1px solid var(--tc-grid-color);padding:4px 8px}.tc-table th[scope=row],.tc-table thead th:first-child{text-align:start}.tc-table thead th{color:var(--tc-text-muted);border-bottom-color:var(--tc-baseline-color);font-weight:600}@media (prefers-reduced-motion:reduce){.tc-chart,.tc-tooltip{--tc-duration:0s;--tc-duration-fast:0s}}@media (forced-colors:active){.tc-value-label,.tc-treemap-label{fill:canvastext;stroke:canvas}.tc-end-label-text,.tc-slice-label-text{fill:canvastext}.tc-slice-label-line{stroke:graytext}.tc-tick-label,.tc-axis-title,.tc-funnel-labels{fill:canvastext}.tc-grid-line,.tc-radar-ring,.tc-radar-spoke{stroke:graytext}.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-line{stroke:canvastext}.tc-area{fill:graytext}.tc-bar,.tc-funnel-stage,.tc-point{fill:canvastext;stroke:canvas}.tc-crosshair{stroke:highlight}.tc-tooltip{border-color:canvastext}.tc-legend-swatch{background:canvastext}.tc-legend-item-hidden .tc-legend-swatch{background:0 0;box-shadow:inset 0 0 0 1.5px canvastext}.tc-pattern-bg{fill:canvas}.tc-pattern-ink{stroke:canvastext}:is(.tc-patterned,.tc-patterns-auto) :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,CanvasText);fill-opacity:1;stroke:canvastext;stroke-width:1px}.tc-patterns-auto .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) .tc-series{--tc-pattern-color:CanvasText;--tc-series-color:Canvas}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){forced-color-adjust:none;background:var(--tc-swatch-pattern), Canvas;box-shadow:inset 0 0 0 1px canvastext}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){box-shadow:none;background:canvastext}}:where(:root,[data-bs-theme],[data-bs-theme-primary],[data-bs-theme-base],[data-bs-theme-font],[data-bs-theme-radius]){--tc-color-1:var(--bs-primary,var(--tblr-chart-1,var(--tblr-primary,#2a78d6)));--tc-focus-color:var(--bs-primary,var(--tblr-chart-1,var(--tblr-primary,#2a78d6)));--tc-surface:var(--bs-body-bg,var(--tblr-bg-surface,#fff));--tc-text-color:var(--bs-body-color,var(--tblr-body-color,#0b0b0b));--tc-text-muted:var(--bs-secondary-color,var(--tblr-secondary,#6f6e69));--tc-grid-color:var(--bs-border-color-translucent,var(--tblr-border-color-translucent,#e1e0d9));--tc-baseline-color:var(--bs-border-color,var(--tblr-border-color,#c3c2b7));--tc-hover-color:rgba(var(--bs-emphasis-color-rgb,var(--tblr-emphasis-color-rgb,11, 11, 11)), .05);--tc-tooltip-bg:var(--bs-emphasis-color,var(--tblr-tooltip-bg,#0b0b0b));--tc-tooltip-color:var(--bs-body-bg,var(--tblr-tooltip-color,#fff));--tc-tooltip-muted:rgba(var(--bs-body-bg-rgb,var(--tblr-body-bg-rgb,255, 255, 255)), .7);--tc-tooltip-border:rgba(var(--bs-body-bg-rgb,var(--tblr-body-bg-rgb,255, 255, 255)), .12);--tc-tooltip-shadow:var(--bs-box-shadow,var(--tblr-box-shadow,0 4px 16px #0b0b0b1f));--tc-tooltip-radius:var(--bs-border-radius,var(--tblr-border-radius,6px));--tc-font-family:var(--bs-body-font-family,var(--tblr-body-font-family,inherit))}:where(:root,[data-bs-theme=light]){--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#eb6834));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#1baf7a));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#eda100));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#e87ba4));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#4a3aa7);--tc-color-8:var(--tblr-red,#e34948)}:where([data-bs-theme=dark]){--tc-color-2:var(--tblr-chart-2,var(--tblr-orange,#d95926));--tc-color-3:var(--tblr-chart-3,var(--tblr-teal,#199e70));--tc-color-4:var(--tblr-chart-4,var(--tblr-yellow,#c98500));--tc-color-5:var(--tblr-chart-5,var(--tblr-pink,#d55181));--tc-color-6:var(--tblr-cyan,#008300);--tc-color-7:var(--tblr-indigo,#9085e9);--tc-color-8:var(--tblr-red,#e66767)}`,t.nonce=e?.nonce??``,document.head.prepend(t)}let t=e?.hasAttribute(`data-observe`)??!1,n=()=>t?Mc(document.body):void jc(document);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,n):queueMicrotask(n)}return e.Chart=ua,e.LINE_HEIGHT=W,e.VERSION=`0.4.0`,e.addMap=Vo,e.arcCentroid=lo,e.arcPathStable=po,e.area=_a,e.areaPath=Si,e.axis=zt,e.axisSize=q,e.band=Vt,e.bandTicks=Pt,e.bar=Sa,e.barPath=ya,e.buildChart=Pe,e.calendar=Ba,e.cancel=he,e.candlestick=Wa,e.categoryInteraction=On,e.chartEvents=Ie,e.chartLabel=ke,e.chartModel=Se,e.chartToString=Fe,e.dataTable=ea,e.defaultHidden=h,e.defaultPlugins=la,e.describeHit=Li,e.dispose=Cc,e.domainOf=bn,e.donut=bs,e.download=Ei,e.downloadChart=lt,e.escapeAttr=ae,e.escapeText=ie,e.estimateTextWidth=H,e.exportCSV=ct,e.exportImage=at,e.exportSVG=it,e.extent=Ut,e.feature=o,e.features=t,e.flush=ge,e.formatDate=wt,e.formatDetail=bt,e.formatNumber=K,e.formatTicks=Ct,e.funnel=$a,e.gauge=So,e.getChart=Sc,e.getDateFormat=mt,e.getNumberFormat=G,e.grid=Bt,e.h=l,e.hbarPath=ba,e.heatmap=Ao,e.highlight=Fi,e.hitAnchor=ta,e.hoverOverlay=Ai,e.hoverUnderlay=ki,e.hoverValue=ji,e.init=jc,e.innerRect=Ue,e.insets=Ve,e.keyboard=zi,e.legend=Ui,e.legendContent=m,e.line=ga,e.linePath=xi,e.linear=Wt,e.linearTicks=Nt,e.log=hr,e.lttb=li,e.lttbIndices=si,e.map=Qo,e.niceDomain=Mt,e.normalizeClass=u,e.normalizeStyle=f,e.observe=Mc,e.padAngleForGap=uo,e.parliament=os,e.percentageBar=ms,e.pie=ys,e.placeTooltip=ra,e.point=Ht,e.pointer=Pi,e.radar=Ds,e.rangeBar=Is,e.register=n,e.render=C,e.renderChart=Ne,e.renderContext=we,e.renderToString=I,e.resolveLegend=Oe,e.resolveSize=be,e.sankey=Ys,e.scatter=nc,e.schedule=V,e.seriesKey=Q,e.seriesLegend=cn,e.seriesTable=kn,e.sparkline=ic,e.stepPrecision=xt,e.sync=Ji,e.tableContent=Ii,e.thinTicks=It,e.tickIncrement=At,e.tickStep=jt,e.ticks=kt,e.time=Hr,e.timePointScale=Ur,e.tooltip=sa,e.tooltipContent=na,e.treemap=hc,e.types=gc,e.zoom=ca,e})({});
3
4
  //# sourceMappingURL=tabler-charts-bootstrap.min.js.map