@tabler/charts-bootstrap 0.1.0 → 0.3.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,3 @@
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`)}}function n(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)}}let r=e=>e>=4352&&(e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=127744);function i(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 a(e,t){let n=0;for(let t=0;t<e.length;t++){let i=e.codePointAt(t);n+=o[i]??(r(i)?1:.57),i>65535&&t++}return n*t}let o=/* @__PURE__ */ Array.from({length:128},(e,t)=>i(String.fromCharCode(t))),s=e=>Math.round(e*100)/100,c=1.25,l=`http://www.w3.org/2000/svg`,u={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`},d={...u,"font-family":``,"font-size":``,"font-weight":`400`,"font-style":`normal`,"font-variant-numeric":`normal`,"letter-spacing":`normal`},f={"stop-color":``,"stop-opacity":`1`},p={opacity:`1`},m=/* @__PURE__ */ new Set([`path`,`line`,`rect`,`circle`,`ellipse`,`polygon`,`polyline`]);function h(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 g(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 _(e,t){let n=getComputedStyle(e);if(n.display===`none`)return!1;let r=e.localName,i=r===`text`?d:r===`stop`?f:m.has(r)?u:p,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=g(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`)||!_(e,n))&&n.remove()}),!0}function v(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(l,`g`);for(let e of n){let t=e.querySelector(`.tc-legend-swatch`),n=e.querySelector(`.tc-legend-name`);if(!t||!n)continue;let c=t.getBoundingClientRect(),u=n.getBoundingClientRect(),d=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(l,`circle`);h.setAttribute(`cx`,String(s(c.left-a.left+c.width/2))),h.setAttribute(`cy`,String(s(c.top-a.top+c.height/2))),h.setAttribute(`r`,String(s(c.width/2-(m?.75:0)))),h.setAttribute(`style`,m?`fill:none;stroke:${d};stroke-width:1.5px`:`fill:${p.startsWith(`url(`)?p:d}`);let g=getComputedStyle(n),_=r.createElementNS(l,`text`);_.setAttribute(`x`,String(s(u.left-a.left))),_.setAttribute(`y`,String(s(u.top-a.top+u.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,_)}let c=t.getAttribute(`data-position`)===`bottom`,u=Number.parseFloat(getComputedStyle(t)[c?`marginTop`:`marginBottom`])||0;return{svg:o,height:s(a.height+u),margin:u,bottom:c}}function y(e,t={}){let n=h(e);for(let e of n.getAnimations?.({subtree:!0})??[])e.finish();let r=n.cloneNode(!0);_(n,r);let i=n.ownerDocument,a=Number(n.getAttribute(`width`)),o=Number(n.getAttribute(`height`));r.setAttribute(`xmlns`,l),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?v(c):void 0,d=o;if(u){let e=i.createElementNS(l,`g`);e.append(...Array.from(r.childNodes)),u.bottom?u.svg.setAttribute(`transform`,`translate(0 ${o+u.margin})`):e.setAttribute(`transform`,`translate(0 ${u.height})`),r.append(e,u.svg),d=o+u.height}r.setAttribute(`width`,String(a)),r.setAttribute(`height`,String(d)),r.setAttribute(`viewBox`,`0 0 ${a} ${d}`);let f=n.getAttribute(`aria-label`);if(f){let e=i.createElementNS(l,`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(l,`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 b(e,t={}){let{type:n=`image/png`,scale:r=2,quality:i}=t,a=y(e,{...t,...n===`image/jpeg`&&t.background===!1?{background:`#fff`}:{}}),o=h(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 x(e,t={}){let{format:n=`png`}=t,r=h(e),i=n===`svg`?new Blob([y(e,t)],{type:`image/svg+xml`}):await b(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 S={};function C(e){Object.assign(S,e)}let w=/* @__PURE__ */ new Set;function T(e){w.add(e),S.post=(e,t,n,r)=>{for(let i of w)t=i(e,t,n,r);return t}}function E(e){let t=S[e];if(!t)throw Error(`@tabler/charts: Import "@tabler/charts/${e===`dates`?`time`:e}" for ${e}.`);return t}C({export:x});function D(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=O(n);e&&(r.class=e)}else if(e===`style`){let e=A(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 j(n,a),{tag:e,attrs:r,children:a,key:i}}function O(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n of e){let e=O(n);e&&(t=t?`${t} ${e}`:e)}return t}let k=/[;{}<>"'\\]|\/\*|\b(?:url(?!\(#[\w-]+\))|src|attr|image|image-set|cross-fade|element|expression)\s*\(/i;function A(e){if(!e)return``;if(typeof e==`string`)return e;let t=``;for(let n in e){let r=e[n];r==null||r===``||k.test(String(r))||(t+=`${t?`;`:``}${n}:${r}`)}return t}function j(e,t){for(let n of e){if(n==null||typeof n==`boolean`)continue;if(Array.isArray(n)){j(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 M=/* @__PURE__ */ new Map,N=/* @__PURE__ */ new Map;function P(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 F(e,t){return`${JSON.stringify(e??null)}|${JSON.stringify(t)}`}function I(e,t={}){return P(M,F(e,t),()=>new Intl.NumberFormat(e,t))}function L(e,t={}){return P(N,F(e,t),()=>new Intl.DateTimeFormat(e,t))}let R=e=>e===0?0:e;function z(e,t){if(typeof e==`function`)return e;let{compactSymbols:n,...r}=e??{};if(n)return V(n===!0?B:n,r,t);let i=I(t,r);return e=>i.format(R(e))}let B=[`K`,`M`,`B`,`T`];function V(e,{notation:t,compactDisplay:n,...r},i){let a=U(r),o=I(i,a?r:{...r,maximumSignificantDigits:2}),s=a?o:I(i,{...r,maximumFractionDigits:0});return t=>{for(let n=0;;n++){let r=R(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 H=e=>e.notation===`compact`||!!e.compactSymbols,U=e=>(e.minimumFractionDigits??e.maximumFractionDigits??e.minimumSignificantDigits??e.maximumSignificantDigits)!==void 0;function W(e,t){return z(typeof e==`object`&&H(e)&&!U(e)?{...e,maximumSignificantDigits:3}:e,t)}function ee(e){let t=Math.abs(e);return!Number.isFinite(t)||t===0?0:Math.max(0,-Math.floor(Math.log10(t)+1e-9))}function te(e){return U(e)||!!e.compactSymbols||(e.notation??`standard`)!==`standard`}function ne(e,t,n){if(typeof t==`function`)return t;let r=t??{};if(te(r))return z(r,n);let i=ee(e);r.style===`percent`&&(i=Math.max(0,i-2));let a=z({...r,minimumFractionDigits:i,maximumFractionDigits:i},n),o=Math.abs(e)*1e-9;return e=>a(Math.abs(e)<o?0:e)}function re(e,t){if(typeof e==`function`)return t=>e(typeof t==`number`?new Date(t):t);let n=L(t,e);return e=>n.format(e)}let ie=Math.sqrt(50),ae=Math.sqrt(10),oe=Math.sqrt(2);function se(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=ie?10:a>=ae?5:a>=oe?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?se(e,t,n*2):[s,c,l]}function ce(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?se(t,e,n):se(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 le(e,t,n){return se(e,t,n)[2]}function ue(e,t,n=5){let r=t<e,i=r?le(t,e,n):le(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function de(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=le(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 fe(e,t={}){let{count:n=5,format:r,locale:i}=t,[a,o]=e.domain,s=ne(ue(a,o,n),r,i);return e.ticks(n).map(t=>({value:t,position:e(t),label:s(t)}))}function pe(e,t=String){return e.domain.map((n,r)=>({value:n,position:e.at(r)+e.bandwidth/2,label:t(n,r)}))}let me=e=>e===`top`||e===`bottom`;function he(e,t,n,r=8){if(e.length<2)return e.slice();let i=e.map(e=>me(t)?a(e.label,n):n*c),o=(t,n)=>Math.abs(e[n].position-e[t].position)>=(i[t]+i[n])/2+r,s=e.length-1,l=Math.abs(e[s].position-e[0].position),u=i.reduce((e,t)=>e+t+r,0),d=l>0?Math.max(1,Math.floor(u/l)):s;for(let t=d;t<=s;t++){let n=!0;for(let e=t;e<=s&&n;e+=t)n=o(e-t,e);if(!n)continue;let r=[];for(let e=0;e<=s;e+=t)r.push(e);let i=r[r.length-1];return i!==s&&(o(i,s)?r.push(s):r.length>1&&o(r[r.length-2],s)&&(r[r.length-1]=s)),r.map(t=>e[t])}return e.slice(0,1)}function ge(e,t,n,r={}){let{tickSize:i=0,tickPadding:o=8}=r;if(t.length===0)return 0;let s=me(e)?n*c:t.reduce((e,t)=>Math.max(e,a(t.label,n)),0)+3;return Math.ceil(s+i+o)}function _e(e){let{position:t,ticks:n,area:r,tickSize:i=0,tickPadding:a=8,line:o=!1}=e,c=me(t),l=t===`top`||t===`left`?-1:1,u=l*(i+a),d=t===`top`?r.y:t===`bottom`?r.y+r.height:t===`left`?r.x:r.x+r.width,f=c?{y:u,dy:t===`top`?`0em`:`0.71em`,"text-anchor":`middle`}:{x:u,dy:`0.32em`,"text-anchor":t===`left`?`end`:`start`},p=c?{y2:l*i}:{x2:l*i};return D(`g`,{key:`axis-${t}`,class:[`tc-axis`,c?`tc-axis-x`:`tc-axis-y`,`tc-axis-${t}`],"aria-hidden":`true`},o&&D(`line`,c?{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=>D(`g`,{key:e.value,class:`tc-tick`,style:c?`transform:translate(${s(e.position)}px,${s(d)}px)`:`transform:translate(${s(d)}px,${s(e.position)}px)`},i>0&&D(`line`,{class:`tc-tick-line`,...p}),D(`text`,{class:`tc-tick-label`,...f},e.label))))}function ve(e){let{direction:t,ticks:n,area:r}=e;return D(`g`,{key:`grid-${t}`,class:[`tc-grid`,`tc-grid-${t}`],"aria-hidden":`true`},n.map(e=>{let n=s(e.position);return D(`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 ye(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 be(e,t,n={}){let{padding:r=0,align:i}=n;return ye(e,t,{paddingInner:1,paddingOuter:r,...i===void 0?{}:{align:i}})}function xe(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 Se(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 ce(r,i,e)},nice(e){return Se(de(r,i,e),t,n)}})}let G=e=>typeof e==`number`&&Math.abs(e)<=1e300?Math.abs(e)<1e-300?0:e:null,Ce=e=>G(e)??void 0,we=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Te=e=>Array.isArray(e)?e:[],Ee=e=>typeof e==`string`?e:G(e)===null?``:String(e),De=e=>typeof e==`string`||G(e instanceof Date?+e:e)!==null?e:``,Oe=e=>{let t=Te(e);return t.every(e=>e==null||G(e)===e)?t:t.map(G)},ke=(e,t)=>Te(e).filter(we).map(t),Ae=e=>({...e,name:Ee(e.name),id:typeof e.id==`string`?e.id:void 0,color:typeof e.color==`string`?e.color:void 0}),je=e=>{let t=we(e)?e:{};return{...t,labels:Array.isArray(t.labels)?t.labels.map(De):void 0,series:ke(t.series,e=>({...Ae(e),values:Oe(e.values)}))}},K=e=>t=>({...t,data:e(t.data)}),Me=e=>ke(e,e=>({...Ae(e),value:G(e.value)??0,max:Ce(e.max)})),q=e=>e.id??e.name;function Ne(e){return e.map((e,t)=>{let n={key:q(e),name:e.name,index:t};return e.color&&(n.color=e.color),e.hidden&&(n.hidden=!0),n})}function Pe(e,t){return{key:q(e),class:[`tc-series`,`tc-series-${t+1}`,e.class],"data-series":e.name,style:{"--tc-series-color":e.color}}}let J=e=>e instanceof Date?e.getTime():e,Y=q,Fe=e=>Ne(e.series);function Ie(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 Le(e,t){return e==null||!Number.isFinite(e)?!1:t?.scale!==`log`||e>0}let Re=e=>e.x?.type===`time`&&Ie(e.data).every(e=>Number.isFinite(Be(e)));function ze(e,t){return e.x?.format?e.x.format:Re(e)?E(`dates`)(Ie(e.data),e.x?.utc,t.locale):e=>String(e)}let Be=e=>new Date(e).getTime();function Ve(e,t,n){return n.scale===`log`?E(`log`).scale(e,t):Se(e,t)}function He(e,t,n,r,i){return t.scale===`log`?E(`log`).ticks(e,n,r,i):fe(e,{count:n,format:r,locale:i})}let Ue=e=>{let{shapes:t,patterns:n}=e;return t??n===!0?S[`point-shapes`]:void 0},We=(e,t)=>Math.min(G(e?.ticks)??t,100);function Ge(e,t,n,r,i=/* @__PURE__ */ new Set,a,o=[]){let s=a??e.series.filter(e=>!i.has(Y(e))).flatMap(e=>e.values);return Ke(o.length?[...s,...o]:s,t,n,r)}function Ke(e,t,n,r){if(t.scale===`log`)return E(`log`).domain(e,t);let i=G(t.min),a=G(t.max),[o,s]=xe(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]=de(o,s,r);i===null&&(o=e),a===null&&(s=t)}return[o,s]}function qe(e){return e.annotations?.length?E(`annotations`):void 0}function Je(e,t,n,r){let i=e.y??{},a=We(i,Math.max(2,r)),o=Ge(e.data,i,n.zero,a,t.hidden,n.values,qe(e)?.values(e.annotations)),s=n.tickFormat??i.format,c=e=>Ve(o,e,i),l=e=>He(e,i,a,s,t.locale);return{scale:c,ticks:l,probe:l(c([0,1]))}}function Ye(e,t,n,r,i,a){let{area:o,x:s,y:c,xTicks:l,yTicks:u,horizontal:d}=r,f=e.x??{},p=qe(e)?.layers(e.annotations,{area:o,horizontal:d,fontSize:t.fontSize,value:c,band:s,keys:i,time:a}),m=e.y?.show!==!1&&[_e({position:d?`bottom`:`left`,ticks:u,area:o})],h=(f.show!==!1&&r.labels.length>0||f.line)&&[_e({position:d?`left`:`bottom`,ticks:l,area:o,line:f.line===!0})],g=e=>e.flatMap(e=>e||[]);return{...r,background:g([e.y?.grid!==!1&&ve({direction:d?`x`:`y`,ticks:u,area:o}),f.grid&&ve({direction:d?`y`:`x`,ticks:l,area:o}),p?.under]),foreground:g([p?.over,d?h:m,d?m:h]),clip:Ze(t,o,n)}}function Xe(e,r,i){let{data:o}=e,s=e.y??{},l=e.x??{},{fontSize:u,locale:d,width:f,height:p}=r,m=i.overhang??0,h=t(e.padding),g=Ie(o),_=ze(e,r),v=s.show!==!1,y=l.show!==!1&&g.length>0,b=Re(e)&&i.scale===`point`,x=Je(e,r,i,Math.round(p/60)),S=x.probe,C=Math.max(2,Math.round(f/80)),w=g.map(J),T=e=>_(g[e],e),D=b?E(`time`).axis(g,w,l,C,d):{edges:g.length?[T(0),T(g.length-1)]:[],scale:e=>i.scale===`point`?be(w,e):ye(w,e,{paddingInner:i.paddingInner??.3,paddingOuter:i.paddingOuter??.15}),ticks:e=>pe(e,(e,t)=>T(t))},O=D.edges,k=Math.ceil(u*c/2),A=y?a(O[0]??``,u):0,j=y?a(O[O.length-1]??``,u):0,M=i.scale===`point`,N=v?ge(`left`,S,u):0,P=e=>{let t=t=>M?Math.ceil(t/2):Math.max(0,Math.ceil(t/2-e));return{right:h.right+Math.max(t(j),m,8),left:h.left+Math.max(N,t(A),m,v?0:8)}},F=Math.max(1,g.length)*2,I=P((f-h.left-h.right-N)/F);M||(I=P((f-I.left-I.right)/F));let L=n(f,p,{top:h.top+Math.max(v?k:0,m,4),bottom:h.bottom+Math.max(y?ge(`bottom`,[S[0]],u):v?k:0,m,4),...I}),R=D.scale([L.x,L.x+L.width]),z=x.scale([L.y+L.height,L.y]),B=he(x.ticks(z),`left`,u,4);return Ye(e,r,m,{area:L,labels:g,x:R,y:z,horizontal:!1,xTicks:y?he(D.ticks(R),`bottom`,u):[],yTicks:B},w,D.time)}function Ze(e,t,n){let r=`${e.id}-clip`,i=n+1;return{def:D(`clipPath`,{id:r},D(`rect`,{x:t.x-i,y:t.y-i,width:t.width+i*2,height:t.height+i*2})),url:`url(#${r})`}}function Qe(e,t){let{dash:n,width:r}=e;return{...Pe(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 $e(e,t,n,r,i){let{area:a,x:o,labels:s,horizontal:c}=e,{data:l}=t,u=ze(t,n),d=W(t.y?.format,n.locale),f=e=>{let i=o.at(e),f=i+o.bandwidth/2,p=s[e],m=c?{x:a.x,y:f}:{x:f,y:null},h=[];l.series.forEach((i,a)=>{if(n.hidden.has(Y(i)))return;let o=i.values[e],s=Le(o,t.y)?o:null,c=s===null?m:r(a,e,s),l={name:i.name,seriesIndex:a,value:s,text:s===null?`–`:d(s),...c};i.color&&(l.color=i.color),h.push(l)});let g={index:e,label:J(p),title:u(p,e),x:c?a.x+a.width/2:f,area:a,items:h};return c&&(g.y=f,g.axis=`y`),o.bandwidth>0&&(g.band=c?{x:a.x,y:i,width:a.width,height:o.bandwidth}:{x:i,y:a.y,width:o.bandwidth,height:a.height}),g};return{count:s.length,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=f(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=f(e);return t!==void 0&&n.items.some(e=>e.seriesIndex===t)&&(n.seriesIndex=t),n}}}function et(e,t,n=1/0){let r=Ie(e.data),i=r.length>n?r.slice(0,n):r,a=ze(e,t),o=W(e.y?.format,t.locale),s=e.data.series.filter(e=>!t.hidden.has(Y(e)));return{columns:[``,...s.map(e=>e.name)],total:r.length,rows:i.map((e,t)=>[a(e,t),...s.map(e=>{let n=e.values[t];return n==null||!Number.isFinite(n)?`–`:o(n)})])}}function tt(e,t){if(e.time){let n=e.time(new Date(Be(t)));return Number.isFinite(n)?[n,n]:void 0}let n=e.keys.indexOf(J(t));return n<0?void 0:[e.band.at(n),e.band.at(n)+e.band.bandwidth]}let nt=(e,t)=>{if(!Array.isArray(e))return t(e);let n=e.map(t);return n.length===2&&!n.includes(null)?n:null},rt=e=>e===void 0?e:ke(e,e=>({...e,y:e.y===void 0?e.y:nt(e.y,G),x:e.x===void 0?e.x:nt(e.x,De),label:e.label==null?void 0:Ee(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),it=e=>Array.isArray(e);function at(e){let t=[];for(let n of rt(e)??[])if(n.y!==void 0)for(let e of it(n.y)?n.y:[n.y])Number.isFinite(e)&&t.push(e);return t}function ot(e,t){if(e=rt(e),!e?.length)return{under:null,over:null};let{area:n,horizontal:r,fontSize:i}=t,o=[],c=[],l=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]=it(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]=it(e.x)?e.x:[e.x,e.x],s=tt(t,a),c=tt(t,o);if(!s||!c)return;n=it(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,c]=i?[l,u]:[d,f];if(p(a,s,c)||p(o,s,c)||a<s&&o>c)return{a0:Math.max(a,s),a1:Math.min(o,c),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]:[l,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=a(e.label,i*.92),r=b-_<=.5,o=[];if(x){let e=_+4,t=r?_-4-n:Math.max(l,b-4-n),a=e+n<=u?[e,t]:[t,e],s=p?d+i:f-4,c=(p?1:-1)*i*1.2;for(let e of a)if(!(e<l||e+n>u))for(let t=0;t<3;t++)o.push([e,s+t*c]);o.length||o.push([Math.max(l+4,a[0]),s])}else{let e=p?u-4-n:l+4,t=p?l+4:u-4-n;for(let n of[e,t])r?o.push([n,_-4],[n,_+i]):o.push([n,_+i],[n,b-4])}let c=([e,t])=>[e,t-i,e+n,t+i*.25],m=o.find(e=>y(c(e),t))??o.find(e=>v(c(e)))??o[0];h.push(c(m)),S=D(`text`,{class:`tc-annotation-label`,x:s(m[0]),y:s(m[1])},e.label)}if(b-_>.5){let e=x?`M${s(_)},${s(d)}H${s(b)}V${s(f)}H${s(_)}Z`:`M${s(l)},${s(_)}H${s(u)}V${s(b)}H${s(l)}Z`;o.push(D(`g`,r(),D(`path`,{class:`tc-annotation-band`,d:e}))),S&&c.push(D(`g`,r(`label`),S));return}let C=s(_);c.push(D(`g`,r(),D(`line`,x?{class:`tc-annotation-line`,x1:C,x2:C,y1:s(d),y2:s(f)}:{class:`tc-annotation-line`,x1:s(l),x2:s(u),y1:C,y2:C}),S))}),{under:o.length?D(`g`,{key:`annotations-under`,class:`tc-annotations`,"aria-hidden":`true`},o):null,over:c.length?D(`g`,{key:`annotations-over`,class:`tc-annotations`,"aria-hidden":`true`},c):null}}function st(e,t,n){let r=e[0],i=e[e.length-1],a=r!==void 0&&i!==void 0?Math.abs(Be(i)-Be(r)):0,o=re({year:`numeric`,month:`short`,day:`numeric`,...a>0&&a<2592e5?{hour:`numeric`,minute:`2-digit`}:{},...t?{timeZone:`UTC`}:{}},n);return e=>Number.isFinite(Be(e))?o(Be(e)):String(e)}function ct(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 ct(f<d?[r,e]:[e,r],t,n)}})}function lt(e,t){let[n,r]=xe(e.filter(e=>e!=null&&e>0&&Number.isFinite(e)))??[1,10],i=G(t.min),a=G(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=ct([n,r],[0,1]).nice().domain;i===null&&(n=e[0]),a===null&&(r=e[1])}return[n,r]}function ut(e,t,n,r){let i=z(n,r);return e.ticks(t).map(t=>({value:t,position:e(t),label:i(t)}))}function dt(e){return e?`${e.index}:${e.seriesIndex??``}`:``}function ft(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 pt(e,t){return D(`div`,{class:`tc-legend-items`},e.map(e=>{let n=t.has(e.key);return D(`button`,{key:e.key,type:`button`,class:[`tc-legend-item`,`tc-series`,`tc-series-${e.index+1}`,n&&`tc-legend-item-hidden`],style:{"--tc-series-color":e.color},"aria-pressed":n?`false`:`true`,"data-key":e.key},D(`span`,{class:`tc-legend-swatch`,"aria-hidden":`true`}),D(`span`,{class:`tc-legend-name`},e.name))}))}function mt(e){return new Set(e.filter(e=>e.hidden).map(e=>e.key))}let ht=/^[a-zA-Z_][\w:.-]*$/,gt=/^on/i;function _t(e){return ht.test(e)}function vt(e){return ht.test(e)&&!gt.test(e)}let yt=`http://www.w3.org/2000/svg`,bt=`http://www.w3.org/1999/xhtml`,X=/* @__PURE__ */ new WeakMap,xt=/* @__PURE__ */ new WeakMap;function Z(e,t,n){let r=xt.get(e)??(n?.parentNode===e?n:void 0);if(t===null||!_t(t.tag))return r&&(r.remove(),xt.delete(e)),null;if(r&&Dt(r,t))return kt(r,t),xt.set(e,r),r;if(r&&S.hydrate?.(r,t,St(e,t.tag)))return xt.set(e,r),r;let i=Et(t,St(e,t.tag),e.ownerDocument);return r?r.replaceWith(i):e.appendChild(i),xt.set(e,i),i}function St(e,t){return t===`svg`||e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?yt:bt}function Ct(e){return e.namespaceURI===`http://www.w3.org/2000/svg`&&e.localName!==`foreignObject`?yt:bt}function wt(e,t,n){if(typeof e==`string`){let t=n.createTextNode(e);return X.set(t,e),t}return _t(e.tag)?Et(e,e.tag===`svg`?yt:t,n):null}function Tt(e,t,n){t===`style`?e.style.cssText=n:e.setAttribute(t,n)}function Et(e,t,n){let r=n.createElementNS(t,e.tag),{attrs:i}=e;for(let e in i)vt(e)&&Tt(r,e,String(i[e]));let a=Ct(r);for(let t of e.children){let e=wt(t,a,n);e&&r.appendChild(e)}return X.set(r,e),r}function Dt(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 Ot(e,t){if(typeof t==`string`){X.get(e)!==t&&(e.data=t,X.set(e,t));return}kt(e,t)}function kt(e,t){let n=X.get(e);n!==t&&(At(e,n.attrs,S.sweep?.(e,n,t)??t.attrs,!0),jt(e,t.children),X.set(e,t))}function At(e,t,n,r=!1){for(let i in n){let a=n[i];t[i]!==a&&vt(i)&&(r&&i===`d`&&S.morph?.(e,String(t[i]??``),String(a))||Tt(e,i,String(a)))}for(let r in t)!(r in n)&&vt(r)&&e.removeAttribute(r)}function jt(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)&&Dt(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=Ct(e),l=e.ownerDocument,u=null;for(let n=t.length-1;n>=0;n--){let r=t[n],i=a[n];if(i)Ot(i,r);else if(i=wt(r,c,l)??void 0,!i)continue;(i.parentNode!==e||i.nextSibling!==u)&&e.insertBefore(i,u),u=i}}let Mt=/* @__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`]),Nt=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]);function Pt(e,t={}){return typeof e==`string`?Ht(e):Ft(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`:!Mt.has(e.tag))}function Ft(e,t){let{tag:n,attrs:r,children:i}=e;if(!_t(n))return``;let a=t||n===`svg`,o=`<${n}`;for(let e in r)vt(e)&&(o+=` ${e}="${Ut(String(r[e]))}"`);if(i.length===0){if(a)return`${o}/>`;if(Nt.has(n.toLowerCase()))return`${o}>`}o+=`>`;let s=a&&n!==`foreignObject`;for(let e of i)o+=typeof e==`string`?Ht(e):Ft(e,s);return`${o}</${n}>`}let It=/[&<>]/,Lt=/[&"<>]/,Rt=/[&<>]/g,zt=/[&"<>]/g,Bt={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`},Vt=e=>Bt[e];function Ht(e){return It.test(e)?e.replace(Rt,Vt):e}function Ut(e){return Lt.test(e)?e.replace(zt,Vt):e}let Wt=/* @__PURE__ */ new WeakMap,Gt=/* @__PURE__ */ new WeakSet,Kt;function qt(){return Kt||typeof ResizeObserver!=`function`||(Kt=new ResizeObserver(e=>{for(let{target:t,contentRect:n}of e)t.isConnected?(Gt.add(t),Wt.get(t)?.(n.width,n.height)):Gt.has(t)&&(Gt.delete(t),Kt?.unobserve(t))})),Kt}function Jt(e,t){let n=qt();return n?(Wt.set(e,t),n.observe(e),()=>{Wt.get(e)===t&&(Wt.delete(e),n.unobserve(e))}):()=>{}}let Yt=/* @__PURE__ */ new Map,Xt=!1,Zt=e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)};function Qt(e){try{e()}catch(e){setTimeout(()=>{throw e})}}function $t(e,t){Yt.set(e,t),Xt||(Xt=!0,Zt(nn))}let en={};function tn(e){Yt.delete(e)}function nn(){Xt=!1;let e=0,t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;do{for(let[r,i]of Yt)Yt.delete(r),t.has(r)?n.set(r,i):(t.add(r),Qt(i),e++);e+=en.idle?.()??0}while(Yt.size>0);for(let[e,t]of n)$t(e,t);return e}let rn=0,an=()=>`tc-${++rn}`;function on(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:r/i;return{width:r,height:Math.max(0,Math.round(a))}}function sn(e,t,n,r,i,a){let o,s=cn(e,t,n,e=>{o=e,r(e)},i,a),c=e.type.render(e,s);return S.post?S.post(e,c,o,s):c}function cn(e,t,n,r,i,a){return{width:t.width,height:t.height,fontSize:e.fontSize??a??12,locale:e.locale,id:n,onHitTest:r,hidden:i}}function ln(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 un(e){if(!e.type||typeof e.type.render!=`function`)throw TypeError("@tabler/charts: `type` must be a chart type such as line.")}function dn(e){let t=e.type.legend?.(e)??[],n=e.legend;return{items:t,show:n===void 0?t.length>=2:n!==!1&&t.length>0,position:typeof n==`object`&&n.position===`bottom`?`bottom`:`top`}}function fn(e){if(e.title)return e.title;let t=(e.type.legend?.(e)??[]).map(e=>e.name).filter(Boolean),n=t.slice(0,6).join(`, `);return`${e.type.name} chart${t.length?`: ${n}${t.length>6?`, …`:``}`:``}`}let pn=e=>Array.isArray(e)?e.reduce((e,t)=>e+pn(t),0):e&&typeof e==`object`?1+pn(e.children):0,mn=(e,t)=>e.animate===!1||e.animate!==!0&&pn(t)>1e3;function hn(e,t,n,r,i,a,o,s){let{width:c,height:l}=t,u=e.description?`${n}-desc`:void 0,{patterns:d}=e,f=d===!1?void 0:(d===!0?E(`patterns`):S.patterns)?.(e,n);return D(`svg`,{class:[`tc-chart`,`tc-chart-${e.type.name}`,r&&`tc-static`,f?.[0],e.class],style:f?.[1],viewBox:`0 0 ${c} ${l}`,width:c,height:l,role:`img`,"aria-label":fn(e),"aria-describedby":u,...s},u&&D(`desc`,{key:`desc`,id:u},e.description),f?.[2],a&&D(`g`,{key:`hover-under`,class:`tc-hover-layer`},a),i,o&&D(`g`,{key:`hover-over`,class:`tc-hover-layer`},o))}function gn(e,t,n=e.id??`tc`,r=()=>{}){un(e),e=ln(e);let i=mt(dn(e).items),a=sn(e,t,n,r,i),o=e;return hn(o,t,n,mn(o,a),a)}function _n(e,t){return Pt(gn(e,t))}let vn=[`hover`,`click`,`legend-toggle`,`render`],yn=/* @__PURE__ */ new WeakMap;var bn=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.#x(),this.#S())};#n={};#r=/* @__PURE__ */ new Map;#i;#a=[];#o=!1;#s;#c;#l=``;#u=null;#d;#f;#p=/* @__PURE__ */ new Map;#m;#h;constructor(e,t,n=[]){let r=typeof e==`string`?document.querySelector(e):e;if(!r)throw Error(`@tabler/charts: element "${String(e)}" not found.`);yn.get(r)?.destroy(),yn.set(r,this),this.element=r,this.#e=ln(t),this.id=t.id??an(),this.#m=r.querySelector(`:scope > svg.tc-chart`),this.#w(),this.#i=Jt(r,this.#t);try{for(let e of[...n,...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;if(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 on(this.#e,e)}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.#y(n),n):null}highlightAt(e,t,n){let r=this.hitTest(e,t);return this.#c={kind:`pointer`,x:e,y:t},this.#y(r,n),r}clearHighlight(e){this.#c=void 0,this.#y(null,e)}toggleSeries(e,t){let{items:n}=dn(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.#b(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.#S(),this}isHidden(e){return this.#b(dn(this.#e).items).has(e)}update(e){this.#e=ln({...this.#e,...e});for(let t in e)t!==`data`&&(this.#h=void 0);return this.#S(),this}setConfig(e){return this.#e=ln(e),this.#h=void 0,this.#S(),this}setData(e){return this.update({data:e})}resize(){return this.#o||(this.#i=Jt(this.element,this.#t)),this.#w(),this.#h=void 0,this.#S(),this}render(){if(this.#o)return this;tn(this);let e=this.#e,t=e;un(t);let n=dn(e),r=this.#b(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.#g(i,r);o&&this.#_();let c=this.#m;Z(this.element,this.#v(a,i),c),this.#m=null,c&&this.#x();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}#g(e,t){let n=this.#e,r=[...t].sort().join(`\0`);this.#h??=n.fontSize??this.#C();let i=n.fontSize??this.#h,a=this.#d,o=!a||a.cfg!==n||a.hidden!==r,s=o||a?.width!==e.width||a.height!==e.height||a.fontSize!==i;if(!a||s){this.#s=void 0;let o=sn(n,e,this.id,e=>{this.#s=e},t,i);a={cfg:n,width:e.width,height:e.height,hidden:r,fontSize:i,content:o,still:mn(n,o)},this.#d=a}return{content:a,stale:s,changed:o}}#_(){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.#y(t,void 0,!0,!1)}#v(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 hn(n,t,this.id,e.still,e.content,i.length?i:void 0,a.length?a:void 0,o)}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,yn.get(this.element)===this&&yn.delete(this.element),tn(this),clearTimeout(this.#f),this.#i();for(let e of this.#a)e.destroy?.();this.#r.clear(),Z(this.element,null)}}#y(e,t,n=!1,r=!0){let i=dt(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.#S()))}#b(e){let t=/* @__PURE__ */ new Set;for(let n of e)(this.#p.get(n.key)??n.hidden)&&t.add(n.key);return t}#x(){let e=this.element.querySelector(`:scope > svg.tc-chart`);e&&(e.setAttribute(`data-resizing`,``),clearTimeout(this.#f),this.#f=setTimeout(()=>e.removeAttribute(`data-resizing`),200))}#S(){this.#o||$t(this,()=>this.render())}#C(){if(typeof getComputedStyle!=`function`)return;let e=Number.parseFloat(getComputedStyle(this.element).getPropertyValue(`--tc-font-size`));return Number.isFinite(e)&&e>0?e:void 0}#w(){let e=this.element,t=typeof getComputedStyle==`function`?getComputedStyle(e):void 0,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 xn=[`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`],Sn=xn.length,Cn=e=>e<Sn?[`${e+1}`,`tc-series-${e+1}`]:[`other`,``];function wn(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let[e,i]=Cn(r.index);n.has(e)||n.set(e,D(`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}},D(`rect`,{class:`tc-pattern-bg`,width:8,height:8}),D(`path`,{class:`tc-pattern-ink`,d:xn[r.index%Sn]})))}return[...n.values()]}function Tn(e,t){let n={};for(let r of e){let[e]=Cn(r.index);n[`--tc-pattern-${e}`]=`url(#${t}-pattern-${e})`}return n}function En(e,t){let{items:n}=dn(e);if(n.length)return[e.patterns===!0?`tc-patterned`:`tc-patterns-auto`,Tn(n,t),D(`defs`,{key:`patterns`},wn(n,t))]}let Dn=[[],[-.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 On(e,t,n,r){let i=Dn[e]??[];if(!i.length)return`M${s(t-r)},${s(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`}${s(t+i[e]*r)},${s(n+i[e+1]*r)}`;return`${a}Z`}function kn(e,t){if(Array.isArray(e))return e.map(e=>kn(e,t));if(!e||typeof e!=`object`)return e;let{attrs:n}=e,r=String(n.class??``),i=/\btc-series-(\d+)\b/.exec(r);return e.tag===`circle`&&t>=0&&/\btc-point\b/.test(r)&&!/\btc-bubble\b/.test(r)?{tag:`path`,attrs:{class:`${r} tc-marker`,d:On(t,+(n.cx??0),+(n.cy??0),+(n.r??0))},children:[],key:e.key}:{...e,children:e.children.map(e=>kn(e,i?Number(i[1])-1:t))}}let An=(e,t)=>e.shapes??e.patterns===!0?kn(t,-1):t,jn=1e3,Mn=60*jn,Nn=60*Mn,Pn=24*Nn,Fn=30*Pn,In=365*Pn,Ln=[{unit:`second`,step:1,ms:jn},{unit:`second`,step:5,ms:5*jn},{unit:`second`,step:15,ms:15*jn},{unit:`second`,step:30,ms:30*jn},{unit:`minute`,step:1,ms:Mn},{unit:`minute`,step:5,ms:5*Mn},{unit:`minute`,step:15,ms:15*Mn},{unit:`minute`,step:30,ms:30*Mn},{unit:`hour`,step:1,ms:Nn},{unit:`hour`,step:3,ms:3*Nn},{unit:`hour`,step:6,ms:6*Nn},{unit:`hour`,step:12,ms:12*Nn},{unit:`day`,step:1,ms:Pn},{unit:`day`,step:2,ms:2*Pn},{unit:`week`,step:1,ms:6048e5},{unit:`month`,step:1,ms:Fn},{unit:`month`,step:3,ms:3*Fn},{unit:`year`,step:1,ms:In}];function Rn(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<Ln.length&&Ln[r].ms<n;)r++;if(r===Ln.length){let e=Math.max(1,ue(0,n/In,1));return{unit:`year`,step:e,ms:e*In}}if(r===0)return Ln[0];let i=Ln[r-1],a=Ln[r];return n/i.ms<a.ms/n?i:a}let Bn=e=>e instanceof Date?e.getTime():e,Vn={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 Hn(e,t,n={}){let r=n.utc===!0,i=Bn(e[0]),a=Bn(e[1]),[o,s]=t,c=a-i,l=c===0?0:(s-o)/c,u=Rn(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+(Bn(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]=Vn[n],o=r?{timeZone:`UTC`}:{},s=L(t,{...i,...o}),c=a?L(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 Hn(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)),Hn(a<i?[l,s]:[s,l],t,n)}})}function Un(e,t,n,r){let[i,a]=xe(e)??[0,1],o=e.filter(e=>Number.isFinite(e)),s=Hn([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=0,n=c.length-1;for(;t<n;){let r=t+n>>1;c[r]<e?t=r+1:n=r}let r=t-1;return r>=0&&e-c[r]<c[t]-e?r:t}}),time:s}}function Wn(e,t,n,r,i){let a=e.map(Be),o=e=>Un(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 Gn=(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,Kn=(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;function qn(e,t,n){let r=e.valueLabels,i=typeof r==`object`?r:{},{fontSize:o,locale:c}=n,l=e.type.valueLabels,u=l?.marks===`slice`,d=l?.marks===`cell`,f=!!e.stacked,p=i.format?z(i.format,c):u?e=>I(c,{style:`percent`,maximumFractionDigits:1}).format(e):l?.format?z(l.format(e),c):void 0,m=o,h=[],g=/* @__PURE__ */ new Map,_=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&&(_+=Math.abs(t.value),!u&&!t.box&&i.points!==`all`&&g.set(t.seriesIndex,h.length),h.push([`${e}-${t.seriesIndex}`,t,n]))}let v=h.flatMap(([,e])=>e.box?[e.box]:[]),y=[];return h.forEach(([e,t,n],r)=>{let{area:s}=n;if(!u&&!t.box&&i.points!==`all`&&g.get(t.seriesIndex)!==r)return;let c=t.value,l=c/(_||1),h=p?p(u?l:c):t.text,b=a(h,o),x=(n,r,i)=>(!t.box&&!u&&(n=Math.max(s.x+b/2+2,Math.min(n,s.x+s.width-b/2-2))),{key:e,text:h,x:n,y:r,inside:i,box:{x:n-b/2-2,y:r-m/2,width:b+4,height:m}}),S=t.y,C=[],{box:w}=t;if(u)C.push(x(t.x,S,!0));else if(w){let e=n.axis===`y`,r=c<0;if(!f&&!d){let n=(e?b/2:m/2)+4,i=r?1:-1,a=S+i*n;C.push(e?x(t.x-i*n,S,!1):x(t.x,a,!1),...e?[]:[x(w.x+b/2-3,a,!1),x(w.x+w.width-b/2+3,a,!1)],e?x(t.x+i*n,S,!0):x(t.x,S-i*n,!0))}else C.push(x(w.x+w.width/2,w.y+w.height/2,!0))}else{let e=b/2+4+4;C.push(x(t.x,S-m/2-4-2,!1),x(t.x,S+m/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,n={...e.box,x:e.box.x+5,width:e.box.width-10})=>Kn(u?s:T,e.box)&&(!e.inside||!w||Kn(w,e.box))&&(!u||Jn(t,s,l,e.box))&&!y.some(t=>Gn(t.box,e.box))&&!v.some(e=>e!==w&&Gn(e,n)),D=C.find(e=>E(e));D&&y.push(D)}),y.length?D(`g`,{key:`value-labels`,class:`tc-value-labels`,"aria-hidden":`true`},y.map(e=>D(`text`,{key:e.key,class:[`tc-value-label`,e.inside&&`tc-value-label-inside`],style:`transform:translate(${s(e.x)}px,${s(e.y)}px)`,"text-anchor":`middle`,dy:`0.35em`},e.text))):null}function Jn(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 Yn=(e,t,n,r)=>e.valueLabels&&n?[t,qn(e,n,r)]:t;function Xn(e,t,n){return e.nodeType===1&&e.localName===t.tag&&e.namespaceURI===n}function Zn(e,t){let n={};for(let t of e.getAttributeNames())n[t]=e.getAttribute(t);n.style&&=``,At(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=Ct(e),a=e.firstChild;for(let n of t.children){let t=a?a.nextSibling:null;if(typeof n==`string`?a?.nodeType===3:a&&Xn(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)):Zn(a,n),a=t;else{let t=wt(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 Qn(e,t,n){return X.has(e)||!Xn(e,t,n)?!1:(Zn(e,t),!0)}let $n=/* @__PURE__ */ new WeakMap;function er(e){let t=$n.get(e);return t&&cancelAnimationFrame(t.frame),$n.delete(e),t?.now}function tr(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):$n.delete(e)};$n.set(e,o),o.frame=requestAnimationFrame(c)}let nr=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,rr;function ir(e,t,n){rr??=typeof CSS>`u`||CSS.supports(`d`,`path("M0 0")`);let r=er(e);if(rr||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,c=n.split(nr),l=n.match(nr)?.map(Number)??[],u=t.match(nr)?.map(Number)??[];return!(o>0)||u.length!==l.length||t.split(nr).join()!==c.join()?!1:(tr(e,r?.length===l.length?r:u,l,o,e=>e.reduce((e,t,n)=>e+s(t)+c[n+1],c[0]),n),!0)}function ar(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),or(e,n,i,Math.max(2,Math.round(t*(i-n)/a)),o),s=i;return s<n&&o.push(s),o}function or(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 sr(e,t){return ar(e,t).map(t=>e[t])}var cr=class{d=``;#e;constructor(e){this.#e=10**Math.max(0,Math.min(12,Math.floor(e)))}#t(e){let t=Math.round(e*this.#e)/this.#e;return String(t===0?0:t)}#n(e,t){return`${this.#t(e)},${this.#t(t)}`}moveTo(e,t){this.d+=`M${this.#n(e,t)}`}lineTo(e,t){this.d+=`L${this.#n(e,t)}`}curveTo(e,t,n,r,i,a){this.d+=`C${this.#n(e,t)},${this.#n(n,r)},${this.#n(i,a)}`}close(){this.d+=`Z`}};function lr(e,t,n,r){let i=n===`monotone`?ur(t):t,a=i[0];if(!a)return 0;switch(r?e.moveTo(a[0],a[1]):e.lineTo(a[0],a[1]),n){case`monotone`:pr(e,i);break;case`step`:dr(e,i,.5);break;case`step-before`:dr(e,i,0);break;case`step-after`:dr(e,i,1);break;default:for(let t=1;t<i.length;t++){let n=i[t];e.lineTo(n[0],n[1])}}return i.length}function ur(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){for(let r=1;r<t.length;r++){let[i,a]=t[r-1],[o,s]=t[r];if(n<=0)e.lineTo(i,s),e.lineTo(o,s);else if(n>=1)e.lineTo(o,a),e.lineTo(o,s);else{let c=i*(1-n)+o*n;e.lineTo(c,a),e.lineTo(c,s),r===t.length-1&&e.lineTo(o,s)}}}let fr=e=>e<0?-1:1;function pr(e,t){let n=t.length;if(n<2)return;if(n===2){let n=t[1];e.lineTo(n[0],n[1]);return}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]=(fr(d)+fr(f))*Math.min(Math.abs(d),Math.abs(f),.5*Math.abs(p))||0}r[0]=mr(t[0],t[1],r[1]),r[n-1]=mr(t[n-2],t[n-1],r[n-2]);for(let i=1;i<n;i++){let[n,a]=t[i-1],[o,s]=t[i],c=(o-n)/3;e.curveTo(n+c,a+c*r[i-1],o-c,s-c*r[i],o,s)}}function mr(e,t,n){let r=t[0]-e[0];return r?3*(t[1]-e[1])/r/2-n/2:n}let hr=e=>e!=null&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function gr(e,t=()=>!0){let n=[],r;for(let i=0;i<e.length;i++)hr(e[i])&&t(i)?(r||(r=[],n.push(r)),r.push(i)):r=void 0;return n}function _r(e,t={}){let{curve:n=`linear`,precision:r=2}=t,i=new cr(r);for(let t of gr(e))lr(i,t.map(t=>e[t]),n,!0)===1&&i.close();return i.d}function vr(e,t,n={}){let{curve:r=`linear`,precision:i=2}=n,a=new cr(i),o=e=>typeof t==`number`?t:t[e]??NaN;for(let t of gr(e,e=>Number.isFinite(o(e))))lr(a,t.map(t=>e[t]),r,!0),lr(a,t.map(t=>[e[t][0],o(t)]).reverse(),r===`step-before`?`step-after`:r===`step-after`?`step-before`:r,!1),a.close();return a.d}let yr={png:`PNG`,svg:`SVG`,jpeg:`JPEG`,webp:`WebP`},br=[`png`,`svg`];function xr(e){return e===!0?{}:Array.isArray(e)?{formats:e}:e}function Sr(){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(),E(`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),Z(r,null),r.remove(),r=void 0,a&&t.classList.remove(`tc-container`))};return{afterRender({config:e,changed:a}){let o=e.download;if(!o||typeof document>`u`){h();return}if(!a&&r?.isConnected)return;E(`export`),i=xr(o);let s=i.formats?.length?i.formats:br;r||(r=n.createElement(`div`),r.className=`tc-download`,r.addEventListener(`click`,f),r.addEventListener(`keydown`,p),r.addEventListener(`focusout`,m)),Z(r,D(`div`,{class:`tc-download-box`},D(`button`,{type:`button`,class:`tc-download-toggle`,"aria-label":i.label??`Download`,"aria-haspopup":`menu`,"aria-expanded":`false`},D(`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`},D(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`}))),D(`div`,{class:`tc-download-menu`,role:`menu`,hidden:``},s.map(e=>D(`button`,{key:e,type:`button`,role:`menuitem`,class:`tc-download-item`,"data-format":e},yr[e]??e))))),t.classList.add(`tc-container`),r.isConnected||t.appendChild(r)},destroy:h}}}}function Cr(e,t,n){return D(`g`,{key:e,class:[`tc-series`,`tc-series-${e+1}`],style:{"--tc-series-color":t}},n)}function wr(e,t=!0){let{area:n}=e;return D(`g`,{class:`tc-hover`,"aria-hidden":`true`},e.mark?null:e.band?D(`rect`,{class:`tc-hover-band`,x:s(e.band.x),y:s(e.band.y),width:s(e.band.width),height:s(e.band.height)}):t&&D(`line`,e.guide?{class:`tc-crosshair`,x1:s(e.guide.x1),x2:s(e.guide.x2),y1:s(e.guide.y1),y2:s(e.guide.y2)}:{class:`tc-crosshair`,x1:s(e.x),x2:s(e.x),y1:s(n.y),y2:s(n.y+n.height)}))}function Tr(e,t=4,n){let{mark:r}=e;if(r){let t=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return D(`g`,{class:`tc-hover`,"aria-hidden":`true`},t&&Cr(t.seriesIndex,t.color,D(`path`,{class:`tc-hover-mark`,d:r.d,style:`transform:translate(${s(r.x)}px,${s(r.y)}px)`})))}return D(`g`,{class:`tc-hover`,"aria-hidden":`true`},!e.band&&e.items.map(e=>e.y!==null&&Cr(e.seriesIndex,e.color,n?D(`path`,{class:`tc-point tc-point-active tc-marker`,d:n(e.seriesIndex,e.x,e.y,t)}):D(`circle`,{class:`tc-point tc-point-active`,cx:s(e.x),cy:s(e.y),r:t}))))}let Er=/* @__PURE__ */ new WeakSet;function Dr(e){let t=e.element;if(Er.has(e)||typeof t.addEventListener!=`function`)return;Er.add(e);let n=n=>{let r=t.querySelector(`svg.tc-chart`);if(!r)return;let{width:i,height:a}=e.size;return ft(r,n.clientX,n.clientY,i,a)},r=e=>!!e.target?.closest?.(`.tc-download`),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),()=>{Er.delete(e),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerdown`,a),t.removeEventListener(`pointerleave`,i),t.removeEventListener(`click`,o)}}function Or(){return{name:`pointer`,install(e){let t=Dr(e);return t?{destroy:t}:{}}}}function kr(){return{name:`highlight`,install(e){let t=Dr(e);return{layers:(e,t)=>({under:wr(e,t.crosshair!==!1),over:Tr(e,4,Ue(t))}),...t?{destroy:t}:{}}}}}function Ar(e,t){let[n=``,...r]=e.columns;return D(`table`,{class:`tc-table`},t&&D(`caption`,null,t),D(`thead`,null,D(`tr`,null,D(`th`,{scope:`col`},n),r.map((e,t)=>D(`th`,{key:t,scope:`col`},e)))),D(`tbody`,null,e.rows.map(([e=``,...t],n)=>D(`tr`,{key:n},D(`th`,{scope:`row`},e),t.map((e,t)=>D(`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 Mr=e=>e.keyboard??e.type.keyboard??!0;function Nr(){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;let r=e.highlightSource===`index`?e.active:null,i=n.count-1,o=r?.index,s=r?.seriesIndex,c=r?.items.map(e=>e.seriesIndex)??[],l=s===void 0?-1:c.indexOf(s);switch(t){case`ArrowRight`:return a(o===void 0?0:Math.min(i,o+1),s),!0;case`ArrowLeft`:return a(o===void 0?i:Math.max(0,o-1),s),!0;case`Home`:return a(0,s),!0;case`End`:return a(i,s),!0;case`ArrowDown`:case`ArrowUp`:{if(o===void 0||c.length===0)return a(0),!0;let e=t===`ArrowDown`?1:-1,n=l===-1?e>0?0:c.length-1:l+e;return a(o,n<0||n>=c.length?void 0:c[n]),!0}case`Escape`:return r?(e.clearHighlight(),!0):!1;default:return!1}},s=e=>e?.matches?.(`svg.tc-chart`)===!0,c=t=>{let{key:n}=t;Mr(e.config)&&s(t.target)&&o(n)&&t.preventDefault()},l=t=>{s(t.target)&&e.highlightSource===`index`&&e.clearHighlight()},u=t=>{Mr(e.config)&&s(t.target)&&r()};return t.addEventListener(`keydown`,c),t.addEventListener(`focusin`,u),t.addEventListener(`focusout`,l),{svgAttrs:e=>Mr(e)?{tabindex:0}:void 0,destroy(){t.removeEventListener(`keydown`,c),t.removeEventListener(`focusin`,u),t.removeEventListener(`focusout`,l),n?.remove()}}}}}function Pr(){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&&=(Z(n,null),n.removeEventListener(`click`,a),i=!1,n.remove(),void 0)},s=()=>{if(!n)return;let e=t.querySelector(`:scope > svg.tc-chart`);n.dataset.position===`bottom`?e?e.nextElementSibling!==n&&e.after(n):n.isConnected||t.appendChild(n):(!n.isConnected||n.nextElementSibling!==e)&&t.insertBefore(n,e??t.firstChild)};return{beforeRender({legend:e,hidden:c}){if(!e.show||typeof document>`u`){o();return}n||(n=t.ownerDocument.createElement(`div`),n.className=`tc-legend`),i||=(n.addEventListener(`click`,a),!0),n.dataset.position=e.position,Z(n,pt(e.items,c),r),r=null,s()},reservedHeight(){if(!n?.isConnected)return 0;let{marginTop:e,marginBottom:t}=getComputedStyle(n);return n.offsetHeight+(Number.parseFloat(e)||0)+(Number.parseFloat(t)||0)},afterRender:s,destroy:o}}}}let Fr=/* @__PURE__ */ new Map,Ir=/* @__PURE__ */ new WeakMap,Lr=!1;function Rr(e,t){let n=Ir.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)}Ir.set(e,n)}return n.get(t)}function zr(){return{name:`sync`,install(e){let t=new WeakRef(e),n,r,i=()=>{n?.delete(t),r&&n?.size===0&&Fr.get(r)===n&&Fr.delete(r)},a=()=>{let a=e.config.sync,o=a?Fr.get(a)??/* @__PURE__ */ new Set:void 0;o!==n&&(i(),a&&o&&(o.add(t),Fr.set(a,o)),n=o,r=a)};a();let o=e.on(`hover`,({hit:t})=>{if(!(Lr||!n||t&&e.highlightSource!==`pointer`)){Lr=!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&&Rr(i.interaction,t.label);a==null?i.clearHighlight():i.highlightIndex(a)}}finally{Lr=!1}}});return{afterRender:a,destroy(){o(),i()}}}}}let Br=/* @__PURE__ */ new Map,Vr=!1;function Hr(){Vr=!1;let e=0;for(;Br.size>0;){let t=Array.from(Br.values());Br.clear();for(let n of t)Qt(n),e++}return e}function Ur(e,t){en.idle=Hr,Br.set(e,t),!Vr&&(Vr=!0,typeof requestIdleCallback==`function`?requestIdleCallback(Hr,{timeout:1e3}):setTimeout(Hr,100))}function Wr(e){Br.delete(e)}function Gr(){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=()=>{Wr(a),n&&=(Z(n,null),n.remove(),void 0)},s=(i,a,s)=>{let c=i.table??!0,l=typeof c==`object`&&c.maxRows?c.maxRows:1e3,u=c!==!1&&typeof document<`u`?i.type.table?.(i,cn(i,a,e.id,()=>{},s,e.fontSize),l):void 0;if(!u){o();return}let d=c===`visible`||typeof c==`object`&&c.visible===!0,f=i.title,p=u.total??u.rows.length,m=u.rows.length>l?{columns:u.columns,rows:u.rows.slice(0,l)}:u;if(p>m.rows.length){let e=I(i.locale),t=`${e.format(m.rows.length)} of ${e.format(p)} rows`;f=f?`${f} (${t})`:t}n||=t.ownerDocument.createElement(`div`),n.className=d?`tc-table-wrap`:`tc-table-wrap tc-sr-only`,Z(n,Ar(m,f),r),r=null;let h=t.querySelector(`:scope > svg.tc-chart`),g=t.querySelector(`:scope > .tc-legend[data-position="bottom"]`)??h;g&&g.nextElementSibling!==n?g.after(n):n.isConnected||t.appendChild(n)};return{afterRender({config:e,size:t,hidden:r,changed:o}){if(!o&&n?.isConnected)return;let c=e.table??!0,l=i===c;i=c,l&&n?.isConnected&&n.classList.contains(`tc-sr-only`)?Ur(a,()=>s(e,t,r)):(Wr(a),s(e,t,r))},destroy:o}}}}function Kr(e,t){if(t)return t;let n=e.items.find(t=>t.seriesIndex===e.seriesIndex)??e.items[0];return e.guide&&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 qr(e,t={}){return D(`div`,{class:`tc-tooltip-content`},t.format?t.format(e):[e.title&&D(`div`,{class:`tc-tooltip-title`},e.title),e.items.map(t=>D(`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}},D(`span`,{class:`tc-tooltip-swatch`}),D(`span`,{class:`tc-tooltip-name`},t.name),D(`span`,{class:`tc-tooltip-value`},t.text))),t.footer&&D(`div`,{class:`tc-tooltip-footer`},t.footer(e))])}function Jr(e,t,n,r=12){let{x:i=0,y:a=0}=n,o=e.x+r+t.width<=i+n.width,s=e.x-r-t.width>=i,c=o||!s?`right`:`left`,l=c===`right`?e.x+r:e.x-r-t.width,u=Math.max(i,Math.min(l,i+n.width-t.width)),d=Math.max(a,Math.min(e.y-t.height/2,a+n.height-t.height));return{x:Math.round(u),y:Math.round(d),side:c}}function Yr(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 Xr=[];function Zr(){for(let e of Xr.splice(0).map(e=>e()))e?.()}function Qr(){return{name:`tooltip`,install(e){let t=Dr(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&&Kr(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`),Z(i,qr(r,s));let c=i,l=++a;Xr.push(()=>{let t=n.querySelector(`svg.tc-chart`);if(!t||l!==a)return;let{width:i,height:s}=e.size,u=n.getBoundingClientRect(),d=t.getBoundingClientRect(),f=u.width>0&&n.offsetWidth>0?u.width/n.offsetWidth:1,p=d.width>0?d.width/i/f:1,m=d.height>0?d.height/s/f:1,h={x:(d.left-u.left)/f-n.clientLeft,y:(d.top-u.top)/f-n.clientTop},g=r.axis===`y`||r.guide?o.x:r.x,_=r.axis===`y`?r.y??o.y:o.y,v=Yr(n),y=Jr({x:h.x+g*p,y:h.y+_*m},{width:c.offsetWidth,height:c.offsetHeight},{x:(v.left-u.left)/f-n.clientLeft,y:(v.top-u.top)/f-n.clientTop,width:(v.right-v.left)/f,height:(v.bottom-v.top)/f});return()=>{c.style.transform=`translate(${y.x}px, ${y.y}px)`,c.dataset.side=y.side,c.hasAttribute(`data-visible`)||(getComputedStyle(c).transform,c.setAttribute(`data-visible`,``))}}),$t(Xr,Zr)},destroy(){a++,i&&(Z(i,null),i.remove()),r&&n.classList.remove(`tc-container`),t?.()}}}}}function $r(){return[kr(),Pr(),Qr(),Gr(),Nr(),zr(),Sr()]}var ei=class extends bn{constructor(e,t){super(e,t,$r())}};function ti(e){return D(`mask`,{id:e,maskContentUnits:`objectBoundingBox`},D(`linearGradient`,{id:`${e}-gradient`,x1:0,y1:0,x2:0,y2:1},D(`stop`,{class:`tc-fade-start`,offset:0}),D(`stop`,{class:`tc-fade-end`,offset:1})),D(`rect`,{width:1,height:1,fill:`url(#${e}-gradient)`}))}function ni(e,t,n={}){let{percent:r=!1,nullAsZero:i=!1,hidden:a}=n,o=e.map(e=>!a?.has(Y(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 ri(e){let t=[];for(let n of e)for(let e of n)e&&t.push(e.y0,e.y1);return t}function ii(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 ai(e,t,n){let{curve:r=`monotone`,points:i=`none`,pointRadius:a=4,connectNulls:o=!1,area:c=n,stacked:l=!1,decimate:u,fill:d=l?`solid`:`gradient`}=e,f=i===`none`?2:a+2,{series:p}=e.data,m=Ie(e.data).length,h=l?ni(p,m,{percent:l===`percent`,nullAsZero:!0,hidden:t.hidden}):null,g=Xe(e,t,{scale:`point`,zero:c||h!==null,overhang:f,...h?{values:ri(h)}:{},...l===`percent`?{tickFormat:{style:`percent`}}:{}}),{x:_,y:v,labels:y}=g,b=v(Math.min(Math.max(0,v.domain[0]),v.domain[1]));t.onHitTest($e(g,e,t,(e,t,n)=>({x:_.at(t),y:v(h?h[e]?.[t]?.y1??0:n)})));let x=c&&d===`gradient`,S=`${t.id}-fade`,C=e=>!t.hidden.has(Y(e)),w=p.map((t,n)=>{if(!C(t))return[];let r=h?.[n];return r?r.map((e,t)=>e?[_.at(t),v(e.y1)]:null):ii(t,y.length,e=>_.at(e),v,o,t=>Le(t,e.y))}),T=w.map(e=>u!==void 0&&e.length>u?E(`decimate`)(e,u):null),O=e=>{let t=w[e],n=T[e];return n?n.map(e=>t[e]):t},k=e=>{let t=h?.[e];if(!t)return b;let n=t.map(e=>e?v(e.y0):null),r=T[e];return r?r.map(e=>n[e]??null):n},A=c&&D(`g`,{class:`tc-areas`},e.data.series.map((e,t)=>C(e)&&D(`g`,Qe(e,t),D(`path`,{class:[`tc-area`,x&&`tc-area-gradient`],d:vr(O(t),k(t),{curve:r}),mask:x?`url(#${S})`:void 0})))),j=e.data.series.map((e,t)=>{if(!C(e))return null;let n=O(t),o=n.filter(e=>e!=null),c=i===`all`?o:i===`last`?o.slice(-1):[];return D(`g`,Qe(e,t),D(`path`,{class:`tc-line`,d:_r(n,{curve:r})}),c.length>0&&D(`g`,{class:`tc-points`},c.map(([e,t])=>D(`circle`,{key:e,class:`tc-point`,cx:s(e),cy:s(t),r:a}))))});return[D(`defs`,{key:`defs`},g.clip.def,x&&ti(S)),g.background,D(`g`,{key:`series`,class:`tc-series-list`,"clip-path":g.clip.url},A,j),g.foreground]}let oi={name:`line`,clean:K(je),render:(e,t)=>ai(e,t,!1),legend:e=>Fe(e.data),table:(e,t,n)=>et(e,t,n)},si={name:`area`,clean:K(je),render:(e,t)=>ai(e,t,!0),legend:e=>Fe(e.data),table:(e,t,n)=>et(e,t,n)},Q=e=>{let t=s(e);return t===0?0:t};function ci(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=Q(e),l=Q(e+a),u=Q(n),d=Q(r),f=r<=n,p=Q(f?r+s:r-s),m=+!!f,h=Q(s);return`M${c},${u}L${c},${p}A${h},${h},0,0,${m},${Q(e+s)},${d}L${Q(e+a-s)},${d}A${h},${h},0,0,${m},${l},${p}L${l},${u}Z`}function li(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=Q(e),l=Q(e+a),u=Q(n),d=Q(r),f=r>=n,p=Q(f?r-s:r+s),m=+!!f,h=Q(s);return`M${u},${c}L${p},${c}A${h},${h},0,0,${m},${d},${Q(e+s)}L${d},${Q(e+a-s)}A${h},${h},0,0,${m},${p},${l}L${u},${l}Z`}function ui(e,r,i){let o=e.y??{},s=e.x??{},{fontSize:c,width:l,height:u}=r,d=i.overhang??0,f=t(e.padding),p=Ie(e.data),m=ze(e,r),h=Je(e,r,i,Math.round(l/80)),g=h.probe,_=o.show!==!1,v=s.show!==!1&&p.length>0,y=p.map((e,t)=>({value:J(e),position:0,label:m(e,t)})),b=e=>_&&e?Math.ceil(a(e.label,c)/2):0,x=n(l,u,{top:f.top+Math.max(d,4),right:f.right+Math.max(b(g[g.length-1]),d,8),bottom:f.bottom+Math.max(_?ge(`bottom`,g,c):0,d,4),left:f.left+Math.max(v?ge(`left`,y,c):0,b(g[0]),d,8)}),S=p.map(J),C=ye(S,[x.y,x.y+x.height],{paddingInner:i.paddingInner??.3,paddingOuter:i.paddingOuter??.15}),w=h.scale([x.x,x.x+x.width]),T=he(h.ticks(w),`bottom`,c);return Ye(e,r,d,{area:x,labels:p,x:C,y:w,horizontal:!0,xTicks:v?he(pe(C,(e,t)=>m(p[t],t)),`left`,c):[],yTicks:T},S)}let di={name:`bar`,clean:K(je),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=Ie(e.data).length,f=e=>(u[e]?.type??`bar`)!==`bar`,p=u.filter((e,t)=>f(t)).map(Y),m=p.length?/* @__PURE__ */ new Set([...t.hidden,...p]):t.hidden,h=o?ni(u,d,{percent:o===`percent`,hidden:m}):null,g={scale:`band`,zero:!0,paddingInner:a,paddingOuter:a/2,...h?{values:[...ri(h),...u.flatMap((e,t)=>f(t)?e.values:[])]}:{},...o===`percent`?{tickFormat:{style:`percent`}}:{}},_=l?ui(e,t,g):Xe(e,t,g),{x:v,y,labels:b}=_,x=/* @__PURE__ */ new Map;u.forEach((e,n)=>{!t.hidden.has(Y(e))&&!f(n)&&x.set(n,x.size)});let S=[...x.keys()],C=h?1:Math.max(1,x.size),w=Math.max(0,Math.min(r,(v.bandwidth-(h?0:i*(C-1)))/C)),T=w*C+(h?0:i*(C-1)),O=(v.bandwidth-T)/2,k=(e,t)=>v.at(t)+O+(h?0:(x.get(e)??0)*(w+i)),A=(t,n)=>{if(h)return h[t]?.[n]??null;let r=u[t]?.values[n];return Le(r,e.y)?{y0:0,y1:r}:null},j=b.map((e,t)=>{let n=-1,r=-1;for(let e of S){let i=A(e,t);i&&(i.y1>i.y0?n=e:i.y1<i.y0&&(r=e))}return{up:n,down:r}});t.onHitTest($e(_,e,t,(e,t,n)=>{if(f(e)){let e=v.at(t)+v.bandwidth/2;return l?{x:y(n),y:e}:{x:e,y:y(n)}}let r=k(e,t),i=A(e,t),a=y(i?.y1??0),o=y(i?.y0??0),s=Math.min(a,o),c=Math.abs(a-o);return l?{x:a,y:r+w/2,box:{x:s,y:r,width:c,height:w}}:{x:r+w/2,y:a,box:{x:r,y:s,width:w,height:c}}},(e,t,n)=>{let r=l?t:e,a=l?e:t;if(h){let e=k(0,n);return r<e-i/2||r>e+w+i/2?void 0:S.find(e=>{let t=A(e,n);if(!t)return!1;let r=y(t.y0),o=y(t.y1);return a>=Math.min(r,o)-i/2&&a<=Math.max(r,o)+i/2})}let o=Math.floor((r-(v.at(n)+O)+i/2)/(w+i)),s=S[o];return s!==void 0&&A(s,n)?s:void 0}));let M=u.map((e,t)=>x.has(t)&&D(`g`,Qe(e,t),b.map((e,r)=>{let a=A(t,r);if(!a)return null;let o=a.y1<a.y0,s=(o?1:-1)*(l?-1:1),c=a.y0===0?0:s*i,u=!h||(o?j[r]?.down:j[r]?.up)===t,d=l?li:ci;return D(`path`,{key:J(e),class:[`tc-bar`,o&&`tc-bar-negative`,l&&`tc-bar-horizontal`],d:d(k(t,r),w,y(a.y0)+c,y(a.y1),u?n:0)})}))),N=p.length?E(`line`):null,P=y(Math.min(Math.max(0,y.domain[0]),y.domain[1])),F=u.map((n,r)=>{if(!N||!f(r)||t.hidden.has(Y(n)))return null;let i=b.map((t,r)=>{let i=n.values[r];if(!Le(i,e.y))return null;let a=v.at(r)+v.bandwidth/2;return l?[y(i),a]:[a,y(i)]}),a=n.type===`area`&&!l;return D(`g`,Qe(n,r),a&&D(`path`,{class:`tc-area`,d:N.areaPath(i,P,{curve:c})}),D(`path`,{class:`tc-line`,d:N.linePath(i,{curve:c})}))});return[D(`defs`,{key:`defs`},_.clip.def),_.background,D(`g`,{key:`series`,class:`tc-series-list`,"clip-path":_.clip.url},M,F),_.foreground]},legend:e=>Fe(e.data),table:(e,t,n)=>et(e,t,n)},fi=(e,t,n,r,i)=>{let a=`A${i},${i},0,0,1,`;return`M${s(e+i)},${t}H${s(e+n-i)}${a}${s(e+n)},${s(t+i)}V${s(t+r-i)}${a}${s(e+n-i)},${s(t+r)}H${s(e+i)}${a}${e},${s(t+r-i)}V${s(t+i)}${a}${s(e+i)},${t}Z`},pi=(e,t)=>[e.open,e.high,e.low,e.close].every(e=>Le(e,t));function mi(e){let t=t=>e.data.map(n=>pi(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 hi={name:`candlestick`,clean:K(e=>ke(e,e=>({...e,x:De(e.x),open:G(e.open),high:G(e.high),low:G(e.low),close:G(e.close)}))),render(e,t){let{maxCandleWidth:n=16,groupPadding:r=.3,radius:i=1}=e,a=mi(e),o=Xe(a,t,{scale:`band`,zero:!1,paddingInner:r,paddingOuter:r/2}),{x:c,y:l,labels:u}=o,d=Math.max(1,Math.min(n,c.bandwidth)),f=e=>c.at(e)+c.bandwidth/2,p=e=>e.close>=e.open,m=$e(o,a,t,(e,t,n)=>({x:f(t),y:l(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))};t.onHitTest(g);let _=e.data.map((t,n)=>{if(!pi(t,e.y))return null;let r=s(f(n)),a=l(Math.max(t.open,t.close)),o=Math.max(l(Math.min(t.open,t.close)),a+1),c=s(f(n)-d/2),m=s(Math.min(i,d/2,(o-a)/2));return D(`g`,{key:J(u[n]),class:[`tc-candle`,p(t)?`tc-candle-up`:`tc-candle-down`]},D(`path`,{class:`tc-candle-wick`,d:`M${r},${s(l(t.high))}V${s(l(t.low))}`}),D(`path`,{class:`tc-candle-body`,d:fi(c,s(a),s(d),s(o-a),m)}))});return[D(`defs`,{key:`defs`},o.clip.def),o.background,D(`g`,{key:`series`,class:`tc-series-list tc-candles`,"clip-path":o.clip.url},_),o.foreground]},table:(e,t,n)=>et(mi(e),t,n)},$=1e-12,gi=Math.PI,_i=gi/2,vi=2*gi,yi=Math.PI/180,bi=e=>e>=1?_i:e<=-1?-_i:Math.asin(e),xi=e=>e>1?0:e<-1?gi:Math.acos(e);function Si(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 Ci(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 wi(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=bi(m/t*Math.sin(p)),a=bi(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<gi){let e=Si(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(xi(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 Ti(e){let t=(e.innerRadius+e.outerRadius)/2,n=(e.startAngle+e.endAngle)/2-_i;return[Math.cos(n)*t,Math.sin(n)*t]}function Ei(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 Di=(e,t)=>Math.atan2(t,e);function Oi(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%vi+vi)%vi,i<$&&Math.abs(n-t)>$&&(i=vi);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-_i,d=e.endAngle-_i,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>vi-$){let e=l*Math.cos(u),t=l*Math.sin(u);i(e,t),o(l,m,e,t),s(l,u,u+(p?vi:-vi)*(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?-vi:vi)*(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}=wi(e,c,l,u,d,f,p);if(b>$&&C>$){let e=Ci(A,j,w,T,l,C,p),t=Ci(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,Di(e.cx+e.x11,e.cy+e.y11),Di(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=Ci(E,D,O,k,c,-S,p),t=Ci(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,Di(e.cx+e.x11,e.cy+e.y11),Di(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 ki(e,t){let n=D(`path`,{class:e,d:Oi(t)});return n.arc=[t.innerRadius,t.outerRadius,t.startAngle,t.endAngle,t.padAngle??0,t.cornerRadius??0],n}function Ai(e,t,n){let{arc:r,attrs:i}=n;if(!r||t.attrs.d===i.d)return;let a=er(e)??t.arc,o=Number.parseFloat(getComputedStyle(e).transitionDuration)*1e3;if(a&&o>0)return tr(e,a,r,o,([e,t,n,r,i,a])=>Oi({innerRadius:e,outerRadius:t,startAngle:n,endAngle:r,padAngle:i,cornerRadius:a}),String(i.d)),{...i,d:t.attrs.d}}let ji=Math.PI/2;function Mi(e){let{data:t}=e;return typeof t==`number`?[{name:``,value:t}]:Array.isArray(t)?t:[t]}function Ni(e,t){let n=e.max??100;return Mi(e).map((e,t)=>({data:e,index:t,max:e.max??n})).filter(e=>!t.has(q(e.data))).map((e,t)=>({...e,position:t,value:Math.min(e.max,Math.max(0,e.data.value||0))}))}function Pi(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/ji)*ji,n=0;n<5&&e<=o+1e-9;n++)a.push([Math.sin(e),-Math.cos(e)]),e+=ji;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 Fi(e,r){let{width:i,height:a,locale:o}=r,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=n(i,a,{top:u.top+8,right:u.right+8,bottom:u.bottom+8,left:u.left+8}),f=(e.startAngle??0)*yi,p=Math.min(360,Math.max(0,e.angle??360))*yi,m=Ni(e,r.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}=Pi(d,f,p,_?-1.4*r.fontSize:0,_?(v?2:.7)*r.fontSize:0),S=z(e.format,o),C=I(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}),O=e=>{let[t,n]=Ti(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,mark:{d:Oi(E(e,2)),x:b,y:x}}},k={count:m.length,hitIndex:e=>{let t=m[e];return t?O(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?O(r):null}};r.onHitTest(k);let A=m.map(e=>D(`g`,Pe(e.data,e.index),ki(`tc-gauge-track`,{...E(e),endAngle:f+p}),ki(`tc-gauge-arc`,E(e)))),j=_?h?.value??C.format(T(g)):``;return[D(`g`,{class:`tc-gauge`,style:`transform:translate(${b}px,${x}px)`},D(`g`,{class:`tc-gauge-rings`},A)),_&&D(`g`,{class:`tc-gauge-center`,"aria-hidden":`true`},D(`text`,{class:`tc-gauge-value`,x:b,y:x,dy:v?`0`:`0.35em`,"text-anchor":`middle`},j),v&&D(`text`,{class:`tc-gauge-label`,x:b,y:x,dy:`1.6em`,"text-anchor":`middle`},v))]}function Ii(e,t){let n=z(e.format,t.locale),r=I(t.locale,{style:`percent`,maximumFractionDigits:1});return{columns:[``,`Value`,`Share`],rows:Ni(e,t.hidden).map(e=>[e.data.name,n(e.value),r.format(e.max>0?e.value/e.max:0)])}}let Li={name:`gauge`,clean:K(e=>Me(typeof e==`number`?[{name:``,value:e}]:we(e)?[e]:e)),render:(e,t)=>(S.sweep=Ai,Fi(e,t)),legend:e=>Ne(Mi(e)),table:Ii},Ri=`var(--tc-heat-empty,var(--tc-grid-color))`,zi=(e,t=`var(--tc-heat-color,var(--tc-color-1))`)=>`color-mix(in oklab,${t} ${s(e*100)}%,${Ri})`,Bi=(e,t)=>e.name??`range-${t+1}`,Vi=(e,t)=>e.findIndex(e=>(e.from===void 0||t>=e.from)&&(e.to===void 0||t<e.to)),Hi=(e,t)=>e.color??(t<8?`var(--tc-color-${t+1})`:`var(--tc-color-other)`);function Ui(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r/2)),o=s;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`}function Wi(e,r){let{width:i,height:o,fontSize:c,locale:l}=r,{gap:u=2,radius:d=3}=e,f=Ie(e.data),p=e.x?.format??(e=>String(e)),m=z(e.format,l),[h,g]=xe(e.data.series.flatMap(e=>e.values))??[0,1],_=e.min??Math.min(0,h),v=e.max??g,y=t=>{let{mid:n}=e,r;return r=n!==void 0&&e.colors&&_<n&&n<v?t<=n?(t-_)/(n-_)*.5:.5+(t-n)/(v-n)*.5:v>_?(t-_)/(v-_):+(t>_),Math.min(1,Math.max(0,r))},b=e=>.08+.92*y(e),x=e.ranges?.length?e.ranges:void 0,S=!x&&e.colors&&e.colors.length>=2?e.colors:void 0,C=!x&&!S&&e.colorBy===`series`,w=C?e.data.series.filter(e=>!r.hidden.has(Y(e))):e.data.series,T=t=>e.data.series.indexOf(t),E=(e,t)=>{if(x){let t=Vi(x,e),n=x[t];return!n||r.hidden.has(Bi(n,t))?{color:Ri,empty:!0}:{style:{"--tc-cell-fill":n.color},color:n.color}}if(S){let t=y(e)*(S.length-1),n=Math.min(S.length-2,Math.floor(t)),r=s((t-n)*100),i=S[n],a=r<=0?i:r>=100?S[n+1]:`color-mix(in oklab,${S[n+1]} ${r}%,${i})`;return{style:{"--tc-cell-fill":a},color:a}}let n=b(e);return{style:`--tc-heat:${s(n*100)}%`,color:C?zi(n,Hi(t,T(t))):zi(n)}},O=t(e.padding,0),k=e.x?.show!==!1&&f.length>0,A=e.y?.show!==!1&&w.length>0,j=w.map((e,t)=>({value:t,position:0,label:e.name})),M=A?ge(`left`,j,c):0,N=k?ge(`bottom`,[{value:0,position:0,label:`M`}],c):0,P=k?a(p(f[f.length-1],f.length-1),c):0,F=(i-O.left-O.right-M)/Math.max(1,f.length)/2,I=n(i,o,{top:O.top,right:O.right+Math.max(0,Math.ceil(P/2-F)),bottom:O.bottom+N,left:O.left+M}),L=ye(f.map((e,t)=>t),[I.x,I.x+I.width]),R=ye(w.map((e,t)=>t),[I.y,I.y+I.height]),B=Math.max(0,L.bandwidth-u),V=Math.max(0,R.bandwidth-u),H=e=>L.at(e)+u/2,U=e=>R.at(e)+u/2,W=(e,t)=>{let n=w[t]?.values[e];return n!=null&&Number.isFinite(n)?n:null},ee=(e,t=0)=>{if(e<0||e>=f.length||w.length===0)return null;let n=Math.max(0,Math.min(w.length-1,t)),r=w.map((t,n)=>{let r=W(e,n),i=x&&r!==null?x[Vi(x,r)]:void 0;return{name:t.name,seriesIndex:n,value:r,text:r===null?`–`:i?.name?`${m(r)} · ${i.name}`:m(r),x:H(e)+B/2,y:U(n)+V/2,box:{x:H(e),y:U(n),width:B,height:V},color:r===null?`var(--tc-grid-color)`:E(r,t).color}});return{index:e,label:J(f[e]),title:p(f[e],e),x:H(e)+B/2,area:I,items:r,seriesIndex:n,mark:{d:Ui(H(e)-2,U(n)-2,B+4,V+4,d+2),x:0,y:0}}},te={count:f.length,hitIndex:(e,t)=>ee(e,t),hitTest(e,t){if(e<I.x||e>I.x+I.width||t<I.y||t>I.y+I.height)return null;let n=Math.min(f.length-1,Math.floor((e-I.x)/(L.step||1))),r=Math.min(w.length-1,Math.floor((t-I.y)/(R.step||1)));return ee(n,r)}};r.onHitTest(te);let ne=w.map((e,t)=>D(`g`,{key:Y(e),class:[`tc-heatmap-row`,C&&[`tc-series`,`tc-series-${T(e)+1}`]],"data-series":e.name,style:C?{"--tc-series-color":e.color}:void 0},f.map((n,r)=>{let i=W(r,t),a=i===null?void 0:E(i,e);return D(`rect`,{key:J(n),class:[`tc-cell`,(i===null||a?.empty)&&`tc-cell-empty`],x:s(H(r)),y:s(U(t)),width:s(B),height:s(V),rx:s(Math.min(d,B/2,V/2)),style:a?.style})}))),re=k?he(pe(L,(e,t)=>p(f[t],t)),`bottom`,c):[],ie=A?pe(R,(e,t)=>w[t]?.name??``):[];return[D(`g`,{class:`tc-heatmap-cells`},ne),k&&_e({position:`bottom`,ticks:re,area:I}),A&&_e({position:`left`,ticks:ie,area:I})]}function Gi(e){let{ranges:t}=e;if(t?.length){let n=z(e.format,e.locale);return t.map((e,t)=>({key:Bi(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`?Fe(e.data):[]}let Ki={name:`heatmap`,clean:K(je),render:Wi,legend:Gi,valueLabels:{marks:`cell`,format:e=>e.format},table:(e,t,n)=>et({data:e.data,...e.x?{x:e.x}:{},y:{format:e.format}},t,n)},qi=5e3;function Ji(e,t){return e.data.map((e,t)=>({data:e,index:t,seats:Math.min(qi,Math.max(0,Math.round(e.seats||0)))})).filter(e=>!t.has(q(e.data))).map((e,t)=>({...e,position:t}))}function Yi(e,t){let n=Math.min(qi,t.reduce((e,t)=>e+t.seats,0)),r=Math.min(qi,Math.round(e.total??0));return{taken:n,total:Math.max(n,r>0?r:0)}}function Xi(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 Zi(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=Xi(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 Qi(e,r){let{width:i,height:a,locale:o}=r,c=n(i,a,t(e.padding,0)),l=Math.min(360,Math.max(0,e.angle??180))*yi,u=(e.startAngle??-(l/yi)/2)*yi,d=Math.min(.95,Math.max(0,e.innerRadius??.45)),f=Math.min(.9,Math.max(0,e.gap??.35)),p=Ji(e,r.hidden),{taken:m,total:h}=Yi(e,p),g=Zi(h,e.rows,u,l,d,f),_=e.center,v=_!==!1,y=v?_?.label:void 0,b=l<=Math.PI+1e-9&&Math.abs(u+l/2)<1e-9,x=r.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(c.width,c.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(c.width/(T.x1-T.x0),c.height/(T.y1-T.y0));if(Math.abs(e-1)<.001)break;w=Math.max(0,w*e)}let E=c.x+(c.width-(T.x1-T.x0))/2-T.x0,O=c.y+(c.height-(T.y1-T.y0))/2-T.y0,k=s(g.dot*w),A=e=>[E+e.x*w,O+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=z(e.format,o),L=I(o,{style:`percent`,maximumFractionDigits:1}),R=(e,t)=>{let n=M[e.position],r=0,i=0;if(t)[r,i]=A(t);else for(let e of n){let[t,a]=A(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)} (${L.format(h>0?e.seats/h:0)})`,x:r,y:i};e.data.color&&(a.color=e.data.color);let o=k+3,c=n.map(e=>{let[t,n]=A(e);return`M${s(t+o)},${s(n)}A${o},${o},0,1,1,${s(t-o)},${s(n)}A${o},${o},0,1,1,${s(t+o)},${s(n)}Z`}).join(``);return{index:P.indexOf(e),label:e.data.name,title:``,x:r,area:{x:E-w,y:O-w,width:w*2,height:w*2},items:[a],seriesIndex:e.index,mark:{d:c,x:0,y:0}}},B={count:P.length,hitIndex:e=>{let t=P[e];return t?R(t):null},hitTest(e,t){let n=k+2,r;for(let i of P)for(let a of M[i.position]){let[o,s]=A(a),c=Math.hypot(e-o,t-s);c<=n&&(!r||c<r.d)&&(r={party:i,seat:a,d:c})}return r?R(r.party,r.seat):null}};r.onHitTest(B);let V=(e,t,n)=>{let[r,i]=A(e);return D(`circle`,{key:t,class:n,r:k,style:`transform:translate(${s(r-E)}px,${s(i-O)}px)`})},H=p.map(e=>D(`g`,Pe(e.data,e.index),M[e.position].map((e,t)=>V(e,t,`tc-seat`)))),U=v?_?.value??F(h):``;return[D(`g`,{class:`tc-parliament`,style:`transform:translate(${s(E)}px,${s(O)}px)`},D(`g`,{class:`tc-parliament-seats`},H,N.length>0&&D(`g`,{key:`vacant`,class:`tc-parliament-vacant`},N.map((e,t)=>V(e,t,`tc-seat tc-seat-vacant`))))),v&&D(`g`,{class:`tc-parliament-center`,"aria-hidden":`true`},y&&D(`text`,{class:`tc-parliament-label`,x:s(E),y:s(O),dy:b?`-2.5em`:`1.6em`,"text-anchor":`middle`},y),D(`text`,{class:`tc-parliament-value`,x:s(E),y:s(O),dy:b?`-0.4em`:y?`0`:`0.35em`,"text-anchor":`middle`},U))]}function $i(e,t){let n=Ji(e,t.hidden),{total:r}=Yi(e,n),i=z(e.format,t.locale),a=I(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 ea={name:`parliament`,clean:K(e=>ke(e,e=>({...Ae(e),seats:G(e.seats)??0}))),render:Qi,legend:e=>Ne(e.data),table:$i};function ta(e,t){let n=e.data.map((e,t)=>({data:e,index:t,value:Math.max(0,e.value||0)})).filter(e=>!t.has(q(e.data))),r=n.reduce((e,t)=>e+t.value,0),i=(e.startAngle??0)*yi;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 na(e,r,i){let{width:a,height:o,locale:s}=r,c=e.gap??2,l=n(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}=ta(e,r.hidden),_=h.filter(e=>e.value>0),v=d===0&&_.length>1?c:0,y=d>0&&_.length>1?Ei(c,d,u):0,b=z(e.format,s),x=I(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]=Ti(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,mark:{d:Oi({...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)*yi,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)}};r.onHitTest(w);let T=h.map(e=>D(`g`,Pe(e.data,e.index),ki(`tc-slice`,S(e)))),E=e.center,O=d>0&&E!==!1,k=O?E?.value??b(g):``,A=O?E?.label:void 0;return[D(`g`,{class:`tc-pie`,style:`transform:translate(${p}px,${m}px)`},g===0&&D(`path`,{class:`tc-pie-track`,d:Oi({innerRadius:d,outerRadius:u,startAngle:0,endAngle:Math.PI*2})}),D(`g`,{class:`tc-pie-slices`,style:v>0?`--tc-pie-gap:${v}px`:void 0},T)),O&&D(`g`,{class:`tc-pie-center`,"aria-hidden":`true`},D(`text`,{class:`tc-pie-value`,x:p,y:m,dy:A?`0`:`0.35em`,"text-anchor":`middle`},k),A&&D(`text`,{class:`tc-pie-label`,x:p,y:m,dy:`1.6em`,"text-anchor":`middle`},A))]}function ra(e,t){let{slices:n,total:r}=ta(e,t.hidden),i=z(e.format,t.locale),a=I(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 ia(e,t){return{name:e,clean:K(Me),render:(e,n)=>(S.sweep=Ai,na(e,n,t)),legend:e=>Ne(e.data),table:ra,valueLabels:{marks:`slice`}}}let aa=ia(`pie`,{inner:0,corner:0}),oa=ia(`donut`,{inner:.62,corner:4});function sa(e,t,n){if(a(e,n)<=t)return e;let r=e.length;for(;r>0&&a(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}function ca(e,t,n){let r=[],i=``;for(let o of e.split(` `)){let e=i?`${i} ${o}`:o;!i||a(e,n)<=t?i=e:(r.push(i),i=o)}return r.push(i),r.length>3&&r.splice(2,r.length,r.slice(2).join(` `)),r}let la=e=>e>.1?1:e<-.1?-1:0;function ua(e,t,n,r){let i=Math.min(e.width,e.height)/2;return t.forEach((t,o)=>{let s=Math.sin(t),c=Math.cos(t),l=n[o]??[],u=Math.max(0,...l.map(e=>a(e,r))),d=da(l.length,r),f=la(s),p=f===0?u/2:u+8;if(Math.abs(s)>1e-6&&(i=Math.min(i,(e.width/2-p)/Math.abs(s))),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 da=(e,t)=>t*(1+Math.max(0,e-1)*c);function fa(e,r){let{width:i,height:a,fontSize:o,locale:l}=r,u=e.r??{},{fill:d=!0,points:f=!1,pointRadius:p=4}=e,m=e.data.series,h=Ie(e.data),g=h.length,_=m.filter(e=>!r.hidden.has(Y(e))),v=e.format??(e=>String(e)),y=W(u.format,l),b=t(e.padding),x=n(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,O=T.map(e=>ca(e,E,o)),k=Math.max(ua(x,w,O,o),Math.min(x.width,x.height)/2*.5),A=O.map((e,t)=>{let n=Math.sin(w[t]),r=la(n)===0?x.width:x.width/2-k*Math.abs(n)-8;return e.map(e=>sa(e,r,o))}),j=We(u,Math.max(2,Math.round(k/40))),M=Se(Ke(_.flatMap(e=>e.values),u,!0,j),[0,k],{clamp:!0}),N=fe(M,{count:j,format:u.format,locale:l}),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(s).join(`,`)}`).join(``)}Z`,I=t=>e.grid===`circle`?`M${s(S)},${s(C-t)}A${s(t)},${s(t)},0,1,1,${s(S)},${s(C+t)}A${s(t)},${s(t)},0,1,1,${s(S)},${s(C-t)}Z`:F(h.map(()=>t)),L=e=>e!=null&&Number.isFinite(e)?M(e):0,R=e=>{let t=[];m.forEach((n,i)=>{if(r.hidden.has(Y(n)))return;let a=n.values[e],o=a!=null&&Number.isFinite(a)?a:null,[s,c]=P(e,L(o)),l={name:n.name,seriesIndex:i,value:o,text:o===null?`–`:y(o),x:s,y:o===null?null:c};n.color&&(l.color=n.color),t.push(l)});let[n,i]=P(e,k);return{index:e,label:J(h[e]),title:T[e],x:n,area:{x:S-k,y:C-k,width:k*2,height:k*2},items:t,guide:{x1:S,y1:C,x2:n,y2:i}}},z={count:g,hitTest(e,t){if(g===0||Math.hypot(e-S,t-C)>k+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}};r.onHitTest(z);let B=D(`g`,{key:`grid`,class:`tc-radar-grid`,"aria-hidden":`true`},N.filter(e=>e.position>0).map(e=>D(`path`,{key:e.value,class:`tc-radar-ring`,d:I(e.position)})),h.map((e,t)=>{let[n,r]=P(t,k);return D(`line`,{key:J(e),class:`tc-radar-spoke`,x1:s(S),y1:s(C),x2:s(n),y2:s(r)})})),V=m.map((e,t)=>{if(r.hidden.has(Y(e)))return null;let n=F(h.map((t,n)=>L(e.values[n])));return D(`g`,Qe(e,t),d&&D(`path`,{class:`tc-area`,d:n}),D(`path`,{class:`tc-line`,d:n}),f&&D(`g`,{class:`tc-points`},h.map((t,n)=>{let r=e.values[n];if(r==null||!Number.isFinite(r))return null;let[i,a]=P(n,M(r));return D(`circle`,{key:J(t),class:`tc-point`,cx:s(i),cy:s(a),r:p})})))}),H=D(`g`,{key:`labels`,class:`tc-radar-labels`,"aria-hidden":`true`},h.map((e,t)=>{let n=w[t],r=la(Math.sin(n)),i=Math.cos(n),[a,o]=P(t,k+8),[l=``,...u]=A[t]??[],d=u.length*c,f=r===0?i>0?`${s(-d)}em`:`0.71em`:`${s(.35-d/2)}em`;return D(`text`,{key:J(e),class:`tc-tick-label tc-radar-label`,x:s(a),y:s(o),"text-anchor":r>0?`start`:r<0?`end`:`middle`,dy:f},l,u.map((e,t)=>D(`tspan`,{key:t,x:s(a),dy:`${c}em`},e)))})),U=u.show!==!1&&D(`g`,{key:`values`,class:`tc-radar-values`,"aria-hidden":`true`},N.filter(e=>e.position>0).map(e=>D(`text`,{key:e.value,class:`tc-tick-label tc-radar-value`,x:s(S+4),y:s(C-e.position),dy:`0.35em`},e.label)));return[B,D(`g`,{key:`series`,class:`tc-series-list tc-radar-series`,style:`transform-origin:${s(S)}px ${s(C)}px`},V),H,U]}let pa={name:`radar`,clean:K(je),render:fa,legend:e=>Fe(e.data),table:(e,t,n)=>et({data:e.data,...e.r?.format?{y:{format:e.r.format}}:{},...e.format?{x:{format:e.format}}:{}},t,n)};function ma(e,t,n){if(a(e,n)<=t)return e;let r=e.length;for(;r>0&&a(`${e.slice(0,r)}…`,n)>t;)r--;return r>0?`${e.slice(0,r).trimEnd()}…`:``}let ha=e=>e.data.color??`var(--tc-color-${e.slot})`;function ga(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(_a(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 _a=(e,t)=>(e.nodes??[]).find(e=>e.color===t)?.name??t;function va(e,r){let{width:i,height:o,fontSize:s,locale:c}=r,l=Math.max(1,e.nodeWidth??12),u=Math.max(0,e.nodePadding??16),d=n(i,o,t(e.padding)),{nodes:f,links:p,columns:m}=ga(e.data,r.hidden,e.align!==`left`),h=W(e.format,c),g=f.map(e=>[e.data.name,h(e.value)]),_=e=>f.reduce((t,n,r)=>{if(!e(n))return t;let[i,o]=g[r];return Math.max(t,a(i,s),a(o,s))},0),v=d.width*.3,y=m>1?Math.min(v,_(e=>e.column===0)):0,b=Math.min(v,_(e=>e.column===m-1)),x={x:d.x+(y?y+8:0),y:d.y,width:Math.max(0,d.width-(y?y+8:0)-(b?b+8:0)),height:d.height},S=m>1?(x.width-l)/(m-1):0,C=Array.from({length:m},()=>[]);for(let e of f)C[e.column]?.push(e);let w=C.reduce((e,t)=>t.length>1?Math.min(e,x.height/2/(t.length-1)):e,u),T=1/0;for(let e of C){let t=e.reduce((e,t)=>e+t.value,0);t>0&&(T=Math.min(T,(x.height-(e.length-1)*w)/t))}(!Number.isFinite(T)||T<0)&&(T=0),C.forEach((e,t)=>{let n=e.reduce((e,t)=>e+t.value*T,0)+(e.length-1)*w,r=x.y+(x.height-n)/2;for(let n of e)n.x=x.x+(m>1?t*S:(x.width-l)/2),n.y=r,n.height=n.value*T,r+=n.height+w});for(let e of f){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*T,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*T}return{nodes:f,links:p,plot:x,nodeWidth:l,labels:f.map((e,t)=>{let[n,r]=g[t],i=e.column===0&&m>1?`left`:`right`,a=i===`left`?y:e.column===m-1?b:S-l-16,o=C[e.column],c=o.indexOf(e),u=[o[c-1],o[c+1]].filter(e=>!!e).reduce((t,n)=>Math.min(t,(e.height+n.height)/2+w),1/0)>=s*2.25;return{side:i,name:ma(n,a,s),value:u?ma(r,a,s):``}})}}function ya(e,t){let n=e.source.x+t,r=e.target.x,i=(n+r)/2,{sy:a,ty:o,width:c}=e,l=(...e)=>e.map(s).join(`,`);return`M${l(n,a)}C${l(i,a,i,o,r,o)}L${l(r,o+c)}C${l(i,o+c,i,a+c,n,a+c)}Z`}let ba=(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 xa(e,t,n,r){let i=e.source.x+t,a=e.target.x;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;ba(i,o,o,a,e)<n==a>i?s=e:c=e}let l=ba(e.sy,e.sy,e.ty,e.ty,(s+c)/2);return r>=l&&r<=l+e.width}function Sa(e,t){let{nodes:n,links:r,plot:i,nodeWidth:a,labels:o}=va(e,t),c=r.filter(e=>e.data.value>0),l=W(e.format,t.locale),u=e=>({d:`M0,0h${s(a)}v${s(e.height)}h${s(-a)}Z`,x:e.x,y:e.y}),d=e=>({name:`${e.source.data.name} → ${e.target.data.name}`,seriesIndex:e.index,color:ha(e.source),value:e.data.value,text:l(e.data.value),x:(e.source.x+a+e.target.x)/2,y:ba(e.sy,e.sy,e.ty,e.ty,.5)+e.width/2}),f=(e,t)=>{let n={name:e.data.name,seriesIndex:r.length+e.index,color:ha(e),value:e.value,text:l(e.value),x:e.x+a/2,y:e.y+e.height/2},o=[...e.ins,...e.outs].map(d),s=o.find(e=>e.seriesIndex===t),f=s&&c.find(e=>e.index===t);return{index:e.index,label:e.data.name,title:``,x:n.x,area:i,items:[n,...o],seriesIndex:s?t:n.seriesIndex,mark:f?{d:ya(f,a),x:0,y:0}:u(e)}},p=e=>{let t=d(e);return{index:e.source.index,label:e.source.data.name,title:``,x:t.x,area:i,items:[t],seriesIndex:e.index,mark:{d:ya(e,a),x:0,y:0}}},m={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 f(r);let i=c.find(n=>xa(n,a,e,t));return i?p(i):null},hitIndex(e,t){let r=n[e];return r?f(r,t):null}};return t.onHitTest(m),[D(`g`,{key:`links`,class:`tc-sankey-links`},c.map(e=>D(`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:ya(e,a)}))),D(`g`,{key:`nodes`,class:`tc-sankey-nodes`},n.map(e=>D(`g`,{key:e.data.name,class:[`tc-series`,`tc-series-${e.slot}`],"data-series":e.data.name,style:{"--tc-series-color":e.data.color}},D(`rect`,{class:`tc-sankey-node`,x:s(e.x),y:s(e.y),width:s(a),height:s(e.height)})))),D(`g`,{key:`labels`,class:`tc-sankey-labels`,"aria-hidden":`true`},n.map((e,t)=>{let n=o[t];if(!n.name&&!n.value)return null;let r=s(n.side===`left`?e.x-8:e.x+a+8),i=s(e.y+e.height/2),c=n.side===`left`?`end`:`start`;return D(`g`,{key:e.data.name,class:`tc-sankey-label`},D(`text`,{class:`tc-value-label tc-sankey-name`,x:r,y:i,dy:n.value?`-0.25em`:`0.35em`,"text-anchor":c},n.name),n.value&&D(`text`,{class:`tc-tick-label tc-sankey-value`,x:r,y:i,dy:`0.95em`,"text-anchor":c},n.value))}))]}function Ca(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 wa(e,t){let{links:n}=ga(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 Ta={name:`sankey`,clean:K(e=>{let t=we(e)?e:{};return{...t,nodes:Array.isArray(t.nodes)?ke(t.nodes,e=>Ae(e)):void 0,links:ke(t.links,e=>({from:Ee(e.from),to:Ee(e.to),value:Math.max(0,G(e.value)??0)}))}}),render:Sa,legend:Ca,table:wa},Ea=e=>`M${e},0A${e},${e},0,1,1,${-e},0A${e},${e},0,1,1,${e},0Z`,Da=e=>e.size!=null&&Number.isFinite(e.size)&&e.size>0?e.size:void 0;function Oa(e,r){let{width:i,height:o,fontSize:l,locale:u}=r,d=e.x??{},f=e.y??{},p=e.radius??4,m=e.data.series.filter(e=>!r.hidden.has(q(e))).flatMap(e=>e.points),h=m.map(Da).filter(e=>e!==void 0),g=xe(h)?.[1]??0,_=e.size?.min??4,v=e.size?.max??24,y=e=>e!=null&&e>0&&g>0?_+(v-_)*Math.sqrt(e/g):p,b=Math.max(p,h.length?v:0)+2,x=We(f,Math.max(2,Math.round(o/60))),S=We(d,Math.max(2,Math.round(i/80))),C=e=>Le(e.x,d)&&Le(e.y,f),w=m.filter(C),T=Ke(w.map(e=>e.x),d,!1,S),E=Ke(w.map(e=>e.y),f,!1,x),O=d.show!==!1,k=f.show!==!1,A=(e,t,n)=>He(e,t,n,t.format,u),j=A(Ve(E,[1,0],f),f,x),M=A(Ve(T,[0,1],d),d,S),N=e=>O&&e?Math.ceil(a(e.label,l)/2):0,P=t(e.padding),F=n(i,o,{top:P.top+Math.max(k?Math.ceil(l*c/2):0,b,4),right:P.right+Math.max(N(M[M.length-1]),b,8),bottom:P.bottom+Math.max(O?ge(`bottom`,M,l):0,b,4),left:P.left+Math.max(k?ge(`left`,j,l):0,N(M[0]),b)}),I=Ve(T,[F.x,F.x+F.width],d),L=Ve(E,[F.y+F.height,F.y],f),R=he(A(I,d,S),`bottom`,l),B=he(A(L,f,x),`left`,l,4),V=[];e.data.series.forEach((e,t)=>{r.hidden.has(q(e))||e.points.forEach((e,n)=>{C(e)&&V.push({seriesIndex:t,pointIndex:n,point:e,cx:I(e.x),cy:L(e.y),r:y(Da(e))})})}),V.sort((e,t)=>e.cx-t.cx);let H=W(d.format,u),U=W(f.format,u),ee=z(void 0,u),te=(t,n)=>{let r=e.data.series[t.seriesIndex],i=Da(t.point),a=i===void 0?``:` · ${ee(i)}`,o={name:r.name,seriesIndex:t.seriesIndex,value:t.point.y,text:`${H(t.point.x)}, ${U(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,mark:{d:Ea(s(t.r+4)),x:t.cx,y:t.cy}}},ne={count:V.length,hitIndex:e=>{let t=V[e];return t?te(t,e):null},hitTest(e,t){let n=0,r=V.length,i=24+v;for(;n<r;){let t=n+r>>1;V[t].cx<e-i?n=t+1:r=t}let a=-1,o=1/0;for(let r=n;r<V.length;r++){let n=V[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:te(V[a],a)}};r.onHitTest(ne);let re=Ue(e),ie=(e,t)=>{if(!e.length)return null;let n=s(p),r=``;for(let i of e)r+=re?re(t,I(i.x),L(i.y),n):`M${s(I(i.x)-p)},${s(L(i.y))}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,${-2*n},0`;return D(`path`,{key:`dots`,class:[`tc-point tc-dots`,re&&`tc-marker`],d:r})},ae=[];f.grid!==!1&&ae.push(ve({direction:`y`,ticks:B,area:F})),d.grid&&ae.push(ve({direction:`x`,ticks:R,area:F}));let oe=Ze(r,F,h.length?0:b),se=e.data.series.map((e,t)=>!r.hidden.has(q(e))&&D(`g`,Pe(e,t),ie(e.points.filter(e=>C(e)&&Da(e)===void 0),t),e.points.map((e,t)=>C(e)&&Da(e)!==void 0&&D(`circle`,{key:t,class:`tc-point tc-bubble`,cx:s(I(e.x)),cy:s(L(e.y)),r:s(y(Da(e)))}))));return[D(`defs`,null,oe.def),ae,D(`g`,{key:`series`,class:`tc-series-list`,"clip-path":oe.url},se),k&&_e({position:`left`,ticks:B,area:F}),O&&_e({position:`bottom`,ticks:R,area:F})]}function ka(e,t,n=1/0){let r=W(e.x?.format,t.locale),i=W(e.y?.format,t.locale),a=z(void 0,t.locale),o=e.data.series.filter(e=>!t.hidden.has(q(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?[Da(t)===void 0?`–`:a(Da(t))]:[]])})}}let Aa={name:`scatter`,clean:K(e=>({...we(e)?e:{},series:ke(we(e)&&e.series,e=>({...Ae(e),points:ke(e.points,e=>({...e,x:G(e.x),y:G(e.y),size:G(e.size)??void 0,label:e.label==null?void 0:Ee(e.label)})).filter(e=>e.x!==null&&e.y!==null)}))})),render:Oa,legend:e=>Ne(e.data.series),table:ka,valueLabels:{format:e=>e.y?.format}};function ja(e,r){let{variant:i=`line`,curve:a=`monotone`,point:o=`last`,markers:c=`none`,pointRadius:l=3,name:u=`Value`}=e,d=e.data.map(e=>e==null||!Number.isFinite(e)?null:e),f=d.length,p=o===`last`||c===`minmax`?l+2:2,m=t(e.padding,0),h=n(r.width,r.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]:Ke(d,{nice:!1},_,2),y=i===`bar`||g,b=f>0?h.width/f:0,x=e=>y?h.x+b*e+b/2:h.x+(f>1?h.width*e/(f-1):h.width/2),S=Se(v,[h.y+h.height,h.y]),C=S(Math.min(Math.max(0,v[0]),v[1])),w=d.map((e,t)=>e===null?null:[x(t),S(e)]),T=z(e.format,r.locale),E=t=>{let n=e.labels?.[t];return n===void 0?``:String(n)},O=e=>S(g?Math.sign(e):e),k=t=>{let n=d[t];if(n===void 0)return null;let r=x(t),i={name:u,seriesIndex:0,value:n,text:n===null?`–`:T(n),x:r,y:n===null?null:O(n)},a={index:t,label:J(e.labels?.[t]??t+1),title:E(t),x:r,area:h,items:[i]};return n!==null&&(a.mark={d:Ea(l+3),x:r,y:O(n)}),a},A={count:f,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(Math.max(0,Math.min(f-1,n)))}};r.onHitTest(A);let j=[];if(g){let e=Math.max(1,b-1);j.push(D(`line`,{class:`tc-sparkline-zero`,x1:h.x,x2:h.x+h.width,y1:s(C),y2:s(C)})),d.forEach((t,n)=>{if(t===null)return;let r=Math.sign(t),i=Math.min(2,h.height/2),[a,o]=r===0?[C+i/2,C-i/2]:[C,S(r)];j.push(D(`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:ci(x(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&&j.push(D(`path`,{key:n,class:[`tc-bar`,t<0&&`tc-bar-negative`],d:ci(x(n)-e/2,e,C,S(t),Math.min(2,e/2))}))})}else i===`area`&&j.push(D(`path`,{class:`tc-area tc-area-gradient`,d:vr(w,C,{curve:a}),mask:`url(#${r.id}-fade)`})),j.push(D(`path`,{class:`tc-line`,d:_r(w,{curve:a})}));let M=(e,t)=>{let n=d[e];return n==null?null:D(`circle`,{key:`${t}-${e}`,class:[`tc-point`,t],cx:s(x(e)),cy:s(S(n)),r:l})},N=[];if(c===`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&&N.push(M(e,`tc-point-min`)),t!==-1&&t!==e&&N.push(M(t,`tc-point-max`))}let P=-1;if(o===`last`){for(let e=f-1;e>=0;e--)if(d[e]!==null){P=e;break}}return[i===`area`&&D(`defs`,null,ti(`${r.id}-fade`)),D(`g`,{class:`tc-series tc-series-1 tc-sparkline`},j,N,P!==-1&&!y&&M(P,`tc-point-last`))]}let Ma={name:`sparkline`,clean:e=>({...K(Oe)(e),labels:Array.isArray(e.labels)?e.labels.map(De):void 0}),render:ja,keyboard:!1},Na={line:oi,area:si,bar:di,pie:aa,donut:oa,scatter:Aa,sparkline:Ma,gauge:Li,heatmap:Ki,candlestick:hi,radar:pa,sankey:Ta,parliament:ea};C({time:{scale:Hn,points:Un,axis:Wn},dates:st,log:{scale:ct,domain:lt,ticks:ut},decimate:ar,line:{linePath:_r,areaPath:vr},annotations:{layers:ot,values:at},patterns:En,"point-shapes":On,hydrate:Qn,morph:ir}),T(An),T(Yn);let Pa=`[data-tc-chart]`,Fa=/* @__PURE__ */ new Set([`chart`,`src`,`data`,`options`]),Ia=/* @__PURE__ */ new Set([`title`,`description`,`locale`,`sync`,`id`,`class`]),La=/* @__PURE__ */ new WeakMap,Ra=/* @__PURE__ */ new WeakSet;function za(e){return La.get(e)}function Ba(e){La.get(e)?.destroy(),La.delete(e)}function Va(e){return e===`true`||e===``?!0:e===`false`?!1:e!==``&&Number.isFinite(Number(e))?Number(e):/^\s*[[{]/.test(e)?Ha(e,`a data-tc-* attribute`):e}function Ha(e,t){try{return JSON.parse(e)}catch(e){throw SyntaxError(`@tabler/charts-bootstrap: invalid JSON in ${t}: ${e.message}`)}}function Ua(e){let t={},n=e.dataset.tcOptions;n&&Object.assign(t,Ha(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);Fa.has(e)||(t[e]=e===`legend`&&r===`bottom`?{position:`bottom`}:e===`tooltip`&&r===`light`?{theme:`light`}:e===`download`&&/^[a-z]/i.test(r)&&!/^(true|false)$/.test(r)?r.split(/[\s,]+/).filter(Boolean):Ia.has(e)?r:Va(r))}return t}function Wa(e){let t=e.dataset.tcData;if(t)return Ha(t,`data-tc-data`);let n=e.querySelector(`:scope > script[type="application/json"]`)?.textContent?.trim();return n?Ha(n,`the inline <script type="application/json">`):void 0}function Ga(e,t,n){e.dispatchEvent(new CustomEvent(`tc-${t}`,{detail:n,bubbles:!0}))}function Ka(e,t,n){let r=new ei(e,{...Ua(e),type:t,data:n});for(let t of vn)r.on(t,n=>Ga(e,t,n));return La.set(e,r),Ga(e,`render`,{size:r.size}),r}function qa(e,t){let n=La.get(e);if(n||Ra.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?(Ra.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?Ka(e,i,t):void 0,t=>{Ga(e,`error`,{error:t,src:a}),console.error(`@tabler/charts-bootstrap: could not load ${a}:`,t)}).finally(()=>{Ra.delete(e),e.removeAttribute(`aria-busy`)})):Ka(e,i,Wa(e)??[])}function Ja(e=document,t={}){let n={...Na,...t.types},r=[...e.querySelectorAll(Pa)];e instanceof Element&&e.matches(Pa)&&r.unshift(e);let i=r.map(e=>{try{return qa(e,n)}catch(t){Ga(e,`error`,{error:t}),console.error(t);return}});return Promise.all(i).then(e=>e.filter(e=>e!==void 0))}function Ya(e=document.body,t={}){Ja(e,t);let n=new MutationObserver(e=>{for(let n of e){let e=n.target.closest?.(Pa);if(!(e&&La.has(e))){for(let e of n.removedNodes)if(e instanceof Element){La.has(e)&&Ba(e);for(let t of e.querySelectorAll(Pa))Ba(t)}for(let e of n.addedNodes)e instanceof Element&&!e.isConnected||e instanceof Element&&Ja(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;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-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-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{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);width:10px;height:10px}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-2 :is(.tc-legend-swatch,.tc-tooltip-swatch){border-radius:1px;scale:.8}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-3 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 3.6%,92.9% 82.1%,7.1% 82.1%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-4 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 3.6%,96.4% 50%,50% 96.4%,3.6% 50%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-5 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(7.1% 17.9%,92.9% 17.9%,50% 96.4%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-6 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(35.7% 7.1%,64.3% 7.1%,64.3% 35.7%,92.9% 35.7%,92.9% 64.3%,64.3% 64.3%,64.3% 92.9%,35.7% 92.9%,35.7% 64.3%,7.1% 64.3%,7.1% 35.7%,35.7% 35.7%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-7 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(25% 7.1%,50% 32.1%,75% 7.1%,92.9% 25%,67.9% 50%,92.9% 75%,75% 92.9%,50% 67.9%,25% 92.9%,7.1% 75%,32.1% 50%,7.1% 25%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-8 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 0%,61.4% 34.3%,97.5% 34.6%,68.6% 56.1%,79.3% 90.4%,50% 69.6%,20.7% 90.4%,31.4% 56.1%,2.5% 34.6%,38.6% 34.3%);border-radius:0}.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 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-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-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-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{transform-origin:100%}.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{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}.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-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{fill:canvastext;stroke:canvas}.tc-tick-label{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-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?Ya(document.body):void Ja(document);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,n):n()}return e.Chart=ei,e.LINE_HEIGHT=c,e.VERSION=`0.1.0`,e.arcCentroid=Ti,e.arcPathStable=Oi,e.area=si,e.areaPath=vr,e.axis=_e,e.axisSize=ge,e.band=ye,e.bandTicks=pe,e.bar=di,e.barPath=ci,e.buildChart=gn,e.cancel=tn,e.candlestick=hi,e.categoryInteraction=$e,e.chartEvents=vn,e.chartLabel=fn,e.chartToString=_n,e.dataTable=Gr,e.defaultHidden=mt,e.defaultPlugins=$r,e.describeHit=jr,e.dispose=Ba,e.domainOf=Ke,e.donut=oa,e.download=Sr,e.downloadChart=x,e.escapeAttr=Ut,e.escapeText=Ht,e.estimateTextWidth=a,e.exportImage=b,e.exportSVG=y,e.extent=xe,e.feature=E,e.features=S,e.flush=nn,e.formatDate=re,e.formatDetail=W,e.formatNumber=z,e.formatTicks=ne,e.gauge=Li,e.getChart=za,e.getDateFormat=L,e.getNumberFormat=I,e.grid=ve,e.h=D,e.hbarPath=li,e.heatmap=Ki,e.highlight=kr,e.hitAnchor=Kr,e.hoverOverlay=Tr,e.hoverUnderlay=wr,e.init=Ja,e.innerRect=n,e.insets=t,e.keyboard=Nr,e.legend=Pr,e.legendContent=pt,e.line=oi,e.linePath=_r,e.linear=Se,e.linearTicks=fe,e.log=ct,e.lttb=sr,e.lttbIndices=ar,e.niceDomain=de,e.normalizeClass=O,e.normalizeStyle=A,e.observe=Ya,e.padAngleForGap=Ei,e.parliament=ea,e.pie=aa,e.placeTooltip=Jr,e.point=be,e.pointer=Or,e.radar=pa,e.register=C,e.render=Z,e.renderContext=cn,e.renderToString=Pt,e.resolveLegend=dn,e.resolveSize=on,e.sankey=Ta,e.scatter=Aa,e.schedule=$t,e.seriesKey=Y,e.seriesLegend=Fe,e.seriesTable=et,e.sparkline=Ma,e.stepPrecision=ee,e.sync=zr,e.tableContent=Ar,e.thinTicks=he,e.tickIncrement=le,e.tickStep=ue,e.ticks=ce,e.time=Hn,e.timePointScale=Un,e.tooltip=Qr,e.tooltipContent=qr,e.types=Na,e})({});
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})({});
3
3
  //# sourceMappingURL=tabler-charts-bootstrap.min.js.map