@blueprint-chart/lib 1.6.0 → 1.7.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.
- package/dist/embed.js +2 -8
- package/dist/index.js +778 -1624
- package/dist/lib/lib.iife.js +18 -31
- package/dist/node-backend/browser.js +6 -6
- package/dist/node-backend/errors-DTQcjINA.js +8 -0
- package/dist/node-backend/index.js +7137 -5342
- package/dist/render-bpc-Bp2OTJmu.js +8028 -0
- package/dist/runtime-BnrDRLyH.js +84 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +48 -51
- package/package.json +12 -12
- package/dist/embed-D0WZKRQq.js +0 -325
- package/dist/node-backend/errors-poq5BHAK.js +0 -8
- package/dist/render-bpc-CwYPC-oi.js +0 -6279
package/dist/lib/lib.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var BlueprintChart=(function(
|
|
1
|
+
var BlueprintChart=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=`
|
|
2
2
|
/* Blueprint Chart — Runtime Embed Styles
|
|
3
3
|
CSS custom properties with baked-in defaults for standalone iframe usage. */
|
|
4
4
|
|
|
@@ -223,31 +223,19 @@ body {
|
|
|
223
223
|
|
|
224
224
|
color: rgba(255, 255, 255, 0.9);
|
|
225
225
|
}
|
|
226
|
-
`,
|
|
227
|
-
`)}function
|
|
226
|
+
`,d=`blueprint-chart-resize`,f=`blueprint-chart-error`;function p(e){return typeof e==`object`&&e&&e.type===`blueprint-chart-resize`&&typeof e.height==`number`?e.height:null}function m(e){return typeof e==`object`&&!!e&&e.type===`blueprint-chart-error`}var h=g();function g(){try{if(typeof globalThis<`u`){let e=globalThis.BLUEPRINT_CHART_RUNTIME_URL;if(typeof e==`string`&&e)return e}return typeof document>`u`?``:document.currentScript?.src??``}catch{return``}}var _=new Map,v=null;function y(){v||(v=e=>{for(let[t,n]of _)if(e.source===t.contentWindow){n(e);return}},window.addEventListener(`message`,v))}function b(){y(),document.querySelectorAll(`script[type="application/blueprint-chart"]`).forEach(x)}function x(e){let t=e.textContent?.trim();if(!t)return;let n=document.createElement(`iframe`);n.className=`blueprint-chart-iframe`,n.style.cssText=`border: none; width: 100%; display: block;`,n.setAttribute(`sandbox`,`allow-scripts`),n.setAttribute(`title`,`Blueprint Chart`),e.parentNode?.insertBefore(n,e),n.srcdoc=S(t,h),_.set(n,e=>{let t=p(e.data);if(t!==null){n.style.height=`${t}px`;return}m(e.data)&&console.warn(`Blueprint Chart: could not render embed.`,e.data.message)})}function S(e,t,n){let r=t?`<script src="${w(t)}"><\/script>`:``,i=n===`dark`?`<html data-bs-theme="dark">`:`<html>`,a=t?[`try {`,` window.BlueprintChart.renderBpc(document.getElementById("chart"), __BPC_SRC__);`,`}`,`catch (e) {`,` parent.postMessage({ type: "${f}", message: String(e) }, "*");`,`}`]:[`parent.postMessage({ type: "${f}", message: "Blueprint Chart runtime URL unavailable" }, "*");`];return[`<!DOCTYPE html>`,`${i}<head>`,`<style>${u}</style>`,`</head><body>`,`<div id="chart" class="blueprint-chart-container"></div>`,r,`<script>`,`var __BPC_SRC__ = ${C(e)};`,`function notifySize() {`,` var h = document.documentElement.scrollHeight;`,` parent.postMessage({ type: "${d}", height: h }, "*");`,`}`,...a,`notifySize();`,`new ResizeObserver(notifySize).observe(document.body);`,`<\/script>`,`</body></html>`].filter(Boolean).join(`
|
|
227
|
+
`)}function C(e){return JSON.stringify(e).replace(/</g,`\\u003c`).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}function w(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function T(e){let t=0;for(let n of e)n.type===`data`&&t++;return t}function E(e){let t={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],series:[],scenes:[],transforms:[]};for(let n of e)switch(n.type){case`property`:t.properties.push(n);break;case`data`:t.data=n;break;case`colorize`:t.colorizes.push(n);break;case`highlight`:t.highlights.push(n);break;case`area-fill`:t.areaFills.push(n);break;case`annotation`:t.annotations.push(n);break;case`series`:t.series.push(n);break;case`scene`:t.scenes.push(n);break;case`transform`:t.transforms.push(n)}return t}function D(e){let t={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],series:[],transforms:[]};for(let n of e)switch(n.type){case`property`:t.properties.push(n);break;case`data`:t.data=n;break;case`colorize`:t.colorizes.push(n);break;case`highlight`:t.highlights.push(n);break;case`area-fill`:t.areaFills.push(n);break;case`annotation`:t.annotations.push(n);break;case`series`:t.series.push(n);break;case`transform`:t.transforms.push(n)}return t}var O=class extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name=`SyntaxError`}format(e){let t=`Error: `+this.message;if(this.location){let n=null,r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,a=this.location.source&&typeof this.location.source.offset==`function`?this.location.source.offset(i):i,o=this.location.source+`:`+a.line+`:`+a.column;if(n){let e=this.location.end,r=``.padEnd(a.line.toString().length,` `),s=n[i.line-1],c=(i.line===e.line?e.column:s.length+1)-i.column||1;t+=`
|
|
228
228
|
--> `+o+`
|
|
229
|
-
`+
|
|
230
|
-
`+
|
|
231
|
-
`+
|
|
232
|
-
at `+o}return
|
|
233
|
-
|
|
234
|
-
`],!0,!1
|
|
235
|
-
|
|
236
|
-
`},v5=function(){return"\r"},x5=function(){return" "},w5=function(u){return String.fromCharCode(parseInt(u,16))},A5=function(u){or("Unknown escape sequence \\"+u)},o0=function(u){return u},_5=function(u){return u},k5=function(u){return u.trim()},S5=function(u){return u.trim()},p=n.peg$currPos|0,zt=p,Ca=[{line:1,column:1}],Dn=p,ss=n.peg$maxFailExpected||[],Z=n.peg$silentFails|0,di;if(n.startRule){if(!(n.startRule in a))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');i=a[n.startRule]}function or(u,y){throw y=y!==void 0?y:nc(zt,p),L5(u,y)}function te(u,y){return{type:"literal",text:u,ignoreCase:y}}function Pn(u,y,k){return{type:"class",parts:u,inverted:y,ignoreCase:k}}function M5(){return{type:"any"}}function $5(){return{type:"end"}}function gi(u){return{type:"other",description:u}}function s0(u){var y=Ca[u],k;if(y)return y;if(u>=Ca.length)k=Ca.length-1;else for(k=u;!Ca[--k];);for(y=Ca[k],y={line:y.line,column:y.column};k<u;)t.charCodeAt(k)===10?(y.line++,y.column=1):y.column++,k++;return Ca[u]=y,y}function nc(u,y,k){var R=s0(u),H=s0(y),K={source:r,start:{offset:u,line:R.line,column:R.column},end:{offset:y,line:H.line,column:H.column}};return K}function Q(u){p<Dn||(p>Dn&&(Dn=p,ss=[]),ss.push(u))}function L5(u,y){return new Ar(u,null,null,y)}function C5(u,y,k){return new Ar(Ar.buildMessage(u,y),u,y,k)}function l0(){var u,y,k,R,H,K,lt,Mt;if(u=p,Rt(),t.substr(p,5)===o?(y=o,p+=5):(y=e,Z===0&&Q(j)),y!==e)if(k=zn(),k!==e)if(R=pi(),R!==e)if(Rt(),t.charCodeAt(p)===123?(H=s,p++):(H=e,Z===0&&Q(J)),H!==e){for(K=[],lt=c0();lt!==e;)K.push(lt),lt=c0();lt=Rt(),t.charCodeAt(p)===125?(Mt=l,p++):(Mt=e,Z===0&&Q(X)),Mt!==e?(Rt(),zt=u,u=ln(R,K)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u}function c0(){var u,y,k,R,H;if(u=p,y=ac(),k=f0(),k===e&&(k=d0(),k===e&&(k=g0(),k===e&&(k=p0(),k===e&&(k=b0(),k===e&&(k=y0(),k===e&&(k=m0(),k===e&&(k=v0(),k===e&&(k=E5(),k===e&&(k=x0(),k===e&&(k=rc())))))))))),k!==e){for(R=[],H=t.charAt(p),C.test(H)?p++:(H=e,Z===0&&Q(O));H!==e;)R.push(H),H=t.charAt(p),C.test(H)?p++:(H=e,Z===0&&Q(O));H=cs(),H===e&&(H=null),Oa(),zt=u,u=Ce(y,k)}else p=u,u=e;return u}function f0(){var u,y,k,R,H,K;if(u=p,t.substr(p,4)===c?(y=c,p+=4):(y=e,Z===0&&Q(ht)),y!==e)if(Rt(),t.charCodeAt(p)===123?(k=s,p++):(k=e,Z===0&&Q(J)),k!==e){for(R=[],H=u0();H!==e;)R.push(H),H=u0();H=Rt(),t.charCodeAt(p)===125?(K=l,p++):(K=e,Z===0&&Q(X)),K!==e?(zt=u,u=Te(R)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;return u}function u0(){var u,y,k,R,H;if(u=p,y=ac(),k=O5(),k===e&&(k=T5()),k!==e){for(R=[],H=t.charAt(p),C.test(H)?p++:(H=e,Z===0&&Q(O));H!==e;)R.push(H),H=t.charAt(p),C.test(H)?p++:(H=e,Z===0&&Q(O));H=cs(),H===e&&(H=null),Oa(),zt=u,u=ar(y,k)}else p=u,u=e;return u}function T5(){var u,y,k,R,H,K,lt,Mt;if(u=p,y=h0(),y!==e)if(Rt(),t.charCodeAt(p)===61?(k=f,p++):(k=e,Z===0&&Q(mt)),k!==e)if(Rt(),R=Ta(),R!==e){if(H=[],K=p,t.charCodeAt(p)===44?(lt=h,p++):(lt=e,Z===0&&Q(vt)),lt!==e?(Rt(),Mt=Ta(),Mt!==e?(zt=K,K=ir(y,R,Mt)):(p=K,K=e)):(p=K,K=e),K!==e)for(;K!==e;)H.push(K),K=p,t.charCodeAt(p)===44?(lt=h,p++):(lt=e,Z===0&&Q(vt)),lt!==e?(Rt(),Mt=Ta(),Mt!==e?(zt=K,K=ir(y,R,Mt)):(p=K,K=e)):(p=K,K=e);else H=e;H!==e?(zt=u,u=fi(y,R,H)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;return u===e&&(u=p,y=h0(),y!==e?(Rt(),t.charCodeAt(p)===61?(k=f,p++):(k=e,Z===0&&Q(mt)),k!==e?(Rt(),R=Ta(),R!==e?(zt=u,u=ui(y,R)):(p=u,u=e)):(p=u,u=e)):(p=u,u=e)),u}function h0(){var u,y;return u=p,y=vn(),y!==e&&(zt=u,y=nt(y)),u=y,u===e&&(u=p,y=pi(),y!==e&&(zt=u,y=Xt(y)),u=y),u}function O5(){var u,y,k,R;return u=p,y=N5(),y!==e?(t.charCodeAt(p)===9?(k=d,p++):(k=e,Z===0&&Q(Tt)),k!==e?(Rt(),R=Ta(),R!==e?(zt=u,u=ee(y,R)):(p=u,u=e)):(p=u,u=e)):(p=u,u=e),u}function N5(){var u,y,k,R;if(u=p,y=p,k=[],R=t.charAt(p),I.test(R)?p++:(R=e,Z===0&&Q(Ht)),R!==e)for(;R!==e;)k.push(R),R=t.charAt(p),I.test(R)?p++:(R=e,Z===0&&Q(Ht));else k=e;return k!==e?y=t.substring(y,p):y=k,y!==e&&(zt=u,y=Qt(y)),u=y,u}function d0(){var u,y,k,R,H,K,lt,Mt;if(u=p,t.substr(p,8)===g?(y=g,p+=8):(y=e,Z===0&&Q(Ft)),y!==e)if(k=zn(),k!==e)if(R=vn(),R!==e)if(Rt(),t.charCodeAt(p)===123?(H=s,p++):(H=e,Z===0&&Q(J)),H!==e){for(Rt(),K=[],lt=Oe();lt!==e;)K.push(lt),lt=Oe();lt=Rt(),t.charCodeAt(p)===125?(Mt=l,p++):(Mt=e,Z===0&&Q(X)),Mt!==e?(zt=u,u=be(R,K)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u===e&&(u=p,t.substr(p,8)===g?(y=g,p+=8):(y=e,Z===0&&Q(Ft)),y!==e?(k=Rt(),t.charCodeAt(p)===123?(R=s,p++):(R=e,Z===0&&Q(J)),R!==e?(zt=u,u=je()):(p=u,u=e)):(p=u,u=e)),u}function g0(){var u,y,k,R,H,K,lt,Mt,ue,ne;if(u=p,t.substr(p,9)===v?(y=v,p+=9):(y=e,Z===0&&Q(Yt)),y!==e)if(k=zn(),k!==e)if(R=vn(),R!==e)if(H=Rt(),t.charCodeAt(p)===123?(K=s,p++):(K=e,Z===0&&Q(J)),K!==e){for(lt=Rt(),Mt=[],ue=Oe();ue!==e;)Mt.push(ue),ue=Oe();ue=Rt(),t.charCodeAt(p)===125?(ne=l,p++):(ne=e,Z===0&&Q(X)),ne!==e?(zt=u,u=Xr(R,Mt)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u===e&&(u=p,t.substr(p,9)===v?(y=v,p+=9):(y=e,Z===0&&Q(Yt)),y!==e?(k=zn(),k!==e?(R=vn(),R!==e?(H=p,Z++,K=p,lt=Rt(),t.charCodeAt(p)===123?(Mt=s,p++):(Mt=e,Z===0&&Q(J)),Mt!==e?(lt=[lt,Mt],K=lt):(p=K,K=e),Z--,K===e?H=void 0:(p=H,H=e),H!==e?(zt=u,u=is(R)):(p=u,u=e)):(p=u,u=e)):(p=u,u=e)):(p=u,u=e),u===e&&(u=p,t.substr(p,9)===v?(y=v,p+=9):(y=e,Z===0&&Q(Yt)),y!==e?(k=Rt(),t.charCodeAt(p)===123?(R=s,p++):(R=e,Z===0&&Q(J)),R!==e?(zt=u,u=os()):(p=u,u=e)):(p=u,u=e))),u}function p0(){var u,y,k,R,H,K,lt,Mt,ue,ne;if(u=p,t.substr(p,9)===m?(y=m,p+=9):(y=e,Z===0&&Q(Ut)),y!==e)if(k=zn(),k!==e)if(R=vn(),R!==e)if(H=zn(),H!==e)if(K=vn(),K!==e)if(Rt(),t.charCodeAt(p)===123?(lt=s,p++):(lt=e,Z===0&&Q(J)),lt!==e){for(Rt(),Mt=[],ue=Oe();ue!==e;)Mt.push(ue),ue=Oe();ue=Rt(),t.charCodeAt(p)===125?(ne=l,p++):(ne=e,Z===0&&Q(X)),ne!==e?(zt=u,u=hi(R,K,Mt)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u===e&&(u=p,t.substr(p,9)===m?(y=m,p+=9):(y=e,Z===0&&Q(Ut)),y!==e?(k=zn(),k!==e?(R=vn(),R!==e?(H=Rt(),t.charCodeAt(p)===123?(K=s,p++):(K=e,Z===0&&Q(J)),K!==e?(zt=u,u=j_()):(p=u,u=e)):(p=u,u=e)):(p=u,u=e)):(p=u,u=e),u===e&&(u=p,t.substr(p,9)===m?(y=m,p+=9):(y=e,Z===0&&Q(Ut)),y!==e?(k=Rt(),t.charCodeAt(p)===123?(R=s,p++):(R=e,Z===0&&Q(J)),R!==e?(zt=u,u=K_()):(p=u,u=e)):(p=u,u=e))),u}function m0(){var u,y,k,R,H,K,lt,Mt;if(u=p,t.substr(p,10)===b?(y=b,p+=10):(y=e,Z===0&&Q(Gt)),y!==e)if(k=zn(),k!==e)if(R=vn(),R!==e)if(Rt(),t.charCodeAt(p)===123?(H=s,p++):(H=e,Z===0&&Q(J)),H!==e){for(Rt(),K=[],lt=Oe();lt!==e;)K.push(lt),lt=Oe();lt=Rt(),t.charCodeAt(p)===125?(Mt=l,p++):(Mt=e,Z===0&&Q(X)),Mt!==e?(zt=u,u=J_(R,K)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u===e&&(u=p,t.substr(p,10)===b?(y=b,p+=10):(y=e,Z===0&&Q(Gt)),y!==e?(k=Rt(),t.charCodeAt(p)===123?(R=s,p++):(R=e,Z===0&&Q(J)),R!==e?(zt=u,u=Q_()):(p=u,u=e)):(p=u,u=e)),u}function b0(){var u,y,k,R,H,K;if(u=p,t.substr(p,5)===x?(y=x,p+=5):(y=e,Z===0&&Q(dt)),y!==e)if(Rt(),t.charCodeAt(p)===123?(k=s,p++):(k=e,Z===0&&Q(J)),k!==e){for(Rt(),R=[],H=Oe();H!==e;)R.push(H),H=Oe();H=Rt(),t.charCodeAt(p)===125?(K=l,p++):(K=e,Z===0&&Q(X)),K!==e?(zt=u,u=t5(R)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;return u}function y0(){var u,y,k,R,H,K;if(u=p,t.substr(p,4)===A?(y=A,p+=4):(y=e,Z===0&&Q($t)),y!==e)if(Rt(),t.charCodeAt(p)===123?(k=s,p++):(k=e,Z===0&&Q(J)),k!==e){for(Rt(),R=[],H=Oe();H!==e;)R.push(H),H=Oe();H=Rt(),t.charCodeAt(p)===125?(K=l,p++):(K=e,Z===0&&Q(X)),K!==e?(zt=u,u=e5(R)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;return u}function v0(){var u,y,k,R,H,K,lt,Mt;if(u=p,t.substr(p,6)===w?(y=w,p+=6):(y=e,Z===0&&Q(U)),y!==e)if(k=zn(),k!==e)if(R=vn(),R!==e)if(Rt(),t.charCodeAt(p)===123?(H=s,p++):(H=e,Z===0&&Q(J)),H!==e){for(Rt(),K=[],lt=Oe();lt!==e;)K.push(lt),lt=Oe();lt=Rt(),t.charCodeAt(p)===125?(Mt=l,p++):(Mt=e,Z===0&&Q(X)),Mt!==e?(zt=u,u=n5(R,K)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u===e&&(u=p,t.substr(p,6)===w?(y=w,p+=6):(y=e,Z===0&&Q(U)),y!==e?(k=Rt(),t.charCodeAt(p)===123?(R=s,p++):(R=e,Z===0&&Q(J)),R!==e?(zt=u,u=r5()):(p=u,u=e)):(p=u,u=e)),u}function E5(){var u,y,k,R,H,K,lt,Mt;if(u=p,t.substr(p,5)===S?(y=S,p+=5):(y=e,Z===0&&Q(T)),y!==e)if(k=zn(),k!==e)if(R=vn(),R===e&&(R=null),Rt(),t.charCodeAt(p)===123?(H=s,p++):(H=e,Z===0&&Q(J)),H!==e){for(K=[],lt=w0();lt!==e;)K.push(lt),lt=w0();lt=Rt(),t.charCodeAt(p)===125?(Mt=l,p++):(Mt=e,Z===0&&Q(X)),Mt!==e?(zt=u,u=a5(R,K)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;return u}function x0(){var u,y,k,R,H,K,lt,Mt;if(u=p,t.substr(p,9)===z?(y=z,p+=9):(y=e,Z===0&&Q(F)),y!==e)if(k=zn(),k!==e)if(R=pi(),R!==e)if(Rt(),t.charCodeAt(p)===123?(H=s,p++):(H=e,Z===0&&Q(J)),H!==e){for(Rt(),K=[],lt=Oe();lt!==e;)K.push(lt),lt=Oe();lt=Rt(),t.charCodeAt(p)===125?(Mt=l,p++):(Mt=e,Z===0&&Q(X)),Mt!==e?(zt=u,u=i5(R,K)):(p=u,u=e)}else p=u,u=e;else p=u,u=e;else p=u,u=e;else p=u,u=e;return u}function w0(){var u,y,k,R,H;if(u=p,y=ac(),k=f0(),k===e&&(k=d0(),k===e&&(k=g0(),k===e&&(k=p0(),k===e&&(k=b0(),k===e&&(k=y0(),k===e&&(k=m0(),k===e&&(k=v0(),k===e&&(k=x0(),k===e&&(k=rc()))))))))),k!==e){for(R=[],H=t.charAt(p),C.test(H)?p++:(H=e,Z===0&&Q(O));H!==e;)R.push(H),H=t.charAt(p),C.test(H)?p++:(H=e,Z===0&&Q(O));H=cs(),H===e&&(H=null),Oa(),zt=u,u=o5(y,k)}else p=u,u=e;return u}function Oe(){var u,y;return u=p,Rt(),y=rc(),y!==e?(Rt(),zt=u,u=s5(y)):(p=u,u=e),u}function rc(){var u,y,k,R;return u=p,y=D5(),y!==e?(Rt(),t.charCodeAt(p)===61?(k=f,p++):(k=e,Z===0&&Q(mt)),k!==e?(Rt(),R=Ta(),R!==e?(zt=u,u=l5(y,R)):(p=u,u=e)):(p=u,u=e)):(p=u,u=e),u}function D5(){var u;return u=vn(),u===e&&(u=pi()),u}function Ta(){var u,y,k;return u=p,y=A0(),y!==e?(t.charCodeAt(p)===37?(k=Y,p++):(k=e,Z===0&&Q(E)),k!==e?(zt=u,u=c5(y)):(p=u,u=e)):(p=u,u=e),u===e&&(u=p,y=A0(),y!==e&&(zt=u,y=f5(y)),u=y,u===e&&(u=p,y=vn(),y!==e&&(zt=u,y=u5(y)),u=y,u===e&&(u=p,y=pi(),y!==e&&(zt=u,y=h5(y)),u=y))),u}function pi(){var u,y,k,R,H;if(Z++,u=p,y=p,k=t.charAt(p),W.test(k)?p++:(k=e,Z===0&&Q(wt)),k!==e){for(R=[],H=t.charAt(p),it.test(H)?p++:(H=e,Z===0&&Q(Ct));H!==e;)R.push(H),H=t.charAt(p),it.test(H)?p++:(H=e,Z===0&&Q(Ct));k=[k,R],y=k}else p=y,y=e;return y!==e?u=t.substring(u,p):u=y,Z--,u===e&&(y=e,Z===0&&Q(at)),u}function A0(){var u,y,k,R,H,K,lt,Mt,ue,ne;if(u=p,y=p,k=p,t.charCodeAt(p)===45?(R=G,p++):(R=e,Z===0&&Q(st)),R===e&&(R=null),H=p,t.charCodeAt(p)===46?(K=_,p++):(K=e,Z===0&&Q(Et)),K!==e){if(lt=[],Mt=t.charAt(p),rt.test(Mt)?p++:(Mt=e,Z===0&&Q(Nt)),Mt!==e)for(;Mt!==e;)lt.push(Mt),Mt=t.charAt(p),rt.test(Mt)?p++:(Mt=e,Z===0&&Q(Nt));else lt=e;lt!==e?(K=[K,lt],H=K):(p=H,H=e)}else p=H,H=e;if(H===e){if(H=p,K=[],lt=t.charAt(p),rt.test(lt)?p++:(lt=e,Z===0&&Q(Nt)),lt!==e)for(;lt!==e;)K.push(lt),lt=t.charAt(p),rt.test(lt)?p++:(lt=e,Z===0&&Q(Nt));else K=e;if(K!==e){if(lt=p,t.charCodeAt(p)===46?(Mt=_,p++):(Mt=e,Z===0&&Q(Et)),Mt!==e){for(ue=[],ne=t.charAt(p),rt.test(ne)?p++:(ne=e,Z===0&&Q(Nt));ne!==e;)ue.push(ne),ne=t.charAt(p),rt.test(ne)?p++:(ne=e,Z===0&&Q(Nt));Mt=[Mt,ue],lt=Mt}else p=lt,lt=e;lt===e&&(lt=null),K=[K,lt],H=K}else p=H,H=e}if(H!==e){if(K=p,lt=t.charAt(p),ct.test(lt)?p++:(lt=e,Z===0&&Q(tt)),lt!==e){if(Mt=t.charAt(p),pt.test(Mt)?p++:(Mt=e,Z===0&&Q(St)),Mt===e&&(Mt=null),ue=[],ne=t.charAt(p),rt.test(ne)?p++:(ne=e,Z===0&&Q(Nt)),ne!==e)for(;ne!==e;)ue.push(ne),ne=t.charAt(p),rt.test(ne)?p++:(ne=e,Z===0&&Q(Nt));else ue=e;ue!==e?(lt=[lt,Mt,ue],K=lt):(p=K,K=e)}else p=K,K=e;K===e&&(K=null),R=[R,H,K],k=R}else p=k,k=e;return k!==e?y=t.substring(y,p):y=k,y!==e&&(zt=u,y=d5(y)),u=y,u}function vn(){var u,y,k,R;if(Z++,u=p,t.charCodeAt(p)===34?(y=B,p++):(y=e,Z===0&&Q(Pt)),y!==e){for(k=[],R=_0();R!==e;)k.push(R),R=_0();t.charCodeAt(p)===34?(R=B,p++):(R=e,Z===0&&Q(Pt)),R!==e?(zt=u,u=g5(k)):(p=u,u=e)}else p=u,u=e;return Z--,u===e&&(y=e,Z===0&&Q(Dt)),u}function _0(){var u,y,k;return u=p,t.charCodeAt(p)===92?(y=P,p++):(y=e,Z===0&&Q(Zt)),y!==e?(k=P5(),k!==e?(zt=u,u=p5(k)):(p=u,u=e)):(p=u,u=e),u===e&&(u=t.charAt(p),xt.test(u)?p++:(u=e,Z===0&&Q(ae))),u}function P5(){var u,y,k,R,H,K,lt,Mt;return u=p,t.charCodeAt(p)===34?(y=B,p++):(y=e,Z===0&&Q(Pt)),y!==e&&(zt=u,y=m5()),u=y,u===e&&(u=p,t.charCodeAt(p)===92?(y=P,p++):(y=e,Z===0&&Q(Zt)),y!==e&&(zt=u,y=b5()),u=y,u===e&&(u=p,t.charCodeAt(p)===110?(y=$,p++):(y=e,Z===0&&Q($e)),y!==e&&(zt=u,y=y5()),u=y,u===e&&(u=p,t.charCodeAt(p)===114?(y=N,p++):(y=e,Z===0&&Q(Ze)),y!==e&&(zt=u,y=v5()),u=y,u===e&&(u=p,t.charCodeAt(p)===116?(y=L,p++):(y=e,Z===0&&Q(Le)),y!==e&&(zt=u,y=x5()),u=y,u===e&&(u=p,t.charCodeAt(p)===117?(y=M,p++):(y=e,Z===0&&Q(yn)),y!==e?(k=p,R=p,H=t.charAt(p),yt.test(H)?p++:(H=e,Z===0&&Q(fe)),H!==e?(K=t.charAt(p),yt.test(K)?p++:(K=e,Z===0&&Q(fe)),K!==e?(lt=t.charAt(p),yt.test(lt)?p++:(lt=e,Z===0&&Q(fe)),lt!==e?(Mt=t.charAt(p),yt.test(Mt)?p++:(Mt=e,Z===0&&Q(fe)),Mt!==e?(H=[H,K,lt,Mt],R=H):(p=R,R=e)):(p=R,R=e)):(p=R,R=e)):(p=R,R=e),R!==e?k=t.substring(k,p):k=R,k!==e?(zt=u,u=w5(k)):(p=u,u=e)):(p=u,u=e),u===e&&(u=p,t.length>p?(y=t.charAt(p),p++):(y=e,Z===0&&Q(ie)),y!==e&&(zt=u,y=A5(y)),u=y)))))),u}function ls(){var u;return u=cs(),u===e&&(u=z5()),u}function cs(){var u,y,k,R;if(u=p,t.substr(p,2)===D?(y=D,p+=2):(y=e,Z===0&&Q(sn)),y!==e){for(k=[],R=t.charAt(p),bt.test(R)?p++:(R=e,Z===0&&Q(ft));R!==e;)k.push(R),R=t.charAt(p),bt.test(R)?p++:(R=e,Z===0&&Q(ft));y=[y,k],u=y}else p=u,u=e;return u}function z5(){var u,y,k,R,H,K;if(u=p,t.substr(p,2)===q?(y=q,p+=2):(y=e,Z===0&&Q(et)),y!==e){for(k=[],R=p,H=p,Z++,t.substr(p,2)===V?(K=V,p+=2):(K=e,Z===0&&Q(gt)),Z--,K===e?H=void 0:(p=H,H=e),H!==e?(t.length>p?(K=t.charAt(p),p++):(K=e,Z===0&&Q(ie)),K!==e?(H=[H,K],R=H):(p=R,R=e)):(p=R,R=e);R!==e;)k.push(R),R=p,H=p,Z++,t.substr(p,2)===V?(K=V,p+=2):(K=e,Z===0&&Q(gt)),Z--,K===e?H=void 0:(p=H,H=e),H!==e?(t.length>p?(K=t.charAt(p),p++):(K=e,Z===0&&Q(ie)),K!==e?(H=[H,K],R=H):(p=R,R=e)):(p=R,R=e);t.substr(p,2)===V?(R=V,p+=2):(R=e,Z===0&&Q(gt)),R!==e?(y=[y,k,R],u=y):(p=u,u=e)}else p=u,u=e;return u}function Oa(){var u,y;for(Z++,u=[],y=t.charAt(p),kt.test(y)?p++:(y=e,Z===0&&Q(At));y!==e;)u.push(y),y=t.charAt(p),kt.test(y)?p++:(y=e,Z===0&&Q(At));return Z--,y=e,Z===0&&Q(Lt),u}function ac(){var u,y,k,R;for(u=p,y=[],k=p,Oa(),R=k0(),R!==e?(zt=k,k=o0(R)):(p=k,k=e);k!==e;)y.push(k),k=p,Oa(),R=k0(),R!==e?(zt=k,k=o0(R)):(p=k,k=e);return k=Oa(),zt=u,u=_5(y),u}function k0(){var u,y,k,R,H,K,lt;if(u=p,t.substr(p,2)===D?(y=D,p+=2):(y=e,Z===0&&Q(sn)),y!==e){for(k=p,R=[],H=t.charAt(p),bt.test(H)?p++:(H=e,Z===0&&Q(ft));H!==e;)R.push(H),H=t.charAt(p),bt.test(H)?p++:(H=e,Z===0&&Q(ft));k=t.substring(k,p),zt=u,u=k5(k)}else p=u,u=e;if(u===e)if(u=p,t.substr(p,2)===q?(y=q,p+=2):(y=e,Z===0&&Q(et)),y!==e){for(k=p,R=[],H=p,K=p,Z++,t.substr(p,2)===V?(lt=V,p+=2):(lt=e,Z===0&&Q(gt)),Z--,lt===e?K=void 0:(p=K,K=e),K!==e?(t.length>p?(lt=t.charAt(p),p++):(lt=e,Z===0&&Q(ie)),lt!==e?(K=[K,lt],H=K):(p=H,H=e)):(p=H,H=e);H!==e;)R.push(H),H=p,K=p,Z++,t.substr(p,2)===V?(lt=V,p+=2):(lt=e,Z===0&&Q(gt)),Z--,lt===e?K=void 0:(p=K,K=e),K!==e?(t.length>p?(lt=t.charAt(p),p++):(lt=e,Z===0&&Q(ie)),lt!==e?(K=[K,lt],H=K):(p=H,H=e)):(p=H,H=e);k=t.substring(k,p),t.substr(p,2)===V?(R=V,p+=2):(R=e,Z===0&&Q(gt)),R!==e?(zt=u,u=S5(k)):(p=u,u=e)}else p=u,u=e;return u}function zn(){var u,y;if(Z++,u=[],y=t.charAt(p),kt.test(y)?p++:(y=e,Z===0&&Q(At)),y===e&&(y=ls()),y!==e)for(;y!==e;)u.push(y),y=t.charAt(p),kt.test(y)?p++:(y=e,Z===0&&Q(At)),y===e&&(y=ls());else u=e;return Z--,u===e&&(y=e,Z===0&&Q(Kt)),u}function Rt(){var u,y;for(Z++,u=[],y=t.charAt(p),kt.test(y)?p++:(y=e,Z===0&&Q(At)),y===e&&(y=ls());y!==e;)u.push(y),y=t.charAt(p),kt.test(y)?p++:(y=e,Z===0&&Q(At)),y===e&&(y=ls());return Z--,y=e,Z===0&&Q(He),u}if(di=i(),n.peg$library)return{peg$result:di,peg$currPos:p,peg$FAILED:e,peg$maxFailExpected:ss,peg$maxFailPos:Dn};if(di!==e&&p===t.length)return di;throw di!==e&&p<t.length&&Q($5()),C5(ss,Dn<t.length?t.charAt(Dn):null,Dn<t.length?nc(Dn,Dn+1):nc(Dn,Dn))}function F0(t){try{return R0(t)}catch(n){if(n instanceof Error&&"location"in n){const e=n.location,r=new SyntaxError(`${n.message} at ${e.start.line}:${e.start.column}`);throw r.location=e,r}throw n}}const sc=[{name:"Blueprint",label:"Blueprint",colors:["#2563A0","#D4A63A","#C94044","#2D8659","#4B90CF","#163A65"]},{name:"BlueprintBold",label:"Blueprint Bold",colors:["#2563A0","#DDF247","#C94044","#2D8659","#D4A63A","#163A65"]},{name:"JosefAlbers",label:"Albers",colors:["#c00559","#de1f6c","#f3a20d","#f07a13","#de6716"]},{name:"Durorthod",label:"Amber",colors:["#2c0c00","#803c15","#c6782c","#ffa91d","#fff3ad"]},{name:"X41",label:"Berry",colors:["#411f6b","#623976","#be3979","#db928a","#e2c6a6"]},{name:"Bright",label:"Bright",colors:["#462255","#ff8811","#9dd9d2","#046e8f","#d44d5c"]},{name:"Cancri",label:"Cancri",colors:["#343854","#8c384d","#cf2438","#d95e31","#f0c742","#f8f0e5"]},{name:"Ceres",label:"Ceres",colors:["#181d20","#4a5f71","#6f8ba0","#f8f9fa"]},{name:"MarcChagall",label:"Chagall",colors:["#3f6f76","#69b7ce","#c65840","#f4ce4b","#62496f"]},{name:"Pelewensis",label:"Coral",colors:["#e2b000","#f7f656","#2449a2","#809098","#0d1115"]},{name:"Deathmasks",label:"Deathmasks",colors:["#926159","#87876e","#c7d2d8","#62b7c8","#43535c","#23313c"]},{name:"Leucosternon",label:"Deep Sea",colors:["#071140","#0e34b2","#207cf5","#9ec8ff","#fbfb53"]},{name:"Deelite",label:"Deelite",colors:["#48448e","#8ccc58","#fc4d97","#b82578"]},{name:"X10",label:"Dusk",colors:["#2a2432","#4f3855","#846d86","#efefcf","#d5b77d","#a89e5e"]},{name:"Vitrixerand",label:"Earth",colors:["#281b27","#723f27","#9b6044","#b5804c","#facd9a"]},{name:"Egypt",label:"Egypt",colors:["#dd5129","#0f7ba2","#43b284","#fab255"]},{name:"ElectronicNight",label:"Electric Night",colors:["#cb54d6","#3e45c4","#21191a","#362f78","#57b4ae"]},{name:"LutjanusSebae",label:"Emperor",colors:["#e5e9ea","#a2bac5","#ce3d21","#992216","#490d07"]},{name:"Enara",label:"Enara",colors:["#262626","#3d5983","#5a8a54","#cfb023"]},{name:"Camo871",label:"Fiesta",colors:["#ffff14","#fea31d","#ce2d41","#3a3fa3"]},{name:"Folklore",label:"Folklore",colors:["#272727","#5c5c5c","#bababa","#f8f8f8"]},{name:"Fritsch",label:"Fritsch",colors:["#0f8d7b","#8942bd","#1e1a1a","#eadd17"]},{name:"AgSunset",label:"Glow",colors:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"]},{name:"Harvey",label:"Harvey",colors:["#c6d4d6","#274c4f","#a4432d","#b17c51"]},{name:"Heep",label:"Heep",colors:["#466e9a","#e84d45","#21201c","#a1baac"]},{name:"Imperator",label:"Imperator",colors:["#04093a","#0527b4","#555dfe","#faf830","#b8980f"]},{name:"Klimt",label:"Klimt",colors:["#df9ed4","#c93f55","#eacc62","#469d76","#3c4b99","#924099"]},{name:"KnickCity",label:"Knick City",colors:["#0c2340","#ff6720","#707372","#c8c9c7"]},{name:"London",label:"London",colors:["#bd241e","#e56b1e","#ffcd22","#15274d"]},{name:"Lover",label:"Lover",colors:["#b8396b","#ffd1d7","#fff5cc","#76bae0","#b28f81","#54483e"]},{name:"Maya",label:"Maya",colors:["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"]},{name:"X24",label:"Mocha",colors:["#2b1917","#7e5945","#bc927b","#f1e6e1"]},{name:"Camo873",label:"Neon",colors:["#132f8a","#5a56c8","#fc7ead","#ffca3e"]},{name:"NetsCity",label:"Nets City",colors:["#010101","#ffb81c","#da291c","#004c97","#418fde"]},{name:"Nodoubt",label:"No Doubt",colors:["#385581","#6dbac6","#dac190","#c9052c"]},{name:"ClaesOldenburg",label:"Oldenburg",colors:["#95b1c9","#263656","#698946","#f8d440","#c82720"]},{name:"Peacesells",label:"Peace Sells",colors:["#9a5155","#483943","#ecc463","#a497b2"]},{name:"PabloPicasso",label:"Picasso",colors:["#4e7989","#a9011b","#e4a826","#80944e","#dcd6b2"]},{name:"Bifasciatum",label:"Reef",colors:["#080214","#16407b","#2b7ff9","#b1fcfc","#6cbe50"]},{name:"SiameseDream",label:"Siamese Dream",colors:["#f0e9e0","#2f1f16","#a34d2c","#cd8e40"]},{name:"X115",label:"Sienna",colors:["#001a29","#633633","#834a39","#e3b571","#eee6a6"]},{name:"Sixers",label:"Sixers",colors:["#888b8d","#e4d5d3","#003da5","#d50032"]},{name:"SolLeWitt",label:"Sol LeWitt",colors:["#0a71b6","#f9c40a","#190506","#eb5432","#eaf2f0"]},{name:"Sunset",label:"Sunset",colors:["#41476b","#675478","#9e6374","#c67b6f","#de9b71","#efbc82","#fbdfa2"]},{name:"Sunset2",label:"Sunset II",colors:["#1d457f","#61599d","#c36377","#eb7f54","#f2af4a"]},{name:"Sunset3",label:"Sunset III",colors:["#390e40","#701c34","#a63228","#c7662a","#eba42b"]},{name:"Pal9",label:"Tropical",colors:["#273b5b","#c1c243","#e73e26","#2e6657","#e8f5b3","#24a99c"]},{name:"Salvelinus",label:"Trout",colors:["#e6452e","#e49a36","#f9dd4c","#5b4a4c","#01040e"]},{name:"TheovanDoesburg",label:"Van Doesburg",colors:["#bd748f","#3d578e","#bfab68","#dad7d0","#272928"]},{name:"Wizards",label:"Wizards",colors:["#c8102e","#0c2340","#8d9093","#c8c9c7"]},{name:"FrancescoXanto",label:"Xanto",colors:["#2c6aa5","#d9ae2c","#ddc655","#d88c27","#64894d"]},{name:"Zeppelin",label:"Zeppelin",colors:["#efdb15","#739c9c","#0d484c","#c71a08"]}],Y0=Object.fromEntries(sc.map(t=>[t.name,t.colors]));function I0(t){if(!t)return;const n=Y0[t];return n?[...n]:void 0}function H0(){return sc}const{min:B0,max:V0}=Math,_r=(t,n=0,e=1)=>B0(V0(n,t),e),gs=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let n=0;n<=3;n++)n<3?((t[n]<0||t[n]>255)&&(t._clipped=!0),t[n]=_r(t[n],0,255)):n===3&&(t[n]=_r(t[n],0,1));return t},lc={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])lc[`[object ${t}]`]=t.toLowerCase();function qt(t){return lc[Object.prototype.toString.call(t)]||"object"}const Vt=(t,n=null)=>t.length>=3?Array.prototype.slice.call(t):qt(t[0])=="object"&&n?n.split("").filter(e=>t[0][e]!==void 0).map(e=>t[0][e]):t[0].slice(0),Ur=t=>{if(t.length<2)return null;const n=t.length-1;return qt(t[n])=="string"?t[n].toLowerCase():null},{PI:mi,min:cc,max:fc}=Math,fn=t=>Math.round(t*100)/100,ps=t=>Math.round(t*100)/100,Gn=mi*2,ms=mi/3,W0=mi/180,G0=180/mi;function uc(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const Bt={format:{},autodetect:[]};let ut=class{constructor(...n){const e=this;if(qt(n[0])==="object"&&n[0].constructor&&n[0].constructor===this.constructor)return n[0];let r=Ur(n),a=!1;if(!r){a=!0,Bt.sorted||(Bt.autodetect=Bt.autodetect.sort((i,o)=>o.p-i.p),Bt.sorted=!0);for(let i of Bt.autodetect)if(r=i.test(...n),r)break}if(Bt.format[r]){const i=Bt.format[r].apply(null,a?n:n.slice(0,-1));e._rgb=gs(i)}else throw new Error("unknown format: "+n);e._rgb.length===3&&e._rgb.push(1)}toString(){return qt(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const q0="3.2.0",Ot=(...t)=>new ut(...t);Ot.version=q0;const Zr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},X0=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,U0=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,hc=t=>{if(t.match(X0)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const n=parseInt(t,16),e=n>>16,r=n>>8&255,a=n&255;return[e,r,a,1]}if(t.match(U0)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const n=parseInt(t,16),e=n>>24&255,r=n>>16&255,a=n>>8&255,i=Math.round((n&255)/255*100)/100;return[e,r,a,i]}throw new Error(`unknown hex color: ${t}`)},{round:bi}=Math,dc=(...t)=>{let[n,e,r,a]=Vt(t,"rgba"),i=Ur(t)||"auto";a===void 0&&(a=1),i==="auto"&&(i=a<1?"rgba":"rgb"),n=bi(n),e=bi(e),r=bi(r);let s="000000"+(n<<16|e<<8|r).toString(16);s=s.substr(s.length-6);let l="0"+bi(a*255).toString(16);switch(l=l.substr(l.length-2),i.toLowerCase()){case"rgba":return`#${s}${l}`;case"argb":return`#${l}${s}`;default:return`#${s}`}};ut.prototype.name=function(){const t=dc(this._rgb,"rgb");for(let n of Object.keys(Zr))if(Zr[n]===t)return n.toLowerCase();return t},Bt.format.named=t=>{if(t=t.toLowerCase(),Zr[t])return hc(Zr[t]);throw new Error("unknown color name: "+t)},Bt.autodetect.push({p:5,test:(t,...n)=>{if(!n.length&&qt(t)==="string"&&Zr[t.toLowerCase()])return"named"}}),ut.prototype.alpha=function(t,n=!1){return t!==void 0&&qt(t)==="number"?n?(this._rgb[3]=t,this):new ut([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},ut.prototype.clipped=function(){return this._rgb._clipped||!1};const Rn={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},Z0=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function qn(t){const n=Z0.get(String(t).toLowerCase());if(!n)throw new Error("unknown Lab illuminant "+t);Rn.labWhitePoint=t,Rn.Xn=n[0],Rn.Zn=n[1]}function Na(){return Rn.labWhitePoint}const bs=(...t)=>{t=Vt(t,"lab");const[n,e,r]=t,[a,i,o]=j0(n,e,r),[s,l,c]=gc(a,i,o);return[s,l,c,t.length>3?t[3]:1]},j0=(t,n,e)=>{const{kE:r,kK:a,kKE:i,Xn:o,Yn:s,Zn:l}=Rn,c=(t+16)/116,f=.002*n+c,h=c-.005*e,d=f*f*f,g=h*h*h,v=d>r?d:(116*f-16)/a,m=t>i?Math.pow((t+16)/116,3):t/a,b=g>r?g:(116*h-16)/a,x=v*o,A=m*s,w=b*l;return[x,A,w]},ys=t=>{const n=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*n},gc=(t,n,e)=>{const{MtxAdaptMa:r,MtxAdaptMaI:a,MtxXYZ2RGB:i,RefWhiteRGB:o,Xn:s,Yn:l,Zn:c}=Rn,f=s*r.m00+l*r.m10+c*r.m20,h=s*r.m01+l*r.m11+c*r.m21,d=s*r.m02+l*r.m12+c*r.m22,g=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,v=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,m=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,b=(t*r.m00+n*r.m10+e*r.m20)*(g/f),x=(t*r.m01+n*r.m11+e*r.m21)*(v/h),A=(t*r.m02+n*r.m12+e*r.m22)*(m/d),w=b*a.m00+x*a.m10+A*a.m20,S=b*a.m01+x*a.m11+A*a.m21,z=b*a.m02+x*a.m12+A*a.m22,Y=ys(w*i.m00+S*i.m10+z*i.m20),G=ys(w*i.m01+S*i.m11+z*i.m21),_=ys(w*i.m02+S*i.m12+z*i.m22);return[Y*255,G*255,_*255]},vs=(...t)=>{const[n,e,r,...a]=Vt(t,"rgb"),[i,o,s]=pc(n,e,r),[l,c,f]=K0(i,o,s);return[l,c,f,...a.length>0&&a[0]<1?[a[0]]:[]]};function K0(t,n,e){const{Xn:r,Yn:a,Zn:i,kE:o,kK:s}=Rn,l=t/r,c=n/a,f=e/i,h=l>o?Math.pow(l,1/3):(s*l+16)/116,d=c>o?Math.pow(c,1/3):(s*c+16)/116,g=f>o?Math.pow(f,1/3):(s*f+16)/116;return[116*d-16,500*(h-d),200*(d-g)]}function xs(t){const n=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*n}const pc=(t,n,e)=>{t=xs(t/255),n=xs(n/255),e=xs(e/255);const{MtxRGB2XYZ:r,MtxAdaptMa:a,MtxAdaptMaI:i,Xn:o,Yn:s,Zn:l,As:c,Bs:f,Cs:h}=Rn;let d=t*r.m00+n*r.m10+e*r.m20,g=t*r.m01+n*r.m11+e*r.m21,v=t*r.m02+n*r.m12+e*r.m22;const m=o*a.m00+s*a.m10+l*a.m20,b=o*a.m01+s*a.m11+l*a.m21,x=o*a.m02+s*a.m12+l*a.m22;let A=d*a.m00+g*a.m10+v*a.m20,w=d*a.m01+g*a.m11+v*a.m21,S=d*a.m02+g*a.m12+v*a.m22;return A*=m/c,w*=b/f,S*=x/h,d=A*i.m00+w*i.m10+S*i.m20,g=A*i.m01+w*i.m11+S*i.m21,v=A*i.m02+w*i.m12+S*i.m22,[d,g,v]};ut.prototype.lab=function(){return vs(this._rgb)},Object.assign(Ot,{lab:(...t)=>new ut(...t,"lab"),getLabWhitePoint:Na,setLabWhitePoint:qn}),Bt.format.lab=bs,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"lab"),qt(t)==="array"&&t.length===3)return"lab"}}),ut.prototype.darken=function(t=1){const n=this,e=n.lab();return e[0]-=Rn.Kn*t,new ut(e,"lab").alpha(n.alpha(),!0)},ut.prototype.brighten=function(t=1){return this.darken(-t)},ut.prototype.darker=ut.prototype.darken,ut.prototype.brighter=ut.prototype.brighten,ut.prototype.get=function(t){const[n,e]=t.split("."),r=this[n]();if(e){const a=n.indexOf(e)-(n.substr(0,2)==="ok"?2:0);if(a>-1)return r[a];throw new Error(`unknown channel ${e} in mode ${n}`)}else return r};const{pow:J0}=Math,Q0=1e-7,tg=20;ut.prototype.luminance=function(t,n="rgb"){if(t!==void 0&&qt(t)==="number"){if(t===0)return new ut([0,0,0,this._rgb[3]],"rgb");if(t===1)return new ut([255,255,255,this._rgb[3]],"rgb");let e=this.luminance(),r=tg;const a=(o,s)=>{const l=o.interpolate(s,.5,n),c=l.luminance();return Math.abs(t-c)<Q0||!r--?l:c>t?a(o,l):a(l,s)},i=(e>t?a(new ut([0,0,0]),this):a(this,new ut([255,255,255]))).rgb();return new ut([...i,this._rgb[3]])}return eg(...this._rgb.slice(0,3))};const eg=(t,n,e)=>(t=ws(t),n=ws(n),e=ws(e),.2126*t+.7152*n+.0722*e),ws=t=>(t/=255,t<=.03928?t/12.92:J0((t+.055)/1.055,2.4)),ye={},jr=(t,n,e=.5,...r)=>{let a=r[0]||"lrgb";if(!ye[a]&&!r.length&&(a=Object.keys(ye)[0]),!ye[a])throw new Error(`interpolation mode ${a} is not defined`);return qt(t)!=="object"&&(t=new ut(t)),qt(n)!=="object"&&(n=new ut(n)),ye[a](t,n,e).alpha(t.alpha()+e*(n.alpha()-t.alpha()))};ut.prototype.mix=ut.prototype.interpolate=function(t,n=.5,...e){return jr(this,t,n,...e)},ut.prototype.premultiply=function(t=!1){const n=this._rgb,e=n[3];return t?(this._rgb=[n[0]*e,n[1]*e,n[2]*e,e],this):new ut([n[0]*e,n[1]*e,n[2]*e,e],"rgb")};const{sin:ng,cos:rg}=Math,mc=(...t)=>{let[n,e,r]=Vt(t,"lch");return isNaN(r)&&(r=0),r=r*W0,[n,rg(r)*e,ng(r)*e]},As=(...t)=>{t=Vt(t,"lch");const[n,e,r]=t,[a,i,o]=mc(n,e,r),[s,l,c]=bs(a,i,o);return[s,l,c,t.length>3?t[3]:1]},ag=(...t)=>{const n=uc(Vt(t,"hcl"));return As(...n)},{sqrt:ig,atan2:og,round:sg}=Math,bc=(...t)=>{const[n,e,r]=Vt(t,"lab"),a=ig(e*e+r*r);let i=(og(r,e)*G0+360)%360;return sg(a*1e4)===0&&(i=Number.NaN),[n,a,i]},_s=(...t)=>{const[n,e,r,...a]=Vt(t,"rgb"),[i,o,s]=vs(n,e,r),[l,c,f]=bc(i,o,s);return[l,c,f,...a.length>0&&a[0]<1?[a[0]]:[]]};ut.prototype.lch=function(){return _s(this._rgb)},ut.prototype.hcl=function(){return uc(_s(this._rgb))},Object.assign(Ot,{lch:(...t)=>new ut(...t,"lch"),hcl:(...t)=>new ut(...t,"hcl")}),Bt.format.lch=As,Bt.format.hcl=ag,["lch","hcl"].forEach(t=>Bt.autodetect.push({p:2,test:(...n)=>{if(n=Vt(n,t),qt(n)==="array"&&n.length===3)return t}})),ut.prototype.saturate=function(t=1){const n=this,e=n.lch();return e[1]+=Rn.Kn*t,e[1]<0&&(e[1]=0),new ut(e,"lch").alpha(n.alpha(),!0)},ut.prototype.desaturate=function(t=1){return this.saturate(-t)},ut.prototype.set=function(t,n,e=!1){const[r,a]=t.split("."),i=this[r]();if(a){const o=r.indexOf(a)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(qt(n)=="string")switch(n.charAt(0)){case"+":i[o]+=+n;break;case"-":i[o]+=+n;break;case"*":i[o]*=+n.substr(1);break;case"/":i[o]/=+n.substr(1);break;default:i[o]=+n}else if(qt(n)==="number")i[o]=n;else throw new Error("unsupported value for Color.set");const s=new ut(i,r);return e?(this._rgb=s._rgb,this):s}throw new Error(`unknown channel ${a} in mode ${r}`)}else return i},ut.prototype.tint=function(t=.5,...n){return jr(this,"white",t,...n)},ut.prototype.shade=function(t=.5,...n){return jr(this,"black",t,...n)};const lg=(t,n,e)=>{const r=t._rgb,a=n._rgb;return new ut(r[0]+e*(a[0]-r[0]),r[1]+e*(a[1]-r[1]),r[2]+e*(a[2]-r[2]),"rgb")};ye.rgb=lg;const{sqrt:ks,pow:Kr}=Math,cg=(t,n,e)=>{const[r,a,i]=t._rgb,[o,s,l]=n._rgb;return new ut(ks(Kr(r,2)*(1-e)+Kr(o,2)*e),ks(Kr(a,2)*(1-e)+Kr(s,2)*e),ks(Kr(i,2)*(1-e)+Kr(l,2)*e),"rgb")};ye.lrgb=cg;const fg=(t,n,e)=>{const r=t.lab(),a=n.lab();return new ut(r[0]+e*(a[0]-r[0]),r[1]+e*(a[1]-r[1]),r[2]+e*(a[2]-r[2]),"lab")};ye.lab=fg;const Jr=(t,n,e,r)=>{let a,i;r==="hsl"?(a=t.hsl(),i=n.hsl()):r==="hsv"?(a=t.hsv(),i=n.hsv()):r==="hcg"?(a=t.hcg(),i=n.hcg()):r==="hsi"?(a=t.hsi(),i=n.hsi()):r==="lch"||r==="hcl"?(r="hcl",a=t.hcl(),i=n.hcl()):r==="oklch"&&(a=t.oklch().reverse(),i=n.oklch().reverse());let o,s,l,c,f,h;(r.substr(0,1)==="h"||r==="oklch")&&([o,l,f]=a,[s,c,h]=i);let d,g,v,m;return!isNaN(o)&&!isNaN(s)?(s>o&&s-o>180?m=s-(o+360):s<o&&o-s>180?m=s+360-o:m=s-o,g=o+e*m):isNaN(o)?isNaN(s)?g=Number.NaN:(g=s,(f==1||f==0)&&r!="hsv"&&(d=c)):(g=o,(h==1||h==0)&&r!="hsv"&&(d=l)),d===void 0&&(d=l+e*(c-l)),v=f+e*(h-f),r==="oklch"?new ut([v,d,g],r):new ut([g,d,v],r)},yc=(t,n,e)=>Jr(t,n,e,"lch");ye.lch=yc,ye.hcl=yc;const ug=t=>{if(qt(t)=="number"&&t>=0&&t<=16777215){const n=t>>16,e=t>>8&255,r=t&255;return[n,e,r,1]}throw new Error("unknown num color: "+t)},hg=(...t)=>{const[n,e,r]=Vt(t,"rgb");return(n<<16)+(e<<8)+r};ut.prototype.num=function(){return hg(this._rgb)},Object.assign(Ot,{num:(...t)=>new ut(...t,"num")}),Bt.format.num=ug,Bt.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&qt(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const dg=(t,n,e)=>{const r=t.num(),a=n.num();return new ut(r+e*(a-r),"num")};ye.num=dg;const{floor:gg}=Math,pg=(...t)=>{t=Vt(t,"hcg");let[n,e,r]=t,a,i,o;r=r*255;const s=e*255;if(e===0)a=i=o=r;else{n===360&&(n=0),n>360&&(n-=360),n<0&&(n+=360),n/=60;const l=gg(n),c=n-l,f=r*(1-e),h=f+s*(1-c),d=f+s*c,g=f+s;switch(l){case 0:[a,i,o]=[g,d,f];break;case 1:[a,i,o]=[h,g,f];break;case 2:[a,i,o]=[f,g,d];break;case 3:[a,i,o]=[f,h,g];break;case 4:[a,i,o]=[d,f,g];break;case 5:[a,i,o]=[g,f,h];break}}return[a,i,o,t.length>3?t[3]:1]},mg=(...t)=>{const[n,e,r]=Vt(t,"rgb"),a=cc(n,e,r),i=fc(n,e,r),o=i-a,s=o*100/255,l=a/(255-o)*100;let c;return o===0?c=Number.NaN:(n===i&&(c=(e-r)/o),e===i&&(c=2+(r-n)/o),r===i&&(c=4+(n-e)/o),c*=60,c<0&&(c+=360)),[c,s,l]};ut.prototype.hcg=function(){return mg(this._rgb)};const bg=(...t)=>new ut(...t,"hcg");Ot.hcg=bg,Bt.format.hcg=pg,Bt.autodetect.push({p:1,test:(...t)=>{if(t=Vt(t,"hcg"),qt(t)==="array"&&t.length===3)return"hcg"}});const yg=(t,n,e)=>Jr(t,n,e,"hcg");ye.hcg=yg;const{cos:Qr}=Math,vg=(...t)=>{t=Vt(t,"hsi");let[n,e,r]=t,a,i,o;return isNaN(n)&&(n=0),isNaN(e)&&(e=0),n>360&&(n-=360),n<0&&(n+=360),n/=360,n<1/3?(o=(1-e)/3,a=(1+e*Qr(Gn*n)/Qr(ms-Gn*n))/3,i=1-(o+a)):n<2/3?(n-=1/3,a=(1-e)/3,i=(1+e*Qr(Gn*n)/Qr(ms-Gn*n))/3,o=1-(a+i)):(n-=2/3,i=(1-e)/3,o=(1+e*Qr(Gn*n)/Qr(ms-Gn*n))/3,a=1-(i+o)),a=_r(r*a*3),i=_r(r*i*3),o=_r(r*o*3),[a*255,i*255,o*255,t.length>3?t[3]:1]},{min:xg,sqrt:wg,acos:Ag}=Math,_g=(...t)=>{let[n,e,r]=Vt(t,"rgb");n/=255,e/=255,r/=255;let a;const i=xg(n,e,r),o=(n+e+r)/3,s=o>0?1-i/o:0;return s===0?a=NaN:(a=(n-e+(n-r))/2,a/=wg((n-e)*(n-e)+(n-r)*(e-r)),a=Ag(a),r>e&&(a=Gn-a),a/=Gn),[a*360,s,o]};ut.prototype.hsi=function(){return _g(this._rgb)};const kg=(...t)=>new ut(...t,"hsi");Ot.hsi=kg,Bt.format.hsi=vg,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"hsi"),qt(t)==="array"&&t.length===3)return"hsi"}});const Sg=(t,n,e)=>Jr(t,n,e,"hsi");ye.hsi=Sg;const Ss=(...t)=>{t=Vt(t,"hsl");const[n,e,r]=t;let a,i,o;if(e===0)a=i=o=r*255;else{const s=[0,0,0],l=[0,0,0],c=r<.5?r*(1+e):r+e-r*e,f=2*r-c,h=n/360;s[0]=h+1/3,s[1]=h,s[2]=h-1/3;for(let d=0;d<3;d++)s[d]<0&&(s[d]+=1),s[d]>1&&(s[d]-=1),6*s[d]<1?l[d]=f+(c-f)*6*s[d]:2*s[d]<1?l[d]=c:3*s[d]<2?l[d]=f+(c-f)*(2/3-s[d])*6:l[d]=f;[a,i,o]=[l[0]*255,l[1]*255,l[2]*255]}return t.length>3?[a,i,o,t[3]]:[a,i,o,1]},vc=(...t)=>{t=Vt(t,"rgba");let[n,e,r]=t;n/=255,e/=255,r/=255;const a=cc(n,e,r),i=fc(n,e,r),o=(i+a)/2;let s,l;return i===a?(s=0,l=Number.NaN):s=o<.5?(i-a)/(i+a):(i-a)/(2-i-a),n==i?l=(e-r)/(i-a):e==i?l=2+(r-n)/(i-a):r==i&&(l=4+(n-e)/(i-a)),l*=60,l<0&&(l+=360),t.length>3&&t[3]!==void 0?[l,s,o,t[3]]:[l,s,o]};ut.prototype.hsl=function(){return vc(this._rgb)};const Mg=(...t)=>new ut(...t,"hsl");Ot.hsl=Mg,Bt.format.hsl=Ss,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"hsl"),qt(t)==="array"&&t.length===3)return"hsl"}});const $g=(t,n,e)=>Jr(t,n,e,"hsl");ye.hsl=$g;const{floor:Lg}=Math,Cg=(...t)=>{t=Vt(t,"hsv");let[n,e,r]=t,a,i,o;if(r*=255,e===0)a=i=o=r;else{n===360&&(n=0),n>360&&(n-=360),n<0&&(n+=360),n/=60;const s=Lg(n),l=n-s,c=r*(1-e),f=r*(1-e*l),h=r*(1-e*(1-l));switch(s){case 0:[a,i,o]=[r,h,c];break;case 1:[a,i,o]=[f,r,c];break;case 2:[a,i,o]=[c,r,h];break;case 3:[a,i,o]=[c,f,r];break;case 4:[a,i,o]=[h,c,r];break;case 5:[a,i,o]=[r,c,f];break}}return[a,i,o,t.length>3?t[3]:1]},{min:Tg,max:Og}=Math,Ng=(...t)=>{t=Vt(t,"rgb");let[n,e,r]=t;const a=Tg(n,e,r),i=Og(n,e,r),o=i-a;let s,l,c;return c=i/255,i===0?(s=Number.NaN,l=0):(l=o/i,n===i&&(s=(e-r)/o),e===i&&(s=2+(r-n)/o),r===i&&(s=4+(n-e)/o),s*=60,s<0&&(s+=360)),[s,l,c]};ut.prototype.hsv=function(){return Ng(this._rgb)};const Eg=(...t)=>new ut(...t,"hsv");Ot.hsv=Eg,Bt.format.hsv=Cg,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"hsv"),qt(t)==="array"&&t.length===3)return"hsv"}});const Dg=(t,n,e)=>Jr(t,n,e,"hsv");ye.hsv=Dg;function yi(t,n){let e=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(n[0])||(n=n.map(o=>[o]));let r=n[0].length,a=n[0].map((o,s)=>n.map(l=>l[s])),i=t.map(o=>a.map(s=>Array.isArray(o)?o.reduce((l,c,f)=>l+c*(s[f]||0),0):s.reduce((l,c)=>l+c*o,0)));return e===1&&(i=i[0]),r===1?i.map(o=>o[0]):i}const Ms=(...t)=>{t=Vt(t,"lab");const[n,e,r,...a]=t,[i,o,s]=Pg([n,e,r]),[l,c,f]=gc(i,o,s);return[l,c,f,...a.length>0&&a[0]<1?[a[0]]:[]]};function Pg(t){var n=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],e=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=yi(e,t);return yi(n,r.map(a=>a**3))}const $s=(...t)=>{const[n,e,r,...a]=Vt(t,"rgb"),i=pc(n,e,r);return[...zg(i),...a.length>0&&a[0]<1?[a[0]]:[]]};function zg(t){const n=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=yi(n,t);return yi(e,r.map(a=>Math.cbrt(a)))}ut.prototype.oklab=function(){return $s(this._rgb)},Object.assign(Ot,{oklab:(...t)=>new ut(...t,"oklab")}),Bt.format.oklab=Ms,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"oklab"),qt(t)==="array"&&t.length===3)return"oklab"}});const Rg=(t,n,e)=>{const r=t.oklab(),a=n.oklab();return new ut(r[0]+e*(a[0]-r[0]),r[1]+e*(a[1]-r[1]),r[2]+e*(a[2]-r[2]),"oklab")};ye.oklab=Rg;const Fg=(t,n,e)=>Jr(t,n,e,"oklch");ye.oklch=Fg;const{pow:Ls,sqrt:Cs,PI:Ts,cos:xc,sin:wc,atan2:Yg}=Math,Ig=(t,n="lrgb",e=null)=>{const r=t.length;e||(e=Array.from(new Array(r)).map(()=>1));const a=r/e.reduce(function(h,d){return h+d});if(e.forEach((h,d)=>{e[d]*=a}),t=t.map(h=>new ut(h)),n==="lrgb")return Hg(t,e);const i=t.shift(),o=i.get(n),s=[];let l=0,c=0;for(let h=0;h<o.length;h++)if(o[h]=(o[h]||0)*e[0],s.push(isNaN(o[h])?0:e[0]),n.charAt(h)==="h"&&!isNaN(o[h])){const d=o[h]/180*Ts;l+=xc(d)*e[0],c+=wc(d)*e[0]}let f=i.alpha()*e[0];t.forEach((h,d)=>{const g=h.get(n);f+=h.alpha()*e[d+1];for(let v=0;v<o.length;v++)if(!isNaN(g[v]))if(s[v]+=e[d+1],n.charAt(v)==="h"){const m=g[v]/180*Ts;l+=xc(m)*e[d+1],c+=wc(m)*e[d+1]}else o[v]+=g[v]*e[d+1]});for(let h=0;h<o.length;h++)if(n.charAt(h)==="h"){let d=Yg(c/s[h],l/s[h])/Ts*180;for(;d<0;)d+=360;for(;d>=360;)d-=360;o[h]=d}else o[h]=o[h]/s[h];return f/=r,new ut(o,n).alpha(f>.99999?1:f,!0)},Hg=(t,n)=>{const e=t.length,r=[0,0,0,0];for(let a=0;a<t.length;a++){const i=t[a],o=n[a]/e,s=i._rgb;r[0]+=Ls(s[0],2)*o,r[1]+=Ls(s[1],2)*o,r[2]+=Ls(s[2],2)*o,r[3]+=s[3]*o}return r[0]=Cs(r[0]),r[1]=Cs(r[1]),r[2]=Cs(r[2]),r[3]>.9999999&&(r[3]=1),new ut(gs(r))},{pow:Bg}=Math;function vi(t){let n="rgb",e=Ot("#ccc"),r=0,a=[0,1],i=[0,1],o=[],s=[0,0],l=!1,c=[],f=!1,h=0,d=1,g=!1,v={},m=!0,b=1;const x=function(_){if(_=_||["#fff","#000"],_&&qt(_)==="string"&&Ot.brewer&&Ot.brewer[_.toLowerCase()]&&(_=Ot.brewer[_.toLowerCase()]),qt(_)==="array"){_.length===1&&(_=[_[0],_[0]]),_=_.slice(0);for(let B=0;B<_.length;B++)_[B]=Ot(_[B]);o.length=0;for(let B=0;B<_.length;B++)o.push(B/(_.length-1))}return Y(),c=_},A=function(_){if(l!=null){const B=l.length-1;let P=0;for(;P<B&&_>=l[P];)P++;return P-1}return 0};let w=_=>_,S=_=>_;const z=function(_,B){let P,$;if(B==null&&(B=!1),isNaN(_)||_===null)return e;B?$=_:l&&l.length>2?$=A(_)/(l.length-2):d!==h?$=(_-h)/(d-h):$=1,$=S($),B||($=w($)),b!==1&&($=Bg($,b)),$=s[0]+$*(1-s[0]-s[1]),$=_r($,0,1);const N=Math.floor($*1e4);if(m&&v[N])P=v[N];else{if(qt(c)==="array")for(let L=0;L<o.length;L++){const M=o[L];if($<=M){P=c[L];break}if($>=M&&L===o.length-1){P=c[L];break}if($>M&&$<o[L+1]){$=($-M)/(o[L+1]-M),P=Ot.interpolate(c[L],c[L+1],$,n);break}}else qt(c)==="function"&&(P=c($));m&&(v[N]=P)}return P};var Y=()=>v={};x(t);const G=function(_){const B=Ot(z(_));return f&&B[f]?B[f]():B};return G.classes=function(_){if(_!=null){if(qt(_)==="array")l=_,a=[_[0],_[_.length-1]];else{const B=Ot.analyze(a);_===0?l=[B.min,B.max]:l=Ot.limits(B,"e",_)}return G}return l},G.domain=function(_){if(!arguments.length)return i;i=_.slice(0),h=_[0],d=_[_.length-1],o=[];const B=c.length;if(_.length===B&&h!==d)for(let P of Array.from(_))o.push((P-h)/(d-h));else{for(let P=0;P<B;P++)o.push(P/(B-1));if(_.length>2){const P=_.map((N,L)=>L/(_.length-1)),$=_.map(N=>(N-h)/(d-h));$.every((N,L)=>P[L]===N)||(S=N=>{if(N<=0||N>=1)return N;let L=0;for(;N>=$[L+1];)L++;const M=(N-$[L])/($[L+1]-$[L]);return P[L]+M*(P[L+1]-P[L])})}}return a=[h,d],G},G.mode=function(_){return arguments.length?(n=_,Y(),G):n},G.range=function(_,B){return x(_),G},G.out=function(_){return f=_,G},G.spread=function(_){return arguments.length?(r=_,G):r},G.correctLightness=function(_){return _==null&&(_=!0),g=_,Y(),g?w=function(B){const P=z(0,!0).lab()[0],$=z(1,!0).lab()[0],N=P>$;let L=z(B,!0).lab()[0];const M=P+($-P)*B;let D=L-M,q=0,V=1,C=20;for(;Math.abs(D)>.01&&C-- >0;)(function(){return N&&(D*=-1),D<0?(q=B,B+=(V-B)*.5):(V=B,B+=(q-B)*.5),L=z(B,!0).lab()[0],D=L-M})();return B}:w=B=>B,G},G.padding=function(_){return _!=null?(qt(_)==="number"&&(_=[_,_]),s=_,G):s},G.colors=function(_,B){arguments.length<2&&(B="hex");let P=[];if(arguments.length===0)P=c.slice(0);else if(_===1)P=[G(.5)];else if(_>1){const $=a[0],N=a[1]-$;P=Vg(0,_).map(L=>G($+L/(_-1)*N))}else{t=[];let $=[];if(l&&l.length>2)for(let N=1,L=l.length,M=1<=L;M?N<L:N>L;M?N++:N--)$.push((l[N-1]+l[N])*.5);else $=a;P=$.map(N=>G(N))}return Ot[B]&&(P=P.map($=>$[B]())),P},G.cache=function(_){return _!=null?(m=_,G):m},G.gamma=function(_){return _!=null?(b=_,G):b},G.nodata=function(_){return _!=null?(e=Ot(_),G):e},G}function Vg(t,n,e){let r=[],a=t<n,i=n;for(let o=t;a?o<i:o>i;a?o++:o--)r.push(o);return r}const Wg=function(t){let n=[1,1];for(let e=1;e<t;e++){let r=[1];for(let a=1;a<=n.length;a++)r[a]=(n[a]||0)+n[a-1];n=r}return n},Gg=function(t){let n,e,r,a;if(t=t.map(i=>new ut(i)),t.length===2)[e,r]=t.map(i=>i.lab()),n=function(i){const o=[0,1,2].map(s=>e[s]+i*(r[s]-e[s]));return new ut(o,"lab")};else if(t.length===3)[e,r,a]=t.map(i=>i.lab()),n=function(i){const o=[0,1,2].map(s=>(1-i)*(1-i)*e[s]+2*(1-i)*i*r[s]+i*i*a[s]);return new ut(o,"lab")};else if(t.length===4){let i;[e,r,a,i]=t.map(o=>o.lab()),n=function(o){const s=[0,1,2].map(l=>(1-o)*(1-o)*(1-o)*e[l]+3*(1-o)*(1-o)*o*r[l]+3*(1-o)*o*o*a[l]+o*o*o*i[l]);return new ut(s,"lab")}}else if(t.length>=5){let i,o,s;i=t.map(l=>l.lab()),s=t.length-1,o=Wg(s),n=function(l){const c=1-l,f=[0,1,2].map(h=>i.reduce((d,g,v)=>d+o[v]*c**(s-v)*l**v*g[h],0));return new ut(f,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return n},qg=t=>{const n=Gg(t);return n.scale=()=>vi(n),n},{round:Ac}=Math;ut.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Ac)},ut.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((n,e)=>e<3?t===!1?n:Ac(n):n)},Object.assign(Ot,{rgb:(...t)=>new ut(...t,"rgb")}),Bt.format.rgb=(...t)=>{const n=Vt(t,"rgba");return n[3]===void 0&&(n[3]=1),n},Bt.autodetect.push({p:3,test:(...t)=>{if(t=Vt(t,"rgba"),qt(t)==="array"&&(t.length===3||t.length===4&&qt(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const xn=(t,n,e)=>{if(!xn[e])throw new Error("unknown blend mode "+e);return xn[e](t,n)},sr=t=>(n,e)=>{const r=Ot(e).rgb(),a=Ot(n).rgb();return Ot.rgb(t(r,a))},lr=t=>(n,e)=>{const r=[];return r[0]=t(n[0],e[0]),r[1]=t(n[1],e[1]),r[2]=t(n[2],e[2]),r},Xg=t=>t,Ug=(t,n)=>t*n/255,Zg=(t,n)=>t>n?n:t,jg=(t,n)=>t>n?t:n,Kg=(t,n)=>255*(1-(1-t/255)*(1-n/255)),Jg=(t,n)=>n<128?2*t*n/255:255*(1-2*(1-t/255)*(1-n/255)),Qg=(t,n)=>255*(1-(1-n/255)/(t/255)),tp=(t,n)=>t===255?255:(t=255*(n/255)/(1-t/255),t>255?255:t);xn.normal=sr(lr(Xg)),xn.multiply=sr(lr(Ug)),xn.screen=sr(lr(Kg)),xn.overlay=sr(lr(Jg)),xn.darken=sr(lr(Zg)),xn.lighten=sr(lr(jg)),xn.dodge=sr(lr(tp)),xn.burn=sr(lr(Qg));const{pow:ep,sin:np,cos:rp}=Math;function ap(t=300,n=-1.5,e=1,r=1,a=[0,1]){let i=0,o;qt(a)==="array"?o=a[1]-a[0]:(o=0,a=[a,a]);const s=function(l){const c=Gn*((t+120)/360+n*l),f=ep(a[0]+o*l,r),d=(i!==0?e[0]+l*i:e)*f*(1-f)/2,g=rp(c),v=np(c),m=f+d*(-.14861*g+1.78277*v),b=f+d*(-.29227*g-.90649*v),x=f+d*(1.97294*g);return Ot(gs([m*255,b*255,x*255,1]))};return s.start=function(l){return l==null?t:(t=l,s)},s.rotations=function(l){return l==null?n:(n=l,s)},s.gamma=function(l){return l==null?r:(r=l,s)},s.hue=function(l){return l==null?e:(e=l,qt(e)==="array"?(i=e[1]-e[0],i===0&&(e=e[1])):i=0,s)},s.lightness=function(l){return l==null?a:(qt(l)==="array"?(a=l,o=l[1]-l[0]):(a=[l,l],o=0),s)},s.scale=()=>Ot.scale(s),s.hue(e),s}const ip="0123456789abcdef",{floor:op,random:sp}=Math,lp=(t=sp)=>{let n="#";for(let e=0;e<6;e++)n+=ip.charAt(op(t()*16));return new ut(n,"hex")},{log:_c,pow:cp,floor:fp,abs:up}=Math;function kc(t,n=null){const e={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return qt(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{n&&qt(r)==="object"&&(r=r[n]),r!=null&&!isNaN(r)&&(e.values.push(r),e.sum+=r,r<e.min&&(e.min=r),r>e.max&&(e.max=r),e.count+=1)}),e.domain=[e.min,e.max],e.limits=(r,a)=>Sc(e,r,a),e}function Sc(t,n="equal",e=7){qt(t)=="array"&&(t=kc(t));const{min:r,max:a}=t,i=t.values.sort((s,l)=>s-l);if(e===1)return[r,a];const o=[];if(n.substr(0,1)==="c"&&(o.push(r),o.push(a)),n.substr(0,1)==="e"){o.push(r);for(let s=1;s<e;s++)o.push(r+s/e*(a-r));o.push(a)}else if(n.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const s=Math.LOG10E*_c(r),l=Math.LOG10E*_c(a);o.push(r);for(let c=1;c<e;c++)o.push(cp(10,s+c/e*(l-s)));o.push(a)}else if(n.substr(0,1)==="q"){o.push(r);for(let s=1;s<e;s++){const l=(i.length-1)*s/e,c=fp(l);if(c===l)o.push(i[c]);else{const f=l-c;o.push(i[c]*(1-f)+i[c+1]*f)}}o.push(a)}else if(n.substr(0,1)==="k"){let s;const l=i.length,c=new Array(l),f=new Array(e);let h=!0,d=0,g=null;g=[],g.push(r);for(let b=1;b<e;b++)g.push(r+b/e*(a-r));for(g.push(a);h;){for(let x=0;x<e;x++)f[x]=0;for(let x=0;x<l;x++){const A=i[x];let w=Number.MAX_VALUE,S;for(let z=0;z<e;z++){const Y=up(g[z]-A);Y<w&&(w=Y,S=z),f[S]++,c[x]=S}}const b=new Array(e);for(let x=0;x<e;x++)b[x]=null;for(let x=0;x<l;x++)s=c[x],b[s]===null?b[s]=i[x]:b[s]+=i[x];for(let x=0;x<e;x++)b[x]*=1/f[x];h=!1;for(let x=0;x<e;x++)if(b[x]!==g[x]){h=!0;break}g=b,d++,d>200&&(h=!1)}const v={};for(let b=0;b<e;b++)v[b]=[];for(let b=0;b<l;b++)s=c[b],v[s].push(i[b]);let m=[];for(let b=0;b<e;b++)m.push(v[b][0]),m.push(v[b][v[b].length-1]);m=m.sort((b,x)=>b-x),o.push(m[0]);for(let b=1;b<m.length;b+=2){const x=m[b];!isNaN(x)&&o.indexOf(x)===-1&&o.push(x)}}return o}const hp=(t,n)=>{t=new ut(t),n=new ut(n);const e=t.luminance(),r=n.luminance();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)};/**
|
|
237
|
-
* @license
|
|
238
|
-
|
|
239
|
-
* The APCA contrast prediction algorithm is based of the formulas published
|
|
240
|
-
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
241
|
-
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
242
|
-
*
|
|
243
|
-
* Note that the APCA implementation is still beta, so please update to
|
|
244
|
-
* future versions of chroma.js when they become available.
|
|
245
|
-
*
|
|
246
|
-
* You can read more about the APCA Readability Criterion at
|
|
247
|
-
* https://readtech.org/ARC/
|
|
248
|
-
*/const Mc=.027,dp=5e-4,gp=.1,$c=1.14,xi=.022,Lc=1.414,pp=(t,n)=>{t=new ut(t),n=new ut(n),t.alpha()<1&&(t=jr(n,t,t.alpha(),"rgb"));const e=Cc(...t.rgb()),r=Cc(...n.rgb()),a=e>=xi?e:e+Math.pow(xi-e,Lc),i=r>=xi?r:r+Math.pow(xi-r,Lc),o=Math.pow(i,.56)-Math.pow(a,.57),s=Math.pow(i,.65)-Math.pow(a,.62),l=Math.abs(i-a)<dp?0:a<i?o*$c:s*$c;return(Math.abs(l)<gp?0:l>0?l-Mc:l+Mc)*100};function Cc(t,n,e){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(n/255,2.4)+.072175*Math.pow(e/255,2.4)}const{sqrt:Xn,pow:se,min:mp,max:bp,atan2:Tc,abs:Oc,cos:wi,sin:Nc,exp:yp,PI:Ec}=Math;function vp(t,n,e=1,r=1,a=1){var i=function(ct){return 360*ct/(2*Ec)},o=function(ct){return 2*Ec*ct/360};t=new ut(t),n=new ut(n);const[s,l,c]=Array.from(t.lab()),[f,h,d]=Array.from(n.lab()),g=(s+f)/2,v=Xn(se(l,2)+se(c,2)),m=Xn(se(h,2)+se(d,2)),b=(v+m)/2,x=.5*(1-Xn(se(b,7)/(se(b,7)+se(25,7)))),A=l*(1+x),w=h*(1+x),S=Xn(se(A,2)+se(c,2)),z=Xn(se(w,2)+se(d,2)),Y=(S+z)/2,G=i(Tc(c,A)),_=i(Tc(d,w)),B=G>=0?G:G+360,P=_>=0?_:_+360,$=Oc(B-P)>180?(B+P+360)/2:(B+P)/2,N=1-.17*wi(o($-30))+.24*wi(o(2*$))+.32*wi(o(3*$+6))-.2*wi(o(4*$-63));let L=P-B;L=Oc(L)<=180?L:P<=B?L+360:L-360,L=2*Xn(S*z)*Nc(o(L)/2);const M=f-s,D=z-S,q=1+.015*se(g-50,2)/Xn(20+se(g-50,2)),V=1+.045*Y,C=1+.015*Y*N,I=30*yp(-se(($-275)/25,2)),it=-(2*Xn(se(Y,7)/(se(Y,7)+se(25,7))))*Nc(2*o(I)),rt=Xn(se(M/(e*q),2)+se(D/(r*V),2)+se(L/(a*C),2)+it*(D/(r*V))*(L/(a*C)));return bp(0,mp(100,rt))}function xp(t,n,e="lab"){t=new ut(t),n=new ut(n);const r=t.get(e),a=n.get(e);let i=0;for(let o in r){const s=(r[o]||0)-(a[o]||0);i+=s*s}return Math.sqrt(i)}const wp=(...t)=>{try{return new ut(...t),!0}catch{return!1}},Ap={cool(){return vi([Ot.hsl(180,1,.9),Ot.hsl(250,.7,.4)])},hot(){return vi(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Os={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Dc=Object.keys(Os),Pc=new Map(Dc.map(t=>[t.toLowerCase(),t])),_p=typeof Proxy=="function"?new Proxy(Os,{get(t,n){const e=n.toLowerCase();if(Pc.has(e))return t[Pc.get(e)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Dc)}}):Os,kp=(...t)=>{t=Vt(t,"cmyk");const[n,e,r,a]=t,i=t.length>4?t[4]:1;return a===1?[0,0,0,i]:[n>=1?0:255*(1-n)*(1-a),e>=1?0:255*(1-e)*(1-a),r>=1?0:255*(1-r)*(1-a),i]},{max:zc}=Math,Sp=(...t)=>{let[n,e,r]=Vt(t,"rgb");n=n/255,e=e/255,r=r/255;const a=1-zc(n,zc(e,r)),i=a<1?1/(1-a):0,o=(1-n-a)*i,s=(1-e-a)*i,l=(1-r-a)*i;return[o,s,l,a]};ut.prototype.cmyk=function(){return Sp(this._rgb)},Object.assign(Ot,{cmyk:(...t)=>new ut(...t,"cmyk")}),Bt.format.cmyk=kp,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"cmyk"),qt(t)==="array"&&t.length===4)return"cmyk"}});const Mp=(...t)=>{const n=Vt(t,"hsla");let e=Ur(t)||"lsa";return n[0]=fn(n[0]||0)+"deg",n[1]=fn(n[1]*100)+"%",n[2]=fn(n[2]*100)+"%",e==="hsla"||n.length>3&&n[3]<1?(n[3]="/ "+(n.length>3?n[3]:1),e="hsla"):n.length=3,`${e.substr(0,3)}(${n.join(" ")})`},$p=(...t)=>{const n=Vt(t,"lab");let e=Ur(t)||"lab";return n[0]=fn(n[0])+"%",n[1]=fn(n[1]),n[2]=fn(n[2]),e==="laba"||n.length>3&&n[3]<1?n[3]="/ "+(n.length>3?n[3]:1):n.length=3,`lab(${n.join(" ")})`},Lp=(...t)=>{const n=Vt(t,"lch");let e=Ur(t)||"lab";return n[0]=fn(n[0])+"%",n[1]=fn(n[1]),n[2]=isNaN(n[2])?"none":fn(n[2])+"deg",e==="lcha"||n.length>3&&n[3]<1?n[3]="/ "+(n.length>3?n[3]:1):n.length=3,`lch(${n.join(" ")})`},Cp=(...t)=>{const n=Vt(t,"lab");return n[0]=fn(n[0]*100)+"%",n[1]=ps(n[1]),n[2]=ps(n[2]),n.length>3&&n[3]<1?n[3]="/ "+(n.length>3?n[3]:1):n.length=3,`oklab(${n.join(" ")})`},Rc=(...t)=>{const[n,e,r,...a]=Vt(t,"rgb"),[i,o,s]=$s(n,e,r),[l,c,f]=bc(i,o,s);return[l,c,f,...a.length>0&&a[0]<1?[a[0]]:[]]},Tp=(...t)=>{const n=Vt(t,"lch");return n[0]=fn(n[0]*100)+"%",n[1]=ps(n[1]),n[2]=isNaN(n[2])?"none":fn(n[2])+"deg",n.length>3&&n[3]<1?n[3]="/ "+(n.length>3?n[3]:1):n.length=3,`oklch(${n.join(" ")})`},{round:Ns}=Math,Op=(...t)=>{const n=Vt(t,"rgba");let e=Ur(t)||"rgb";if(e.substr(0,3)==="hsl")return Mp(vc(n),e);if(e.substr(0,3)==="lab"){const r=Na();qn("d50");const a=$p(vs(n),e);return qn(r),a}if(e.substr(0,3)==="lch"){const r=Na();qn("d50");const a=Lp(_s(n),e);return qn(r),a}return e.substr(0,5)==="oklab"?Cp($s(n)):e.substr(0,5)==="oklch"?Tp(Rc(n)):(n[0]=Ns(n[0]),n[1]=Ns(n[1]),n[2]=Ns(n[2]),(e==="rgba"||n.length>3&&n[3]<1)&&(n[3]="/ "+(n.length>3?n[3]:1),e="rgba"),`${e.substr(0,3)}(${n.slice(0,e==="rgb"?3:4).join(" ")})`)},Fc=(...t)=>{t=Vt(t,"lch");const[n,e,r,...a]=t,[i,o,s]=mc(n,e,r),[l,c,f]=Ms(i,o,s);return[l,c,f,...a.length>0&&a[0]<1?[a[0]]:[]]},Un=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,wn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Ai=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,un=/\s*/.source,ta=/\s+/.source,Es=/\s*,\s*/.source,_i=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,ea=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Yc=new RegExp("^rgba?\\("+un+[Un,Un,Un].join(ta)+ea+"\\)$"),Ic=new RegExp("^rgb\\("+un+[Un,Un,Un].join(Es)+un+"\\)$"),Hc=new RegExp("^rgba\\("+un+[Un,Un,Un,wn].join(Es)+un+"\\)$"),Bc=new RegExp("^hsla?\\("+un+[_i,Ai,Ai].join(ta)+ea+"\\)$"),Vc=new RegExp("^hsl?\\("+un+[_i,Ai,Ai].join(Es)+un+"\\)$"),Wc=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Gc=new RegExp("^lab\\("+un+[wn,wn,wn].join(ta)+ea+"\\)$"),qc=new RegExp("^lch\\("+un+[wn,wn,_i].join(ta)+ea+"\\)$"),Xc=new RegExp("^oklab\\("+un+[wn,wn,wn].join(ta)+ea+"\\)$"),Uc=new RegExp("^oklch\\("+un+[wn,wn,_i].join(ta)+ea+"\\)$"),{round:Zc}=Math,na=t=>t.map((n,e)=>e<=2?_r(Zc(n),0,255):n),le=(t,n=0,e=100,r=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,r?t=n+(t+1)*.5*(e-n):t=n+t*(e-n)),+t),Ne=(t,n)=>t==="none"?n:t,Ds=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let n;if(Bt.format.named)try{return Bt.format.named(t)}catch{}if((n=t.match(Yc))||(n=t.match(Ic))){let e=n.slice(1,4);for(let a=0;a<3;a++)e[a]=+le(Ne(e[a],0),0,255);e=na(e);const r=n[4]!==void 0?+le(n[4],0,1):1;return e[3]=r,e}if(n=t.match(Hc)){const e=n.slice(1,5);for(let r=0;r<4;r++)e[r]=+le(e[r],0,255);return e}if((n=t.match(Bc))||(n=t.match(Vc))){const e=n.slice(1,4);e[0]=+Ne(e[0].replace("deg",""),0),e[1]=+le(Ne(e[1],0),0,100)*.01,e[2]=+le(Ne(e[2],0),0,100)*.01;const r=na(Ss(e)),a=n[4]!==void 0?+le(n[4],0,1):1;return r[3]=a,r}if(n=t.match(Wc)){const e=n.slice(1,4);e[1]*=.01,e[2]*=.01;const r=Ss(e);for(let a=0;a<3;a++)r[a]=Zc(r[a]);return r[3]=+n[4],r}if(n=t.match(Gc)){const e=n.slice(1,4);e[0]=le(Ne(e[0],0),0,100),e[1]=le(Ne(e[1],0),-125,125,!0),e[2]=le(Ne(e[2],0),-125,125,!0);const r=Na();qn("d50");const a=na(bs(e));qn(r);const i=n[4]!==void 0?+le(n[4],0,1):1;return a[3]=i,a}if(n=t.match(qc)){const e=n.slice(1,4);e[0]=le(e[0],0,100),e[1]=le(Ne(e[1],0),0,150,!1),e[2]=+Ne(e[2].replace("deg",""),0);const r=Na();qn("d50");const a=na(As(e));qn(r);const i=n[4]!==void 0?+le(n[4],0,1):1;return a[3]=i,a}if(n=t.match(Xc)){const e=n.slice(1,4);e[0]=le(Ne(e[0],0),0,1),e[1]=le(Ne(e[1],0),-.4,.4,!0),e[2]=le(Ne(e[2],0),-.4,.4,!0);const r=na(Ms(e)),a=n[4]!==void 0?+le(n[4],0,1):1;return r[3]=a,r}if(n=t.match(Uc)){const e=n.slice(1,4);e[0]=le(Ne(e[0],0),0,1),e[1]=le(Ne(e[1],0),0,.4,!1),e[2]=+Ne(e[2].replace("deg",""),0);const r=na(Fc(e)),a=n[4]!==void 0?+le(n[4],0,1):1;return r[3]=a,r}};Ds.test=t=>Yc.test(t)||Bc.test(t)||Gc.test(t)||qc.test(t)||Xc.test(t)||Uc.test(t)||Ic.test(t)||Hc.test(t)||Vc.test(t)||Wc.test(t)||t==="transparent",ut.prototype.css=function(t){return Op(this._rgb,t)};const Np=(...t)=>new ut(...t,"css");Ot.css=Np,Bt.format.css=Ds,Bt.autodetect.push({p:5,test:(t,...n)=>{if(!n.length&&qt(t)==="string"&&Ds.test(t))return"css"}}),Bt.format.gl=(...t)=>{const n=Vt(t,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n};const Ep=(...t)=>new ut(...t,"gl");Ot.gl=Ep,ut.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]},ut.prototype.hex=function(t){return dc(this._rgb,t)};const Dp=(...t)=>new ut(...t,"hex");Ot.hex=Dp,Bt.format.hex=hc,Bt.autodetect.push({p:4,test:(t,...n)=>{if(!n.length&&qt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:ki}=Math,jc=t=>{const n=t/100;let e,r,a;return n<66?(e=255,r=n<6?0:-155.25485562709179-.44596950469579133*(r=n-2)+104.49216199393888*ki(r),a=n<20?0:-254.76935184120902+.8274096064007395*(a=n-10)+115.67994401066147*ki(a)):(e=351.97690566805693+.114206453784165*(e=n-55)-40.25366309332127*ki(e),r=325.4494125711974+.07943456536662342*(r=n-50)-28.0852963507957*ki(r),a=255),[e,r,a,1]},{round:Pp}=Math,zp=(...t)=>{const n=Vt(t,"rgb"),e=n[0],r=n[2];let a=1e3,i=4e4;const o=.4;let s;for(;i-a>o;){s=(i+a)*.5;const l=jc(s);l[2]/l[0]>=r/e?i=s:a=s}return Pp(s)};ut.prototype.temp=ut.prototype.kelvin=ut.prototype.temperature=function(){return zp(this._rgb)};const Ps=(...t)=>new ut(...t,"temp");Object.assign(Ot,{temp:Ps,kelvin:Ps,temperature:Ps}),Bt.format.temp=Bt.format.kelvin=Bt.format.temperature=jc,ut.prototype.oklch=function(){return Rc(this._rgb)},Object.assign(Ot,{oklch:(...t)=>new ut(...t,"oklch")}),Bt.format.oklch=Fc,Bt.autodetect.push({p:2,test:(...t)=>{if(t=Vt(t,"oklch"),qt(t)==="array"&&t.length===3)return"oklch"}}),Object.assign(Ot,{analyze:kc,average:Ig,bezier:qg,blend:xn,brewer:_p,Color:ut,colors:Zr,contrast:hp,contrastAPCA:pp,cubehelix:ap,deltaE:vp,distance:xp,input:Bt,interpolate:jr,limits:Sc,mix:jr,random:lp,scale:vi,scales:Ap,valid:wp});function Kc(t,n){if(!Ot.valid(t))return n;try{return Ot(t)}catch{return n}}function hn(t){return Ot.valid(t)&&Ot.contrast(t,"#fff")>=Ot.contrast(t,"#333")?"#fff":"#333"}const Ea=4.5;function Be(t){let n=t;for(;n&&n instanceof Element;){const e=getComputedStyle(n).backgroundColor;if(e&&e!=="rgba(0, 0, 0, 0)"&&e!=="transparent")return e;n=n.parentElement}return"#fff"}function Jc(t,n="#fff"){if(!Ot.valid(t))return Ot.valid(n)?hn(n):"#333";let e=Ot(t);const r=Kc(n,Ot("#fff"));if(Ot.contrast(e,r)>=Ea)return e.hex();const a=r.luminance()>.5;for(let i=0;i<20&&(e=a?e.darken(.3):e.brighten(.3),!(Ot.contrast(e,r)>=Ea));i++);return e.hex()}const zs=12,Si=.25,Qc=20;function Rp(t,n){if(t.length===0)return[];const e=Kc(n,Ot("#fff")),r=Ot.valid(n)?n:"#fff",a=e.luminance()>.5,i=t.map(o=>Ot.valid(o)?Fp(Ot(o),r,a):Ot("#000"));for(let o=1;o<i.length;o++)Ot.deltaE(i[o],i[o-1])>=zs||(i[o]=Yp(i[o],i[o-1],r,a));return i.map(o=>o.hex())}function Fp(t,n,e){for(let r=0;r<Qc;r++){if(Ot.contrast(t,n)>=Ea)return t;t=e?t.darken(Si):t.brighten(Si)}return t}function Yp(t,n,e,r){const a=tf(t,n,e,r);if(Ot.deltaE(a,n)>=zs)return a;const i=tf(t,n,e,!r);return Ot.deltaE(i,n)>Ot.deltaE(a,n)&&Ot.contrast(i,e)>=Ea?i:a}function tf(t,n,e,r){let a=t,i=Ot.deltaE(t,n),o=t;for(let s=0;s<Qc;s++){o=r?o.darken(Si):o.brighten(Si);const l=Ot.deltaE(o,n);if(l>i&&Ot.contrast(o,e)>=Ea&&(a=o,i=l),i>=zs)break}return a}function ef(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mi={exports:{}},Ip=Mi.exports,nf;function Hp(){return nf||(nf=1,(function(t,n){(function(e,r){t.exports=r()})(Ip,(function(){var e=1e3,r=6e4,a=36e5,i="millisecond",o="second",s="minute",l="hour",c="day",f="week",h="month",d="quarter",g="year",v="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,A={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var D=["th","st","nd","rd"],q=M%100;return"["+M+(D[(q-20)%10]||D[q]||D[0])+"]"}},w=function(M,D,q){var V=String(M);return!V||V.length>=D?M:""+Array(D+1-V.length).join(q)+M},S={s:w,z:function(M){var D=-M.utcOffset(),q=Math.abs(D),V=Math.floor(q/60),C=q%60;return(D<=0?"+":"-")+w(V,2,"0")+":"+w(C,2,"0")},m:function M(D,q){if(D.date()<q.date())return-M(q,D);var V=12*(q.year()-D.year())+(q.month()-D.month()),C=D.clone().add(V,h),I=q-C<0,W=D.clone().add(V+(I?-1:1),h);return+(-(V+(q-C)/(I?C-W:W-C))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:h,y:g,w:f,d:c,D:v,h:l,m:s,s:o,ms:i,Q:d}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},z="en",Y={};Y[z]=A;var G="$isDayjsObject",_=function(M){return M instanceof N||!(!M||!M[G])},B=function M(D,q,V){var C;if(!D)return z;if(typeof D=="string"){var I=D.toLowerCase();Y[I]&&(C=I),q&&(Y[I]=q,C=I);var W=D.split("-");if(!C&&W.length>1)return M(W[0])}else{var it=D.name;Y[it]=D,C=it}return!V&&C&&(z=C),C||!V&&z},P=function(M,D){if(_(M))return M.clone();var q=typeof D=="object"?D:{};return q.date=M,q.args=arguments,new N(q)},$=S;$.l=B,$.i=_,$.w=function(M,D){return P(M,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var N=(function(){function M(q){this.$L=B(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[G]=!0}var D=M.prototype;return D.parse=function(q){this.$d=(function(V){var C=V.date,I=V.utc;if(C===null)return new Date(NaN);if($.u(C))return new Date;if(C instanceof Date)return new Date(C);if(typeof C=="string"&&!/Z$/i.test(C)){var W=C.match(b);if(W){var it=W[2]-1||0,rt=(W[7]||"0").substring(0,3);return I?new Date(Date.UTC(W[1],it,W[3]||1,W[4]||0,W[5]||0,W[6]||0,rt)):new Date(W[1],it,W[3]||1,W[4]||0,W[5]||0,W[6]||0,rt)}}return new Date(C)})(q),this.init()},D.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},D.$utils=function(){return $},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(q,V){var C=P(q);return this.startOf(V)<=C&&C<=this.endOf(V)},D.isAfter=function(q,V){return P(q)<this.startOf(V)},D.isBefore=function(q,V){return this.endOf(V)<P(q)},D.$g=function(q,V,C){return $.u(q)?this[V]:this.set(C,q)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(q,V){var C=this,I=!!$.u(V)||V,W=$.p(q),it=function(j,J){var X=$.w(C.$u?Date.UTC(C.$y,J,j):new Date(C.$y,J,j),C);return I?X:X.endOf(c)},rt=function(j,J){return $.w(C.toDate()[j].apply(C.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(J)),C)},ct=this.$W,pt=this.$M,xt=this.$D,yt="set"+(this.$u?"UTC":"");switch(W){case g:return I?it(1,0):it(31,11);case h:return I?it(1,pt):it(0,pt+1);case f:var bt=this.$locale().weekStart||0,kt=(ct<bt?ct+7:ct)-bt;return it(I?xt-kt:xt+(6-kt),pt);case c:case v:return rt(yt+"Hours",0);case l:return rt(yt+"Minutes",1);case s:return rt(yt+"Seconds",2);case o:return rt(yt+"Milliseconds",3);default:return this.clone()}},D.endOf=function(q){return this.startOf(q,!1)},D.$set=function(q,V){var C,I=$.p(q),W="set"+(this.$u?"UTC":""),it=(C={},C[c]=W+"Date",C[v]=W+"Date",C[h]=W+"Month",C[g]=W+"FullYear",C[l]=W+"Hours",C[s]=W+"Minutes",C[o]=W+"Seconds",C[i]=W+"Milliseconds",C)[I],rt=I===c?this.$D+(V-this.$W):V;if(I===h||I===g){var ct=this.clone().set(v,1);ct.$d[it](rt),ct.init(),this.$d=ct.set(v,Math.min(this.$D,ct.daysInMonth())).$d}else it&&this.$d[it](rt);return this.init(),this},D.set=function(q,V){return this.clone().$set(q,V)},D.get=function(q){return this[$.p(q)]()},D.add=function(q,V){var C,I=this;q=Number(q);var W=$.p(V),it=function(pt){var xt=P(I);return $.w(xt.date(xt.date()+Math.round(pt*q)),I)};if(W===h)return this.set(h,this.$M+q);if(W===g)return this.set(g,this.$y+q);if(W===c)return it(1);if(W===f)return it(7);var rt=(C={},C[s]=r,C[l]=a,C[o]=e,C)[W]||1,ct=this.$d.getTime()+q*rt;return $.w(ct,this)},D.subtract=function(q,V){return this.add(-1*q,V)},D.format=function(q){var V=this,C=this.$locale();if(!this.isValid())return C.invalidDate||m;var I=q||"YYYY-MM-DDTHH:mm:ssZ",W=$.z(this),it=this.$H,rt=this.$m,ct=this.$M,pt=C.weekdays,xt=C.months,yt=C.meridiem,bt=function(J,X,O,ht){return J&&(J[X]||J(V,I))||O[X].slice(0,ht)},kt=function(J){return $.s(it%12||12,J,"0")},j=yt||function(J,X,O){var ht=J<12?"AM":"PM";return O?ht.toLowerCase():ht};return I.replace(x,(function(J,X){return X||(function(O){switch(O){case"YY":return String(V.$y).slice(-2);case"YYYY":return $.s(V.$y,4,"0");case"M":return ct+1;case"MM":return $.s(ct+1,2,"0");case"MMM":return bt(C.monthsShort,ct,xt,3);case"MMMM":return bt(xt,ct);case"D":return V.$D;case"DD":return $.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return bt(C.weekdaysMin,V.$W,pt,2);case"ddd":return bt(C.weekdaysShort,V.$W,pt,3);case"dddd":return pt[V.$W];case"H":return String(it);case"HH":return $.s(it,2,"0");case"h":return kt(1);case"hh":return kt(2);case"a":return j(it,rt,!0);case"A":return j(it,rt,!1);case"m":return String(rt);case"mm":return $.s(rt,2,"0");case"s":return String(V.$s);case"ss":return $.s(V.$s,2,"0");case"SSS":return $.s(V.$ms,3,"0");case"Z":return W}return null})(J)||W.replace(":","")}))},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(q,V,C){var I,W=this,it=$.p(V),rt=P(q),ct=(rt.utcOffset()-this.utcOffset())*r,pt=this-rt,xt=function(){return $.m(W,rt)};switch(it){case g:I=xt()/12;break;case h:I=xt();break;case d:I=xt()/3;break;case f:I=(pt-ct)/6048e5;break;case c:I=(pt-ct)/864e5;break;case l:I=pt/a;break;case s:I=pt/r;break;case o:I=pt/e;break;default:I=pt}return C?I:$.a(I)},D.daysInMonth=function(){return this.endOf(h).$D},D.$locale=function(){return Y[this.$L]},D.locale=function(q,V){if(!q)return this.$L;var C=this.clone(),I=B(q,V,!0);return I&&(C.$L=I),C},D.clone=function(){return $.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},M})(),L=N.prototype;return P.prototype=L,[["$ms",i],["$s",o],["$m",s],["$H",l],["$W",c],["$M",h],["$y",g],["$D",v]].forEach((function(M){L[M[1]]=function(D){return this.$g(D,M[0],M[1])}})),P.extend=function(M,D){return M.$i||(M(D,N,P),M.$i=!0),P},P.locale=B,P.isDayjs=_,P.unix=function(M){return P(1e3*M)},P.en=Y[z],P.Ls=Y,P.p={},P}))})(Mi)),Mi.exports}var Bp=Hp();const ra=ef(Bp);var $i={exports:{}},Vp=$i.exports,rf;function Wp(){return rf||(rf=1,(function(t,n){(function(e,r){t.exports=r()})(Vp,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,i=/\d\d/,o=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,l={},c=function(b){return(b=+b)+(b>68?1900:2e3)},f=function(b){return function(x){this[b]=+x}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(b){(this.zone||(this.zone={})).offset=(function(x){if(!x||x==="Z")return 0;var A=x.match(/([+-]|\d\d)/g),w=60*A[1]+(+A[2]||0);return w===0?0:A[0]==="+"?-w:w})(b)}],d=function(b){var x=l[b];return x&&(x.indexOf?x:x.s.concat(x.f))},g=function(b,x){var A,w=l.meridiem;if(w){for(var S=1;S<=24;S+=1)if(b.indexOf(w(S,0,x))>-1){A=S>12;break}}else A=b===(x?"pm":"PM");return A},v={A:[s,function(b){this.afternoon=g(b,!1)}],a:[s,function(b){this.afternoon=g(b,!0)}],Q:[a,function(b){this.month=3*(b-1)+1}],S:[a,function(b){this.milliseconds=100*+b}],SS:[i,function(b){this.milliseconds=10*+b}],SSS:[/\d{3}/,function(b){this.milliseconds=+b}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[i,f("day")],Do:[s,function(b){var x=l.ordinal,A=b.match(/\d+/);if(this.day=A[0],x)for(var w=1;w<=31;w+=1)x(w).replace(/\[|\]/g,"")===b&&(this.day=w)}],w:[o,f("week")],ww:[i,f("week")],M:[o,f("month")],MM:[i,f("month")],MMM:[s,function(b){var x=d("months"),A=(d("monthsShort")||x.map((function(w){return w.slice(0,3)}))).indexOf(b)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[s,function(b){var x=d("months").indexOf(b)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,f("year")],YY:[i,function(b){this.year=c(b)}],YYYY:[/\d{4}/,f("year")],Z:h,ZZ:h};function m(b){var x,A;x=b,A=l&&l.formats;for(var w=(b=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(P,$,N){var L=N&&N.toUpperCase();return $||A[N]||e[N]||A[L].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(M,D,q){return D||q.slice(1)}))}))).match(r),S=w.length,z=0;z<S;z+=1){var Y=w[z],G=v[Y],_=G&&G[0],B=G&&G[1];w[z]=B?{regex:_,parser:B}:Y.replace(/^\[|\]$/g,"")}return function(P){for(var $={},N=0,L=0;N<S;N+=1){var M=w[N];if(typeof M=="string")L+=M.length;else{var D=M.regex,q=M.parser,V=P.slice(L),C=D.exec(V)[0];q.call($,C),P=P.replace(C,"")}}return(function(I){var W=I.afternoon;if(W!==void 0){var it=I.hours;W?it<12&&(I.hours+=12):it===12&&(I.hours=0),delete I.afternoon}})($),$}}return function(b,x,A){A.p.customParseFormat=!0,b&&b.parseTwoDigitYear&&(c=b.parseTwoDigitYear);var w=x.prototype,S=w.parse;w.parse=function(z){var Y=z.date,G=z.utc,_=z.args;this.$u=G;var B=_[1];if(typeof B=="string"){var P=_[2]===!0,$=_[3]===!0,N=P||$,L=_[2];$&&(L=_[2]),l=this.$locale(),!P&&L&&(l=A.Ls[L]),this.$d=(function(V,C,I,W){try{if(["x","X"].indexOf(C)>-1)return new Date((C==="X"?1e3:1)*V);var it=m(C)(V),rt=it.year,ct=it.month,pt=it.day,xt=it.hours,yt=it.minutes,bt=it.seconds,kt=it.milliseconds,j=it.zone,J=it.week,X=new Date,O=pt||(rt||ct?1:X.getDate()),ht=rt||X.getFullYear(),mt=0;rt&&!ct||(mt=ct>0?ct-1:X.getMonth());var vt,Tt=xt||0,Ht=yt||0,Ft=bt||0,Yt=kt||0;return j?new Date(Date.UTC(ht,mt,O,Tt,Ht,Ft,Yt+60*j.offset*1e3)):I?new Date(Date.UTC(ht,mt,O,Tt,Ht,Ft,Yt)):(vt=new Date(ht,mt,O,Tt,Ht,Ft,Yt),J&&(vt=W(vt).week(J).toDate()),vt)}catch{return new Date("")}})(Y,B,G,A),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),N&&Y!=this.format(B)&&(this.$d=new Date("")),l={}}else if(B instanceof Array)for(var M=B.length,D=1;D<=M;D+=1){_[1]=B[D-1];var q=A.apply(this,_);if(q.isValid()){this.$d=q.$d,this.$L=q.$L,this.init();break}D===M&&(this.$d=new Date(""))}else S.call(this,z)}}}))})($i)),$i.exports}var Gp=Wp();const qp=ef(Gp);ra.extend(qp);const af=["YYYY-MM-DDTHH:mm:ss","YYYY-MM-DD HH:mm","YYYY-MM-DD","YYYY/MM/DD","MM/DD/YYYY","M/D/YYYY","M/D/YY","DD/MM/YYYY","DD.MM.YYYY","MMM D, YYYY","MMMM D, YYYY","MMM YYYY","MMMM YYYY","YYYY-MM","YYYY/MM","YYYY"];function Xp(t){return t.includes("HH")||t.includes("mm")||t.includes("ss")?"datetime":t.includes("DD")||new RegExp("(?<![MA-Z])D(?!D)").test(t)?"day":t==="YYYY"?"year":t.includes("MM")||t.includes("MMM")||t.includes("MMMM")||t.includes("M/")?"month":"day"}function Li(t){return new Date(Date.UTC(t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()))}function Up(t){const n=t.trim();if(!n)return null;if(/^\d{4}$/.test(n)){const e=ra(n,"YYYY",!0);return e.isValid()?Li(e):null}for(const e of af){if(e==="YYYY")continue;const r=ra(n,e,!0);if(r.isValid())return Li(r)}return null}function Da(t){const n=t.trim();if(!n)return;const e=Up(n);if(e)return e.getTime();const r=parseFloat(n);if(!isNaN(r))return r}function Ci(t){if(t.length===0)return null;const n=[];let e=null;const r=t[0].trim();if(!r)return null;if(/^\d{4}$/.test(r)){for(const i of t){const o=i.trim();if(!/^\d{4}$/.test(o))return null;const s=ra(o,"YYYY",!0);if(!s.isValid())return null;n.push(Li(s))}return{dates:n,granularity:"year"}}const a=[];for(const i of af)i!=="YYYY"&&ra(r,i,!0).isValid()&&a.push(i);if(a.length===0)return null;for(const i of a){const o=[];let s=!0;for(const l of t){const c=ra(l.trim(),i,!0);if(!c.isValid()){s=!1;break}o.push(Li(c))}if(s){e=i,n.push(...o);break}}return e?{dates:n,granularity:Xp(e)}:null}var ve=(t=>(t.BarVertical="bar-vertical",t.BarHorizontal="bar-horizontal",t.BarMulti="bar-multi",t.ColumnStacked="column-stacked",t.BarStacked="bar-stacked",t.BarSplit="bar-split",t.BarGrouped="bar-grouped",t.Line="line",t.LineMulti="line-multi",t.Area="area",t.AreaStacked="area-stacked",t.Donut="donut",t.Pie="pie",t.VerticalBar="vertical-bar",t.HorizontalBar="horizontal-bar",t))(ve||{}),An=(t=>(t.Left="left",t.Right="right",t))(An||{}),aa=(t=>(t.Linear="linear",t.Log="log",t))(aa||{}),he=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t.None="none",t))(he||{}),Jt=(t=>(t.Auto="auto",t.Inside="inside",t.Outside="outside",t.Off="off",t))(Jt||{}),Pa=(t=>(t.Auto="auto",t.Horizontal="horizontal",t.Vertical="vertical",t))(Pa||{}),ce=(t=>(t.NW="NW",t.N="N",t.NE="NE",t.E="E",t.SE="SE",t.S="S",t.SW="SW",t.W="W",t.Center="center",t))(ce||{}),xe=(t=>(t.Direct="direct",t.CurveLeft="curve-left",t.CurveRight="curve-right",t.Elbow="elbow",t))(xe||{}),Ti=(t=>(t.Solid="solid",t.Dotted="dotted",t.Dashed="dashed",t))(Ti||{}),we=(t=>(t.Point="point",t.Range="range",t.Free="free",t))(we||{}),of=(t=>(t.Start="start",t.Center="center",t.End="end",t))(of||{}),Ve=(t=>(t.Vertical="vertical",t.Horizontal="horizontal",t))(Ve||{}),Ke=(t=>(t.Circle="circle",t.Square="square",t.Diamond="diamond",t.Triangle="triangle",t.TriangleDown="triangleDown",t.Cross="cross",t.Star="star",t))(Ke||{}),Je=(t=>(t.All="all",t.First="first",t.Last="last",t.FirstLast="firstLast",t))(Je||{}),Ee=(t=>(t.Filled="filled",t.Hollow="hollow",t))(Ee||{}),pe=(t=>(t.Ascending="ascending",t.Descending="descending",t.None="none",t))(pe||{}),_n=(t=>(t.Total="total",t.WithinGroups="within-groups",t.None="none",t))(_n||{}),ia=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t))(ia||{}),Zn=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(Zn||{}),It=(t=>(t.Inside="inside",t.Outside="outside",t.Auto="auto",t))(It||{}),Ae=(t=>(t.Both="both",t.Vertical="vertical",t.Horizontal="horizontal",t))(Ae||{}),kn=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t))(kn||{}),kr=(t=>(t.Normal="normal",t.Percent="percent",t))(kr||{}),_t=(t=>(t.Colors="colors",t.Boolean="boolean",t.Select="select",t.Text="text",t.NumberFormat="numberFormat",t.DateFormat="dateFormat",t))(_t||{}),_e=(t=>(t.Off="",t.Auto="auto",t.Outside="outside",t.Inside="inside",t))(_e||{}),Sn=(t=>(t.Linear="linear",t.MonotoneX="monotoneX",t.Step="step",t.StepBefore="stepBefore",t.StepAfter="stepAfter",t.Basis="basis",t.Cardinal="cardinal",t.CatmullRom="catmullRom",t))(Sn||{});function sf(t){const n=t==null?void 0:t.trim();if(!n)return;const e=Number.parseFloat(n);return Number.isFinite(e)?e:void 0}function lf(t){var i;const n=t.split(`
|
|
249
|
-
`).map(o=>o.trim()).filter(Boolean),e=[],r=[],a=(i=n[0])==null?void 0:i.match(/^series\s*=\s*(.+)$/);if(a){const o=a[1].trim(),s=o.includes('","')?o.split(",").map(f=>f.trim().replace(/^"|"$/g,"")):o.replace(/^"|"$/g,"").split(",").map(f=>f.trim()),l=s.map(()=>[]);for(let f=1;f<n.length;f++){const h=n[f].match(/^"([^"]+)"\s*=\s*([^"]+)$/),g=n[f].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??h;if(g){e.push(g[1]);const v=g[2].split(",");for(let m=0;m<s.length;m++)l[m].push(sf(v[m]))}}const c=s.map((f,h)=>({name:f,values:l[h]}));return{labels:e,values:l[0]??[],series:c}}for(const o of n){const s=o.match(/^"([^"]+)"\s*=\s*(.+)$/);s&&(e.push(s[1]),r.push(sf(s[2])))}return{labels:e,values:r}}function Zp(t,n){const e={},r=I0(t.colorPalette);return r?e.colors=r:t.colors&&t.colors.length>0&&(e.colors=t.colors),t.autoContrast&&n&&e.colors&&(e.colors=Rp(e.colors,n)),t.allowDarkMode!==void 0&&(e.allowDarkMode=t.allowDarkMode),e}function jp(t){const n={};return t.legend!==void 0&&(n.legend=t.legend),t.legendPosition!==void 0&&(n.legendPosition=t.legendPosition),t.legendAnchor!==void 0&&(n.legendAnchor=t.legendAnchor),t.directLabelling!==void 0&&(n.directLabelling=t.directLabelling),t.directLabelAnchor!==void 0&&(n.directLabelAnchor=t.directLabelAnchor),n}function Kp(t){if(!(t.showVerticalTicks!==void 0||t.verticalGridStyle!==void 0||t.verticalNumberFormat!==void 0||t.showVerticalAxis!==void 0||t.verticalAxisDirection!==void 0||t.verticalScaleType!==void 0||t.verticalLabelPosition!==void 0||t.verticalRangeMin||t.verticalRangeMax))return{};const e={};t.showVerticalTicks!==void 0&&(e.showTicks=t.showVerticalTicks),t.verticalAxisDirection!==void 0&&(e.direction=t.verticalAxisDirection),t.verticalGridStyle!==void 0&&(e.gridStyle=t.verticalGridStyle),t.verticalNumberFormat!==void 0&&(e.numberFormat=t.verticalNumberFormat),t.showVerticalAxis!==void 0&&(e.showAxis=t.showVerticalAxis),t.verticalScaleType!==void 0&&(e.scaleType=t.verticalScaleType),t.verticalLabelPosition!==void 0&&(e.labelPosition=t.verticalLabelPosition);const r=Da(t.verticalRangeMin??""),a=Da(t.verticalRangeMax??"");return(r!==void 0||a!==void 0)&&(e.range={},r!==void 0&&(e.range.min=r),a!==void 0&&(e.range.max=a)),{verticalAxis:e}}function Jp(t){if(!(t.showHorizontalTicks!==void 0||t.horizontalGridStyle!==void 0||t.horizontalNumberFormat!==void 0||t.showHorizontalAxis!==void 0||t.horizontalScaleType!==void 0||t.horizontalLabelPosition!==void 0||t.horizontalLabelRotation!==void 0||t.horizontalRangeMin||t.horizontalRangeMax))return{};const e={};t.showHorizontalTicks!==void 0&&(e.showTicks=t.showHorizontalTicks),t.horizontalGridStyle!==void 0&&(e.gridStyle=t.horizontalGridStyle),t.horizontalNumberFormat!==void 0&&(e.numberFormat=t.horizontalNumberFormat),t.showHorizontalAxis!==void 0&&(e.showAxis=t.showHorizontalAxis),t.horizontalScaleType!==void 0&&(e.scaleType=t.horizontalScaleType),t.horizontalLabelPosition!==void 0&&(e.labelPosition=t.horizontalLabelPosition),t.horizontalLabelRotation!==void 0&&(e.labelRotation=t.horizontalLabelRotation);const r=Da(t.horizontalRangeMin??""),a=Da(t.horizontalRangeMax??"");return(r!==void 0||a!==void 0)&&(e.range={},r!==void 0&&(e.range.min=r),a!==void 0&&(e.range.max=a)),{horizontalAxis:e}}function Qp(t){return t.lineSymbols?{lineSymbols:{symbol:t.lineSymbolShape??Ke.Circle,showOn:t.lineSymbolShowOn??Je.FirstLast,style:t.lineSymbolStyle??Ee.Filled,size:parseFloat(t.lineSymbolSize??"3.5")||3.5,opacity:parseFloat(t.lineSymbolOpacity??"1")||1}}:{}}function tm(t,n){const e={...Zp(t,n),...jp(t),...Kp(t),...Jp(t),...Qp(t)};t.interpolation!==void 0&&(e.interpolation=t.interpolation),t.valueLabels!==void 0&&(e.valueLabels=t.valueLabels),t.valueLabelPosition!==void 0&&(e.valueLabelPosition=t.valueLabelPosition),t.tooltips!==void 0&&(e.tooltips=t.tooltips),t.crosshair!==void 0&&(e.crosshair=t.crosshair),t.crosshairDirection&&(e.crosshairDirection=t.crosshairDirection),t.crosshairStyle&&(e.crosshairStyle=t.crosshairStyle),t.crosshairColor&&(e.crosshairColor=t.crosshairColor),t.displayAsPercentage!==void 0&&(e.displayAsPercentage=t.displayAsPercentage),t.showTotal!==void 0&&(e.showTotal=t.showTotal),t.showLabels!==void 0&&(e.showLabels=t.showLabels),t.showValues!==void 0&&(e.showValues=t.showValues),t.swapLabelValue!==void 0&&(e.swapLabelValue=t.swapLabelValue);const r=parseInt(t.sliceMax??"",10);!isNaN(r)&&r>0&&(e.sliceMax=r),t.sliceGroupLabel!==void 0&&(e.sliceGroupLabel=t.sliceGroupLabel),t.barBackground!==void 0&&(e.barBackground=t.barBackground),t.barSeparators!==void 0&&(e.barSeparators=t.barSeparators);const a=parseFloat(t.barGap??"");isNaN(a)||(e.barGap=Math.max(0,Math.min(100,a))),t.connectedColumns!==void 0&&(e.connectedColumns=t.connectedColumns);const i=parseFloat(t.connectionsOpacity??"");isNaN(i)||(e.connectionsOpacity=Math.max(0,Math.min(1,i))),t.stackMode!==void 0&&(e.stackMode=t.stackMode),t.stacked!==void 0&&(e.stacked=t.stacked),t.stackPercent!==void 0&&(e.stackPercent=t.stackPercent),t.areaSortMode!==void 0&&(e.areaSortMode=t.areaSortMode),t.areaLines!==void 0&&(e.areaLines=t.areaLines);const o=parseFloat(t.areaFillOpacity??"");return isNaN(o)||(e.areaFillOpacity=o),t.edgePadding!==void 0&&(e.edgePadding=t.edgePadding),t.waterfall!==void 0&&(e.waterfall=t.waterfall),t.waterfallTotal!==void 0&&(e.waterfallTotal=t.waterfallTotal),t.categoryLabelLine!==void 0&&(e.categoryLabelLine=t.categoryLabelLine),e}function Oi(t,n){if(!n||n.min===void 0&&n.max===void 0)return t.map((r,a)=>a);const e=[];for(let r=0;r<t.length;r++){const a=Da(t[r]);if(a===void 0){e.push(r);continue}n.min!==void 0&&a<n.min||n.max!==void 0&&a>n.max||e.push(r)}return e}const Rs=60;function Sr(t){const n=Number.isFinite(t)?Math.max(0,Math.min(100,t)):Rs;return n/(n+100)}function oa(t,n,e){let r=0,a=0,i=1/0,o=!0,s=!1;for(const f of t)Number.isFinite(f)&&(s=!0,f<r&&(r=f),f>a&&(a=f),f<=0?o=!1:f<i&&(i=f));e===aa.Log&&s&&o&&(r=i);let l=(n==null?void 0:n.min)??r,c=(n==null?void 0:n.max)??a;if(l>c&&([l,c]=[c,l]),l===c)if(l===0)c=1;else{const f=Math.abs(l)*.1;l=l-f,c=c+f}return[l,c]}function Ni(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function em(t,n){return t==null||n==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function cf(t){let n,e,r;t.length!==2?(n=Ni,e=(s,l)=>Ni(t(s),l),r=(s,l)=>t(s)-l):(n=t===Ni||t===em?t:nm,e=t,r=t);function a(s,l,c=0,f=s.length){if(c<f){if(n(l,l)!==0)return f;do{const h=c+f>>>1;e(s[h],l)<0?c=h+1:f=h}while(c<f)}return c}function i(s,l,c=0,f=s.length){if(c<f){if(n(l,l)!==0)return f;do{const h=c+f>>>1;e(s[h],l)<=0?c=h+1:f=h}while(c<f)}return c}function o(s,l,c=0,f=s.length){const h=a(s,l,c,f-1);return h>c&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:a,center:o,right:i}}function nm(){return 0}function rm(t){return t===null?NaN:+t}const am=cf(Ni).right,im=cf(rm).center;class Fs extends Map{constructor(n,e=lm){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const[r,a]of n)this.set(r,a)}get(n){return super.get(ff(this,n))}has(n){return super.has(ff(this,n))}set(n,e){return super.set(om(this,n),e)}delete(n){return super.delete(sm(this,n))}}function ff({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function om({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function sm({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function lm(t){return t!==null&&typeof t=="object"?t.valueOf():t}function cm(t){return t}function uf(t,n,...e){return fm(t,cm,n,e)}function fm(t,n,e,r){return(function a(i,o){if(o>=r.length)return e(i);const s=new Fs,l=r[o++];let c=-1;for(const f of i){const h=l(f,++c,i),d=s.get(h);d?d.push(f):s.set(h,[f])}for(const[f,h]of s)s.set(f,a(h,o));return n(s)})(t,0)}const um=Math.sqrt(50),hm=Math.sqrt(10),dm=Math.sqrt(2);function Ei(t,n,e){const r=(n-t)/Math.max(0,e),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=um?10:i>=hm?5:i>=dm?2:1;let s,l,c;return a<0?(c=Math.pow(10,-a)/o,s=Math.round(t*c),l=Math.round(n*c),s/c<t&&++s,l/c>n&&--l,c=-c):(c=Math.pow(10,a)*o,s=Math.round(t/c),l=Math.round(n/c),s*c<t&&++s,l*c>n&&--l),l<s&&.5<=e&&e<2?Ei(t,n,e*2):[s,l,c]}function gm(t,n,e){if(n=+n,t=+t,e=+e,!(e>0))return[];if(t===n)return[t];const r=n<t,[a,i,o]=r?Ei(n,t,e):Ei(t,n,e);if(!(i>=a))return[];const s=i-a+1,l=new Array(s);if(r)if(o<0)for(let c=0;c<s;++c)l[c]=(i-c)/-o;else for(let c=0;c<s;++c)l[c]=(i-c)*o;else if(o<0)for(let c=0;c<s;++c)l[c]=(a+c)/-o;else for(let c=0;c<s;++c)l[c]=(a+c)*o;return l}function Ys(t,n,e){return n=+n,t=+t,e=+e,Ei(t,n,e)[2]}function pm(t,n,e){n=+n,t=+t,e=+e;const r=n<t,a=r?Ys(n,t,e):Ys(t,n,e);return(r?-1:1)*(a<0?1/-a:a)}function Mr(t,n){let e;if(n===void 0)for(const r of t)r!=null&&(e<r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let a of t)(a=n(a,++r,t))!=null&&(e<a||e===void 0&&a>=a)&&(e=a)}return e}function mm(t,n,e){t=+t,n=+n,e=(a=arguments.length)<2?(n=t,t=0,1):a<3?1:+e;for(var r=-1,a=Math.max(0,Math.ceil((n-t)/e))|0,i=new Array(a);++r<a;)i[r]=t+r*e;return i}function hf(t,n){let e=0;if(n===void 0)for(let r of t)(r=+r)&&(e+=r);else{let r=-1;for(let a of t)(a=+n(a,++r,t))&&(e+=a)}return e}function bm(t){return t}var Di=1,Pi=2,Is=3,za=4,df=1e-6;function ym(t){return"translate("+t+",0)"}function vm(t){return"translate(0,"+t+")"}function xm(t){return n=>+t(n)}function wm(t,n){return n=Math.max(0,t.bandwidth()-n*2)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function Am(){return!this.__axis}function zi(t,n){var e=[],r=null,a=null,i=6,o=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=t===Di||t===za?-1:1,f=t===za||t===Pi?"x":"y",h=t===Di||t===Is?ym:vm;function d(g){var v=r??(n.ticks?n.ticks.apply(n,e):n.domain()),m=a??(n.tickFormat?n.tickFormat.apply(n,e):bm),b=Math.max(i,0)+s,x=n.range(),A=+x[0]+l,w=+x[x.length-1]+l,S=(n.bandwidth?wm:xm)(n.copy(),l),z=g.selection?g.selection():g,Y=z.selectAll(".domain").data([null]),G=z.selectAll(".tick").data(v,n).order(),_=G.exit(),B=G.enter().append("g").attr("class","tick"),P=G.select("line"),$=G.select("text");Y=Y.merge(Y.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),G=G.merge(B),P=P.merge(B.append("line").attr("stroke","currentColor").attr(f+"2",c*i)),$=$.merge(B.append("text").attr("fill","currentColor").attr(f,c*b).attr("dy",t===Di?"0em":t===Is?"0.71em":"0.32em")),g!==z&&(Y=Y.transition(g),G=G.transition(g),P=P.transition(g),$=$.transition(g),_=_.transition(g).attr("opacity",df).attr("transform",function(N){return isFinite(N=S(N))?h(N+l):this.getAttribute("transform")}),B.attr("opacity",df).attr("transform",function(N){var L=this.parentNode.__axis;return h((L&&isFinite(L=L(N))?L:S(N))+l)})),_.remove(),Y.attr("d",t===za||t===Pi?o?"M"+c*o+","+A+"H"+l+"V"+w+"H"+c*o:"M"+l+","+A+"V"+w:o?"M"+A+","+c*o+"V"+l+"H"+w+"V"+c*o:"M"+A+","+l+"H"+w),G.attr("opacity",1).attr("transform",function(N){return h(S(N)+l)}),P.attr(f+"2",c*i),$.attr(f,c*b).text(m),z.filter(Am).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Pi?"start":t===za?"end":"middle"),z.each(function(){this.__axis=S})}return d.scale=function(g){return arguments.length?(n=g,d):n},d.ticks=function(){return e=Array.from(arguments),d},d.tickArguments=function(g){return arguments.length?(e=g==null?[]:Array.from(g),d):e.slice()},d.tickValues=function(g){return arguments.length?(r=g==null?null:Array.from(g),d):r&&r.slice()},d.tickFormat=function(g){return arguments.length?(a=g,d):a},d.tickSize=function(g){return arguments.length?(i=o=+g,d):i},d.tickSizeInner=function(g){return arguments.length?(i=+g,d):i},d.tickSizeOuter=function(g){return arguments.length?(o=+g,d):o},d.tickPadding=function(g){return arguments.length?(s=+g,d):s},d.offset=function(g){return arguments.length?(l=+g,d):l},d}function _m(t){return zi(Di,t)}function gf(t){return zi(Pi,t)}function km(t){return zi(Is,t)}function pf(t){return zi(za,t)}var Sm={value:()=>{}};function Hs(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new Ri(e)}function Ri(t){this._=t}function Mm(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",a=e.indexOf(".");if(a>=0&&(r=e.slice(a+1),e=e.slice(0,a)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}Ri.prototype=Hs.prototype={constructor:Ri,on:function(t,n){var e=this._,r=Mm(t+"",e),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(t=r[i]).type)&&(a=$m(e[a],t.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++i<o;)if(a=(t=r[i]).type)e[a]=mf(e[a],t.name,n);else if(n==null)for(a in e)e[a]=mf(e[a],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Ri(t)},call:function(t,n){if((a=arguments.length-2)>0)for(var e=new Array(a),r=0,a,i;r<a;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],a=0,i=r.length;a<i;++a)r[a].value.apply(n,e)}};function $m(t,n){for(var e=0,r=t.length,a;e<r;++e)if((a=t[e]).name===n)return a.value}function mf(t,n,e){for(var r=0,a=t.length;r<a;++r)if(t[r].name===n){t[r]=Sm,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var Bs="http://www.w3.org/1999/xhtml";const bf={svg:"http://www.w3.org/2000/svg",xhtml:Bs,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fi(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),bf.hasOwnProperty(n)?{space:bf[n],local:t}:t}function Lm(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Bs&&n.documentElement.namespaceURI===Bs?n.createElement(t):n.createElementNS(e,t)}}function Cm(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yf(t){var n=Fi(t);return(n.local?Cm:Lm)(n)}function Tm(){}function Vs(t){return t==null?Tm:function(){return this.querySelector(t)}}function Om(t){typeof t!="function"&&(t=Vs(t));for(var n=this._groups,e=n.length,r=new Array(e),a=0;a<e;++a)for(var i=n[a],o=i.length,s=r[a]=new Array(o),l,c,f=0;f<o;++f)(l=i[f])&&(c=t.call(l,l.__data__,f,i))&&("__data__"in l&&(c.__data__=l.__data__),s[f]=c);return new Qe(r,this._parents)}function Nm(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Em(){return[]}function vf(t){return t==null?Em:function(){return this.querySelectorAll(t)}}function Dm(t){return function(){return Nm(t.apply(this,arguments))}}function Pm(t){typeof t=="function"?t=Dm(t):t=vf(t);for(var n=this._groups,e=n.length,r=[],a=[],i=0;i<e;++i)for(var o=n[i],s=o.length,l,c=0;c<s;++c)(l=o[c])&&(r.push(t.call(l,l.__data__,c,o)),a.push(l));return new Qe(r,a)}function xf(t){return function(){return this.matches(t)}}function wf(t){return function(n){return n.matches(t)}}var zm=Array.prototype.find;function Rm(t){return function(){return zm.call(this.children,t)}}function Fm(){return this.firstElementChild}function Ym(t){return this.select(t==null?Fm:Rm(typeof t=="function"?t:wf(t)))}var Im=Array.prototype.filter;function Hm(){return Array.from(this.children)}function Bm(t){return function(){return Im.call(this.children,t)}}function Vm(t){return this.selectAll(t==null?Hm:Bm(typeof t=="function"?t:wf(t)))}function Wm(t){typeof t!="function"&&(t=xf(t));for(var n=this._groups,e=n.length,r=new Array(e),a=0;a<e;++a)for(var i=n[a],o=i.length,s=r[a]=[],l,c=0;c<o;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&s.push(l);return new Qe(r,this._parents)}function Af(t){return new Array(t.length)}function Gm(){return new Qe(this._enter||this._groups.map(Af),this._parents)}function Yi(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Yi.prototype={constructor:Yi,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function qm(t){return function(){return t}}function Xm(t,n,e,r,a,i){for(var o=0,s,l=n.length,c=i.length;o<c;++o)(s=n[o])?(s.__data__=i[o],r[o]=s):e[o]=new Yi(t,i[o]);for(;o<l;++o)(s=n[o])&&(a[o]=s)}function Um(t,n,e,r,a,i,o){var s,l,c=new Map,f=n.length,h=i.length,d=new Array(f),g;for(s=0;s<f;++s)(l=n[s])&&(d[s]=g=o.call(l,l.__data__,s,n)+"",c.has(g)?a[s]=l:c.set(g,l));for(s=0;s<h;++s)g=o.call(t,i[s],s,i)+"",(l=c.get(g))?(r[s]=l,l.__data__=i[s],c.delete(g)):e[s]=new Yi(t,i[s]);for(s=0;s<f;++s)(l=n[s])&&c.get(d[s])===l&&(a[s]=l)}function Zm(t){return t.__data__}function jm(t,n){if(!arguments.length)return Array.from(this,Zm);var e=n?Um:Xm,r=this._parents,a=this._groups;typeof t!="function"&&(t=qm(t));for(var i=a.length,o=new Array(i),s=new Array(i),l=new Array(i),c=0;c<i;++c){var f=r[c],h=a[c],d=h.length,g=Km(t.call(f,f&&f.__data__,c,r)),v=g.length,m=s[c]=new Array(v),b=o[c]=new Array(v),x=l[c]=new Array(d);e(f,h,m,b,x,g,n);for(var A=0,w=0,S,z;A<v;++A)if(S=m[A]){for(A>=w&&(w=A+1);!(z=b[w])&&++w<v;);S._next=z||null}}return o=new Qe(o,r),o._enter=s,o._exit=l,o}function Km(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Jm(){return new Qe(this._exit||this._groups.map(Af),this._parents)}function Qm(t,n,e){var r=this.enter(),a=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(a=n(a),a&&(a=a.selection())),e==null?i.remove():e(i),r&&a?r.merge(a).order():a}function tb(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,a=e.length,i=r.length,o=Math.min(a,i),s=new Array(a),l=0;l<o;++l)for(var c=e[l],f=r[l],h=c.length,d=s[l]=new Array(h),g,v=0;v<h;++v)(g=c[v]||f[v])&&(d[v]=g);for(;l<a;++l)s[l]=e[l];return new Qe(s,this._parents)}function eb(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function nb(t){t||(t=rb);function n(h,d){return h&&d?t(h.__data__,d.__data__):!h-!d}for(var e=this._groups,r=e.length,a=new Array(r),i=0;i<r;++i){for(var o=e[i],s=o.length,l=a[i]=new Array(s),c,f=0;f<s;++f)(c=o[f])&&(l[f]=c);l.sort(n)}return new Qe(a,this._parents).order()}function rb(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function ab(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ib(){return Array.from(this)}function ob(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function sb(){let t=0;for(const n of this)++t;return t}function lb(){return!this.node()}function cb(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var a=n[e],i=0,o=a.length,s;i<o;++i)(s=a[i])&&t.call(s,s.__data__,i,a);return this}function fb(t){return function(){this.removeAttribute(t)}}function ub(t){return function(){this.removeAttributeNS(t.space,t.local)}}function hb(t,n){return function(){this.setAttribute(t,n)}}function db(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function gb(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function pb(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function mb(t,n){var e=Fi(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?ub:fb:typeof n=="function"?e.local?pb:gb:e.local?db:hb)(e,n))}function _f(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function bb(t){return function(){this.style.removeProperty(t)}}function yb(t,n,e){return function(){this.style.setProperty(t,n,e)}}function vb(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function xb(t,n,e){return arguments.length>1?this.each((n==null?bb:typeof n=="function"?vb:yb)(t,n,e??"")):sa(this.node(),t)}function sa(t,n){return t.style.getPropertyValue(n)||_f(t).getComputedStyle(t,null).getPropertyValue(n)}function wb(t){return function(){delete this[t]}}function Ab(t,n){return function(){this[t]=n}}function _b(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function kb(t,n){return arguments.length>1?this.each((n==null?wb:typeof n=="function"?_b:Ab)(t,n)):this.node()[t]}function kf(t){return t.trim().split(/^|\s+/)}function Ws(t){return t.classList||new Sf(t)}function Sf(t){this._node=t,this._names=kf(t.getAttribute("class")||"")}Sf.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Mf(t,n){for(var e=Ws(t),r=-1,a=n.length;++r<a;)e.add(n[r])}function $f(t,n){for(var e=Ws(t),r=-1,a=n.length;++r<a;)e.remove(n[r])}function Sb(t){return function(){Mf(this,t)}}function Mb(t){return function(){$f(this,t)}}function $b(t,n){return function(){(n.apply(this,arguments)?Mf:$f)(this,t)}}function Lb(t,n){var e=kf(t+"");if(arguments.length<2){for(var r=Ws(this.node()),a=-1,i=e.length;++a<i;)if(!r.contains(e[a]))return!1;return!0}return this.each((typeof n=="function"?$b:n?Sb:Mb)(e,n))}function Cb(){this.textContent=""}function Tb(t){return function(){this.textContent=t}}function Ob(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function Nb(t){return arguments.length?this.each(t==null?Cb:(typeof t=="function"?Ob:Tb)(t)):this.node().textContent}function Eb(){this.innerHTML=""}function Db(t){return function(){this.innerHTML=t}}function Pb(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function zb(t){return arguments.length?this.each(t==null?Eb:(typeof t=="function"?Pb:Db)(t)):this.node().innerHTML}function Rb(){this.nextSibling&&this.parentNode.appendChild(this)}function Fb(){return this.each(Rb)}function Yb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ib(){return this.each(Yb)}function Hb(t){var n=typeof t=="function"?t:yf(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Bb(){return null}function Vb(t,n){var e=typeof t=="function"?t:yf(t),r=n==null?Bb:typeof n=="function"?n:Vs(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Wb(){var t=this.parentNode;t&&t.removeChild(this)}function Gb(){return this.each(Wb)}function qb(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Xb(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Ub(t){return this.select(t?Xb:qb)}function Zb(t){return arguments.length?this.property("__data__",t):this.node().__data__}function jb(t){return function(n){t.call(this,n,this.__data__)}}function Kb(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function Jb(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,a=n.length,i;e<a;++e)i=n[e],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):n[++r]=i;++r?n.length=r:delete this.__on}}}function Qb(t,n,e){return function(){var r=this.__on,a,i=jb(n);if(r){for(var o=0,s=r.length;o<s;++o)if((a=r[o]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=e),a.value=n;return}}this.addEventListener(t.type,i,e),a={type:t.type,name:t.name,value:n,listener:i,options:e},r?r.push(a):this.__on=[a]}}function ty(t,n,e){var r=Kb(t+""),a,i=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,c=s.length,f;l<c;++l)for(a=0,f=s[l];a<i;++a)if((o=r[a]).type===f.type&&o.name===f.name)return f.value}return}for(s=n?Qb:Jb,a=0;a<i;++a)this.each(s(r[a],n,e));return this}function Lf(t,n,e){var r=_f(t),a=r.CustomEvent;typeof a=="function"?a=new a(n,e):(a=r.document.createEvent("Event"),e?(a.initEvent(n,e.bubbles,e.cancelable),a.detail=e.detail):a.initEvent(n,!1,!1)),t.dispatchEvent(a)}function ey(t,n){return function(){return Lf(this,t,n)}}function ny(t,n){return function(){return Lf(this,t,n.apply(this,arguments))}}function ry(t,n){return this.each((typeof n=="function"?ny:ey)(t,n))}function*ay(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var Cf=[null];function Qe(t,n){this._groups=t,this._parents=n}function la(){return new Qe([[document.documentElement]],Cf)}function iy(){return this}Qe.prototype=la.prototype={constructor:Qe,select:Om,selectAll:Pm,selectChild:Ym,selectChildren:Vm,filter:Wm,data:jm,enter:Gm,exit:Jm,join:Qm,merge:tb,selection:iy,order:eb,sort:nb,call:ab,nodes:ib,node:ob,size:sb,empty:lb,each:cb,attr:mb,style:xb,property:kb,classed:Lb,text:Nb,html:zb,raise:Fb,lower:Ib,append:Hb,insert:Vb,remove:Gb,clone:Ub,datum:Zb,on:ty,dispatch:ry,[Symbol.iterator]:ay};function ot(t){return typeof t=="string"?new Qe([[document.querySelector(t)]],[document.documentElement]):new Qe([[t]],Cf)}function oy(t){let n;for(;n=t.sourceEvent;)t=n;return t}function sy(t,n){if(t=oy(t),n===void 0&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[t.clientX-a.left-n.clientLeft,t.clientY-a.top-n.clientTop]}}return[t.pageX,t.pageY]}function Gs(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Tf(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Ra(){}var Fa=.7,Ii=1/Fa,ca="\\s*([+-]?\\d+)\\s*",Ya="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ly=/^#([0-9a-f]{3,8})$/,cy=new RegExp(`^rgb\\(${ca},${ca},${ca}\\)$`),fy=new RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),uy=new RegExp(`^rgba\\(${ca},${ca},${ca},${Ya}\\)$`),hy=new RegExp(`^rgba\\(${Fn},${Fn},${Fn},${Ya}\\)$`),dy=new RegExp(`^hsl\\(${Ya},${Fn},${Fn}\\)$`),gy=new RegExp(`^hsla\\(${Ya},${Fn},${Fn},${Ya}\\)$`),Of={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Gs(Ra,$r,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Nf,formatHex:Nf,formatHex8:py,formatHsl:my,formatRgb:Ef,toString:Ef});function Nf(){return this.rgb().formatHex()}function py(){return this.rgb().formatHex8()}function my(){return Ff(this).formatHsl()}function Ef(){return this.rgb().formatRgb()}function $r(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=ly.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?Df(n):e===3?new We(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?Hi(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?Hi(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=cy.exec(t))?new We(n[1],n[2],n[3],1):(n=fy.exec(t))?new We(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=uy.exec(t))?Hi(n[1],n[2],n[3],n[4]):(n=hy.exec(t))?Hi(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=dy.exec(t))?Rf(n[1],n[2]/100,n[3]/100,1):(n=gy.exec(t))?Rf(n[1],n[2]/100,n[3]/100,n[4]):Of.hasOwnProperty(t)?Df(Of[t]):t==="transparent"?new We(NaN,NaN,NaN,0):null}function Df(t){return new We(t>>16&255,t>>8&255,t&255,1)}function Hi(t,n,e,r){return r<=0&&(t=n=e=NaN),new We(t,n,e,r)}function by(t){return t instanceof Ra||(t=$r(t)),t?(t=t.rgb(),new We(t.r,t.g,t.b,t.opacity)):new We}function qs(t,n,e,r){return arguments.length===1?by(t):new We(t,n,e,r??1)}function We(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}Gs(We,qs,Tf(Ra,{brighter(t){return t=t==null?Ii:Math.pow(Ii,t),new We(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Fa:Math.pow(Fa,t),new We(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new We(Lr(this.r),Lr(this.g),Lr(this.b),Bi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pf,formatHex:Pf,formatHex8:yy,formatRgb:zf,toString:zf}));function Pf(){return`#${Cr(this.r)}${Cr(this.g)}${Cr(this.b)}`}function yy(){return`#${Cr(this.r)}${Cr(this.g)}${Cr(this.b)}${Cr((isNaN(this.opacity)?1:this.opacity)*255)}`}function zf(){const t=Bi(this.opacity);return`${t===1?"rgb(":"rgba("}${Lr(this.r)}, ${Lr(this.g)}, ${Lr(this.b)}${t===1?")":`, ${t})`}`}function Bi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Lr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Cr(t){return t=Lr(t),(t<16?"0":"")+t.toString(16)}function Rf(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Mn(t,n,e,r)}function Ff(t){if(t instanceof Mn)return new Mn(t.h,t.s,t.l,t.opacity);if(t instanceof Ra||(t=$r(t)),!t)return new Mn;if(t instanceof Mn)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,a=Math.min(n,e,r),i=Math.max(n,e,r),o=NaN,s=i-a,l=(i+a)/2;return s?(n===i?o=(e-r)/s+(e<r)*6:e===i?o=(r-n)/s+2:o=(n-e)/s+4,s/=l<.5?i+a:2-i-a,o*=60):s=l>0&&l<1?0:o,new Mn(o,s,l,t.opacity)}function vy(t,n,e,r){return arguments.length===1?Ff(t):new Mn(t,n,e,r??1)}function Mn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}Gs(Mn,vy,Tf(Ra,{brighter(t){return t=t==null?Ii:Math.pow(Ii,t),new Mn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Fa:Math.pow(Fa,t),new Mn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,a=2*e-r;return new We(Xs(t>=240?t-240:t+120,a,r),Xs(t,a,r),Xs(t<120?t+240:t-120,a,r),this.opacity)},clamp(){return new Mn(Yf(this.h),Vi(this.s),Vi(this.l),Bi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Bi(this.opacity);return`${t===1?"hsl(":"hsla("}${Yf(this.h)}, ${Vi(this.s)*100}%, ${Vi(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Yf(t){return t=(t||0)%360,t<0?t+360:t}function Vi(t){return Math.max(0,Math.min(1,t||0))}function Xs(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}const Us=t=>()=>t;function xy(t,n){return function(e){return t+e*n}}function wy(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Ay(t){return(t=+t)==1?If:function(n,e){return e-n?wy(n,e,t):Us(isNaN(n)?e:n)}}function If(t,n){var e=n-t;return e?xy(t,e):Us(isNaN(t)?n:t)}const Wi=(function t(n){var e=Ay(n);function r(a,i){var o=e((a=qs(a)).r,(i=qs(i)).r),s=e(a.g,i.g),l=e(a.b,i.b),c=If(a.opacity,i.opacity);return function(f){return a.r=o(f),a.g=s(f),a.b=l(f),a.opacity=c(f),a+""}}return r.gamma=t,r})(1);function _y(t,n){n||(n=[]);var e=t?Math.min(n.length,t.length):0,r=n.slice(),a;return function(i){for(a=0;a<e;++a)r[a]=t[a]*(1-i)+n[a]*i;return r}}function ky(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Sy(t,n){var e=n?n.length:0,r=t?Math.min(e,t.length):0,a=new Array(r),i=new Array(e),o;for(o=0;o<r;++o)a[o]=Ks(t[o],n[o]);for(;o<e;++o)i[o]=n[o];return function(s){for(o=0;o<r;++o)i[o]=a[o](s);return i}}function My(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function De(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function Ia(t,n){var e={},r={},a;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in t?e[a]=Ks(t[a],n[a]):r[a]=n[a];return function(i){for(a in e)r[a]=e[a](i);return r}}var Zs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,js=new RegExp(Zs.source,"g");function $y(t){return function(){return t}}function Ly(t){return function(n){return t(n)+""}}function Hf(t,n){var e=Zs.lastIndex=js.lastIndex=0,r,a,i,o=-1,s=[],l=[];for(t=t+"",n=n+"";(r=Zs.exec(t))&&(a=js.exec(n));)(i=a.index)>e&&(i=n.slice(e,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:De(r,a)})),e=js.lastIndex;return e<n.length&&(i=n.slice(e),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?Ly(l[0].x):$y(n):(n=l.length,function(c){for(var f=0,h;f<n;++f)s[(h=l[f]).i]=h.x(c);return s.join("")})}function Ks(t,n){var e=typeof n,r;return n==null||e==="boolean"?Us(n):(e==="number"?De:e==="string"?(r=$r(n))?(n=r,Wi):Hf:n instanceof $r?Wi:n instanceof Date?My:ky(n)?_y:Array.isArray(n)?Sy:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?Ia:De)(t,n)}function Cy(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var Bf=180/Math.PI,Js={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vf(t,n,e,r,a,i){var o,s,l;return(o=Math.sqrt(t*t+n*n))&&(t/=o,n/=o),(l=t*e+n*r)&&(e-=t*l,r-=n*l),(s=Math.sqrt(e*e+r*r))&&(e/=s,r/=s,l/=s),t*r<n*e&&(t=-t,n=-n,l=-l,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(n,t)*Bf,skewX:Math.atan(l)*Bf,scaleX:o,scaleY:s}}var Gi;function Ty(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Js:Vf(n.a,n.b,n.c,n.d,n.e,n.f)}function Oy(t){return t==null||(Gi||(Gi=document.createElementNS("http://www.w3.org/2000/svg","g")),Gi.setAttribute("transform",t),!(t=Gi.transform.baseVal.consolidate()))?Js:(t=t.matrix,Vf(t.a,t.b,t.c,t.d,t.e,t.f))}function Wf(t,n,e,r){function a(c){return c.length?c.pop()+" ":""}function i(c,f,h,d,g,v){if(c!==h||f!==d){var m=g.push("translate(",null,n,null,e);v.push({i:m-4,x:De(c,h)},{i:m-2,x:De(f,d)})}else(h||d)&&g.push("translate("+h+n+d+e)}function o(c,f,h,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:h.push(a(h)+"rotate(",null,r)-2,x:De(c,f)})):f&&h.push(a(h)+"rotate("+f+r)}function s(c,f,h,d){c!==f?d.push({i:h.push(a(h)+"skewX(",null,r)-2,x:De(c,f)}):f&&h.push(a(h)+"skewX("+f+r)}function l(c,f,h,d,g,v){if(c!==h||f!==d){var m=g.push(a(g)+"scale(",null,",",null,")");v.push({i:m-4,x:De(c,h)},{i:m-2,x:De(f,d)})}else(h!==1||d!==1)&&g.push(a(g)+"scale("+h+","+d+")")}return function(c,f){var h=[],d=[];return c=t(c),f=t(f),i(c.translateX,c.translateY,f.translateX,f.translateY,h,d),o(c.rotate,f.rotate,h,d),s(c.skewX,f.skewX,h,d),l(c.scaleX,c.scaleY,f.scaleX,f.scaleY,h,d),c=f=null,function(g){for(var v=-1,m=d.length,b;++v<m;)h[(b=d[v]).i]=b.x(g);return h.join("")}}}var Ny=Wf(Ty,"px, ","px)","deg)"),Ey=Wf(Oy,", ",")",")"),fa=0,Ha=0,Ba=0,Gf=1e3,qi,Va,Xi=0,Tr=0,Ui=0,Wa=typeof performance=="object"&&performance.now?performance:Date,qf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qs(){return Tr||(qf(Dy),Tr=Wa.now()+Ui)}function Dy(){Tr=0}function Zi(){this._call=this._time=this._next=null}Zi.prototype=Xf.prototype={constructor:Zi,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?Qs():+e)+(n==null?0:+n),!this._next&&Va!==this&&(Va?Va._next=this:qi=this,Va=this),this._call=t,this._time=e,tl()},stop:function(){this._call&&(this._call=null,this._time=1/0,tl())}};function Xf(t,n,e){var r=new Zi;return r.restart(t,n,e),r}function Py(){Qs(),++fa;for(var t=qi,n;t;)(n=Tr-t._time)>=0&&t._call.call(void 0,n),t=t._next;--fa}function Uf(){Tr=(Xi=Wa.now())+Ui,fa=Ha=0;try{Py()}finally{fa=0,Ry(),Tr=0}}function zy(){var t=Wa.now(),n=t-Xi;n>Gf&&(Ui-=n,Xi=t)}function Ry(){for(var t,n=qi,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:qi=e);Va=t,tl(r)}function tl(t){if(!fa){Ha&&(Ha=clearTimeout(Ha));var n=t-Tr;n>24?(t<1/0&&(Ha=setTimeout(Uf,t-Wa.now()-Ui)),Ba&&(Ba=clearInterval(Ba))):(Ba||(Xi=Wa.now(),Ba=setInterval(zy,Gf)),fa=1,qf(Uf))}}function Zf(t,n,e){var r=new Zi;return n=n==null?0:+n,r.restart(a=>{r.stop(),t(a+n)},n,e),r}var Fy=Hs("start","end","cancel","interrupt"),Yy=[],jf=0,Kf=1,el=2,ji=3,Jf=4,nl=5,Ki=6;function Ji(t,n,e,r,a,i){var o=t.__transition;if(!o)t.__transition={};else if(e in o)return;Iy(t,e,{name:n,index:r,group:a,on:Fy,tween:Yy,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:jf})}function rl(t,n){var e=$n(t,n);if(e.state>jf)throw new Error("too late; already scheduled");return e}function Yn(t,n){var e=$n(t,n);if(e.state>ji)throw new Error("too late; already running");return e}function $n(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Iy(t,n,e){var r=t.__transition,a;r[n]=e,e.timer=Xf(i,0,e.time);function i(c){e.state=Kf,e.timer.restart(o,e.delay,e.time),e.delay<=c&&o(c-e.delay)}function o(c){var f,h,d,g;if(e.state!==Kf)return l();for(f in r)if(g=r[f],g.name===e.name){if(g.state===ji)return Zf(o);g.state===Jf?(g.state=Ki,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[f]):+f<n&&(g.state=Ki,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[f])}if(Zf(function(){e.state===ji&&(e.state=Jf,e.timer.restart(s,e.delay,e.time),s(c))}),e.state=el,e.on.call("start",t,t.__data__,e.index,e.group),e.state===el){for(e.state=ji,a=new Array(d=e.tween.length),f=0,h=-1;f<d;++f)(g=e.tween[f].value.call(t,t.__data__,e.index,e.group))&&(a[++h]=g);a.length=h+1}}function s(c){for(var f=c<e.duration?e.ease.call(null,c/e.duration):(e.timer.restart(l),e.state=nl,1),h=-1,d=a.length;++h<d;)a[h].call(t,f);e.state===nl&&(e.on.call("end",t,t.__data__,e.index,e.group),l())}function l(){e.state=Ki,e.timer.stop(),delete r[n];for(var c in r)return;delete t.__transition}}function Hy(t,n){var e=t.__transition,r,a,i=!0,o;if(e){n=n==null?null:n+"";for(o in e){if((r=e[o]).name!==n){i=!1;continue}a=r.state>el&&r.state<nl,r.state=Ki,r.timer.stop(),r.on.call(a?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete e[o]}i&&delete t.__transition}}function By(t){return this.each(function(){Hy(this,t)})}function Vy(t,n){var e,r;return function(){var a=Yn(this,t),i=a.tween;if(i!==e){r=e=i;for(var o=0,s=r.length;o<s;++o)if(r[o].name===n){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function Wy(t,n,e){var r,a;if(typeof e!="function")throw new Error;return function(){var i=Yn(this,t),o=i.tween;if(o!==r){a=(r=o).slice();for(var s={name:n,value:e},l=0,c=a.length;l<c;++l)if(a[l].name===n){a[l]=s;break}l===c&&a.push(s)}i.tween=a}}function Gy(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r=$n(this.node(),e).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===t)return o.value;return null}return this.each((n==null?Vy:Wy)(e,t,n))}function al(t,n,e){var r=t._id;return t.each(function(){var a=Yn(this,r);(a.value||(a.value={}))[n]=e.apply(this,arguments)}),function(a){return $n(a,r).value[n]}}function Qf(t,n){var e;return(typeof n=="number"?De:n instanceof $r?Wi:(e=$r(n))?(n=e,Wi):Hf)(t,n)}function qy(t){return function(){this.removeAttribute(t)}}function Xy(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Uy(t,n,e){var r,a=e+"",i;return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=n(r=o,e)}}function Zy(t,n,e){var r,a=e+"",i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=n(r=o,e)}}function jy(t,n,e){var r,a,i;return function(){var o,s=e(this),l;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=s+"",o===l?null:o===r&&l===a?i:(a=l,i=n(r=o,s)))}}function Ky(t,n,e){var r,a,i;return function(){var o,s=e(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=s+"",o===l?null:o===r&&l===a?i:(a=l,i=n(r=o,s)))}}function Jy(t,n){var e=Fi(t),r=e==="transform"?Ey:Qf;return this.attrTween(t,typeof n=="function"?(e.local?Ky:jy)(e,r,al(this,"attr."+t,n)):n==null?(e.local?Xy:qy)(e):(e.local?Zy:Uy)(e,r,n))}function Qy(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function t1(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function e1(t,n){var e,r;function a(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&t1(t,i)),e}return a._value=n,a}function n1(t,n){var e,r;function a(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Qy(t,i)),e}return a._value=n,a}function r1(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var r=Fi(t);return this.tween(e,(r.local?e1:n1)(r,n))}function a1(t,n){return function(){rl(this,t).delay=+n.apply(this,arguments)}}function i1(t,n){return n=+n,function(){rl(this,t).delay=n}}function o1(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?a1:i1)(n,t)):$n(this.node(),n).delay}function s1(t,n){return function(){Yn(this,t).duration=+n.apply(this,arguments)}}function l1(t,n){return n=+n,function(){Yn(this,t).duration=n}}function c1(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?s1:l1)(n,t)):$n(this.node(),n).duration}function f1(t,n){if(typeof n!="function")throw new Error;return function(){Yn(this,t).ease=n}}function u1(t){var n=this._id;return arguments.length?this.each(f1(n,t)):$n(this.node(),n).ease}function h1(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;Yn(this,t).ease=e}}function d1(t){if(typeof t!="function")throw new Error;return this.each(h1(this._id,t))}function g1(t){typeof t!="function"&&(t=xf(t));for(var n=this._groups,e=n.length,r=new Array(e),a=0;a<e;++a)for(var i=n[a],o=i.length,s=r[a]=[],l,c=0;c<o;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&s.push(l);return new jn(r,this._parents,this._name,this._id)}function p1(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,a=e.length,i=Math.min(r,a),o=new Array(r),s=0;s<i;++s)for(var l=n[s],c=e[s],f=l.length,h=o[s]=new Array(f),d,g=0;g<f;++g)(d=l[g]||c[g])&&(h[g]=d);for(;s<r;++s)o[s]=n[s];return new jn(o,this._parents,this._name,this._id)}function m1(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function b1(t,n,e){var r,a,i=m1(n)?rl:Yn;return function(){var o=i(this,t),s=o.on;s!==r&&(a=(r=s).copy()).on(n,e),o.on=a}}function y1(t,n){var e=this._id;return arguments.length<2?$n(this.node(),e).on.on(t):this.each(b1(e,t,n))}function v1(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function x1(){return this.on("end.remove",v1(this._id))}function w1(t){var n=this._name,e=this._id;typeof t!="function"&&(t=Vs(t));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var s=r[o],l=s.length,c=i[o]=new Array(l),f,h,d=0;d<l;++d)(f=s[d])&&(h=t.call(f,f.__data__,d,s))&&("__data__"in f&&(h.__data__=f.__data__),c[d]=h,Ji(c[d],n,e,d,c,$n(f,e)));return new jn(i,this._parents,n,e)}function A1(t){var n=this._name,e=this._id;typeof t!="function"&&(t=vf(t));for(var r=this._groups,a=r.length,i=[],o=[],s=0;s<a;++s)for(var l=r[s],c=l.length,f,h=0;h<c;++h)if(f=l[h]){for(var d=t.call(f,f.__data__,h,l),g,v=$n(f,e),m=0,b=d.length;m<b;++m)(g=d[m])&&Ji(g,n,e,m,d,v);i.push(d),o.push(f)}return new jn(i,o,n,e)}var _1=la.prototype.constructor;function k1(){return new _1(this._groups,this._parents)}function S1(t,n){var e,r,a;return function(){var i=sa(this,t),o=(this.style.removeProperty(t),sa(this,t));return i===o?null:i===e&&o===r?a:a=n(e=i,r=o)}}function tu(t){return function(){this.style.removeProperty(t)}}function M1(t,n,e){var r,a=e+"",i;return function(){var o=sa(this,t);return o===a?null:o===r?i:i=n(r=o,e)}}function $1(t,n,e){var r,a,i;return function(){var o=sa(this,t),s=e(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),sa(this,t))),o===l?null:o===r&&l===a?i:(a=l,i=n(r=o,s))}}function L1(t,n){var e,r,a,i="style."+n,o="end."+i,s;return function(){var l=Yn(this,t),c=l.on,f=l.value[i]==null?s||(s=tu(n)):void 0;(c!==e||a!==f)&&(r=(e=c).copy()).on(o,a=f),l.on=r}}function C1(t,n,e){var r=(t+="")=="transform"?Ny:Qf;return n==null?this.styleTween(t,S1(t,r)).on("end.style."+t,tu(t)):typeof n=="function"?this.styleTween(t,$1(t,r,al(this,"style."+t,n))).each(L1(this._id,t)):this.styleTween(t,M1(t,r,n),e).on("end.style."+t,null)}function T1(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function O1(t,n,e){var r,a;function i(){var o=n.apply(this,arguments);return o!==a&&(r=(a=o)&&T1(t,o,e)),r}return i._value=n,i}function N1(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,O1(t,n,e??""))}function E1(t){return function(){this.textContent=t}}function D1(t){return function(){var n=t(this);this.textContent=n??""}}function P1(t){return this.tween("text",typeof t=="function"?D1(al(this,"text",t)):E1(t==null?"":t+""))}function z1(t){return function(n){this.textContent=t.call(this,n)}}function R1(t){var n,e;function r(){var a=t.apply(this,arguments);return a!==e&&(n=(e=a)&&z1(a)),n}return r._value=t,r}function F1(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,R1(t))}function Y1(){for(var t=this._name,n=this._id,e=nu(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,l,c=0;c<s;++c)if(l=o[c]){var f=$n(l,n);Ji(l,t,e,c,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new jn(r,this._parents,t,e)}function I1(){var t,n,e=this,r=e._id,a=e.size();return new Promise(function(i,o){var s={value:o},l={value:function(){--a===0&&i()}};e.each(function(){var c=Yn(this,r),f=c.on;f!==t&&(n=(t=f).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(l)),c.on=n}),a===0&&i()})}var H1=0;function jn(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function eu(t){return la().transition(t)}function nu(){return++H1}var Kn=la.prototype;jn.prototype=eu.prototype={constructor:jn,select:w1,selectAll:A1,selectChild:Kn.selectChild,selectChildren:Kn.selectChildren,filter:g1,merge:p1,selection:k1,transition:Y1,call:Kn.call,nodes:Kn.nodes,node:Kn.node,size:Kn.size,empty:Kn.empty,each:Kn.each,on:y1,attr:Jy,attrTween:r1,style:C1,styleTween:N1,text:P1,textTween:F1,remove:x1,tween:Gy,delay:o1,duration:c1,ease:u1,easeVarying:d1,end:I1,[Symbol.iterator]:Kn[Symbol.iterator]};function Qi(t){return--t*t*t+1}function to(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var B1={time:null,delay:0,duration:250,ease:to};function V1(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function W1(t){var n,e;t instanceof jn?(n=t._id,t=t._name):(n=nu(),(e=B1).time=Qs(),t=t==null?null:t+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,l,c=0;c<s;++c)(l=o[c])&&Ji(l,t,n,c,o,e||V1(l,n));return new jn(r,this._parents,t,n)}la.prototype.interrupt=By,la.prototype.transition=W1;const il=Math.PI,ol=2*il,Or=1e-6,G1=ol-Or;function ru(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function q1(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return ru;const e=10**n;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*e)/e+r[a]}}class X1{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?ru:q1(n)}moveTo(n,e){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,e){this._append`L${this._x1=+n},${this._y1=+e}`}quadraticCurveTo(n,e,r,a){this._append`Q${+n},${+e},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(n,e,r,a,i,o){this._append`C${+n},${+e},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(n,e,r,a,i){if(n=+n,e=+e,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,s=this._y1,l=r-n,c=a-e,f=o-n,h=s-e,d=f*f+h*h;if(this._x1===null)this._append`M${this._x1=n},${this._y1=e}`;else if(d>Or)if(!(Math.abs(h*l-c*f)>Or)||!i)this._append`L${this._x1=n},${this._y1=e}`;else{let g=r-o,v=a-s,m=l*l+c*c,b=g*g+v*v,x=Math.sqrt(m),A=Math.sqrt(d),w=i*Math.tan((il-Math.acos((m+d-b)/(2*x*A)))/2),S=w/A,z=w/x;Math.abs(S-1)>Or&&this._append`L${n+S*f},${e+S*h}`,this._append`A${i},${i},0,0,${+(h*g>f*v)},${this._x1=n+z*l},${this._y1=e+z*c}`}}arc(n,e,r,a,i,o){if(n=+n,e=+e,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(a),l=r*Math.sin(a),c=n+s,f=e+l,h=1^o,d=o?a-i:i-a;this._x1===null?this._append`M${c},${f}`:(Math.abs(this._x1-c)>Or||Math.abs(this._y1-f)>Or)&&this._append`L${c},${f}`,r&&(d<0&&(d=d%ol+ol),d>G1?this._append`A${r},${r},0,1,${h},${n-s},${e-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=f}`:d>Or&&this._append`A${r},${r},0,${+(d>=il)},${h},${this._x1=n+r*Math.cos(i)},${this._y1=e+r*Math.sin(i)}`)}rect(n,e,r,a){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function U1(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function eo(t,n){if(!isFinite(t)||t===0)return null;var e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ua(t){return t=eo(Math.abs(t)),t?t[1]:NaN}function Z1(t,n){return function(e,r){for(var a=e.length,i=[],o=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(e.substring(a-=s,a+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return i.reverse().join(n)}}function j1(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var K1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function no(t){if(!(n=K1.exec(t)))throw new Error("invalid format: "+t);var n;return new sl({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}no.prototype=sl.prototype;function sl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}sl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function J1(t){t:for(var n=t.length,e=1,r=-1,a;e<n;++e)switch(t[e]){case".":r=a=e;break;case"0":r===0&&(r=e),a=e;break;default:if(!+t[e])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(a+1):t}var ro;function Q1(t,n){var e=eo(t,n);if(!e)return ro=void 0,t.toPrecision(n);var r=e[0],a=e[1],i=a-(ro=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+eo(t,Math.max(0,n+i-1))[0]}function au(t,n){var e=eo(t,n);if(!e)return t+"";var r=e[0],a=e[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const iu={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:U1,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>au(t*100,n),r:au,s:Q1,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ou(t){return t}var su=Array.prototype.map,lu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tv(t){var n=t.grouping===void 0||t.thousands===void 0?ou:Z1(su.call(t.grouping,Number),t.thousands+""),e=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?ou:j1(su.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(h,d){h=no(h);var g=h.fill,v=h.align,m=h.sign,b=h.symbol,x=h.zero,A=h.width,w=h.comma,S=h.precision,z=h.trim,Y=h.type;Y==="n"?(w=!0,Y="g"):iu[Y]||(S===void 0&&(S=12),z=!0,Y="g"),(x||g==="0"&&v==="=")&&(x=!0,g="0",v="=");var G=(d&&d.prefix!==void 0?d.prefix:"")+(b==="$"?e:b==="#"&&/[boxX]/.test(Y)?"0"+Y.toLowerCase():""),_=(b==="$"?r:/[%p]/.test(Y)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),B=iu[Y],P=/[defgprs%]/.test(Y);S=S===void 0?6:/[gprs]/.test(Y)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function $(N){var L=G,M=_,D,q,V;if(Y==="c")M=B(N)+M,N="";else{N=+N;var C=N<0||1/N<0;if(N=isNaN(N)?l:B(Math.abs(N),S),z&&(N=J1(N)),C&&+N==0&&m!=="+"&&(C=!1),L=(C?m==="("?m:s:m==="-"||m==="("?"":m)+L,M=(Y==="s"&&!isNaN(N)&&ro!==void 0?lu[8+ro/3]:"")+M+(C&&m==="("?")":""),P){for(D=-1,q=N.length;++D<q;)if(V=N.charCodeAt(D),48>V||V>57){M=(V===46?a+N.slice(D+1):N.slice(D))+M,N=N.slice(0,D);break}}}w&&!x&&(N=n(N,1/0));var I=L.length+N.length+M.length,W=I<A?new Array(A-I+1).join(g):"";switch(w&&x&&(N=n(W+N,W.length?A-M.length:1/0),W=""),v){case"<":N=L+N+M+W;break;case"=":N=L+W+N+M;break;case"^":N=W.slice(0,I=W.length>>1)+L+N+M+W.slice(I);break;default:N=W+L+N+M;break}return i(N)}return $.toString=function(){return h+""},$}function f(h,d){var g=Math.max(-8,Math.min(8,Math.floor(ua(d)/3)))*3,v=Math.pow(10,-g),m=c((h=no(h),h.type="f",h),{suffix:lu[8+g/3]});return function(b){return m(v*b)}}return{format:c,formatPrefix:f}}var ao,io,cu;ev({thousands:",",grouping:[3],currency:["$",""]});function ev(t){return ao=tv(t),io=ao.format,cu=ao.formatPrefix,ao}function nv(t){return Math.max(0,-ua(Math.abs(t)))}function rv(t,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ua(n)/3)))*3-ua(Math.abs(t)))}function av(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ua(n)-ua(t))+1}function oo(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}const fu=Symbol("implicit");function ll(){var t=new Fs,n=[],e=[],r=fu;function a(i){let o=t.get(i);if(o===void 0){if(r!==fu)return r;t.set(i,o=n.push(i)-1)}return e[o%e.length]}return a.domain=function(i){if(!arguments.length)return n.slice();n=[],t=new Fs;for(const o of i)t.has(o)||t.set(o,n.push(o)-1);return a},a.range=function(i){return arguments.length?(e=Array.from(i),a):e.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return ll(n,e).unknown(r)},oo.apply(a,arguments),a}function tn(){var t=ll().unknown(void 0),n=t.domain,e=t.range,r=0,a=1,i,o,s=!1,l=0,c=0,f=.5;delete t.unknown;function h(){var d=n().length,g=a<r,v=g?a:r,m=g?r:a;i=(m-v)/Math.max(1,d-l+c*2),s&&(i=Math.floor(i)),v+=(m-v-i*(d-l))*f,o=i*(1-l),s&&(v=Math.round(v),o=Math.round(o));var b=mm(d).map(function(x){return v+i*x});return e(g?b.reverse():b)}return t.domain=function(d){return arguments.length?(n(d),h()):n()},t.range=function(d){return arguments.length?([r,a]=d,r=+r,a=+a,h()):[r,a]},t.rangeRound=function(d){return[r,a]=d,r=+r,a=+a,s=!0,h()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(d){return arguments.length?(s=!!d,h()):s},t.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),h()):l},t.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},t.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},t.align=function(d){return arguments.length?(f=Math.max(0,Math.min(1,d)),h()):f},t.copy=function(){return tn(n(),[r,a]).round(s).paddingInner(l).paddingOuter(c).align(f)},oo.apply(h(),arguments)}function uu(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return uu(n())},t}function so(){return uu(tn.apply(null,arguments).paddingInner(1))}function iv(t){return function(){return t}}function ov(t){return+t}var hu=[0,1];function ha(t){return t}function cl(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:iv(isNaN(n)?NaN:.5)}function sv(t,n){var e;return t>n&&(e=t,t=n,n=e),function(r){return Math.max(t,Math.min(n,r))}}function lv(t,n,e){var r=t[0],a=t[1],i=n[0],o=n[1];return a<r?(r=cl(a,r),i=e(o,i)):(r=cl(r,a),i=e(i,o)),function(s){return i(r(s))}}function cv(t,n,e){var r=Math.min(t.length,n.length)-1,a=new Array(r),i=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++o<r;)a[o]=cl(t[o],t[o+1]),i[o]=e(n[o],n[o+1]);return function(s){var l=am(t,s,1,r)-1;return i[l](a[l](s))}}function du(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function gu(){var t=hu,n=hu,e=Ks,r,a,i,o=ha,s,l,c;function f(){var d=Math.min(t.length,n.length);return o!==ha&&(o=sv(t[0],t[d-1])),s=d>2?cv:lv,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?i:(l||(l=s(t.map(r),n,e)))(r(o(d)))}return h.invert=function(d){return o(a((c||(c=s(n,t.map(r),De)))(d)))},h.domain=function(d){return arguments.length?(t=Array.from(d,ov),f()):t.slice()},h.range=function(d){return arguments.length?(n=Array.from(d),f()):n.slice()},h.rangeRound=function(d){return n=Array.from(d),e=Cy,f()},h.clamp=function(d){return arguments.length?(o=d?!0:ha,f()):o!==ha},h.interpolate=function(d){return arguments.length?(e=d,f()):e},h.unknown=function(d){return arguments.length?(i=d,h):i},function(d,g){return r=d,a=g,f()}}function fv(){return gu()(ha,ha)}function uv(t,n,e,r){var a=pm(t,n,e),i;switch(r=no(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(n));return r.precision==null&&!isNaN(i=rv(a,o))&&(r.precision=i),cu(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=av(a,Math.max(Math.abs(t),Math.abs(n))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=nv(a))&&(r.precision=i-(r.type==="%")*2);break}}return io(r)}function pu(t){var n=t.domain;return t.ticks=function(e){var r=n();return gm(r[0],r[r.length-1],e??10)},t.tickFormat=function(e,r){var a=n();return uv(a[0],a[a.length-1],e??10,r)},t.nice=function(e){e==null&&(e=10);var r=n(),a=0,i=r.length-1,o=r[a],s=r[i],l,c,f=10;for(s<o&&(c=o,o=s,s=c,c=a,a=i,i=c);f-- >0;){if(c=Ys(o,s,e),c===l)return r[a]=o,r[i]=s,n(r);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function Pe(){var t=fv();return t.copy=function(){return du(t,Pe())},oo.apply(t,arguments),pu(t)}function mu(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function bu(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function hv(t){var n=1,e=t(mu(n),bu(n));return e.constant=function(r){return arguments.length?t(mu(n=+r),bu(n)):n},pu(e)}function cr(){var t=hv(gu());return t.copy=function(){return du(t,cr()).constant(t.constant())},oo.apply(t,arguments)}const fl=new Date,ul=new Date;function In(t,n,e,r){function a(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(t(i=new Date(+i)),i),a.ceil=i=>(t(i=new Date(i-1)),n(i,1),t(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o<s-i?o:s},a.offset=(i,o)=>(n(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const l=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i<o)||!(s>0))return l;let c;do l.push(c=new Date(+i)),n(i,s),t(i);while(c<i&&i<o);return l},a.filter=i=>In(o=>{if(o>=o)for(;t(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;n(o,-1),!i(o););else for(;--s>=0;)for(;n(o,1),!i(o););}),e&&(a.count=(i,o)=>(fl.setTime(+i),ul.setTime(+o),t(fl),t(ul),Math.floor(e(fl,ul))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const hl=1e3*60,Ga=hl*60*24,yu=Ga*7,dl=In(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*hl)/Ga,t=>t.getDate()-1);dl.range;const gl=In(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/Ga,t=>t.getUTCDate()-1);gl.range,In(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/Ga,t=>Math.floor(t/Ga)).range;function Nr(t){return In(n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},(n,e)=>{n.setDate(n.getDate()+e*7)},(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*hl)/yu)}const vu=Nr(0),lo=Nr(1),dv=Nr(2),gv=Nr(3),da=Nr(4),pv=Nr(5),mv=Nr(6);vu.range,lo.range,dv.range,gv.range,da.range,pv.range,mv.range;function Er(t){return In(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e*7)},(n,e)=>(e-n)/yu)}const xu=Er(0),co=Er(1),bv=Er(2),yv=Er(3),ga=Er(4),vv=Er(5),xv=Er(6);xu.range,co.range,bv.range,yv.range,ga.range,vv.range,xv.range;const Dr=In(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n)},(t,n)=>n.getFullYear()-t.getFullYear(),t=>t.getFullYear());Dr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:In(n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e*t)}),Dr.range;const Pr=In(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)},(t,n)=>n.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Pr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:In(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e*t)}),Pr.range;function pl(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ml(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function qa(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function wv(t){var n=t.dateTime,e=t.date,r=t.time,a=t.periods,i=t.days,o=t.shortDays,s=t.months,l=t.shortMonths,c=Xa(a),f=Ua(a),h=Xa(i),d=Ua(i),g=Xa(o),v=Ua(o),m=Xa(s),b=Ua(s),x=Xa(l),A=Ua(l),w={a:V,A:C,b:I,B:W,c:null,d:Mu,e:Mu,f:Wv,g:tx,G:nx,H:Hv,I:Bv,j:Vv,L:$u,m:Gv,M:qv,p:it,q:rt,Q:Eu,s:Du,S:Xv,u:Uv,U:Zv,V:jv,w:Kv,W:Jv,x:null,X:null,y:Qv,Y:ex,Z:rx,"%":Nu},S={a:ct,A:pt,b:xt,B:yt,c:null,d:Cu,e:Cu,f:sx,g:bx,G:vx,H:ax,I:ix,j:ox,L:Tu,m:lx,M:cx,p:bt,q:kt,Q:Eu,s:Du,S:fx,u:ux,U:hx,V:dx,w:gx,W:px,x:null,X:null,y:mx,Y:yx,Z:xx,"%":Nu},z={a:P,A:$,b:N,B:L,c:M,d:ku,e:ku,f:Rv,g:_u,G:Au,H:Su,I:Su,j:Ev,L:zv,m:Nv,M:Dv,p:B,q:Ov,Q:Yv,s:Iv,S:Pv,u:Mv,U:$v,V:Lv,w:Sv,W:Cv,x:D,X:q,y:_u,Y:Au,Z:Tv,"%":Fv};w.x=Y(e,w),w.X=Y(r,w),w.c=Y(n,w),S.x=Y(e,S),S.X=Y(r,S),S.c=Y(n,S);function Y(j,J){return function(X){var O=[],ht=-1,mt=0,vt=j.length,Tt,Ht,Ft;for(X instanceof Date||(X=new Date(+X));++ht<vt;)j.charCodeAt(ht)===37&&(O.push(j.slice(mt,ht)),(Ht=wu[Tt=j.charAt(++ht)])!=null?Tt=j.charAt(++ht):Ht=Tt==="e"?" ":"0",(Ft=J[Tt])&&(Tt=Ft(X,Ht)),O.push(Tt),mt=ht+1);return O.push(j.slice(mt,ht)),O.join("")}}function G(j,J){return function(X){var O=qa(1900,void 0,1),ht=_(O,j,X+="",0),mt,vt;if(ht!=X.length)return null;if("Q"in O)return new Date(O.Q);if("s"in O)return new Date(O.s*1e3+("L"in O?O.L:0));if(J&&!("Z"in O)&&(O.Z=0),"p"in O&&(O.H=O.H%12+O.p*12),O.m===void 0&&(O.m="q"in O?O.q:0),"V"in O){if(O.V<1||O.V>53)return null;"w"in O||(O.w=1),"Z"in O?(mt=ml(qa(O.y,0,1)),vt=mt.getUTCDay(),mt=vt>4||vt===0?co.ceil(mt):co(mt),mt=gl.offset(mt,(O.V-1)*7),O.y=mt.getUTCFullYear(),O.m=mt.getUTCMonth(),O.d=mt.getUTCDate()+(O.w+6)%7):(mt=pl(qa(O.y,0,1)),vt=mt.getDay(),mt=vt>4||vt===0?lo.ceil(mt):lo(mt),mt=dl.offset(mt,(O.V-1)*7),O.y=mt.getFullYear(),O.m=mt.getMonth(),O.d=mt.getDate()+(O.w+6)%7)}else("W"in O||"U"in O)&&("w"in O||(O.w="u"in O?O.u%7:"W"in O?1:0),vt="Z"in O?ml(qa(O.y,0,1)).getUTCDay():pl(qa(O.y,0,1)).getDay(),O.m=0,O.d="W"in O?(O.w+6)%7+O.W*7-(vt+5)%7:O.w+O.U*7-(vt+6)%7);return"Z"in O?(O.H+=O.Z/100|0,O.M+=O.Z%100,ml(O)):pl(O)}}function _(j,J,X,O){for(var ht=0,mt=J.length,vt=X.length,Tt,Ht;ht<mt;){if(O>=vt)return-1;if(Tt=J.charCodeAt(ht++),Tt===37){if(Tt=J.charAt(ht++),Ht=z[Tt in wu?J.charAt(ht++):Tt],!Ht||(O=Ht(j,X,O))<0)return-1}else if(Tt!=X.charCodeAt(O++))return-1}return O}function B(j,J,X){var O=c.exec(J.slice(X));return O?(j.p=f.get(O[0].toLowerCase()),X+O[0].length):-1}function P(j,J,X){var O=g.exec(J.slice(X));return O?(j.w=v.get(O[0].toLowerCase()),X+O[0].length):-1}function $(j,J,X){var O=h.exec(J.slice(X));return O?(j.w=d.get(O[0].toLowerCase()),X+O[0].length):-1}function N(j,J,X){var O=x.exec(J.slice(X));return O?(j.m=A.get(O[0].toLowerCase()),X+O[0].length):-1}function L(j,J,X){var O=m.exec(J.slice(X));return O?(j.m=b.get(O[0].toLowerCase()),X+O[0].length):-1}function M(j,J,X){return _(j,n,J,X)}function D(j,J,X){return _(j,e,J,X)}function q(j,J,X){return _(j,r,J,X)}function V(j){return o[j.getDay()]}function C(j){return i[j.getDay()]}function I(j){return l[j.getMonth()]}function W(j){return s[j.getMonth()]}function it(j){return a[+(j.getHours()>=12)]}function rt(j){return 1+~~(j.getMonth()/3)}function ct(j){return o[j.getUTCDay()]}function pt(j){return i[j.getUTCDay()]}function xt(j){return l[j.getUTCMonth()]}function yt(j){return s[j.getUTCMonth()]}function bt(j){return a[+(j.getUTCHours()>=12)]}function kt(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var J=Y(j+="",w);return J.toString=function(){return j},J},parse:function(j){var J=G(j+="",!1);return J.toString=function(){return j},J},utcFormat:function(j){var J=Y(j+="",S);return J.toString=function(){return j},J},utcParse:function(j){var J=G(j+="",!0);return J.toString=function(){return j},J}}}var wu={"-":"",_:" ",0:"0"},de=/^\s*\d+/,Av=/^%/,_v=/[\\^$*+?|[\]().{}]/g;function jt(t,n,e){var r=t<0?"-":"",a=(r?-t:t)+"",i=a.length;return r+(i<e?new Array(e-i+1).join(n)+a:a)}function kv(t){return t.replace(_v,"\\$&")}function Xa(t){return new RegExp("^(?:"+t.map(kv).join("|")+")","i")}function Ua(t){return new Map(t.map((n,e)=>[n.toLowerCase(),e]))}function Sv(t,n,e){var r=de.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Mv(t,n,e){var r=de.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function $v(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Lv(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Cv(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function Au(t,n,e){var r=de.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function _u(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Tv(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Ov(t,n,e){var r=de.exec(n.slice(e,e+1));return r?(t.q=r[0]*3-3,e+r[0].length):-1}function Nv(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function ku(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Ev(t,n,e){var r=de.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Su(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Dv(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Pv(t,n,e){var r=de.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function zv(t,n,e){var r=de.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Rv(t,n,e){var r=de.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Fv(t,n,e){var r=Av.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Yv(t,n,e){var r=de.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Iv(t,n,e){var r=de.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Mu(t,n){return jt(t.getDate(),n,2)}function Hv(t,n){return jt(t.getHours(),n,2)}function Bv(t,n){return jt(t.getHours()%12||12,n,2)}function Vv(t,n){return jt(1+dl.count(Dr(t),t),n,3)}function $u(t,n){return jt(t.getMilliseconds(),n,3)}function Wv(t,n){return $u(t,n)+"000"}function Gv(t,n){return jt(t.getMonth()+1,n,2)}function qv(t,n){return jt(t.getMinutes(),n,2)}function Xv(t,n){return jt(t.getSeconds(),n,2)}function Uv(t){var n=t.getDay();return n===0?7:n}function Zv(t,n){return jt(vu.count(Dr(t)-1,t),n,2)}function Lu(t){var n=t.getDay();return n>=4||n===0?da(t):da.ceil(t)}function jv(t,n){return t=Lu(t),jt(da.count(Dr(t),t)+(Dr(t).getDay()===4),n,2)}function Kv(t){return t.getDay()}function Jv(t,n){return jt(lo.count(Dr(t)-1,t),n,2)}function Qv(t,n){return jt(t.getFullYear()%100,n,2)}function tx(t,n){return t=Lu(t),jt(t.getFullYear()%100,n,2)}function ex(t,n){return jt(t.getFullYear()%1e4,n,4)}function nx(t,n){var e=t.getDay();return t=e>=4||e===0?da(t):da.ceil(t),jt(t.getFullYear()%1e4,n,4)}function rx(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+jt(n/60|0,"0",2)+jt(n%60,"0",2)}function Cu(t,n){return jt(t.getUTCDate(),n,2)}function ax(t,n){return jt(t.getUTCHours(),n,2)}function ix(t,n){return jt(t.getUTCHours()%12||12,n,2)}function ox(t,n){return jt(1+gl.count(Pr(t),t),n,3)}function Tu(t,n){return jt(t.getUTCMilliseconds(),n,3)}function sx(t,n){return Tu(t,n)+"000"}function lx(t,n){return jt(t.getUTCMonth()+1,n,2)}function cx(t,n){return jt(t.getUTCMinutes(),n,2)}function fx(t,n){return jt(t.getUTCSeconds(),n,2)}function ux(t){var n=t.getUTCDay();return n===0?7:n}function hx(t,n){return jt(xu.count(Pr(t)-1,t),n,2)}function Ou(t){var n=t.getUTCDay();return n>=4||n===0?ga(t):ga.ceil(t)}function dx(t,n){return t=Ou(t),jt(ga.count(Pr(t),t)+(Pr(t).getUTCDay()===4),n,2)}function gx(t){return t.getUTCDay()}function px(t,n){return jt(co.count(Pr(t)-1,t),n,2)}function mx(t,n){return jt(t.getUTCFullYear()%100,n,2)}function bx(t,n){return t=Ou(t),jt(t.getUTCFullYear()%100,n,2)}function yx(t,n){return jt(t.getUTCFullYear()%1e4,n,4)}function vx(t,n){var e=t.getUTCDay();return t=e>=4||e===0?ga(t):ga.ceil(t),jt(t.getUTCFullYear()%1e4,n,4)}function xx(){return"+0000"}function Nu(){return"%"}function Eu(t){return+t}function Du(t){return Math.floor(+t/1e3)}var pa,bl;wx({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wx(t){return pa=wv(t),bl=pa.format,pa.parse,pa.utcFormat,pa.utcParse,pa}function Wt(t){return function(){return t}}const Pu=Math.abs,ke=Math.atan2,Jn=Math.cos,Ax=Math.max,yl=Math.min,Ge=Math.sin,Se=Math.sqrt,Me=1e-12,fr=Math.PI,fo=fr/2,ur=2*fr;function _x(t){return t>1?0:t<-1?fr:Math.acos(t)}function zu(t){return t>=1?fo:t<=-1?-fo:Math.asin(t)}function uo(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{const r=Math.floor(e);if(!(r>=0))throw new RangeError(`invalid digits: ${e}`);n=r}return t},()=>new X1(n)}function kx(t){return t.innerRadius}function Sx(t){return t.outerRadius}function Mx(t){return t.startAngle}function $x(t){return t.endAngle}function Lx(t){return t&&t.padAngle}function Cx(t,n,e,r,a,i,o,s){var l=e-t,c=r-n,f=o-a,h=s-i,d=h*l-f*c;if(!(d*d<Me))return d=(f*(n-i)-h*(t-a))/d,[t+d*l,n+d*c]}function ho(t,n,e,r,a,i,o){var s=t-e,l=n-r,c=(o?i:-i)/Se(s*s+l*l),f=c*l,h=-c*s,d=t+f,g=n+h,v=e+f,m=r+h,b=(d+v)/2,x=(g+m)/2,A=v-d,w=m-g,S=A*A+w*w,z=a-i,Y=d*m-v*g,G=(w<0?-1:1)*Se(Ax(0,z*z*S-Y*Y)),_=(Y*w-A*G)/S,B=(-Y*A-w*G)/S,P=(Y*w+A*G)/S,$=(-Y*A+w*G)/S,N=_-b,L=B-x,M=P-b,D=$-x;return N*N+L*L>M*M+D*D&&(_=P,B=$),{cx:_,cy:B,x01:-f,y01:-h,x11:_*(a/z-1),y11:B*(a/z-1)}}function Tx(){var t=kx,n=Sx,e=Wt(0),r=null,a=Mx,i=$x,o=Lx,s=null,l=uo(c);function c(){var f,h,d=+t.apply(this,arguments),g=+n.apply(this,arguments),v=a.apply(this,arguments)-fo,m=i.apply(this,arguments)-fo,b=Pu(m-v),x=m>v;if(s||(s=f=l()),g<d&&(h=g,g=d,d=h),!(g>Me))s.moveTo(0,0);else if(b>ur-Me)s.moveTo(g*Jn(v),g*Ge(v)),s.arc(0,0,g,v,m,!x),d>Me&&(s.moveTo(d*Jn(m),d*Ge(m)),s.arc(0,0,d,m,v,x));else{var A=v,w=m,S=v,z=m,Y=b,G=b,_=o.apply(this,arguments)/2,B=_>Me&&(r?+r.apply(this,arguments):Se(d*d+g*g)),P=yl(Pu(g-d)/2,+e.apply(this,arguments)),$=P,N=P,L,M;if(B>Me){var D=zu(B/d*Ge(_)),q=zu(B/g*Ge(_));(Y-=D*2)>Me?(D*=x?1:-1,S+=D,z-=D):(Y=0,S=z=(v+m)/2),(G-=q*2)>Me?(q*=x?1:-1,A+=q,w-=q):(G=0,A=w=(v+m)/2)}var V=g*Jn(A),C=g*Ge(A),I=d*Jn(z),W=d*Ge(z);if(P>Me){var it=g*Jn(w),rt=g*Ge(w),ct=d*Jn(S),pt=d*Ge(S),xt;if(b<fr)if(xt=Cx(V,C,ct,pt,it,rt,I,W)){var yt=V-xt[0],bt=C-xt[1],kt=it-xt[0],j=rt-xt[1],J=1/Ge(_x((yt*kt+bt*j)/(Se(yt*yt+bt*bt)*Se(kt*kt+j*j)))/2),X=Se(xt[0]*xt[0]+xt[1]*xt[1]);$=yl(P,(d-X)/(J-1)),N=yl(P,(g-X)/(J+1))}else $=N=0}G>Me?N>Me?(L=ho(ct,pt,V,C,g,N,x),M=ho(it,rt,I,W,g,N,x),s.moveTo(L.cx+L.x01,L.cy+L.y01),N<P?s.arc(L.cx,L.cy,N,ke(L.y01,L.x01),ke(M.y01,M.x01),!x):(s.arc(L.cx,L.cy,N,ke(L.y01,L.x01),ke(L.y11,L.x11),!x),s.arc(0,0,g,ke(L.cy+L.y11,L.cx+L.x11),ke(M.cy+M.y11,M.cx+M.x11),!x),s.arc(M.cx,M.cy,N,ke(M.y11,M.x11),ke(M.y01,M.x01),!x))):(s.moveTo(V,C),s.arc(0,0,g,A,w,!x)):s.moveTo(V,C),!(d>Me)||!(Y>Me)?s.lineTo(I,W):$>Me?(L=ho(I,W,it,rt,d,-$,x),M=ho(V,C,ct,pt,d,-$,x),s.lineTo(L.cx+L.x01,L.cy+L.y01),$<P?s.arc(L.cx,L.cy,$,ke(L.y01,L.x01),ke(M.y01,M.x01),!x):(s.arc(L.cx,L.cy,$,ke(L.y01,L.x01),ke(L.y11,L.x11),!x),s.arc(0,0,d,ke(L.cy+L.y11,L.cx+L.x11),ke(M.cy+M.y11,M.cx+M.x11),x),s.arc(M.cx,M.cy,$,ke(M.y11,M.x11),ke(M.y01,M.x01),!x))):s.arc(0,0,d,z,S,x)}if(s.closePath(),f)return s=null,f+""||null}return c.centroid=function(){var f=(+t.apply(this,arguments)+ +n.apply(this,arguments))/2,h=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-fr/2;return[Jn(h)*f,Ge(h)*f]},c.innerRadius=function(f){return arguments.length?(t=typeof f=="function"?f:Wt(+f),c):t},c.outerRadius=function(f){return arguments.length?(n=typeof f=="function"?f:Wt(+f),c):n},c.cornerRadius=function(f){return arguments.length?(e=typeof f=="function"?f:Wt(+f),c):e},c.padRadius=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Wt(+f),c):r},c.startAngle=function(f){return arguments.length?(a=typeof f=="function"?f:Wt(+f),c):a},c.endAngle=function(f){return arguments.length?(i=typeof f=="function"?f:Wt(+f),c):i},c.padAngle=function(f){return arguments.length?(o=typeof f=="function"?f:Wt(+f),c):o},c.context=function(f){return arguments.length?(s=f??null,c):s},c}function go(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ru(t){this._context=t}Ru.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function po(t){return new Ru(t)}function Fu(t){return t[0]}function Yu(t){return t[1]}function Za(t,n){var e=Wt(!0),r=null,a=po,i=null,o=uo(s);t=typeof t=="function"?t:t===void 0?Fu:Wt(t),n=typeof n=="function"?n:n===void 0?Yu:Wt(n);function s(l){var c,f=(l=go(l)).length,h,d=!1,g;for(r==null&&(i=a(g=o())),c=0;c<=f;++c)!(c<f&&e(h=l[c],c,l))===d&&((d=!d)?i.lineStart():i.lineEnd()),d&&i.point(+t(h,c,l),+n(h,c,l));if(g)return i=null,g+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Wt(+l),s):t},s.y=function(l){return arguments.length?(n=typeof l=="function"?l:Wt(+l),s):n},s.defined=function(l){return arguments.length?(e=typeof l=="function"?l:Wt(!!l),s):e},s.curve=function(l){return arguments.length?(a=l,r!=null&&(i=a(r)),s):a},s.context=function(l){return arguments.length?(l==null?r=i=null:i=a(r=l),s):r},s}function ja(t,n,e){var r=null,a=Wt(!0),i=null,o=po,s=null,l=uo(c);t=typeof t=="function"?t:t===void 0?Fu:Wt(+t),n=typeof n=="function"?n:Wt(n===void 0?0:+n),e=typeof e=="function"?e:e===void 0?Yu:Wt(+e);function c(h){var d,g,v,m=(h=go(h)).length,b,x=!1,A,w=new Array(m),S=new Array(m);for(i==null&&(s=o(A=l())),d=0;d<=m;++d){if(!(d<m&&a(b=h[d],d,h))===x)if(x=!x)g=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),v=d-1;v>=g;--v)s.point(w[v],S[v]);s.lineEnd(),s.areaEnd()}x&&(w[d]=+t(b,d,h),S[d]=+n(b,d,h),s.point(r?+r(b,d,h):w[d],e?+e(b,d,h):S[d]))}if(A)return s=null,A+""||null}function f(){return Za().defined(a).curve(o).context(i)}return c.x=function(h){return arguments.length?(t=typeof h=="function"?h:Wt(+h),r=null,c):t},c.x0=function(h){return arguments.length?(t=typeof h=="function"?h:Wt(+h),c):t},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Wt(+h),c):r},c.y=function(h){return arguments.length?(n=typeof h=="function"?h:Wt(+h),e=null,c):n},c.y0=function(h){return arguments.length?(n=typeof h=="function"?h:Wt(+h),c):n},c.y1=function(h){return arguments.length?(e=h==null?null:typeof h=="function"?h:Wt(+h),c):e},c.lineX0=c.lineY0=function(){return f().x(t).y(n)},c.lineY1=function(){return f().x(t).y(e)},c.lineX1=function(){return f().x(r).y(n)},c.defined=function(h){return arguments.length?(a=typeof h=="function"?h:Wt(!!h),c):a},c.curve=function(h){return arguments.length?(o=h,i!=null&&(s=o(i)),c):o},c.context=function(h){return arguments.length?(h==null?i=s=null:s=o(i=h),c):i},c}function Ox(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function Nx(t){return t}function Ex(){var t=Nx,n=Ox,e=null,r=Wt(0),a=Wt(ur),i=Wt(0);function o(s){var l,c=(s=go(s)).length,f,h,d=0,g=new Array(c),v=new Array(c),m=+r.apply(this,arguments),b=Math.min(ur,Math.max(-ur,a.apply(this,arguments)-m)),x,A=Math.min(Math.abs(b)/c,i.apply(this,arguments)),w=A*(b<0?-1:1),S;for(l=0;l<c;++l)(S=v[g[l]=l]=+t(s[l],l,s))>0&&(d+=S);for(n!=null?g.sort(function(z,Y){return n(v[z],v[Y])}):e!=null&&g.sort(function(z,Y){return e(s[z],s[Y])}),l=0,h=d?(b-c*w)/d:0;l<c;++l,m=x)f=g[l],S=v[f],x=m+(S>0?S*h:0)+w,v[f]={data:s[f],index:l,value:S,startAngle:m,endAngle:x,padAngle:A};return v}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:Wt(+s),o):t},o.sortValues=function(s){return arguments.length?(n=s,e=null,o):n},o.sort=function(s){return arguments.length?(e=s,n=null,o):e},o.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:Wt(+s),o):r},o.endAngle=function(s){return arguments.length?(a=typeof s=="function"?s:Wt(+s),o):a},o.padAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Wt(+s),o):i},o}const vl={draw(t,n){const e=Se(n/fr);t.moveTo(e,0),t.arc(0,0,e,0,ur)}},Dx={draw(t,n){const e=Se(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Iu=Se(1/3),Px=Iu*2,zx={draw(t,n){const e=Se(n/Px),r=e*Iu;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Rx={draw(t,n){const e=Se(n),r=-e/2;t.rect(r,r,e,e)}},Fx=.8908130915292852,Hu=Ge(fr/10)/Ge(7*fr/10),Yx=Ge(ur/10)*Hu,Ix=-Jn(ur/10)*Hu,Hx={draw(t,n){const e=Se(n*Fx),r=Yx*e,a=Ix*e;t.moveTo(0,-e),t.lineTo(r,a);for(let i=1;i<5;++i){const o=ur*i/5,s=Jn(o),l=Ge(o);t.lineTo(l*e,-s*e),t.lineTo(s*r-l*a,l*r+s*a)}t.closePath()}},xl=Se(3),Bu={draw(t,n){const e=-Se(n/(xl*3));t.moveTo(0,e*2),t.lineTo(-xl*e,-e),t.lineTo(xl*e,-e),t.closePath()}},Bx=Se(3),Vx={draw(t,n){const e=Se(n)*.6824,r=e/2,a=e*Bx/2;t.moveTo(0,-e),t.lineTo(a,r),t.lineTo(-a,r),t.closePath()}};function Wx(t,n){let e=null,r=uo(a);t=typeof t=="function"?t:Wt(t||vl),n=typeof n=="function"?n:Wt(n===void 0?64:+n);function a(){let i;if(e||(e=i=r()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),i)return e=null,i+""||null}return a.type=function(i){return arguments.length?(t=typeof i=="function"?i:Wt(i),a):t},a.size=function(i){return arguments.length?(n=typeof i=="function"?i:Wt(+i),a):n},a.context=function(i){return arguments.length?(e=i??null,a):e},a}function Vu(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Wu(t){this._context=t}Wu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Vu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Vu(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Gx(t){return new Wu(t)}function Gu(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function wl(t,n){this._context=t,this._k=(1-n)/6}wl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Gu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Gu(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const qx=(function t(n){function e(r){return new wl(r,n)}return e.tension=function(r){return t(+r)},e})(0);function Xx(t,n,e){var r=t._x1,a=t._y1,i=t._x2,o=t._y2;if(t._l01_a>Me){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Me){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-n*t._l12_2a)/f,o=(o*c+t._y1*t._l23_2a-e*t._l12_2a)/f}t._context.bezierCurveTo(r,a,i,o,t._x2,t._y2)}function qu(t,n){this._context=t,this._alpha=n}qu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Xx(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Ux=(function t(n){function e(r){return n?new qu(r,n):new wl(r,0)}return e.alpha=function(r){return t(+r)},e})(.5);function Xu(t){return t<0?-1:1}function Uu(t,n,e){var r=t._x1-t._x0,a=n-t._x1,i=(t._y1-t._y0)/(r||a<0&&-0),o=(e-t._y1)/(a||r<0&&-0),s=(i*a+o*r)/(r+a);return(Xu(i)+Xu(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function Zu(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Al(t,n,e){var r=t._x0,a=t._y0,i=t._x1,o=t._y1,s=(i-r)/3;t._context.bezierCurveTo(r+s,a+s*n,i-s,o-s*e,i,o)}function mo(t){this._context=t}mo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Al(this,this._t0,Zu(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Al(this,Zu(this,e=Uu(this,t,n)),e);break;default:Al(this,this._t0,e=Uu(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},Object.create(mo.prototype).point=function(t,n){mo.prototype.point.call(this,n,t)};function Zx(t){return new mo(t)}function bo(t,n){this._context=t,this._t=n}bo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function jx(t){return new bo(t,.5)}function Kx(t){return new bo(t,0)}function Jx(t){return new bo(t,1)}function yo(t,n){if((o=t.length)>1)for(var e=1,r,a,i=t[n[0]],o,s=i.length;e<o;++e)for(a=i,i=t[n[e]],r=0;r<s;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function vo(t){for(var n=t.length,e=new Array(n);--n>=0;)e[n]=n;return e}function Qx(t,n){return t[n]}function t2(t){const n=[];return n.key=t,n}function ju(){var t=Wt([]),n=vo,e=yo,r=Qx;function a(i){var o=Array.from(t.apply(this,arguments),t2),s,l=o.length,c=-1,f;for(const h of i)for(s=0,++c;s<l;++s)(o[s][c]=[0,+r(h,o[s].key,c,i)]).data=h;for(s=0,f=go(n(o));s<l;++s)o[f[s]].index=s;return e(o,f),o}return a.keys=function(i){return arguments.length?(t=typeof i=="function"?i:Wt(Array.from(i)),a):t},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:Wt(+i),a):r},a.order=function(i){return arguments.length?(n=i==null?vo:typeof i=="function"?i:Wt(Array.from(i)),a):n},a.offset=function(i){return arguments.length?(e=i??yo,a):e},a}function e2(t,n){if((r=t.length)>0){for(var e,r,a=0,i=t[0].length,o;a<i;++a){for(o=e=0;e<r;++e)o+=t[e][a][1]||0;if(o)for(e=0;e<r;++e)t[e][a][1]/=o}yo(t,n)}}function n2(t,n){if((l=t.length)>0)for(var e,r=0,a,i,o,s,l,c=t[n[0]].length;r<c;++r)for(o=s=0,e=0;e<l;++e)(i=(a=t[n[e]][r])[1]-a[0])>0?(a[0]=o,a[1]=o+=i):i<0?(a[1]=s,a[0]=s+=i):(a[0]=0,a[1]=i)}function Ka(t,n,e){this.k=t,this.x=n,this.y=e}Ka.prototype={constructor:Ka,scale:function(t){return t===1?this:new Ka(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new Ka(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Ka.prototype;function _l(t,n){if(!t)throw new Error(`[d3-blueprint] ${n}`)}class r2{constructor(){oe(this,"properties",new Map)}define(n,e){_l(!this.properties.has(n),`config "${n}" is already defined`);const{defaultValue:r,getter:a,setter:i}=e,o=i?i(r):r;return this.properties.set(n,{value:o,getter:a,setter:i}),this}get(n){const e=this.getProperty(n),{value:r,getter:a}=e;return a?a(r):r}set(n,e){const r=this.getProperty(n);return r.value=r.setter?r.setter(e):e,this}setBatch(n){for(const[e,r]of Object.entries(n))this.set(e,r);return this}getAll(){const n={};for(const[e]of this.properties)n[e]=this.get(e);return n}has(n){return this.properties.has(n)}getProperty(n){const e=this.properties.get(n);return _l(e,`config "${n}" is not defined`),e}}const kl=["update","enter","merge","exit"],Ku=new Set([...kl,...kl.map(t=>`${t}:transition`)]);function a2(t){return Ku.has(t)}function Ju(t){_l(a2(t),`"${t}" is not a valid lifecycle event. Expected one of: ${[...Ku].join(", ")}`)}function i2(t,n,e){const r=t.exit(),a={update:t,enter:n,merge:n.merge(t),exit:r};return kl.map(i=>{const o=a[i],s=e.get(i)??[],l=e.get(`${i}:transition`)??[];return{name:i,selection:o,handlers:s,transitionHandlers:l}})}function o2(t,n){for(const e of n)e(t)}function s2(t,n){return n.map(e=>{const r=t.transition();return e(r),l2(r)})}function l2(t){return t.end().then(()=>{},()=>{})}class c2{constructor(n,e){oe(this,"base");oe(this,"dataBindFn");oe(this,"insertFn");oe(this,"handlers",new Map);if(this.base=n,this.dataBindFn=e.dataBind,this.insertFn=e.insert,e.events)for(const[r,a]of Object.entries(e.events))a&&this.on(r,a)}on(n,e){Ju(n);const r=this.handlers.get(n)??[];return r.push(e),this.handlers.set(n,r),this}off(n,e){if(Ju(n),!e)return this.handlers.delete(n),this;const r=this.handlers.get(n);if(r){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}return this}draw(n){const e=this.dataBindFn(this.base,n),r=e.enter(),a=this.insertFn(r),i=i2(e,a,this.handlers),o=[];for(const s of i){o2(s.selection,s.handlers);const l=s2(s.selection,s.transitionHandlers);o.push(...l)}return Promise.all(o).then(()=>{})}}function f2(t,n,e,r){if(e&&r){const i=new c2(e,r);return t.set(n,i),i}const a=t.get(n);if(!a)throw new Error(`[d3-blueprint] layer "${n}" is not defined`);return a}function u2(t,n,e,r){return typeof e=="string"&&r===void 0?t.get(e):typeof e=="string"?(t.set(e,r),n):(t.setBatch(e),n)}function h2(t,n){const e=[];for(const r of t.values())e.push(r.draw(n));return e}function d2(t,n){const e=[];for(const r of t.values()){const a=r.draw(n);a&&e.push(a)}return e}const g2=["preDraw","postDraw","postTransition"];class zr{constructor(n){oe(this,"base");oe(this,"layers",new Map);oe(this,"attachments",new Map);oe(this,"configs",new r2);oe(this,"dispatcher");oe(this,"attached",new Proxy({},{get:(n,e)=>{const r=this.attachments.get(e);if(!r)throw new Error(`[d3-blueprint] attachment "${e}" is not defined`);return r},has:(n,e)=>this.attachments.has(e)}));this.base=n,this.dispatcher=Hs(...g2),this.initialize()}initialize(){}transform(n){return n}preDraw(n){}postDraw(n){}postTransition(n){}layer(n,e,r){return f2(this.layers,n,e,r)}attach(n,e,r){if(r!==void 0){const a=e;this.attachments.set(n,new a(r))}else this.attachments.set(n,e);return this}config(n,e){return u2(this.configs,this,n,e)}configDefine(n,e){return this.configs.define(n,e),this}on(n,e){return this.dispatcher.on(n,e),this}off(n){return this.dispatcher.on(n,null),this}use(n,e){const r=e||n.name||"plugin";if(n.install(this),n.preDraw&&this.on(`preDraw.${r}`,a=>n.preDraw(this,a)),n.postDraw&&this.on(`postDraw.${r}`,a=>n.postDraw(this,a)),n.postTransition&&this.on(`postTransition.${r}`,a=>n.postTransition(this,a)),n.destroy){const a=this.destroy.bind(this);this.destroy=()=>{n.destroy(this),a()}}return this}async draw(n){const e=this.transform(n);this.preDraw(e),this.dispatcher.call("preDraw",this,e);const r=h2(this.layers,e),a=d2(this.attachments,e);this.postDraw(e),this.dispatcher.call("postDraw",this,e),await Promise.all([...r,...a]),this.postTransition(e),this.dispatcher.call("postTransition",this,e)}destroy(){this.layers.clear(),this.attachments.clear()}}class p2 extends zr{initialize(){const n=this.base.append("div").attr("class","bc-frame"),e=n.append("div").attr("class","bc-frame-header");n.append("div").attr("class","bc-frame-body"),n.append("p").attr("class","bc-frame-note");const r=n.append("div").attr("class","bc-frame-footer").style("display","flex").style("justify-content","space-between").style("align-items","center").style("flex-wrap","wrap").style("gap","0.25rem 1rem"),a=r.append("div").attr("class","bc-frame-footer-left").style("display","flex").style("flex-wrap","wrap").style("gap","0.25rem 0.75rem"),i=r.append("div").attr("class","bc-frame-footer-right").style("display","flex").style("align-items","center");this.layer("headerItems",e,{dataBind:(o,s)=>o.selectAll(".bc-frame-header-item").data(s.headerItems,l=>l.className),insert:o=>o.append(s=>document.createElement(s.tag)),events:{enter:o=>{o.attr("class",s=>s.className).text(s=>s.text)},merge:o=>{o.attr("class",s=>s.className).text(s=>s.text)},exit:o=>{o.remove()}}}),this.layer("footerLeftItems",a,{dataBind:(o,s)=>o.selectAll(".bc-frame-footer-item").data(s.footerLeftItems,l=>l.className),insert:o=>o.append(s=>document.createElement(s.tag)),events:{enter:o=>{o.attr("class",s=>s.className).each(function(s){if(this.textContent="",s.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=s.prefix,this.appendChild(l)}if(s.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=s.href,l.textContent=s.text,this.appendChild(l)}else this.appendChild(document.createTextNode(s.text))})},merge:o=>{o.attr("class",s=>s.className).each(function(s){if(this.textContent="",s.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=s.prefix,this.appendChild(l)}if(s.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=s.href,l.textContent=s.text,this.appendChild(l)}else this.appendChild(document.createTextNode(s.text))})},exit:o=>{o.remove()}}}),this.layer("footerRightItems",i,{dataBind:(o,s)=>o.selectAll(".bc-frame-footer-item").data(s.footerRightItems,l=>l.className),insert:o=>o.append(s=>document.createElement(s.tag)),events:{enter:o=>{o.attr("class",s=>s.className).each(function(s){if(s.html){const c=document.createRange().createContextualFragment(s.html);this.appendChild(c)}else this.textContent=s.text}),o.filter(s=>!!s.href).attr("href",s=>s.href),o.filter(s=>!!s.target).attr("target",s=>s.target),o.filter(s=>!!s.rel).attr("rel",s=>s.rel)},merge:o=>{o.attr("class",s=>s.className).each(function(s){if(this.textContent="",s.html){const c=document.createRange().createContextualFragment(s.html);this.appendChild(c)}else this.textContent=s.text}),o.filter(s=>!!s.href).attr("href",s=>s.href),o.filter(s=>!!s.target).attr("target",s=>s.target),o.filter(s=>!!s.rel).attr("rel",s=>s.rel)},exit:o=>{o.remove()}}})}}function m2(t){const n=[];return t.title&&n.push({tag:"h3",className:"bc-frame-title",text:t.title}),t.description&&n.push({tag:"p",className:"bc-frame-description",text:t.description}),n}function b2(t){const n=[];return t.byline&&n.push({tag:"span",className:"bc-frame-byline",text:t.byline}),t.source&&n.push({tag:"span",className:"bc-frame-source",text:t.source,prefix:"Source: ",href:t.sourceUrl||void 0}),n}const y2='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48.042969 90.607422" width="10" height="18" style="vertical-align:-3px;margin-right:3px"><path fill="currentColor" opacity="0.55" d="M 20.042969 34.607422 A 28 28 0 0 1 23.072266 34.779297 A 28 28 0 0 0 20.042969 34.607422 z M 23.34375 34.810547 A 28 28 0 0 1 26.171875 35.292969 A 28 28 0 0 0 23.34375 34.810547 z M 16.570312 34.84375 A 28 28 0 0 0 15.474609 35.033203 A 28 28 0 0 1 16.570312 34.84375 z M 26.390625 35.341797 A 28 28 0 0 1 29.316406 36.189453 A 28 28 0 0 0 26.390625 35.341797 z M 13.128906 35.511719 A 28 28 0 0 0 11.904297 35.873047 A 28 28 0 0 1 13.128906 35.511719 z M 29.373047 36.210938 A 28 28 0 0 1 32.103516 37.347656 A 28 28 0 0 0 29.373047 36.210938 z M 9.7832031 36.609375 A 28 28 0 0 0 8.5820312 37.117188 A 28 28 0 0 1 9.7832031 36.609375 z M 32.392578 37.486328 A 28 28 0 0 1 34.939453 38.90625 A 28 28 0 0 0 32.392578 37.486328 z M 6.5742188 38.128906 A 28 28 0 0 0 5.4511719 38.765625 A 28 28 0 0 1 6.5742188 38.128906 z M 35.041016 38.966797 A 28 28 0 0 1 37.523438 40.738281 A 28 28 0 0 0 35.041016 38.966797 z M 3.5273438 40.080078 A 28 28 0 0 0 2.5761719 40.771484 A 28 28 0 0 1 3.5273438 40.080078 z M 37.658203 40.851562 A 28 28 0 0 1 39.804688 42.783203 A 28 28 0 0 0 37.658203 40.851562 z M 40.011719 42.990234 A 28 28 0 0 1 42.013672 45.251953 A 28 28 0 0 0 40.011719 42.990234 z M 42.013672 45.251953 A 28 28 0 0 1 20.042969 56 A 28 28 0 0 1 14.232422 55.3125 A 16 16 0 0 1 16 62.607422 A 16 16 0 0 1 0 78.607422 L 0 82.121094 A 28 28 0 0 0 20.042969 90.607422 A 28 28 0 0 0 48.042969 62.607422 A 28 28 0 0 0 42.013672 45.251953 z M 1.3007812 46.667969 A 16 16 0 0 1 1.6191406 46.697266 A 16 16 0 0 0 1.3007812 46.667969 z M 4.2558594 47.189453 A 16 16 0 0 1 4.4355469 47.242188 A 16 16 0 0 0 4.2558594 47.189453 z "/><path fill="currentColor" opacity="0.85" d="M 6.0637516 38.376047 A 28 28 0 0 1 20.042969 34.615234 A 28 28 0 0 1 42.013672 45.259765 A 28 28 0 0 0 48.042969 28.007812 A 28 28 0 0 0 20.042969 0.0078125 A 28 28 0 0 0 0 8.4941407 L 0 16.007812 A 12 12 0 0 1 12 28.007812 A 12 12 0 0 1 6.0613693 38.364443 "/><path fill="currentColor" d="M 20.042969 34.607422 A 28 28 0 0 0 5.0878906 38.970703 A 28 28 0 0 1 6.0644531 38.376953 L 6.0605469 38.365234 A 12 12 0 0 1 0 40.007812 L 0 43.09375 L 0 43.101562 L 0 46.607422 A 16 16 0 0 1 2.8847656 46.873047 A 16 16 0 0 1 2.9199219 46.878906 A 16 16 0 0 1 5.7011719 47.662109 A 16 16 0 0 1 5.7324219 47.673828 A 16 16 0 0 1 8.3300781 48.955078 A 16 16 0 0 1 8.3398438 48.958984 A 16 16 0 0 1 8.3457031 48.962891 A 16 16 0 0 1 10.662109 50.6875 A 16 16 0 0 1 10.697266 50.71875 A 16 16 0 0 1 12.660156 52.837891 A 16 16 0 0 1 12.667969 52.845703 A 16 16 0 0 1 12.673828 52.855469 A 16 16 0 0 1 14.228516 55.306641 A 16 16 0 0 1 14.232422 55.3125 A 28 28 0 0 0 20.042969 56 A 28 28 0 0 0 42.013672 45.251953 A 28 28 0 0 0 20.042969 34.607422 z M 4.7695312 39.177734 A 28 28 0 0 0 2.5390625 40.798828 A 28 28 0 0 1 4.7695312 39.177734 z M 2.1816406 41.091797 A 28 28 0 0 0 0.11914062 42.984375 A 28 28 0 0 1 2.1816406 41.091797 z "/></svg>';function v2(){return[{tag:"a",className:"bc-frame-credit",text:"Blueprint Chart",html:y2+"Blueprint Chart",href:"/",target:"_blank",rel:"noopener noreferrer"}]}function dn(t,n){if(n===null)return{wrapper:t,header:t,body:t,footer:t};const e=n??{};new p2(ot(t)).draw({headerItems:m2(e),footerLeftItems:b2(e),footerRightItems:v2()});const a=t.querySelector(".bc-frame"),i=a.querySelector(".bc-frame-header"),o=a.querySelector(".bc-frame-body"),s=a.querySelector(".bc-frame-note"),l=a.querySelector(".bc-frame-footer");if(e.padding&&a.style.setProperty("--bc-frame-padding",e.padding),e.transparentBackground&&a.style.setProperty("--bc-frame-bg","transparent"),e.note?s.textContent=e.note:s.style.display="none",t.isConnected){const c=getComputedStyle(t),f=c.aspectRatio&&c.aspectRatio!=="auto"&&c.aspectRatio!=="",h=c.display==="flex"&&c.flexDirection==="column";if(f||h){const d=i.offsetHeight,g=l.offsetHeight,v=s.style.display!=="none"?s.offsetHeight:0;a.classList.add("bc-frame--constrained"),o.dataset.headerH=String(d);const m=t;o.dataset.footerH=String(m.__bcFooterH??g+v),requestAnimationFrame(()=>{m.__bcFooterH=l.offsetHeight+(s.style.display!=="none"?s.offsetHeight:0)})}}return{wrapper:a,header:i,body:o,footer:l}}function Qu(t){return t&&(t.startsWith("(")&&t.endsWith(")")?t.slice(0,-1):t)}function x2(t){if(!t)return{prefix:"",d3Spec:"",suffix:""};if(t.includes("|")){const n=t.split("|");return{prefix:n[0]??"",d3Spec:Qu(n[1]??""),suffix:n[2]??""}}return{prefix:"",d3Spec:Qu(t),suffix:""}}function hr(t){if(!t)return null;const{prefix:n,d3Spec:e,suffix:r}=x2(t);if(!e)return null;const a=io(e);return!n&&!r?a:i=>`${n}${a(i)}${r}`}function xo(t,n){return!Number.isFinite(n)||n<=0?"0%":`${Math.round(t/n*100)}%`}function Ln(t,n){if(!t)return;const e=t.stableTop??t.top,r=n.stableTop??n.top;return{dx:t.left-n.left,dy:e-r}}const w2={top:12,right:20,bottom:24,left:50},th=600,eh=400;class A2 extends zr{initialize(){this.configDefine("totalWidth",{defaultValue:th}),this.configDefine("totalHeight",{defaultValue:eh}),this.layer("svg",this.base,{dataBind:(n,e)=>n.selectAll("svg").data(e),insert:n=>n.append("svg"),events:{enter:n=>{const e=this.config("totalWidth"),r=this.config("totalHeight");n.attr("width",e).attr("height",r).append("g").attr("transform",a=>`translate(${a.left},${a.top})`)}}})}}const _2=400,nh=2,wo=2,Ao=9;function Rr(t,n,e,r){const a=Math.min(0,...t),i=Math.max(0,...t),o=(n==null?void 0:n.min)??a,s=(n==null?void 0:n.max)??i,l=r==="log"?cr().domain([o,s]).nice():Pe().domain([o,s]).nice(),c=l.ticks(),f=e?hr(e)??l.tickFormat():l.tickFormat(),h=c.map(g=>f(g));if(h.length===0)return 0;try{const v=document.createElement("canvas").getContext("2d");if(v){v.font="10px sans-serif";let m=0;for(const b of h){const x=v.measureText(b).width;x>m&&(m=x)}return Math.ceil(m)+wo+Ao}}catch{}return Math.max(...h.map(g=>g.length))*6+wo+Ao}function _o(t){if(t.length===0)return 0;try{const r=document.createElement("canvas").getContext("2d");if(r){r.font="10px sans-serif";let a=0;for(const i of t){const o=r.measureText(i).width;o>a&&(a=o)}return Math.ceil(a)+wo+Ao}}catch{}return Math.max(...t.map(e=>e.length))*6+wo+Ao}function Cn(t,n,e,r,a,i){const o={},s=a??50,l=r??"left",c=n??"auto",f=c==="auto"?t>0&&t<_2?"inside":"outside":c,h=f==="inside",d=f==="off";return l==="right"?(o.left=0,h?o.right=nh:d?o.right=0:o.right=s):(o.right=i!==!1?15:0,h?o.left=nh:d?o.left=0:o.left=s),h&&(o.top=35),(i===!1||e==="inside"||e==="off")&&(o.bottom=5),o}function qe(t){const n=t.getBoundingClientRect(),e=getComputedStyle(t);return{width:n.width-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0),height:n.height-(parseFloat(e.paddingTop)||0)-(parseFloat(e.paddingBottom)||0)}}function k2(t,n){var a;const e=n.closest(".bc-frame");if(!e||e.style.getPropertyValue("--bc-frame-bg").trim()==="transparent")return;(a=t.querySelector(".bc-canvas-bg"))==null||a.remove();const r=t.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("class","bc-canvas-bg"),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("fill",Be(e)),t.insertBefore(r,t.firstChild)}function gn(t,n){const e={...w2,...n},r=t.closest(".bc-frame--constrained")!=null;if(r){const d=parseFloat(t.dataset.headerH||"0"),g=parseFloat(t.dataset.footerH||"0"),v=e.top;e.top=d+v,e.bottom+=g,e.stableTop=v}const a=qe(t),i=a.width>0?a.width:th,o=a.height>0?a.height:eh,s=i-e.left-e.right,l=o-e.top-e.bottom,c=new A2(ot(t));c.config({totalWidth:i,totalHeight:o}),c.draw([e]);const f=t.querySelector("svg"),h=f.querySelector("g");return k2(f,t),r&&(f.setAttribute("viewBox",`0 0 ${i} ${o}`),f.setAttribute("preserveAspectRatio","none"),f.removeAttribute("width"),f.removeAttribute("height"),f.style.width="100%",f.style.height="100%",f.style.display="block"),{svg:f,chartArea:h,width:s,height:l,margin:e}}function Fr(t){return typeof window>"u"||typeof window.matchMedia!="function"?t:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:t}const ma=500;let rh=0;function pn(t){rh=t?ma:0}function Ja(){return Fr(rh)}function en(t,n){const e=Fr(ma);e<=0||typeof t.animate!="function"||t.animate([{opacity:0},{opacity:1}],{duration:e,easing:"ease-in-out"})}function nn(t,n){const e=Fr(ma);if(t.querySelectorAll("[data-bc-fade-overlay]").forEach(a=>{typeof a.getAnimations=="function"&&a.getAnimations().forEach(i=>i.cancel()),a.remove()}),e<=0||t.children.length===0)return null;const r=document.createElement("div");return r.style.position="absolute",r.style.inset="0",r.style.pointerEvents="none",r.style.display="flex",r.style.flexDirection="column",r.dataset.bcFadeOverlay="true",Array.from(t.childNodes).forEach(a=>{r.appendChild(a.cloneNode(!0))}),r.querySelectorAll(".bc-axis-vertical, .bc-axis-horizontal").forEach(a=>{a.remove()}),r.querySelectorAll(".bc-frame-footer, .bc-frame-note").forEach(a=>{a.remove()}),r.querySelectorAll("[data-bc-fade-overlay], .bc-frame--fade-snapshot").forEach(a=>{a.remove()}),r.querySelectorAll(".bc-frame").forEach(a=>{a.classList.remove("bc-frame"),a.classList.add("bc-frame--fade-snapshot")}),r}function rn(t,n,e){const r=Fr(ma);if(getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(n),r>0&&typeof n.animate=="function"){const i=n.animate([{opacity:1},{opacity:0}],{duration:r,easing:"ease-in-out"});i.onfinish=()=>n.remove()}else n.remove()}const S2=60,Qa=10,Sl=1.3,M2=12,$2=3,L2=14,C2=10;function T2(t,n,e=$2){if(t==="")return[""];if(t.length*Qa<=n)return[t];const r=t.split(/\s+/).filter(Boolean);if(r.length===0)return null;const a=[];let i="";for(const o of r){if(o.length*Qa>n)return null;const s=i?`${i} ${o}`:o;if(s.length*Qa<=n)i=s;else if(a.push(i),i=o,a.length>=e)return null}return i&&a.push(i),a.length>e?null:a}const O2={year:"%Y",month:"%b %Y",day:"%b %-d, %Y",datetime:"%b %-d, %Y %H:%M"};function N2(t){return typeof t.step=="function"}function ah(t,n){const e=Ci(n);if(t&&t.includes("%")){if(e){const r=bl(t),a=new Map;return n.forEach((i,o)=>a.set(i,e.dates[o])),i=>{if(i instanceof Date)return r(i);const o=a.get(String(i));return o?r(o):String(i)}}return null}if(t)return hr(t)??io(t);if(e){const r=bl(O2[e.granularity]??"%Y-%m-%d"),a=new Map;return n.forEach((i,o)=>a.set(i,e.dates[o])),i=>{if(i instanceof Date)return r(i);const o=a.get(String(i));return o?r(o):String(i)}}return null}function ti(t,n){let e=0;for(const r of t){const i=(n?n(r):r).length*Qa;i>e&&(e=i)}return e}function E2(t,n,e){if(t.length<=1)return t;const r=e?ti(t,e):t.reduce((c,f)=>Math.max(c,f.length),0)*Qa,a=Math.max(16,Math.ceil(r)+8),i=Math.max(2,Math.floor(n/a));if(t.length<=i)return t;const o=Math.ceil(t.length/i),s=t.filter((c,f)=>f%o===0),l=t[t.length-1];return s[s.length-1]!==l&&s.push(l),s}function D2(t,n,e,r){if(t.length<=1||n<=0||e==="horizontal")return!1;if(e==="vertical")return!0;if(Ci(t))return!1;const a=ti(t,r??null),i=n/t.length;return a>i*Sl}function P2(t,n){if(t.length===0)return 0;const e=ti(t,n??null);return Math.ceil(e)+M2}function z2(t){let n=1;for(const e of t)e.length>n&&(n=e.length);return n<=1?0:n*L2+C2}function Ml(t,n,e={},r=24){if(t.length===0||n<=0||e.labelPosition==="off"||e.labelPosition==="inside")return;const a=e.tickFormat?e.tickFormat:ah(e.numberFormat??null,t),i=e.labelRotation??"auto";if(!(i!=="vertical"&&Ci(t)!==null)&&t.length>1){const f=n/t.length*Sl,d=ti(t,a)>f;if(i!=="vertical"&&d){const g=ih(t,f,a);if(g){const v=z2(Array.from(g.values()));return v>r?v:void 0}}}if(!D2(t,n,i,a))return;const l=P2(t,a);return l>r?l:void 0}function ih(t,n,e){const r=new Map;let a=!1;for(const i of t){const o=e?e(i):i,s=T2(o,n);if(s===null)return null;r.set(i,s),s.length>1&&(a=!0)}return a?r:null}function R2(t,n){t.selectAll(".tick").each(function(){const e=ot(this),r=e.datum(),a=r instanceof Date?r.toISOString():String(r),i=n.get(a);if(!i||i.length<=1)return;const o=e.select("text");o.empty()||(o.attr("dy",null).text(null),i.forEach((s,l)=>{o.append("tspan").attr("x",0).attr("dy",l===0?"0.71em":"1em").text(s)}))})}class F2 extends zr{initialize(){this.configDefine("scale",{defaultValue:tn()}),this.configDefine("height",{defaultValue:0}),this.configDefine("tickPosition",{defaultValue:"below"}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:"dashed"}),this.configDefine("ticks",{defaultValue:null}),this.configDefine("numberFormat",{defaultValue:null}),this.configDefine("width",{defaultValue:0}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("labelPosition",{defaultValue:"auto"}),this.configDefine("labelRotation",{defaultValue:"auto"}),this.configDefine("zeroY",{defaultValue:null}),this.configDefine("tickFormat",{defaultValue:null});const n=this.base.append("g");this.layer("axis",n,{dataBind:(e,r)=>e.selectAll(".bc-axis-horizontal").data(r),insert:e=>e.append("g").attr("class","bc-axis bc-axis-horizontal"),events:{"merge:transition":e=>{this.applyAxis(e,"merge")},exit:e=>{e.remove()},enter:e=>{this.applyAxis(e,"enter")}}})}applyAxis(n,e){const r=this.config("scale"),a=this.config("scale"),i=this.config("tickPosition"),o=this.config("height"),s=this.config("labelPosition"),l=this.config("labelRotation"),c=this.config("width"),f=this.config("numberFormat"),h=this.config("labels"),d=this.config("tickFormat"),g=i==="above"?_m(r):km(r);this.config("showTicks")||g.tickSizeOuter(0);const v=d||ah(f,h);v&&g.tickFormat(v);const m=N2(a),b=m?a.domain():[],x=m&&l!=="vertical"&&Ci(b)!==null;let A=null,w=!1;if(m&&!x&&b.length>1&&c>0){const $=c/b.length*Sl,L=ti(b,v)>$;l==="vertical"?w=!0:L&&(A=ih(b,$,v),!A&&l==="auto"&&(w=!0))}let S=this.config("ticks");if(!S&&c>0)if(m){if(x){const P=E2(b,c,v);P.length<b.length&&(S=P)}}else{const P=Math.max(2,Math.floor(c/S2));g.ticks(P)}S&&g.tickValues(S);const z=i==="above"?0:o,Y=n.node(),G=e==="merge"?Ja():0;if(e==="merge"){if(!Y)return;G>0?(n.attr("transform",`translate(0,${z})`),n.duration(G).call(g)):ot(Y).attr("transform",`translate(0,${z})`).call(g)}else n.attr("transform",`translate(0,${z})`),n.call(g);const _=G>0?n:Y?ot(Y):n;if(!this.config("showAxis"))_.select(".domain").remove();else if(e==="enter"){const P=this.config("zeroY");if(P!=null){const $=P-(i==="above"?0:o);_.select(".domain").attr("transform",`translate(0,${$})`)}}this.config("showTicks")||_.selectAll(".tick line").remove();const B=s==="auto"?"outside":s;B==="off"?_.selectAll(".tick text").remove():B==="inside"&&_.selectAll(".tick text").attr("y",0).attr("dy","-0.6em"),w&&B!=="off"?_.selectAll(".tick text").attr("transform","rotate(-90)").attr("text-anchor","end").attr("x",i==="above"?9:-9).attr("y",0).attr("dy","0.32em"):_.selectAll(".tick text").attr("transform",null),A&&B!=="off"&&R2(_,A)}postDraw(){const n=this.config("gridStyle"),e=this.config("height"),r=this.base.select(".bc-axis-horizontal").node();r&&n!=="none"&&e>0&&Y2(r,n,e)}}function Y2(t,n,e){var s;const r=((s=t.ownerSVGElement)==null?void 0:s.parentElement)??document.documentElement,i=getComputedStyle(r).getPropertyValue("--bc-grid-color").trim()||"#ccc";ot(t).selectAll(".tick").each(function(){const c=ot(this).append("line").attr("class","bc-grid-line").attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",-e).attr("stroke",i).attr("stroke-width",1);n==="dashed"?c.attr("stroke-dasharray","4,4"):n==="dotted"&&c.attr("stroke-dasharray","1,3")})}const oh=30;class I2 extends zr{initialize(){this.configDefine("scale",{defaultValue:Pe()}),this.configDefine("direction",{defaultValue:An.Left}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:he.Dashed}),this.configDefine("gridWidth",{defaultValue:0}),this.configDefine("height",{defaultValue:0}),this.configDefine("ticks",{defaultValue:null}),this.configDefine("numberFormat",{defaultValue:null}),this.configDefine("labelPosition",{defaultValue:Jt.Auto}),this.configDefine("topPadding",{defaultValue:0}),this.configDefine("tickFormat",{defaultValue:null});const n=this.base.append("g");this.layer("axis",n,{dataBind:(e,r)=>e.selectAll(".bc-axis-vertical").data(r),insert:e=>e.append("g").attr("class","bc-axis bc-axis-vertical"),events:{"merge:transition":e=>{const r=this.config("scale"),a=this.config("direction"),i=this.config("showAxis"),o=this.config("showTicks"),s=this.config("labelPosition"),l=this.config("gridWidth"),c=this.config("height"),f=a===An.Right?gf(r):pf(r);o||f.tickSizeOuter(0);const h=this.config("ticks");if(h)f.tickValues(h);else if(c>0){const m=Math.max(2,Math.floor(c/oh));f.ticks(m)}const d=this.config("tickFormat");if(d)f.tickFormat(d);else{const m=this.config("numberFormat"),b=m?hr(m):null;b&&f.tickFormat(b)}const g=Ja(),v=e.node();if(v){g>0?e.duration(g).call(f):ot(v).call(f),i||ot(v).select(".domain").remove(),o||ot(v).selectAll(".tick line").attr("opacity",0);const b=s===Jt.Auto?l>0&&l<400?Jt.Inside:Jt.Outside:s;if(b===Jt.Inside){const x=i?4:0,A=g>0?e.selectAll(".tick text"):ot(v).selectAll(".tick text");a===An.Right?A.attr("x",-x).attr("dy","-0.4em").attr("text-anchor","end"):A.attr("x",x).attr("dy","-0.4em").attr("text-anchor","start")}else b===Jt.Off&&ot(v).selectAll(".tick text").attr("opacity",0)}},exit:e=>{e.remove()},enter:e=>{const r=this.config("scale"),a=this.config("direction"),i=this.config("labelPosition"),o=this.config("gridWidth"),s=this.config("height"),l=this.config("topPadding"),c=a===An.Right?gf(r):pf(r);this.config("showTicks")||c.tickSizeOuter(0);const f=this.config("ticks");if(f)c.tickValues(f);else if(s>0){const b=Math.max(2,Math.floor(s/oh));c.ticks(b)}const h=this.config("tickFormat");if(h)c.tickFormat(h);else{const b=this.config("numberFormat"),x=b?hr(b):null;x&&c.tickFormat(x)}e.call(c);const d=this.config("showAxis"),g=this.config("showTicks");d||e.select(".domain").remove();const m=i===Jt.Auto?o>0&&o<400?Jt.Inside:Jt.Outside:i;if(m===Jt.Inside){const b=d?4:0;if(a===An.Right?e.selectAll(".tick text").attr("x",-b).attr("dy","-0.4em").attr("text-anchor","end"):e.selectAll(".tick text").attr("x",b).attr("dy","-0.4em").attr("text-anchor","start"),g?e.selectAll(".tick line").attr("x2",a===An.Right?-6:6):e.selectAll(".tick line").remove(),l>0&&d){const x=e.select(".domain");if(!x.empty()){const A=x.attr("d"),w=A.replace(/V[\d.]+/,`V${-l}`);w!==A&&x.attr("d",w)}}}else g||e.selectAll(".tick line").remove(),m===Jt.Off&&e.selectAll(".tick text").remove()}}})}postDraw(){const n=this.config("gridStyle"),e=this.config("gridWidth"),r=this.config("direction"),a=this.base.select(".bc-axis-vertical").node();if(a&&n!==he.None&&e>0){const i=r===An.Right?-e:e;H2(a,n,i)}}}function H2(t,n,e){var s;const r=((s=t.ownerSVGElement)==null?void 0:s.parentElement)??document.documentElement,i=getComputedStyle(r).getPropertyValue("--bc-grid-color").trim()||"#ccc";ot(t).selectAll(".tick").each(function(){const c=ot(this).append("line").attr("class","bc-grid-line").attr("x1",0).attr("x2",e).attr("y1",0).attr("y2",0).attr("stroke",i).attr("stroke-width",1);n===he.Dashed?c.attr("stroke-dasharray","4,4"):n===he.Dotted&&c.attr("stroke-dasharray","1,3")})}function B2(t){return typeof t.step=="function"}const ko=new WeakMap;class an{constructor(n){oe(this,"vGroup",null);oe(this,"hGroup",null);oe(this,"vChart",null);oe(this,"hChart",null);oe(this,"container");oe(this,"initialized",!1);this.container=n}static for(n){let e=ko.get(n);return e||(e=new an(n),ko.set(n,e)),e}static clear(n){ko.delete(n)}detach(){var n,e;(n=this.vGroup)!=null&&n.parentNode&&(ot(this.vGroup).interrupt().selectAll("*").interrupt(),this.vGroup.querySelectorAll(".bc-grid-line").forEach(r=>r.remove()),this.vGroup.remove()),(e=this.hGroup)!=null&&e.parentNode&&(ot(this.hGroup).interrupt().selectAll("*").interrupt(),this.hGroup.querySelectorAll(".bc-grid-line").forEach(r=>r.remove()),this.hGroup.remove())}attach(n,e){if(!this.initialized)this.vGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.vGroup.setAttribute("class","bc-axis-service-v"),this.hGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.hGroup.setAttribute("class","bc-axis-service-h"),n.appendChild(this.vGroup),n.appendChild(this.hGroup),this.vChart=new I2(ot(this.vGroup)),this.hChart=new F2(ot(this.hGroup)),this.initialized=!0;else{for(const a of[this.vGroup,this.hGroup])ot(a).selectAll(".tick").interrupt();n.appendChild(this.vGroup),n.appendChild(this.hGroup);const r=1;if(e&&(Math.abs(e.dx)>=r||Math.abs(e.dy)>=r)){const{dx:a,dy:i}=e;for(const o of[this.vGroup,this.hGroup]){o.setAttribute("transform",`translate(${a},${i})`);const s=Ja();s>0?ot(o).transition().duration(s).attrTween("transform",()=>{const l=De(a,0),c=De(i,0);return f=>`translate(${l(f)},${c(f)})`}):o.removeAttribute("transform")}}}}update(n){const e=n.order??"vertical-first";e==="horizontal-first"?(this.updateHorizontal(n.horizontal),this.updateVertical(n.vertical)):(this.updateVertical(n.vertical),this.updateHorizontal(n.horizontal)),e==="horizontal-first"?this.hGroup&&this.vGroup&&this.hGroup.parentNode&&this.hGroup.parentNode.insertBefore(this.hGroup,this.vGroup):this.vGroup&&this.hGroup&&this.vGroup.parentNode&&this.vGroup.parentNode.insertBefore(this.vGroup,this.hGroup)}updateVertical(n){if(!this.vChart||!this.vGroup)return;if(!n){this.vGroup.style.display="none";return}this.vGroup.style.display="";const e=n.options;this.vChart.config({scale:n.scale,direction:e.direction??"left",showAxis:e.showAxis??!0,showTicks:e.showTicks??!1,gridStyle:e.gridStyle??"dashed",gridWidth:e.gridWidth??0,height:n.height,ticks:e.ticks??null,numberFormat:e.numberFormat??null,labelPosition:e.labelPosition??"auto",topPadding:e.topPadding??0,tickFormat:e.tickFormat??null}),this.vChart.draw([{placeholder:!0}]);const r=this.vGroup.querySelector(".bc-axis-vertical");r&&(e.direction??"left")==="right"?r.setAttribute("transform",`translate(${e.gridWidth??0},0)`):r&&r.removeAttribute("transform")}updateHorizontal(n){if(!this.hChart||!this.hGroup)return;if(!n){this.hGroup.style.display="none";return}this.hGroup.style.display="";const e=n.options,r=n.scale,a=B2(r)?r.domain():[];this.hChart.config({scale:r,height:n.height,tickPosition:e.tickPosition??"below",showAxis:e.showAxis??!0,showTicks:e.showTicks??!1,gridStyle:e.gridStyle??"dashed",ticks:e.ticks??null,numberFormat:e.numberFormat??null,width:e.width??0,labels:a,labelPosition:e.labelPosition??"auto",labelRotation:e.labelRotation??"auto",zeroY:e.zeroY??null,tickFormat:e.tickFormat??null}),this.hChart.draw([{placeholder:!0}])}destroy(){this.detach(),this.vChart=null,this.hChart=null,this.vGroup=null,this.hGroup=null,this.initialized=!1,ko.delete(this.container)}}const $l=Math.min,ba=Math.max,So=Math.round,Hn=t=>({x:t,y:t}),V2={left:"right",right:"left",bottom:"top",top:"bottom"},W2={start:"end",end:"start"};function sh(t,n,e){return ba(t,$l(n,e))}function Mo(t,n){return typeof t=="function"?t(n):t}function Yr(t){return t.split("-")[0]}function $o(t){return t.split("-")[1]}function lh(t){return t==="x"?"y":"x"}function ch(t){return t==="y"?"height":"width"}const G2=new Set(["top","bottom"]);function dr(t){return G2.has(Yr(t))?"y":"x"}function fh(t){return lh(dr(t))}function q2(t,n,e){e===void 0&&(e=!1);const r=$o(t),a=fh(t),i=ch(a);let o=a==="x"?r===(e?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(o=Lo(o)),[o,Lo(o)]}function X2(t){const n=Lo(t);return[Ll(t),n,Ll(n)]}function Ll(t){return t.replace(/start|end/g,n=>W2[n])}const uh=["left","right"],hh=["right","left"],U2=["top","bottom"],Z2=["bottom","top"];function j2(t,n,e){switch(t){case"top":case"bottom":return e?n?hh:uh:n?uh:hh;case"left":case"right":return n?U2:Z2;default:return[]}}function K2(t,n,e,r){const a=$o(t);let i=j2(Yr(t),e==="start",r);return a&&(i=i.map(o=>o+"-"+a),n&&(i=i.concat(i.map(Ll)))),i}function Lo(t){return t.replace(/left|right|bottom|top/g,n=>V2[n])}function J2(t){return{top:0,right:0,bottom:0,left:0,...t}}function Q2(t){return typeof t!="number"?J2(t):{top:t,right:t,bottom:t,left:t}}function Co(t){const{x:n,y:e,width:r,height:a}=t;return{width:r,height:a,top:e,left:n,right:n+r,bottom:e+a,x:n,y:e}}function dh(t,n,e){let{reference:r,floating:a}=t;const i=dr(n),o=fh(n),s=ch(o),l=Yr(n),c=i==="y",f=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,d=r[s]/2-a[s]/2;let g;switch(l){case"top":g={x:f,y:r.y-a.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-a.width,y:h};break;default:g={x:r.x,y:r.y}}switch($o(n)){case"start":g[o]-=d*(e&&c?-1:1);break;case"end":g[o]+=d*(e&&c?-1:1);break}return g}async function tw(t,n){var e;n===void 0&&(n={});const{x:r,y:a,platform:i,rects:o,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:d=!1,padding:g=0}=Mo(n,t),v=Q2(g),b=s[d?h==="floating"?"reference":"floating":h],x=Co(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(b)))==null||e?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),A=h==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},z=Co(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:A,offsetParent:w,strategy:l}):A);return{top:(x.top-z.top+v.top)/S.y,bottom:(z.bottom-x.bottom+v.bottom)/S.y,left:(x.left-z.left+v.left)/S.x,right:(z.right-x.right+v.right)/S.x}}const ew=async(t,n,e)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=e,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(n));let c=await o.getElementRects({reference:t,floating:n,strategy:a}),{x:f,y:h}=dh(c,r,l),d=r,g={},v=0;for(let b=0;b<s.length;b++){var m;const{name:x,fn:A}=s[b],{x:w,y:S,data:z,reset:Y}=await A({x:f,y:h,initialPlacement:r,placement:d,strategy:a,middlewareData:g,rects:c,platform:{...o,detectOverflow:(m=o.detectOverflow)!=null?m:tw},elements:{reference:t,floating:n}});f=w??f,h=S??h,g={...g,[x]:{...g[x],...z}},Y&&v<=50&&(v++,typeof Y=="object"&&(Y.placement&&(d=Y.placement),Y.rects&&(c=Y.rects===!0?await o.getElementRects({reference:t,floating:n,strategy:a}):Y.rects),{x:f,y:h}=dh(c,d,l)),b=-1)}return{x:f,y:h,placement:d,strategy:a,middlewareData:g}},nw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var e,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:c}=n,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=Mo(t,n);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const x=Yr(a),A=dr(s),w=Yr(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),z=d||(w||!m?[Lo(s)]:X2(s)),Y=v!=="none";!d&&Y&&z.push(...K2(s,m,v,S));const G=[s,...z],_=await l.detectOverflow(n,b),B=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&B.push(_[x]),h){const M=q2(a,o,S);B.push(_[M[0]],_[M[1]])}if(P=[...P,{placement:a,overflows:B}],!B.every(M=>M<=0)){var $,N;const M=((($=i.flip)==null?void 0:$.index)||0)+1,D=G[M];if(D&&(!(h==="alignment"?A!==dr(D):!1)||P.every(C=>dr(C.placement)===A?C.overflows[0]>0:!0)))return{data:{index:M,overflows:P},reset:{placement:D}};let q=(N=P.filter(V=>V.overflows[0]<=0).sort((V,C)=>V.overflows[1]-C.overflows[1])[0])==null?void 0:N.placement;if(!q)switch(g){case"bestFit":{var L;const V=(L=P.filter(C=>{if(Y){const I=dr(C.placement);return I===A||I==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(I=>I>0).reduce((I,W)=>I+W,0)]).sort((C,I)=>C[1]-I[1])[0])==null?void 0:L[0];V&&(q=V);break}case"initialPlacement":q=s;break}if(a!==q)return{reset:{placement:q}}}return{}}}},rw=new Set(["left","top"]);async function aw(t,n){const{placement:e,platform:r,elements:a}=t,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Yr(e),s=$o(e),l=dr(e)==="y",c=rw.has(o)?-1:1,f=i&&l?-1:1,h=Mo(n,t);let{mainAxis:d,crossAxis:g,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof v=="number"&&(g=s==="end"?v*-1:v),l?{x:g*f,y:d*c}:{x:d*c,y:g*f}}const iw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var e,r;const{x:a,y:i,placement:o,middlewareData:s}=n,l=await aw(n,t);return o===((e=s.offset)==null?void 0:e.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},ow=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:r,placement:a,platform:i}=n,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:A,y:w}=x;return{x:A,y:w}}},...c}=Mo(t,n),f={x:e,y:r},h=await i.detectOverflow(n,c),d=dr(Yr(a)),g=lh(d);let v=f[g],m=f[d];if(o){const x=g==="y"?"top":"left",A=g==="y"?"bottom":"right",w=v+h[x],S=v-h[A];v=sh(w,v,S)}if(s){const x=d==="y"?"top":"left",A=d==="y"?"bottom":"right",w=m+h[x],S=m-h[A];m=sh(w,m,S)}const b=l.fn({...n,[g]:v,[d]:m});return{...b,data:{x:b.x-e,y:b.y-r,enabled:{[g]:o,[d]:s}}}}}};function To(){return typeof window<"u"}function ya(t){return gh(t)?(t.nodeName||"").toLowerCase():"#document"}function on(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Qn(t){var n;return(n=(gh(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function gh(t){return To()?t instanceof Node||t instanceof on(t).Node:!1}function Tn(t){return To()?t instanceof Element||t instanceof on(t).Element:!1}function Bn(t){return To()?t instanceof HTMLElement||t instanceof on(t).HTMLElement:!1}function ph(t){return!To()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof on(t).ShadowRoot}const sw=new Set(["inline","contents"]);function ei(t){const{overflow:n,overflowX:e,overflowY:r,display:a}=On(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+e)&&!sw.has(a)}const lw=new Set(["table","td","th"]);function cw(t){return lw.has(ya(t))}const fw=[":popover-open",":modal"];function Oo(t){return fw.some(n=>{try{return t.matches(n)}catch{return!1}})}const uw=["transform","translate","scale","rotate","perspective"],hw=["transform","translate","scale","rotate","perspective","filter"],dw=["paint","layout","strict","content"];function Cl(t){const n=Tl(),e=Tn(t)?On(t):t;return uw.some(r=>e[r]?e[r]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!n&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!n&&(e.filter?e.filter!=="none":!1)||hw.some(r=>(e.willChange||"").includes(r))||dw.some(r=>(e.contain||"").includes(r))}function gw(t){let n=gr(t);for(;Bn(n)&&!va(n);){if(Cl(n))return n;if(Oo(n))return null;n=gr(n)}return null}function Tl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pw=new Set(["html","body","#document"]);function va(t){return pw.has(ya(t))}function On(t){return on(t).getComputedStyle(t)}function No(t){return Tn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gr(t){if(ya(t)==="html")return t;const n=t.assignedSlot||t.parentNode||ph(t)&&t.host||Qn(t);return ph(n)?n.host:n}function mh(t){const n=gr(t);return va(n)?t.ownerDocument?t.ownerDocument.body:t.body:Bn(n)&&ei(n)?n:mh(n)}function bh(t,n,e){var r;n===void 0&&(n=[]);const a=mh(t),i=a===((r=t.ownerDocument)==null?void 0:r.body),o=on(a);return i?(Ol(o),n.concat(o,o.visualViewport||[],ei(a)?a:[],[])):n.concat(a,bh(a,[]))}function Ol(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yh(t){const n=On(t);let e=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=Bn(t),i=a?t.offsetWidth:e,o=a?t.offsetHeight:r,s=So(e)!==i||So(r)!==o;return s&&(e=i,r=o),{width:e,height:r,$:s}}function vh(t){return Tn(t)?t:t.contextElement}function xa(t){const n=vh(t);if(!Bn(n))return Hn(1);const e=n.getBoundingClientRect(),{width:r,height:a,$:i}=yh(n);let o=(i?So(e.width):e.width)/r,s=(i?So(e.height):e.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const mw=Hn(0);function xh(t){const n=on(t);return!Tl()||!n.visualViewport?mw:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function bw(t,n,e){return n===void 0&&(n=!1),!e||n&&e!==on(t)?!1:n}function ni(t,n,e,r){n===void 0&&(n=!1),e===void 0&&(e=!1);const a=t.getBoundingClientRect(),i=vh(t);let o=Hn(1);n&&(r?Tn(r)&&(o=xa(r)):o=xa(t));const s=bw(i,e,r)?xh(i):Hn(0);let l=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,f=a.width/o.x,h=a.height/o.y;if(i){const d=on(i),g=r&&Tn(r)?on(r):r;let v=d,m=Ol(v);for(;m&&r&&g!==v;){const b=xa(m),x=m.getBoundingClientRect(),A=On(m),w=x.left+(m.clientLeft+parseFloat(A.paddingLeft))*b.x,S=x.top+(m.clientTop+parseFloat(A.paddingTop))*b.y;l*=b.x,c*=b.y,f*=b.x,h*=b.y,l+=w,c+=S,v=on(m),m=Ol(v)}}return Co({width:f,height:h,x:l,y:c})}function Eo(t,n){const e=No(t).scrollLeft;return n?n.left+e:ni(Qn(t)).left+e}function wh(t,n){const e=t.getBoundingClientRect(),r=e.left+n.scrollLeft-Eo(t,e),a=e.top+n.scrollTop;return{x:r,y:a}}function yw(t){let{elements:n,rect:e,offsetParent:r,strategy:a}=t;const i=a==="fixed",o=Qn(r),s=n?Oo(n.floating):!1;if(r===o||s&&i)return e;let l={scrollLeft:0,scrollTop:0},c=Hn(1);const f=Hn(0),h=Bn(r);if((h||!h&&!i)&&((ya(r)!=="body"||ei(o))&&(l=No(r)),Bn(r))){const g=ni(r);c=xa(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const d=o&&!h&&!i?wh(o,l):Hn(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x+d.x,y:e.y*c.y-l.scrollTop*c.y+f.y+d.y}}function vw(t){return Array.from(t.getClientRects())}function xw(t){const n=Qn(t),e=No(t),r=t.ownerDocument.body,a=ba(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),i=ba(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let o=-e.scrollLeft+Eo(t);const s=-e.scrollTop;return On(r).direction==="rtl"&&(o+=ba(n.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:s}}const Ah=25;function ww(t,n){const e=on(t),r=Qn(t),a=e.visualViewport;let i=r.clientWidth,o=r.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const f=Tl();(!f||f&&n==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=Eo(r);if(c<=0){const f=r.ownerDocument,h=f.body,d=getComputedStyle(h),g=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,v=Math.abs(r.clientWidth-h.clientWidth-g);v<=Ah&&(i-=v)}else c<=Ah&&(i+=c);return{width:i,height:o,x:s,y:l}}const Aw=new Set(["absolute","fixed"]);function _w(t,n){const e=ni(t,!0,n==="fixed"),r=e.top+t.clientTop,a=e.left+t.clientLeft,i=Bn(t)?xa(t):Hn(1),o=t.clientWidth*i.x,s=t.clientHeight*i.y,l=a*i.x,c=r*i.y;return{width:o,height:s,x:l,y:c}}function _h(t,n,e){let r;if(n==="viewport")r=ww(t,e);else if(n==="document")r=xw(Qn(t));else if(Tn(n))r=_w(n,e);else{const a=xh(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Co(r)}function kh(t,n){const e=gr(t);return e===n||!Tn(e)||va(e)?!1:On(e).position==="fixed"||kh(e,n)}function kw(t,n){const e=n.get(t);if(e)return e;let r=bh(t,[]).filter(s=>Tn(s)&&ya(s)!=="body"),a=null;const i=On(t).position==="fixed";let o=i?gr(t):t;for(;Tn(o)&&!va(o);){const s=On(o),l=Cl(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&Aw.has(a.position)||ei(o)&&!l&&kh(t,o))?r=r.filter(f=>f!==o):a=s,o=gr(o)}return n.set(t,r),r}function Sw(t){let{element:n,boundary:e,rootBoundary:r,strategy:a}=t;const o=[...e==="clippingAncestors"?Oo(n)?[]:kw(n,this._c):[].concat(e),r],s=o[0],l=o.reduce((c,f)=>{const h=_h(n,f,a);return c.top=ba(h.top,c.top),c.right=$l(h.right,c.right),c.bottom=$l(h.bottom,c.bottom),c.left=ba(h.left,c.left),c},_h(n,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Mw(t){const{width:n,height:e}=yh(t);return{width:n,height:e}}function $w(t,n,e){const r=Bn(n),a=Qn(n),i=e==="fixed",o=ni(t,!0,i,n);let s={scrollLeft:0,scrollTop:0};const l=Hn(0);function c(){l.x=Eo(a)}if(r||!r&&!i)if((ya(n)!=="body"||ei(a))&&(s=No(n)),r){const g=ni(n,!0,i,n);l.x=g.x+n.clientLeft,l.y=g.y+n.clientTop}else a&&c();i&&!r&&a&&c();const f=a&&!r&&!i?wh(a,s):Hn(0),h=o.left+s.scrollLeft-l.x-f.x,d=o.top+s.scrollTop-l.y-f.y;return{x:h,y:d,width:o.width,height:o.height}}function Nl(t){return On(t).position==="static"}function Sh(t,n){if(!Bn(t)||On(t).position==="fixed")return null;if(n)return n(t);let e=t.offsetParent;return Qn(t)===e&&(e=e.ownerDocument.body),e}function Mh(t,n){const e=on(t);if(Oo(t))return e;if(!Bn(t)){let a=gr(t);for(;a&&!va(a);){if(Tn(a)&&!Nl(a))return a;a=gr(a)}return e}let r=Sh(t,n);for(;r&&cw(r)&&Nl(r);)r=Sh(r,n);return r&&va(r)&&Nl(r)&&!Cl(r)?e:r||gw(t)||e}const Lw=async function(t){const n=this.getOffsetParent||Mh,e=this.getDimensions,r=await e(t.floating);return{reference:$w(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cw(t){return On(t).direction==="rtl"}const Tw={convertOffsetParentRelativeRectToViewportRelativeRect:yw,getDocumentElement:Qn,getClippingRect:Sw,getOffsetParent:Mh,getElementRects:Lw,getClientRects:vw,getDimensions:Mw,getScale:xa,isElement:Tn,isRTL:Cw},$h=iw,Lh=ow,Ch=nw,Th=(t,n,e)=>{const r=new Map,a={platform:Tw,...e},i={...a.platform,_c:r};return ew(t,n,{...a,platform:i})},Oh="bc-tooltip";function Ow(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
250
|
-
.${Oh} {
|
|
229
|
+
`+r+` |
|
|
230
|
+
`+a.line+` | `+s+`
|
|
231
|
+
`+r+` | `+``.padEnd(i.column-1,` `)+``.padEnd(c,`^`)}else t+=`
|
|
232
|
+
at `+o}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}let r=Object.prototype.hasOwnProperty.call(RegExp.prototype,`unicode`)?RegExp(`[\\p{C}\\p{Mn}\\p{Mc}]`,`gu`):null;function i(e){return r?e.replace(r,e=>`\\u{`+n(e)+`}`):e}function a(e){return i(e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\0/g,`\\0`).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\x00-\x0F]/g,e=>`\\x0`+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>`\\x`+n(e)))}function o(e){return i(e.replace(/\\/g,`\\\\`).replace(/\]/g,`\\]`).replace(/\^/g,`\\^`).replace(/-/g,`\\-`).replace(/\0/g,`\\0`).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\x00-\x0F]/g,e=>`\\x0`+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>`\\x`+n(e)))}let s={literal(e){return`"`+a(e.text)+`"`},class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+`-`+o(e[1]):o(e));return`[`+(e.inverted?`^`:``)+t.join(``)+`]`+(e.unicode?`u`:``)},any(){return`any character`},end(){return`end of input`},other(e){return e.description}};function c(e){return s[e.type](e)}function l(e){let t=e.map(c);if(t.sort(),t.length>0){let e=1;for(let n=1;n<t.length;n++)t[n-1]!==t[n]&&(t[e]=t[n],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+` or `+t[1];default:return t.slice(0,-1).join(`, `)+`, or `+t[t.length-1]}}function u(e){return e?`"`+a(e)+`"`:`end of input`}return`Expected `+l(e)+` but `+u(t)+` found.`}};function k(e,t){t=t===void 0?{}:t;let n={},r=t.grammarSource,i={Chart:Lt},a=Lt,o=`chart`,s=`data`,c=`colorize`,l=`highlight`,u=`area-fill`,d=`annotation`,f=`range`,p=`note`,m=`series`,h=`scene`,g=`transform`,_=/^[ \t]/,v=/^[^\t\n\r{}=]/,y=/^[a-zA-Z_#]/,b=/^[a-zA-Z0-9_#\-]/,x=/^[0-9]/,S=/^[eE]/,C=/^[+\-]/,w=/^[^"\\]/,k=/^[0-9a-fA-F]/,A=/^[^\n]/,ee=/^[ \t\n\r]/,j=Ot(`chart`,!1),M=Ot(`{`,!1),N=Ot(`}`,!1),P=kt([` `,` `],!1,!1,!1),F=Ot(`data`,!1),I=Ot(`=`,!1),L=Ot(`,`,!1),R=Ot(` `,!1),z=kt([` `,`
|
|
233
|
+
`,`\r`,`{`,`}`,`=`],!0,!1,!1),B=Ot(`colorize`,!1),V=Ot(`highlight`,!1),H=Ot(`area-fill`,!1),U=Ot(`annotation`,!1),te=Ot(`range`,!1),ne=Ot(`note`,!1),re=Ot(`series`,!1),ie=Ot(`scene`,!1),ae=Ot(`transform`,!1),oe=Ot(`%`,!1),se=Mt(`identifier`),ce=kt([[`a`,`z`],[`A`,`Z`],`_`,`#`],!1,!1,!1),W=kt([[`a`,`z`],[`A`,`Z`],[`0`,`9`],`_`,`#`,`-`],!1,!1,!1),G=Ot(`-`,!1),le=Ot(`.`,!1),K=kt([[`0`,`9`]],!1,!1,!1),ue=kt([`e`,`E`],!1,!1,!1),de=kt([`+`,`-`],!1,!1,!1),fe=Mt(`string`),pe=Ot(`"`,!1),me=Ot(`\\`,!1),he=kt([`"`,`\\`],!0,!1,!1),ge=Ot(`n`,!1),_e=Ot(`r`,!1),ve=Ot(`t`,!1),ye=Ot(`u`,!1),be=kt([[`0`,`9`],[`a`,`f`],[`A`,`F`]],!1,!1,!1),xe=At(),Se=Ot(`//`,!1),Ce=kt([`
|
|
234
|
+
`],!0,!1,!1),we=Ot(`/*`,!1),Te=Ot(`*/`,!1),Ee=kt([` `,` `,`
|
|
235
|
+
`,`\r`],!1,!1,!1),De=Mt(`whitespace`);function Oe(e,t){T(t)>1&&Et(`duplicate data block — a chart or scene may define at most one data { } block`);let n=E(t);return{type:`chart`,chartType:e,properties:n.properties,data:n.data,colorizes:n.colorizes,highlights:n.highlights,areaFills:n.areaFills,annotations:n.annotations,series:n.series,scenes:n.scenes,transforms:n.transforms}}function ke(e,t){return e.length&&(t.leadingComments=e),t}function Ae(e){return{type:`data`,entries:e}}function je(e,t){return e.length&&(t.leadingComments=e),t}function Me(e,t,n){return n}function Ne(e,t,n){let r=[t,...n];return{type:`property`,key:e.name,...e.quoted&&e.name===`series`?{quotedKey:!0}:{},value:r[0].value,isPercentage:!1,values:r.map(e=>e.value)}}function Pe(e,t){return{type:`property`,key:e.name,...e.quoted&&e.name===`series`?{quotedKey:!0}:{},value:t.value,isPercentage:t.isPercentage}}function Fe(e){return{name:e,quoted:!0}}function Ie(e){return{name:e,quoted:!1}}function Le(e,t){return{type:`property`,key:e,...e===`series`?{quotedKey:!0}:{},value:t.value,isPercentage:t.isPercentage}}function Re(e){return e.trim()}function ze(e,t){return{type:`colorize`,target:e,properties:t}}function Be(){Et(`colorize needs a quoted target, e.g. colorize "2021" { ... }`)}function Ve(e,t){return{type:`colorize`,target:e,properties:t,fromHighlight:!0}}function He(e){return{type:`highlight`,target:e,properties:[]}}function Ue(){Et(`highlight needs a quoted target, e.g. highlight "2021" { ... } or highlight "2021"`)}function We(e,t,n){return{type:`area-fill`,from:e,to:t,properties:n}}function Ge(){Et(`area-fill needs two quoted targets, e.g. area-fill "Revenue" "Cost" { ... }`)}function Ke(){Et(`area-fill needs two quoted targets, e.g. area-fill "Revenue" "Cost" { ... }`)}function qe(e,t){return{type:`annotation`,kind:`point`,target:e,properties:t}}function Je(){Et(`annotation needs a quoted target, e.g. annotation "2021" { ... }`)}function Ye(e){return{type:`annotation`,kind:`range`,properties:e}}function Xe(e){return{type:`annotation`,kind:`free`,properties:e}}function Ze(e,t){return{type:`series`,name:e,properties:t}}function Qe(){Et(`series needs a quoted name, e.g. series "Revenue" { ... }`)}function $e(e,t){T(t)>1&&Et(`duplicate data block — a chart or scene may define at most one data { } block`);let n=D(t);return{type:`scene`,name:e??null,properties:n.properties,data:n.data,colorizes:n.colorizes,highlights:n.highlights,areaFills:n.areaFills,annotations:n.annotations,series:n.series,transforms:n.transforms}}function et(e,t){return{type:`transform`,transformType:e,properties:t}}function tt(e,t){return e.length&&(t.leadingComments=e),t}function nt(e){return e}function rt(e,t){return{type:`property`,key:e,value:t.value,isPercentage:t.isPercentage}}function it(e){return{value:e,isPercentage:!0}}function at(e){return{value:e,isPercentage:!1}}function ot(e){return{value:e,isPercentage:!1}}function st(e){return{value:e,isPercentage:!1}}function ct(e){return parseFloat(e)}function lt(e){return e.join(``)}function ut(e){return e}function dt(){return`"`}function ft(){return`\\`}function pt(){return`
|
|
236
|
+
`}function mt(){return`\r`}function ht(){return` `}function gt(e){return String.fromCharCode(parseInt(e,16))}function _t(e){Et(`Unknown escape sequence \\`+e)}function vt(e){return e}function yt(e){return e}function bt(e){return e.trim()}function xt(e){return e.trim()}let q=t.peg$currPos|0,J=q,St=[{line:1,column:1}],Ct=q,wt=t.peg$maxFailExpected||[],Y=t.peg$silentFails|0,Tt;if(t.startRule){if(!(t.startRule in i))throw Error(`Can't start parsing from rule "`+t.startRule+`".`);a=i[t.startRule]}function Et(e,t){throw t=t===void 0?Pt(J,q):t,Ft(e,t)}function Dt(t=q){let n=e.codePointAt(t);return n===void 0?``:String.fromCodePoint(n)}function Ot(e,t){return{type:`literal`,text:e,ignoreCase:t}}function kt(e,t,n,r){return{type:`class`,parts:e,inverted:t,ignoreCase:n,unicode:r}}function At(){return{type:`any`}}function jt(){return{type:`end`}}function Mt(e){return{type:`other`,description:e}}function Nt(t){let n=St[t],r;if(n)return n;if(t>=St.length)r=St.length-1;else for(r=t;!St[--r];);for(n=St[r],n={line:n.line,column:n.column};r<t;)e.charCodeAt(r)===10?(n.line++,n.column=1):n.column++,r++;return St[t]=n,n}function Pt(e,t,n){let i=Nt(e),a=Nt(t),o={source:r,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:a.line,column:a.column}};return n&&r&&typeof r.offset==`function`&&(o.start=r.offset(o.start),o.end=r.offset(o.end)),o}function X(e){q<Ct||(q>Ct&&(Ct=q,wt=[]),wt.push(e))}function Ft(e,t){return new O(e,null,null,t)}function It(e,t,n){return new O(O.buildMessage(e,t),e,t,n)}function Lt(){let t,r,i,a,s,c,l,u;if(t=q,Z(),e.substr(q,5)===o?(r=o,q+=5):(r=n,Y===0&&X(j)),r!==n){if(i=_n(),i!==n){if(a=on(),a!==n){if(Z(),e.charCodeAt(q)===123?(s=`{`,q++):(s=n,Y===0&&X(M)),s!==n){for(c=[],l=Rt();l!==n;)c.push(l),l=Rt();l=Z(),e.charCodeAt(q)===125?(u=`}`,q++):(u=n,Y===0&&X(N)),u===n?(q=t,t=n):(Z(),J=t,t=Oe(a,c))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t}function Rt(){let t,r,i,a,o;if(t=q,r=hn(),i=zt(),i===n&&(i=Gt(),i===n&&(i=Kt(),i===n&&(i=qt(),i===n&&(i=Yt(),i===n&&(i=Xt(),i===n&&(i=Jt(),i===n&&(i=Zt(),i===n&&(i=Qt(),i===n&&(i=$t(),i===n&&(i=nn())))))))))),i!==n){for(a=[],o=e.charAt(q),_.test(o)?q++:(o=n,Y===0&&X(P));o!==n;)a.push(o),o=e.charAt(q),_.test(o)?q++:(o=n,Y===0&&X(P));o=fn(),o===n&&(o=null),mn(),J=t,t=ke(r,i)}else q=t,t=n;return t}function zt(){let t,r,i,a,o,c;if(t=q,e.substr(q,4)===s?(r=s,q+=4):(r=n,Y===0&&X(F)),r!==n){if(Z(),e.charCodeAt(q)===123?(i=`{`,q++):(i=n,Y===0&&X(M)),i!==n){for(a=[],o=Bt();o!==n;)a.push(o),o=Bt();o=Z(),e.charCodeAt(q)===125?(c=`}`,q++):(c=n,Y===0&&X(N)),c===n?(q=t,t=n):(J=t,t=Ae(a))}else q=t,t=n}else q=t,t=n;return t}function Bt(){let t,r,i,a,o;if(t=q,r=hn(),i=Ut(),i===n&&(i=Vt()),i!==n){for(a=[],o=e.charAt(q),_.test(o)?q++:(o=n,Y===0&&X(P));o!==n;)a.push(o),o=e.charAt(q),_.test(o)?q++:(o=n,Y===0&&X(P));o=fn(),o===n&&(o=null),mn(),J=t,t=je(r,i)}else q=t,t=n;return t}function Vt(){let t,r,i,a,o,s,c,l;if(t=q,r=Ht(),r!==n){if(Z(),e.charCodeAt(q)===61?(i=`=`,q++):(i=n,Y===0&&X(I)),i!==n){if(Z(),a=an(),a!==n){if(o=[],s=q,e.charCodeAt(q)===44?(c=`,`,q++):(c=n,Y===0&&X(L)),c===n?(q=s,s=n):(Z(),l=an(),l===n?(q=s,s=n):(J=s,s=Me(r,a,l))),s!==n)for(;s!==n;)o.push(s),s=q,e.charCodeAt(q)===44?(c=`,`,q++):(c=n,Y===0&&X(L)),c===n?(q=s,s=n):(Z(),l=an(),l===n?(q=s,s=n):(J=s,s=Me(r,a,l)));else o=n;o===n?(q=t,t=n):(J=t,t=Ne(r,a,o))}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t===n&&(t=q,r=Ht(),r===n?(q=t,t=n):(Z(),e.charCodeAt(q)===61?(i=`=`,q++):(i=n,Y===0&&X(I)),i===n?(q=t,t=n):(Z(),a=an(),a===n?(q=t,t=n):(J=t,t=Pe(r,a))))),t}function Ht(){let e,t;return e=q,t=cn(),t!==n&&(J=e,t=Fe(t)),e=t,e===n&&(e=q,t=on(),t!==n&&(J=e,t=Ie(t)),e=t),e}function Ut(){let t,r,i,a;return t=q,r=Wt(),r===n?(q=t,t=n):(e.charCodeAt(q)===9?(i=` `,q++):(i=n,Y===0&&X(R)),i===n?(q=t,t=n):(Z(),a=an(),a===n?(q=t,t=n):(J=t,t=Le(r,a)))),t}function Wt(){let t,r,i,a;if(t=q,r=q,i=[],a=e.charAt(q),v.test(a)?q++:(a=n,Y===0&&X(z)),a!==n)for(;a!==n;)i.push(a),a=e.charAt(q),v.test(a)?q++:(a=n,Y===0&&X(z));else i=n;return r=i===n?i:e.substring(r,q),r!==n&&(J=t,r=Re(r)),t=r,t}function Gt(){let t,r,i,a,o,s,l,u;if(t=q,e.substr(q,8)===c?(r=c,q+=8):(r=n,Y===0&&X(B)),r!==n){if(i=_n(),i!==n){if(a=cn(),a!==n){if(Z(),e.charCodeAt(q)===123?(o=`{`,q++):(o=n,Y===0&&X(M)),o!==n){for(Z(),s=[],l=tn();l!==n;)s.push(l),l=tn();l=Z(),e.charCodeAt(q)===125?(u=`}`,q++):(u=n,Y===0&&X(N)),u===n?(q=t,t=n):(J=t,t=ze(a,s))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t===n&&(t=q,e.substr(q,8)===c?(r=c,q+=8):(r=n,Y===0&&X(B)),r===n?(q=t,t=n):(i=Z(),e.charCodeAt(q)===123?(a=`{`,q++):(a=n,Y===0&&X(M)),a===n?(q=t,t=n):(J=t,t=Be()))),t}function Kt(){let t,r,i,a,o,s,c,u,d,f;if(t=q,e.substr(q,9)===l?(r=l,q+=9):(r=n,Y===0&&X(V)),r!==n){if(i=_n(),i!==n){if(a=cn(),a!==n){if(o=Z(),e.charCodeAt(q)===123?(s=`{`,q++):(s=n,Y===0&&X(M)),s!==n){for(c=Z(),u=[],d=tn();d!==n;)u.push(d),d=tn();d=Z(),e.charCodeAt(q)===125?(f=`}`,q++):(f=n,Y===0&&X(N)),f===n?(q=t,t=n):(J=t,t=Ve(a,u))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t===n&&(t=q,e.substr(q,9)===l?(r=l,q+=9):(r=n,Y===0&&X(V)),r===n?(q=t,t=n):(i=_n(),i===n?(q=t,t=n):(a=cn(),a===n?(q=t,t=n):(o=q,Y++,s=q,c=Z(),e.charCodeAt(q)===123?(u=`{`,q++):(u=n,Y===0&&X(M)),u===n?(q=s,s=n):(c=[c,u],s=c),Y--,s===n?o=void 0:(q=o,o=n),o===n?(q=t,t=n):(J=t,t=He(a))))),t===n&&(t=q,e.substr(q,9)===l?(r=l,q+=9):(r=n,Y===0&&X(V)),r===n?(q=t,t=n):(i=Z(),e.charCodeAt(q)===123?(a=`{`,q++):(a=n,Y===0&&X(M)),a===n?(q=t,t=n):(J=t,t=Ue())))),t}function qt(){let t,r,i,a,o,s,c,l,d,f;if(t=q,e.substr(q,9)===u?(r=u,q+=9):(r=n,Y===0&&X(H)),r!==n){if(i=_n(),i!==n){if(a=cn(),a!==n){if(o=_n(),o!==n){if(s=cn(),s!==n){if(Z(),e.charCodeAt(q)===123?(c=`{`,q++):(c=n,Y===0&&X(M)),c!==n){for(Z(),l=[],d=tn();d!==n;)l.push(d),d=tn();d=Z(),e.charCodeAt(q)===125?(f=`}`,q++):(f=n,Y===0&&X(N)),f===n?(q=t,t=n):(J=t,t=We(a,s,l))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t===n&&(t=q,e.substr(q,9)===u?(r=u,q+=9):(r=n,Y===0&&X(H)),r===n?(q=t,t=n):(i=_n(),i===n?(q=t,t=n):(a=cn(),a===n?(q=t,t=n):(o=Z(),e.charCodeAt(q)===123?(s=`{`,q++):(s=n,Y===0&&X(M)),s===n?(q=t,t=n):(J=t,t=Ge())))),t===n&&(t=q,e.substr(q,9)===u?(r=u,q+=9):(r=n,Y===0&&X(H)),r===n?(q=t,t=n):(i=Z(),e.charCodeAt(q)===123?(a=`{`,q++):(a=n,Y===0&&X(M)),a===n?(q=t,t=n):(J=t,t=Ke())))),t}function Jt(){let t,r,i,a,o,s,c,l;if(t=q,e.substr(q,10)===d?(r=d,q+=10):(r=n,Y===0&&X(U)),r!==n){if(i=_n(),i!==n){if(a=cn(),a!==n){if(Z(),e.charCodeAt(q)===123?(o=`{`,q++):(o=n,Y===0&&X(M)),o!==n){for(Z(),s=[],c=tn();c!==n;)s.push(c),c=tn();c=Z(),e.charCodeAt(q)===125?(l=`}`,q++):(l=n,Y===0&&X(N)),l===n?(q=t,t=n):(J=t,t=qe(a,s))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t===n&&(t=q,e.substr(q,10)===d?(r=d,q+=10):(r=n,Y===0&&X(U)),r===n?(q=t,t=n):(i=Z(),e.charCodeAt(q)===123?(a=`{`,q++):(a=n,Y===0&&X(M)),a===n?(q=t,t=n):(J=t,t=Je()))),t}function Yt(){let t,r,i,a,o,s;if(t=q,e.substr(q,5)===f?(r=f,q+=5):(r=n,Y===0&&X(te)),r!==n){if(Z(),e.charCodeAt(q)===123?(i=`{`,q++):(i=n,Y===0&&X(M)),i!==n){for(Z(),a=[],o=tn();o!==n;)a.push(o),o=tn();o=Z(),e.charCodeAt(q)===125?(s=`}`,q++):(s=n,Y===0&&X(N)),s===n?(q=t,t=n):(J=t,t=Ye(a))}else q=t,t=n}else q=t,t=n;return t}function Xt(){let t,r,i,a,o,s;if(t=q,e.substr(q,4)===p?(r=p,q+=4):(r=n,Y===0&&X(ne)),r!==n){if(Z(),e.charCodeAt(q)===123?(i=`{`,q++):(i=n,Y===0&&X(M)),i!==n){for(Z(),a=[],o=tn();o!==n;)a.push(o),o=tn();o=Z(),e.charCodeAt(q)===125?(s=`}`,q++):(s=n,Y===0&&X(N)),s===n?(q=t,t=n):(J=t,t=Xe(a))}else q=t,t=n}else q=t,t=n;return t}function Zt(){let t,r,i,a,o,s,c,l;if(t=q,e.substr(q,6)===m?(r=m,q+=6):(r=n,Y===0&&X(re)),r!==n){if(i=_n(),i!==n){if(a=cn(),a!==n){if(Z(),e.charCodeAt(q)===123?(o=`{`,q++):(o=n,Y===0&&X(M)),o!==n){for(Z(),s=[],c=tn();c!==n;)s.push(c),c=tn();c=Z(),e.charCodeAt(q)===125?(l=`}`,q++):(l=n,Y===0&&X(N)),l===n?(q=t,t=n):(J=t,t=Ze(a,s))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t===n&&(t=q,e.substr(q,6)===m?(r=m,q+=6):(r=n,Y===0&&X(re)),r===n?(q=t,t=n):(i=Z(),e.charCodeAt(q)===123?(a=`{`,q++):(a=n,Y===0&&X(M)),a===n?(q=t,t=n):(J=t,t=Qe()))),t}function Qt(){let t,r,i,a,o,s,c,l;if(t=q,e.substr(q,5)===h?(r=h,q+=5):(r=n,Y===0&&X(ie)),r!==n){if(i=_n(),i!==n){if(a=cn(),a===n&&(a=null),Z(),e.charCodeAt(q)===123?(o=`{`,q++):(o=n,Y===0&&X(M)),o!==n){for(s=[],c=en();c!==n;)s.push(c),c=en();c=Z(),e.charCodeAt(q)===125?(l=`}`,q++):(l=n,Y===0&&X(N)),l===n?(q=t,t=n):(J=t,t=$e(a,s))}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t}function $t(){let t,r,i,a,o,s,c,l;if(t=q,e.substr(q,9)===g?(r=g,q+=9):(r=n,Y===0&&X(ae)),r!==n){if(i=_n(),i!==n){if(a=on(),a!==n){if(Z(),e.charCodeAt(q)===123?(o=`{`,q++):(o=n,Y===0&&X(M)),o!==n){for(Z(),s=[],c=tn();c!==n;)s.push(c),c=tn();c=Z(),e.charCodeAt(q)===125?(l=`}`,q++):(l=n,Y===0&&X(N)),l===n?(q=t,t=n):(J=t,t=et(a,s))}else q=t,t=n}else q=t,t=n}else q=t,t=n}else q=t,t=n;return t}function en(){let t,r,i,a,o;if(t=q,r=hn(),i=zt(),i===n&&(i=Gt(),i===n&&(i=Kt(),i===n&&(i=qt(),i===n&&(i=Yt(),i===n&&(i=Xt(),i===n&&(i=Jt(),i===n&&(i=Zt(),i===n&&(i=$t(),i===n&&(i=nn()))))))))),i!==n){for(a=[],o=e.charAt(q),_.test(o)?q++:(o=n,Y===0&&X(P));o!==n;)a.push(o),o=e.charAt(q),_.test(o)?q++:(o=n,Y===0&&X(P));o=fn(),o===n&&(o=null),mn(),J=t,t=tt(r,i)}else q=t,t=n;return t}function tn(){let e,t;return e=q,Z(),t=nn(),t===n?(q=e,e=n):(Z(),J=e,e=nt(t)),e}function nn(){let t,r,i,a;return t=q,r=rn(),r===n?(q=t,t=n):(Z(),e.charCodeAt(q)===61?(i=`=`,q++):(i=n,Y===0&&X(I)),i===n?(q=t,t=n):(Z(),a=an(),a===n?(q=t,t=n):(J=t,t=rt(r,a)))),t}function rn(){let e;return e=cn(),e===n&&(e=on()),e}function an(){let t,r,i;return t=q,r=sn(),r===n?(q=t,t=n):(e.charCodeAt(q)===37?(i=`%`,q++):(i=n,Y===0&&X(oe)),i===n?(q=t,t=n):(J=t,t=it(r))),t===n&&(t=q,r=sn(),r!==n&&(J=t,r=at(r)),t=r,t===n&&(t=q,r=cn(),r!==n&&(J=t,r=ot(r)),t=r,t===n&&(t=q,r=on(),r!==n&&(J=t,r=st(r)),t=r))),t}function on(){let t,r,i,a,o;if(Y++,t=q,r=q,i=e.charAt(q),y.test(i)?q++:(i=n,Y===0&&X(ce)),i!==n){for(a=[],o=e.charAt(q),b.test(o)?q++:(o=n,Y===0&&X(W));o!==n;)a.push(o),o=e.charAt(q),b.test(o)?q++:(o=n,Y===0&&X(W));i=[i,a],r=i}else q=r,r=n;return t=r===n?r:e.substring(t,q),Y--,t===n&&(r=n,Y===0&&X(se)),t}function sn(){let t,r,i,a,o,s,c,l,u,d;if(t=q,r=q,i=q,e.charCodeAt(q)===45?(a=`-`,q++):(a=n,Y===0&&X(G)),a===n&&(a=null),o=q,e.charCodeAt(q)===46?(s=`.`,q++):(s=n,Y===0&&X(le)),s!==n){if(c=[],l=e.charAt(q),x.test(l)?q++:(l=n,Y===0&&X(K)),l!==n)for(;l!==n;)c.push(l),l=e.charAt(q),x.test(l)?q++:(l=n,Y===0&&X(K));else c=n;c===n?(q=o,o=n):(s=[s,c],o=s)}else q=o,o=n;if(o===n){if(o=q,s=[],c=e.charAt(q),x.test(c)?q++:(c=n,Y===0&&X(K)),c!==n)for(;c!==n;)s.push(c),c=e.charAt(q),x.test(c)?q++:(c=n,Y===0&&X(K));else s=n;if(s!==n){if(c=q,e.charCodeAt(q)===46?(l=`.`,q++):(l=n,Y===0&&X(le)),l!==n){for(u=[],d=e.charAt(q),x.test(d)?q++:(d=n,Y===0&&X(K));d!==n;)u.push(d),d=e.charAt(q),x.test(d)?q++:(d=n,Y===0&&X(K));l=[l,u],c=l}else q=c,c=n;c===n&&(c=null),s=[s,c],o=s}else q=o,o=n}if(o!==n){if(s=q,c=e.charAt(q),S.test(c)?q++:(c=n,Y===0&&X(ue)),c!==n){if(l=e.charAt(q),C.test(l)?q++:(l=n,Y===0&&X(de)),l===n&&(l=null),u=[],d=e.charAt(q),x.test(d)?q++:(d=n,Y===0&&X(K)),d!==n)for(;d!==n;)u.push(d),d=e.charAt(q),x.test(d)?q++:(d=n,Y===0&&X(K));else u=n;u===n?(q=s,s=n):(c=[c,l,u],s=c)}else q=s,s=n;s===n&&(s=null),a=[a,o,s],i=a}else q=i,i=n;return r=i===n?i:e.substring(r,q),r!==n&&(J=t,r=ct(r)),t=r,t}function cn(){let t,r,i,a;if(Y++,t=q,e.charCodeAt(q)===34?(r=`"`,q++):(r=n,Y===0&&X(pe)),r!==n){for(i=[],a=ln();a!==n;)i.push(a),a=ln();e.charCodeAt(q)===34?(a=`"`,q++):(a=n,Y===0&&X(pe)),a===n?(q=t,t=n):(J=t,t=lt(i))}else q=t,t=n;return Y--,t===n&&(r=n,Y===0&&X(fe)),t}function ln(){let t,r,i;return t=q,e.charCodeAt(q)===92?(r=`\\`,q++):(r=n,Y===0&&X(me)),r===n?(q=t,t=n):(i=un(),i===n?(q=t,t=n):(J=t,t=ut(i))),t===n&&(t=e.charAt(q),w.test(t)?q++:(t=n,Y===0&&X(he))),t}function un(){let t,r,i,a,o,s,c,l;return t=q,e.charCodeAt(q)===34?(r=`"`,q++):(r=n,Y===0&&X(pe)),r!==n&&(J=t,r=dt()),t=r,t===n&&(t=q,e.charCodeAt(q)===92?(r=`\\`,q++):(r=n,Y===0&&X(me)),r!==n&&(J=t,r=ft()),t=r,t===n&&(t=q,e.charCodeAt(q)===110?(r=`n`,q++):(r=n,Y===0&&X(ge)),r!==n&&(J=t,r=pt()),t=r,t===n&&(t=q,e.charCodeAt(q)===114?(r=`r`,q++):(r=n,Y===0&&X(_e)),r!==n&&(J=t,r=mt()),t=r,t===n&&(t=q,e.charCodeAt(q)===116?(r=`t`,q++):(r=n,Y===0&&X(ve)),r!==n&&(J=t,r=ht()),t=r,t===n&&(t=q,e.charCodeAt(q)===117?(r=`u`,q++):(r=n,Y===0&&X(ye)),r===n?(q=t,t=n):(i=q,a=q,o=e.charAt(q),k.test(o)?q++:(o=n,Y===0&&X(be)),o===n?(q=a,a=n):(s=e.charAt(q),k.test(s)?q++:(s=n,Y===0&&X(be)),s===n?(q=a,a=n):(c=e.charAt(q),k.test(c)?q++:(c=n,Y===0&&X(be)),c===n?(q=a,a=n):(l=e.charAt(q),k.test(l)?q++:(l=n,Y===0&&X(be)),l===n?(q=a,a=n):(o=[o,s,c,l],a=o)))),i=a===n?a:e.substring(i,q),i===n?(q=t,t=n):(J=t,t=gt(i))),t===n&&(t=q,e.length>q?(r=e.charAt(q),q++):(r=n,Y===0&&X(xe)),r!==n&&(J=t,r=_t(r)),t=r)))))),t}function dn(){let e;return e=fn(),e===n&&(e=pn()),e}function fn(){let t,r,i,a;if(t=q,e.substr(q,2)===`//`?(r=`//`,q+=2):(r=n,Y===0&&X(Se)),r!==n){for(i=[],a=e.charAt(q),A.test(a)?q++:(a=n,Y===0&&X(Ce));a!==n;)i.push(a),a=e.charAt(q),A.test(a)?q++:(a=n,Y===0&&X(Ce));r=[r,i],t=r}else q=t,t=n;return t}function pn(){let t,r,i,a,o,s;if(t=q,e.substr(q,2)===`/*`?(r=`/*`,q+=2):(r=n,Y===0&&X(we)),r!==n){for(i=[],a=q,o=q,Y++,e.substr(q,2)===`*/`?(s=`*/`,q+=2):(s=n,Y===0&&X(Te)),Y--,s===n?o=void 0:(q=o,o=n),o===n?(q=a,a=n):(e.length>q?(s=e.charAt(q),q++):(s=n,Y===0&&X(xe)),s===n?(q=a,a=n):(o=[o,s],a=o));a!==n;)i.push(a),a=q,o=q,Y++,e.substr(q,2)===`*/`?(s=`*/`,q+=2):(s=n,Y===0&&X(Te)),Y--,s===n?o=void 0:(q=o,o=n),o===n?(q=a,a=n):(e.length>q?(s=e.charAt(q),q++):(s=n,Y===0&&X(xe)),s===n?(q=a,a=n):(o=[o,s],a=o));e.substr(q,2)===`*/`?(a=`*/`,q+=2):(a=n,Y===0&&X(Te)),a===n?(q=t,t=n):(r=[r,i,a],t=r)}else q=t,t=n;return t}function mn(){let t,r;for(Y++,t=[],r=e.charAt(q),ee.test(r)?q++:(r=n,Y===0&&X(Ee));r!==n;)t.push(r),r=e.charAt(q),ee.test(r)?q++:(r=n,Y===0&&X(Ee));return Y--,t}function hn(){let e,t,r,i;for(e=q,t=[],r=q,mn(),i=gn(),i===n?(q=r,r=n):(J=r,r=vt(i));r!==n;)t.push(r),r=q,mn(),i=gn(),i===n?(q=r,r=n):(J=r,r=vt(i));return r=mn(),J=e,e=yt(t),e}function gn(){let t,r,i,a,o,s,c;if(t=q,e.substr(q,2)===`//`?(r=`//`,q+=2):(r=n,Y===0&&X(Se)),r!==n){for(i=q,a=[],o=e.charAt(q),A.test(o)?q++:(o=n,Y===0&&X(Ce));o!==n;)a.push(o),o=e.charAt(q),A.test(o)?q++:(o=n,Y===0&&X(Ce));i=e.substring(i,q),J=t,t=bt(i)}else q=t,t=n;if(t===n){if(t=q,e.substr(q,2)===`/*`?(r=`/*`,q+=2):(r=n,Y===0&&X(we)),r!==n){for(i=q,a=[],o=q,s=q,Y++,e.substr(q,2)===`*/`?(c=`*/`,q+=2):(c=n,Y===0&&X(Te)),Y--,c===n?s=void 0:(q=s,s=n),s===n?(q=o,o=n):(e.length>q?(c=e.charAt(q),q++):(c=n,Y===0&&X(xe)),c===n?(q=o,o=n):(s=[s,c],o=s));o!==n;)a.push(o),o=q,s=q,Y++,e.substr(q,2)===`*/`?(c=`*/`,q+=2):(c=n,Y===0&&X(Te)),Y--,c===n?s=void 0:(q=s,s=n),s===n?(q=o,o=n):(e.length>q?(c=e.charAt(q),q++):(c=n,Y===0&&X(xe)),c===n?(q=o,o=n):(s=[s,c],o=s));i=e.substring(i,q),e.substr(q,2)===`*/`?(a=`*/`,q+=2):(a=n,Y===0&&X(Te)),a===n?(q=t,t=n):(J=t,t=xt(i))}else q=t,t=n}return t}function _n(){let t,r;if(Y++,t=[],r=e.charAt(q),ee.test(r)?q++:(r=n,Y===0&&X(Ee)),r===n&&(r=dn()),r!==n)for(;r!==n;)t.push(r),r=e.charAt(q),ee.test(r)?q++:(r=n,Y===0&&X(Ee)),r===n&&(r=dn());else t=n;return Y--,t===n&&(r=n,Y===0&&X(De)),t}function Z(){let t,r;for(Y++,t=[],r=e.charAt(q),ee.test(r)?q++:(r=n,Y===0&&X(Ee)),r===n&&(r=dn());r!==n;)t.push(r),r=e.charAt(q),ee.test(r)?q++:(r=n,Y===0&&X(Ee)),r===n&&(r=dn());return Y--,t}Tt=a();let vn=Tt!==n&&q===e.length;function yn(){throw Tt!==n&&q<e.length&&X(jt()),It(wt,Ct<e.length?Dt(Ct):null,Ct<e.length?Pt(Ct,Ct+1):Pt(Ct,Ct))}if(t.peg$library)return{peg$result:Tt,peg$currPos:q,peg$FAILED:n,peg$maxFailExpected:wt,peg$maxFailPos:Ct,peg$success:vn,peg$throw:vn?void 0:yn};if(vn)return Tt;yn()}function A(e){try{return k(e)}catch(e){if(e instanceof Error&&`location`in e){let t=e.location,n=SyntaxError(`${e.message} at ${t.start.line}:${t.start.column}`);throw n.location=t,n}throw e}}var ee=[{name:`Blueprint`,label:`Blueprint`,colors:[`#2563A0`,`#D4A63A`,`#C94044`,`#2D8659`,`#4B90CF`,`#163A65`]},{name:`BlueprintBold`,label:`Blueprint Bold`,colors:[`#2563A0`,`#DDF247`,`#C94044`,`#2D8659`,`#D4A63A`,`#163A65`]},{name:`JosefAlbers`,label:`Albers`,colors:[`#c00559`,`#de1f6c`,`#f3a20d`,`#f07a13`,`#de6716`]},{name:`Durorthod`,label:`Amber`,colors:[`#2c0c00`,`#803c15`,`#c6782c`,`#ffa91d`,`#fff3ad`]},{name:`X41`,label:`Berry`,colors:[`#411f6b`,`#623976`,`#be3979`,`#db928a`,`#e2c6a6`]},{name:`Bright`,label:`Bright`,colors:[`#462255`,`#ff8811`,`#9dd9d2`,`#046e8f`,`#d44d5c`]},{name:`Cancri`,label:`Cancri`,colors:[`#343854`,`#8c384d`,`#cf2438`,`#d95e31`,`#f0c742`,`#f8f0e5`]},{name:`Ceres`,label:`Ceres`,colors:[`#181d20`,`#4a5f71`,`#6f8ba0`,`#f8f9fa`]},{name:`MarcChagall`,label:`Chagall`,colors:[`#3f6f76`,`#69b7ce`,`#c65840`,`#f4ce4b`,`#62496f`]},{name:`Pelewensis`,label:`Coral`,colors:[`#e2b000`,`#f7f656`,`#2449a2`,`#809098`,`#0d1115`]},{name:`Deathmasks`,label:`Deathmasks`,colors:[`#926159`,`#87876e`,`#c7d2d8`,`#62b7c8`,`#43535c`,`#23313c`]},{name:`Leucosternon`,label:`Deep Sea`,colors:[`#071140`,`#0e34b2`,`#207cf5`,`#9ec8ff`,`#fbfb53`]},{name:`Deelite`,label:`Deelite`,colors:[`#48448e`,`#8ccc58`,`#fc4d97`,`#b82578`]},{name:`X10`,label:`Dusk`,colors:[`#2a2432`,`#4f3855`,`#846d86`,`#efefcf`,`#d5b77d`,`#a89e5e`]},{name:`Vitrixerand`,label:`Earth`,colors:[`#281b27`,`#723f27`,`#9b6044`,`#b5804c`,`#facd9a`]},{name:`Egypt`,label:`Egypt`,colors:[`#dd5129`,`#0f7ba2`,`#43b284`,`#fab255`]},{name:`ElectronicNight`,label:`Electric Night`,colors:[`#cb54d6`,`#3e45c4`,`#21191a`,`#362f78`,`#57b4ae`]},{name:`LutjanusSebae`,label:`Emperor`,colors:[`#e5e9ea`,`#a2bac5`,`#ce3d21`,`#992216`,`#490d07`]},{name:`Enara`,label:`Enara`,colors:[`#262626`,`#3d5983`,`#5a8a54`,`#cfb023`]},{name:`Camo871`,label:`Fiesta`,colors:[`#ffff14`,`#fea31d`,`#ce2d41`,`#3a3fa3`]},{name:`Folklore`,label:`Folklore`,colors:[`#272727`,`#5c5c5c`,`#bababa`,`#f8f8f8`]},{name:`Fritsch`,label:`Fritsch`,colors:[`#0f8d7b`,`#8942bd`,`#1e1a1a`,`#eadd17`]},{name:`AgSunset`,label:`Glow`,colors:[`#4b2991`,`#872ca2`,`#c0369d`,`#ea4f88`,`#fa7876`,`#f6a97a`,`#edd9a3`]},{name:`Harvey`,label:`Harvey`,colors:[`#c6d4d6`,`#274c4f`,`#a4432d`,`#b17c51`]},{name:`Heep`,label:`Heep`,colors:[`#466e9a`,`#e84d45`,`#21201c`,`#a1baac`]},{name:`Imperator`,label:`Imperator`,colors:[`#04093a`,`#0527b4`,`#555dfe`,`#faf830`,`#b8980f`]},{name:`Klimt`,label:`Klimt`,colors:[`#df9ed4`,`#c93f55`,`#eacc62`,`#469d76`,`#3c4b99`,`#924099`]},{name:`KnickCity`,label:`Knick City`,colors:[`#0c2340`,`#ff6720`,`#707372`,`#c8c9c7`]},{name:`London`,label:`London`,colors:[`#bd241e`,`#e56b1e`,`#ffcd22`,`#15274d`]},{name:`Lover`,label:`Lover`,colors:[`#b8396b`,`#ffd1d7`,`#fff5cc`,`#76bae0`,`#b28f81`,`#54483e`]},{name:`Maya`,label:`Maya`,colors:[`#3d5a80`,`#98c1d9`,`#e0fbfc`,`#ee6c4d`,`#293241`]},{name:`X24`,label:`Mocha`,colors:[`#2b1917`,`#7e5945`,`#bc927b`,`#f1e6e1`]},{name:`Camo873`,label:`Neon`,colors:[`#132f8a`,`#5a56c8`,`#fc7ead`,`#ffca3e`]},{name:`NetsCity`,label:`Nets City`,colors:[`#010101`,`#ffb81c`,`#da291c`,`#004c97`,`#418fde`]},{name:`Nodoubt`,label:`No Doubt`,colors:[`#385581`,`#6dbac6`,`#dac190`,`#c9052c`]},{name:`ClaesOldenburg`,label:`Oldenburg`,colors:[`#95b1c9`,`#263656`,`#698946`,`#f8d440`,`#c82720`]},{name:`Peacesells`,label:`Peace Sells`,colors:[`#9a5155`,`#483943`,`#ecc463`,`#a497b2`]},{name:`PabloPicasso`,label:`Picasso`,colors:[`#4e7989`,`#a9011b`,`#e4a826`,`#80944e`,`#dcd6b2`]},{name:`Bifasciatum`,label:`Reef`,colors:[`#080214`,`#16407b`,`#2b7ff9`,`#b1fcfc`,`#6cbe50`]},{name:`SiameseDream`,label:`Siamese Dream`,colors:[`#f0e9e0`,`#2f1f16`,`#a34d2c`,`#cd8e40`]},{name:`X115`,label:`Sienna`,colors:[`#001a29`,`#633633`,`#834a39`,`#e3b571`,`#eee6a6`]},{name:`Sixers`,label:`Sixers`,colors:[`#888b8d`,`#e4d5d3`,`#003da5`,`#d50032`]},{name:`SolLeWitt`,label:`Sol LeWitt`,colors:[`#0a71b6`,`#f9c40a`,`#190506`,`#eb5432`,`#eaf2f0`]},{name:`Sunset`,label:`Sunset`,colors:[`#41476b`,`#675478`,`#9e6374`,`#c67b6f`,`#de9b71`,`#efbc82`,`#fbdfa2`]},{name:`Sunset2`,label:`Sunset II`,colors:[`#1d457f`,`#61599d`,`#c36377`,`#eb7f54`,`#f2af4a`]},{name:`Sunset3`,label:`Sunset III`,colors:[`#390e40`,`#701c34`,`#a63228`,`#c7662a`,`#eba42b`]},{name:`Pal9`,label:`Tropical`,colors:[`#273b5b`,`#c1c243`,`#e73e26`,`#2e6657`,`#e8f5b3`,`#24a99c`]},{name:`Salvelinus`,label:`Trout`,colors:[`#e6452e`,`#e49a36`,`#f9dd4c`,`#5b4a4c`,`#01040e`]},{name:`TheovanDoesburg`,label:`Van Doesburg`,colors:[`#bd748f`,`#3d578e`,`#bfab68`,`#dad7d0`,`#272928`]},{name:`Wizards`,label:`Wizards`,colors:[`#c8102e`,`#0c2340`,`#8d9093`,`#c8c9c7`]},{name:`FrancescoXanto`,label:`Xanto`,colors:[`#2c6aa5`,`#d9ae2c`,`#ddc655`,`#d88c27`,`#64894d`]},{name:`Zeppelin`,label:`Zeppelin`,colors:[`#efdb15`,`#739c9c`,`#0d484c`,`#c71a08`]}],j=Object.fromEntries(ee.map(e=>[e.name,e.colors]));function M(e){if(!e)return;let t=j[e];return t?[...t]:void 0}function N(){return ee}var{min:P,max:F}=Math,I=(e,t=0,n=1)=>P(F(t,e),n),L=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=I(e[t],0,255)):t===3&&(e[t]=I(e[t],0,1));return e},R={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])R[`[object ${e}]`]=e.toLowerCase();function z(e){return R[Object.prototype.toString.call(e)]||`object`}var B=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):z(e[0])==`object`&&t?t.split(``).filter(t=>e[0][t]!==void 0).map(t=>e[0][t]):e[0].slice(0),V=e=>{if(e.length<2)return null;let t=e.length-1;return z(e[t])==`string`?e[t].toLowerCase():null},{PI:H,min:U,max:te}=Math,ne=e=>Math.round(e*100)/100,re=e=>Math.round(e*100)/100,ie=H*2,ae=H/3,oe=H/180,se=180/H;function ce(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}var W={format:{},autodetect:[]},G=class{constructor(...e){let t=this;if(z(e[0])===`object`&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=V(e),r=!1;if(!n){r=!0,W.sorted||=(W.autodetect=W.autodetect.sort((e,t)=>t.p-e.p),!0);for(let t of W.autodetect)if(n=t.test(...e),n)break}if(W.format[n])t._rgb=L(W.format[n].apply(null,r?e:e.slice(0,-1)));else throw Error(`unknown format: `+e);t._rgb.length===3&&t._rgb.push(1)}toString(){return z(this.hex)==`function`?this.hex():`[${this._rgb.join(`,`)}]`}},le=`3.2.0`,K=(...e)=>new G(...e);K.version=le;var ue={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,laserlemon:`#ffff54`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrod:`#fafad2`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,maroon2:`#7f0000`,maroon3:`#b03060`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,purple2:`#7f007f`,purple3:`#a020f0`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},de=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,fe=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,pe=e=>{if(e.match(de)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16);return[t>>16,t>>8&255,t&255,1]}if(e.match(fe)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((t&255)/255*100)/100]}throw Error(`unknown hex color: ${e}`)},{round:me}=Math,he=(...e)=>{let[t,n,r,i]=B(e,`rgba`),a=V(e)||`auto`;i===void 0&&(i=1),a===`auto`&&(a=i<1?`rgba`:`rgb`),t=me(t),n=me(n),r=me(r);let o=`000000`+(t<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let s=`0`+me(i*255).toString(16);switch(s=s.substr(s.length-2),a.toLowerCase()){case`rgba`:return`#${o}${s}`;case`argb`:return`#${s}${o}`;default:return`#${o}`}};G.prototype.name=function(){let e=he(this._rgb,`rgb`);for(let t of Object.keys(ue))if(ue[t]===e)return t.toLowerCase();return e},W.format.named=e=>{if(e=e.toLowerCase(),ue[e])return pe(ue[e]);throw Error(`unknown color name: `+e)},W.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&z(e)===`string`&&ue[e.toLowerCase()])return`named`}}),G.prototype.alpha=function(e,t=!1){return e!==void 0&&z(e)===`number`?t?(this._rgb[3]=e,this):new G([this._rgb[0],this._rgb[1],this._rgb[2],e],`rgb`):this._rgb[3]},G.prototype.clipped=function(){return this._rgb._clipped||!1};var ge={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},_e=new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);function ve(e){let t=_e.get(String(e).toLowerCase());if(!t)throw Error(`unknown Lab illuminant `+e);ge.labWhitePoint=e,ge.Xn=t[0],ge.Zn=t[1]}function ye(){return ge.labWhitePoint}var be=(...e)=>{e=B(e,`lab`);let[t,n,r]=e,[i,a,o]=xe(t,n,r),[s,c,l]=Ce(i,a,o);return[s,c,l,e.length>3?e[3]:1]},xe=(e,t,n)=>{let{kE:r,kK:i,kKE:a,Xn:o,Yn:s,Zn:c}=ge,l=(e+16)/116,u=.002*t+l,d=l-.005*n,f=u*u*u,p=d*d*d,m=f>r?f:(116*u-16)/i,h=e>a?((e+16)/116)**3:e/i,g=p>r?p:(116*d-16)/i;return[m*o,h*s,g*c]},Se=e=>{let t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*t},Ce=(e,t,n)=>{let{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:s,Yn:c,Zn:l}=ge,u=s*r.m00+c*r.m10+l*r.m20,d=s*r.m01+c*r.m11+l*r.m21,f=s*r.m02+c*r.m12+l*r.m22,p=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,m=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,h=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,g=(e*r.m00+t*r.m10+n*r.m20)*(p/u),_=(e*r.m01+t*r.m11+n*r.m21)*(m/d),v=(e*r.m02+t*r.m12+n*r.m22)*(h/f),y=g*i.m00+_*i.m10+v*i.m20,b=g*i.m01+_*i.m11+v*i.m21,x=g*i.m02+_*i.m12+v*i.m22,S=Se(y*a.m00+b*a.m10+x*a.m20),C=Se(y*a.m01+b*a.m11+x*a.m21),w=Se(y*a.m02+b*a.m12+x*a.m22);return[S*255,C*255,w*255]},we=(...e)=>{let[t,n,r,...i]=B(e,`rgb`),[a,o,s]=De(t,n,r),[c,l,u]=Te(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function Te(e,t,n){let{Xn:r,Yn:i,Zn:a,kE:o,kK:s}=ge,c=e/r,l=t/i,u=n/a,d=c>o?c**(1/3):(s*c+16)/116,f=l>o?l**(1/3):(s*l+16)/116,p=u>o?u**(1/3):(s*u+16)/116;return[116*f-16,500*(d-f),200*(f-p)]}function Ee(e){let t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*t}var De=(e,t,n)=>{e=Ee(e/255),t=Ee(t/255),n=Ee(n/255);let{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:s,Zn:c,As:l,Bs:u,Cs:d}=ge,f=e*r.m00+t*r.m10+n*r.m20,p=e*r.m01+t*r.m11+n*r.m21,m=e*r.m02+t*r.m12+n*r.m22,h=o*i.m00+s*i.m10+c*i.m20,g=o*i.m01+s*i.m11+c*i.m21,_=o*i.m02+s*i.m12+c*i.m22,v=f*i.m00+p*i.m10+m*i.m20,y=f*i.m01+p*i.m11+m*i.m21,b=f*i.m02+p*i.m12+m*i.m22;return v*=h/l,y*=g/u,b*=_/d,f=v*a.m00+y*a.m10+b*a.m20,p=v*a.m01+y*a.m11+b*a.m21,m=v*a.m02+y*a.m12+b*a.m22,[f,p,m]};G.prototype.lab=function(){return we(this._rgb)},Object.assign(K,{lab:(...e)=>new G(...e,`lab`),getLabWhitePoint:ye,setLabWhitePoint:ve}),W.format.lab=be,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`lab`),z(e)===`array`&&e.length===3)return`lab`}}),G.prototype.darken=function(e=1){let t=this,n=t.lab();return n[0]-=ge.Kn*e,new G(n,`lab`).alpha(t.alpha(),!0)},G.prototype.brighten=function(e=1){return this.darken(-e)},G.prototype.darker=G.prototype.darken,G.prototype.brighter=G.prototype.brighten,G.prototype.get=function(e){let[t,n]=e.split(`.`),r=this[t]();if(n){let e=t.indexOf(n)-(t.substr(0,2)===`ok`?2:0);if(e>-1)return r[e];throw Error(`unknown channel ${n} in mode ${t}`)}return r};var{pow:Oe}=Math,ke=1e-7,Ae=20;G.prototype.luminance=function(e,t=`rgb`){if(e!==void 0&&z(e)===`number`){if(e===0)return new G([0,0,0,this._rgb[3]],`rgb`);if(e===1)return new G([255,255,255,this._rgb[3]],`rgb`);let n=this.luminance(),r=Ae,i=(n,a)=>{let o=n.interpolate(a,.5,t),s=o.luminance();return Math.abs(e-s)<ke||!r--?o:s>e?i(n,o):i(o,a)};return new G([...(n>e?i(new G([0,0,0]),this):i(this,new G([255,255,255]))).rgb(),this._rgb[3]])}return je(...this._rgb.slice(0,3))};var je=(e,t,n)=>(e=Me(e),t=Me(t),n=Me(n),.2126*e+.7152*t+.0722*n),Me=e=>(e/=255,e<=.03928?e/12.92:Oe((e+.055)/1.055,2.4)),Ne={},Pe=(e,t,n=.5,...r)=>{let i=r[0]||`lrgb`;if(!Ne[i]&&!r.length&&(i=Object.keys(Ne)[0]),!Ne[i])throw Error(`interpolation mode ${i} is not defined`);return z(e)!==`object`&&(e=new G(e)),z(t)!==`object`&&(t=new G(t)),Ne[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};G.prototype.mix=G.prototype.interpolate=function(e,t=.5,...n){return Pe(this,e,t,...n)},G.prototype.premultiply=function(e=!1){let t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new G([t[0]*n,t[1]*n,t[2]*n,n],`rgb`)};var{sin:Fe,cos:Ie}=Math,Le=(...e)=>{let[t,n,r]=B(e,`lch`);return isNaN(r)&&(r=0),r*=oe,[t,Ie(r)*n,Fe(r)*n]},Re=(...e)=>{e=B(e,`lch`);let[t,n,r]=e,[i,a,o]=Le(t,n,r),[s,c,l]=be(i,a,o);return[s,c,l,e.length>3?e[3]:1]},ze=(...e)=>Re(...ce(B(e,`hcl`))),{sqrt:Be,atan2:Ve,round:He}=Math,Ue=(...e)=>{let[t,n,r]=B(e,`lab`),i=Be(n*n+r*r),a=(Ve(r,n)*se+360)%360;return He(i*1e4)===0&&(a=NaN),[t,i,a]},We=(...e)=>{let[t,n,r,...i]=B(e,`rgb`),[a,o,s]=we(t,n,r),[c,l,u]=Ue(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};G.prototype.lch=function(){return We(this._rgb)},G.prototype.hcl=function(){return ce(We(this._rgb))},Object.assign(K,{lch:(...e)=>new G(...e,`lch`),hcl:(...e)=>new G(...e,`hcl`)}),W.format.lch=Re,W.format.hcl=ze,[`lch`,`hcl`].forEach(e=>W.autodetect.push({p:2,test:(...t)=>{if(t=B(t,e),z(t)===`array`&&t.length===3)return e}})),G.prototype.saturate=function(e=1){let t=this,n=t.lch();return n[1]+=ge.Kn*e,n[1]<0&&(n[1]=0),new G(n,`lch`).alpha(t.alpha(),!0)},G.prototype.desaturate=function(e=1){return this.saturate(-e)},G.prototype.set=function(e,t,n=!1){let[r,i]=e.split(`.`),a=this[r]();if(i){let e=r.indexOf(i)-(r.substr(0,2)===`ok`?2:0);if(e>-1){if(z(t)==`string`)switch(t.charAt(0)){case`+`:a[e]+=+t;break;case`-`:a[e]+=+t;break;case`*`:a[e]*=+t.substr(1);break;case`/`:a[e]/=+t.substr(1);break;default:a[e]=+t}else if(z(t)===`number`)a[e]=t;else throw Error(`unsupported value for Color.set`);let i=new G(a,r);return n?(this._rgb=i._rgb,this):i}throw Error(`unknown channel ${i} in mode ${r}`)}return a},G.prototype.tint=function(e=.5,...t){return Pe(this,`white`,e,...t)},G.prototype.shade=function(e=.5,...t){return Pe(this,`black`,e,...t)},Ne.rgb=(e,t,n)=>{let r=e._rgb,i=t._rgb;return new G(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`rgb`)};var{sqrt:Ge,pow:Ke}=Math;Ne.lrgb=(e,t,n)=>{let[r,i,a]=e._rgb,[o,s,c]=t._rgb;return new G(Ge(Ke(r,2)*(1-n)+Ke(o,2)*n),Ge(Ke(i,2)*(1-n)+Ke(s,2)*n),Ge(Ke(a,2)*(1-n)+Ke(c,2)*n),`rgb`)},Ne.lab=(e,t,n)=>{let r=e.lab(),i=t.lab();return new G(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`lab`)};var qe=(e,t,n,r)=>{let i,a;r===`hsl`?(i=e.hsl(),a=t.hsl()):r===`hsv`?(i=e.hsv(),a=t.hsv()):r===`hcg`?(i=e.hcg(),a=t.hcg()):r===`hsi`?(i=e.hsi(),a=t.hsi()):r===`lch`||r===`hcl`?(r=`hcl`,i=e.hcl(),a=t.hcl()):r===`oklch`&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,s,c,l,u,d;(r.substr(0,1)===`h`||r===`oklch`)&&([o,c,u]=i,[s,l,d]=a);let f,p,m,h;return!isNaN(o)&&!isNaN(s)?(h=s>o&&s-o>180?s-(o+360):s<o&&o-s>180?s+360-o:s-o,p=o+n*h):isNaN(o)?isNaN(s)?p=NaN:(p=s,(u==1||u==0)&&r!=`hsv`&&(f=l)):(p=o,(d==1||d==0)&&r!=`hsv`&&(f=c)),f===void 0&&(f=c+n*(l-c)),m=u+n*(d-u),r===`oklch`?new G([m,f,p],r):new G([p,f,m],r)},Je=(e,t,n)=>qe(e,t,n,`lch`);Ne.lch=Je,Ne.hcl=Je;var Ye=e=>{if(z(e)==`number`&&e>=0&&e<=16777215)return[e>>16,e>>8&255,e&255,1];throw Error(`unknown num color: `+e)},Xe=(...e)=>{let[t,n,r]=B(e,`rgb`);return(t<<16)+(n<<8)+r};G.prototype.num=function(){return Xe(this._rgb)},Object.assign(K,{num:(...e)=>new G(...e,`num`)}),W.format.num=Ye,W.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&z(e[0])===`number`&&e[0]>=0&&e[0]<=16777215)return`num`}}),Ne.num=(e,t,n)=>{let r=e.num();return new G(r+n*(t.num()-r),`num`)};var{floor:Ze}=Math,Qe=(...e)=>{e=B(e,`hcg`);let[t,n,r]=e,i,a,o;r*=255;let s=n*255;if(n===0)i=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=Ze(t),c=t-e,l=r*(1-n),u=l+s*(1-c),d=l+s*c,f=l+s;switch(e){case 0:[i,a,o]=[f,d,l];break;case 1:[i,a,o]=[u,f,l];break;case 2:[i,a,o]=[l,f,d];break;case 3:[i,a,o]=[l,u,f];break;case 4:[i,a,o]=[d,l,f];break;case 5:[i,a,o]=[f,l,u]}}return[i,a,o,e.length>3?e[3]:1]},$e=(...e)=>{let[t,n,r]=B(e,`rgb`),i=U(t,n,r),a=te(t,n,r),o=a-i,s=o*100/255,c=i/(255-o)*100,l;return o===0?l=NaN:(t===a&&(l=(n-r)/o),n===a&&(l=2+(r-t)/o),r===a&&(l=4+(t-n)/o),l*=60,l<0&&(l+=360)),[l,s,c]};G.prototype.hcg=function(){return $e(this._rgb)},K.hcg=(...e)=>new G(...e,`hcg`),W.format.hcg=Qe,W.autodetect.push({p:1,test:(...e)=>{if(e=B(e,`hcg`),z(e)===`array`&&e.length===3)return`hcg`}}),Ne.hcg=(e,t,n)=>qe(e,t,n,`hcg`);var{cos:et}=Math,tt=(...e)=>{e=B(e,`hsi`);let[t,n,r]=e,i,a,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,i=(1+n*et(ie*t)/et(ae-ie*t))/3,a=1-(o+i)):t<2/3?(t-=1/3,i=(1-n)/3,a=(1+n*et(ie*t)/et(ae-ie*t))/3,o=1-(i+a)):(t-=2/3,a=(1-n)/3,o=(1+n*et(ie*t)/et(ae-ie*t))/3,i=1-(a+o)),i=I(r*i*3),a=I(r*a*3),o=I(r*o*3),[i*255,a*255,o*255,e.length>3?e[3]:1]},{min:nt,sqrt:rt,acos:it}=Math,at=(...e)=>{let[t,n,r]=B(e,`rgb`);t/=255,n/=255,r/=255;let i,a=nt(t,n,r),o=(t+n+r)/3,s=o>0?1-a/o:0;return s===0?i=NaN:(i=(t-n+(t-r))/2,i/=rt((t-n)*(t-n)+(t-r)*(n-r)),i=it(i),r>n&&(i=ie-i),i/=ie),[i*360,s,o]};G.prototype.hsi=function(){return at(this._rgb)},K.hsi=(...e)=>new G(...e,`hsi`),W.format.hsi=tt,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`hsi`),z(e)===`array`&&e.length===3)return`hsi`}}),Ne.hsi=(e,t,n)=>qe(e,t,n,`hsi`);var ot=(...e)=>{e=B(e,`hsl`);let[t,n,r]=e,i,a,o;if(n===0)i=a=o=r*255;else{let e=[0,0,0],s=[0,0,0],c=r<.5?r*(1+n):r+n-r*n,l=2*r-c,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&--e[t],6*e[t]<1?s[t]=l+(c-l)*6*e[t]:2*e[t]<1?s[t]=c:3*e[t]<2?s[t]=l+(c-l)*(2/3-e[t])*6:s[t]=l;[i,a,o]=[s[0]*255,s[1]*255,s[2]*255]}return e.length>3?[i,a,o,e[3]]:[i,a,o,1]},st=(...e)=>{e=B(e,`rgba`);let[t,n,r]=e;t/=255,n/=255,r/=255;let i=U(t,n,r),a=te(t,n,r),o=(a+i)/2,s,c;return a===i?(s=0,c=NaN):s=o<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?c=(n-r)/(a-i):n==a?c=2+(r-t)/(a-i):r==a&&(c=4+(t-n)/(a-i)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,s,o,e[3]]:[c,s,o]};G.prototype.hsl=function(){return st(this._rgb)},K.hsl=(...e)=>new G(...e,`hsl`),W.format.hsl=ot,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`hsl`),z(e)===`array`&&e.length===3)return`hsl`}}),Ne.hsl=(e,t,n)=>qe(e,t,n,`hsl`);var{floor:ct}=Math,lt=(...e)=>{e=B(e,`hsv`);let[t,n,r]=e,i,a,o;if(r*=255,n===0)i=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=ct(t),s=t-e,c=r*(1-n),l=r*(1-n*s),u=r*(1-n*(1-s));switch(e){case 0:[i,a,o]=[r,u,c];break;case 1:[i,a,o]=[l,r,c];break;case 2:[i,a,o]=[c,r,u];break;case 3:[i,a,o]=[c,l,r];break;case 4:[i,a,o]=[u,c,r];break;case 5:[i,a,o]=[r,c,l]}}return[i,a,o,e.length>3?e[3]:1]},{min:ut,max:dt}=Math,ft=(...e)=>{e=B(e,`rgb`);let[t,n,r]=e,i=ut(t,n,r),a=dt(t,n,r),o=a-i,s,c,l;return l=a/255,a===0?(s=NaN,c=0):(c=o/a,t===a&&(s=(n-r)/o),n===a&&(s=2+(r-t)/o),r===a&&(s=4+(t-n)/o),s*=60,s<0&&(s+=360)),[s,c,l]};G.prototype.hsv=function(){return ft(this._rgb)},K.hsv=(...e)=>new G(...e,`hsv`),W.format.hsv=lt,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`hsv`),z(e)===`array`&&e.length===3)return`hsv`}}),Ne.hsv=(e,t,n)=>qe(e,t,n,`hsv`);function pt(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>Array.isArray(e)?e.reduce((e,n,r)=>e+n*(t[r]||0),0):t.reduce((t,n)=>t+n*e,0)));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}var mt=(...e)=>{e=B(e,`lab`);let[t,n,r,...i]=e,[a,o,s]=ht([t,n,r]),[c,l,u]=Ce(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function ht(e){return pt([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],pt([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}var gt=(...e)=>{let[t,n,r,...i]=B(e,`rgb`);return[..._t(De(t,n,r)),...i.length>0&&i[0]<1?[i[0]]:[]]};function _t(e){return pt([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],pt([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}G.prototype.oklab=function(){return gt(this._rgb)},Object.assign(K,{oklab:(...e)=>new G(...e,`oklab`)}),W.format.oklab=mt,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`oklab`),z(e)===`array`&&e.length===3)return`oklab`}}),Ne.oklab=(e,t,n)=>{let r=e.oklab(),i=t.oklab();return new G(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`oklab`)},Ne.oklch=(e,t,n)=>qe(e,t,n,`oklch`);var{pow:vt,sqrt:yt,PI:bt,cos:xt,sin:q,atan2:J}=Math,St=(e,t=`lrgb`,n=null)=>{let r=e.length;n||=Array.from(Array(r)).map(()=>1);let i=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=i}),e=e.map(e=>new G(e)),t===`lrgb`)return Ct(e,n);let a=e.shift(),o=a.get(t),s=[],c=0,l=0;for(let e=0;e<o.length;e++)if(o[e]=(o[e]||0)*n[0],s.push(isNaN(o[e])?0:n[0]),t.charAt(e)===`h`&&!isNaN(o[e])){let t=o[e]/180*bt;c+=xt(t)*n[0],l+=q(t)*n[0]}let u=a.alpha()*n[0];e.forEach((e,r)=>{let i=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<o.length;e++)if(!isNaN(i[e])){if(s[e]+=n[r+1],t.charAt(e)===`h`){let t=i[e]/180*bt;c+=xt(t)*n[r+1],l+=q(t)*n[r+1]}else o[e]+=i[e]*n[r+1]}});for(let e=0;e<o.length;e++)if(t.charAt(e)===`h`){let t=J(l/s[e],c/s[e])/bt*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;o[e]=t}else o[e]=o[e]/s[e];return u/=r,new G(o,t).alpha(u>.99999?1:u,!0)},Ct=(e,t)=>{let n=e.length,r=[0,0,0,0];for(let i=0;i<e.length;i++){let a=e[i],o=t[i]/n,s=a._rgb;r[0]+=vt(s[0],2)*o,r[1]+=vt(s[1],2)*o,r[2]+=vt(s[2],2)*o,r[3]+=s[3]*o}return r[0]=yt(r[0]),r[1]=yt(r[1]),r[2]=yt(r[2]),r[3]>.9999999&&(r[3]=1),new G(L(r))},{pow:wt}=Math;function Y(e){let t=`rgb`,n=K(`#ccc`),r=0,i=[0,1],a=[0,1],o=[],s=[0,0],c=!1,l=[],u=!1,d=0,f=1,p=!1,m={},h=!0,g=1,_=function(e){if(e||=[`#fff`,`#000`],e&&z(e)===`string`&&K.brewer&&K.brewer[e.toLowerCase()]&&(e=K.brewer[e.toLowerCase()]),z(e)===`array`){e.length===1&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=K(e[t]);o.length=0;for(let t=0;t<e.length;t++)o.push(t/(e.length-1))}return S(),l=e},v=function(e){if(c!=null){let t=c.length-1,n=0;for(;n<t&&e>=c[n];)n++;return n-1}return 0},y=e=>e,b=e=>e,x=function(e,r){let i,a;if(r??=!1,isNaN(e)||e===null)return n;a=r?e:c&&c.length>2?v(e)/(c.length-2):f===d?1:(e-d)/(f-d),a=b(a),r||(a=y(a)),g!==1&&(a=wt(a,g)),a=s[0]+a*(1-s[0]-s[1]),a=I(a,0,1);let u=Math.floor(a*1e4);if(h&&m[u])i=m[u];else{if(z(l)===`array`)for(let e=0;e<o.length;e++){let n=o[e];if(a<=n){i=l[e];break}if(a>=n&&e===o.length-1){i=l[e];break}if(a>n&&a<o[e+1]){a=(a-n)/(o[e+1]-n),i=K.interpolate(l[e],l[e+1],a,t);break}}else z(l)===`function`&&(i=l(a));h&&(m[u]=i)}return i};var S=()=>m={};_(e);let C=function(e){let t=K(x(e));return u&&t[u]?t[u]():t};return C.classes=function(e){if(e!=null){if(z(e)===`array`)c=e,i=[e[0],e[e.length-1]];else{let t=K.analyze(i);c=e===0?[t.min,t.max]:K.limits(t,`e`,e)}return C}return c},C.domain=function(e){if(!arguments.length)return a;a=e.slice(0),d=e[0],f=e[e.length-1],o=[];let t=l.length;if(e.length===t&&d!==f)for(let t of Array.from(e))o.push((t-d)/(f-d));else{for(let e=0;e<t;e++)o.push(e/(t-1));if(e.length>2){let t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-d)/(f-d));n.every((e,n)=>t[n]===e)||(b=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;let i=(e-n[r])/(n[r+1]-n[r]);return t[r]+i*(t[r+1]-t[r])})}}return i=[d,f],C},C.mode=function(e){return arguments.length?(t=e,S(),C):t},C.range=function(e,t){return _(e,t),C},C.out=function(e){return u=e,C},C.spread=function(e){return arguments.length?(r=e,C):r},C.correctLightness=function(e){return e??=!0,p=e,S(),y=p?function(e){let t=x(0,!0).lab()[0],n=x(1,!0).lab()[0],r=t>n,i=x(e,!0).lab()[0],a=t+(n-t)*e,o=i-a,s=0,c=1,l=20;for(;Math.abs(o)>.01&&l-->0;)(function(){return r&&(o*=-1),o<0?(s=e,e+=(c-e)*.5):(c=e,e+=(s-e)*.5),i=x(e,!0).lab()[0],o=i-a})();return e}:e=>e,C},C.padding=function(e){return e==null?s:(z(e)===`number`&&(e=[e,e]),s=e,C)},C.colors=function(t,n){arguments.length<2&&(n=`hex`);let r=[];if(arguments.length===0)r=l.slice(0);else if(t===1)r=[C(.5)];else if(t>1){let e=i[0],n=i[1]-e;r=Tt(0,t,!1).map(r=>C(e+r/(t-1)*n))}else{e=[];let t=[];if(c&&c.length>2)for(let e=1,n=c.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push((c[e-1]+c[e])*.5);else t=i;r=t.map(e=>C(e))}return K[n]&&(r=r.map(e=>e[n]())),r},C.cache=function(e){return e==null?h:(h=e,C)},C.gamma=function(e){return e==null?g:(g=e,C)},C.nodata=function(e){return e==null?n:(n=K(e),C)},C}function Tt(e,t,n){let r=[],i=e<t,a=n?i?t+1:t-1:t;for(let t=e;i?t<a:t>a;i?t++:t--)r.push(t);return r}var Et=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t},Dt=function(e){let t,n,r,i;if(e=e.map(e=>new G(e)),e.length===2)[n,r]=e.map(e=>e.lab()),t=function(e){return new G([0,1,2].map(t=>n[t]+e*(r[t]-n[t])),`lab`)};else if(e.length===3)[n,r,i]=e.map(e=>e.lab()),t=function(e){return new G([0,1,2].map(t=>(1-e)*(1-e)*n[t]+2*(1-e)*e*r[t]+e*e*i[t]),`lab`)};else if(e.length===4){let a;[n,r,i,a]=e.map(e=>e.lab()),t=function(e){return new G([0,1,2].map(t=>(1-e)*(1-e)*(1-e)*n[t]+3*(1-e)*(1-e)*e*r[t]+3*(1-e)*e*e*i[t]+e*e*e*a[t]),`lab`)}}else if(e.length>=5){let n,r,i;n=e.map(e=>e.lab()),i=e.length-1,r=Et(i),t=function(e){let t=1-e;return new G([0,1,2].map(a=>n.reduce((n,o,s)=>n+r[s]*t**(i-s)*e**s*o[a],0)),`lab`)}}else throw RangeError(`No point in running bezier with only one color.`);return t},Ot=e=>{let t=Dt(e);return t.scale=()=>Y(t),t},{round:kt}=Math;G.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(kt)},G.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:kt(t):t)},Object.assign(K,{rgb:(...e)=>new G(...e,`rgb`)}),W.format.rgb=(...e)=>{let t=B(e,`rgba`);return t[3]===void 0&&(t[3]=1),t},W.autodetect.push({p:3,test:(...e)=>{if(e=B(e,`rgba`),z(e)===`array`&&(e.length===3||e.length===4&&z(e[3])==`number`&&e[3]>=0&&e[3]<=1))return`rgb`}});var At=(e,t,n)=>{if(!At[n])throw Error(`unknown blend mode `+n);return At[n](e,t)},jt=e=>(t,n)=>{let r=K(n).rgb(),i=K(t).rgb();return K.rgb(e(r,i))},Mt=e=>(t,n)=>{let r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r};At.normal=jt(Mt(e=>e)),At.multiply=jt(Mt((e,t)=>e*t/255)),At.screen=jt(Mt((e,t)=>255*(1-(1-e/255)*(1-t/255)))),At.overlay=jt(Mt((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)))),At.darken=jt(Mt((e,t)=>e>t?t:e)),At.lighten=jt(Mt((e,t)=>e>t?e:t)),At.dodge=jt(Mt((e,t)=>e===255?255:(e=t/255*255/(1-e/255),e>255?255:e))),At.burn=jt(Mt((e,t)=>255*(1-(1-t/255)/(e/255))));var{pow:Nt,sin:Pt,cos:X}=Math;function Ft(e=300,t=-1.5,n=1,r=1,i=[0,1]){let a=0,o;z(i)===`array`?o=i[1]-i[0]:(o=0,i=[i,i]);let s=function(s){let c=ie*((e+120)/360+t*s),l=Nt(i[0]+o*s,r),u=(a===0?n:n[0]+s*a)*l*(1-l)/2,d=X(c),f=Pt(c),p=l+u*(-.14861*d+1.78277*f),m=l+u*(-.29227*d-.90649*f),h=l+1.97294*d*u;return K(L([p*255,m*255,h*255,1]))};return s.start=function(t){return t==null?e:(e=t,s)},s.rotations=function(e){return e==null?t:(t=e,s)},s.gamma=function(e){return e==null?r:(r=e,s)},s.hue=function(e){return e==null?n:(n=e,z(n)===`array`?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,s)},s.lightness=function(e){return e==null?i:(z(e)===`array`?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=()=>K.scale(s),s.hue(n),s}var It=`0123456789abcdef`,{floor:Lt,random:Rt}=Math,zt=(e=Rt)=>{let t=`#`;for(let n=0;n<6;n++)t+=It.charAt(Lt(e()*16));return new G(t,`hex`)},{log:Bt,pow:Vt,floor:Ht,abs:Ut}=Math;function Wt(e,t=null){let n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return z(e)===`object`&&(e=Object.values(e)),e.forEach(e=>{t&&z(e)===`object`&&(e=e[t]),e!=null&&!isNaN(e)&&(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>Gt(n,e,t),n}function Gt(e,t=`equal`,n=7){z(e)==`array`&&(e=Wt(e));let{min:r,max:i}=e,a=e.values.sort((e,t)=>e-t);if(n===1)return[r,i];let o=[];if(t.substr(0,1)===`c`&&(o.push(r),o.push(i)),t.substr(0,1)===`e`){o.push(r);for(let e=1;e<n;e++)o.push(r+e/n*(i-r));o.push(i)}else if(t.substr(0,1)===`l`){if(r<=0)throw Error(`Logarithmic scales are only possible for values > 0`);let e=Math.LOG10E*Bt(r),t=Math.LOG10E*Bt(i);o.push(r);for(let r=1;r<n;r++)o.push(Vt(10,e+r/n*(t-e)));o.push(i)}else if(t.substr(0,1)===`q`){o.push(r);for(let e=1;e<n;e++){let t=(a.length-1)*e/n,r=Ht(t);if(r===t)o.push(a[r]);else{let e=t-r;o.push(a[r]*(1-e)+a[r+1]*e)}}o.push(i)}else if(t.substr(0,1)===`k`){let e,t=a.length,s=Array(t),c=Array(n),l=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(i-r));for(d.push(i);l;){for(let e=0;e<n;e++)c[e]=0;for(let e=0;e<t;e++){let t=a[e],r=Number.MAX_VALUE,i;for(let a=0;a<n;a++){let n=Ut(d[a]-t);n<r&&(r=n,i=a),c[i]++,s[e]=i}}let r=Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=s[n],r[e]===null?r[e]=a[n]:r[e]+=a[n];for(let e=0;e<n;e++)r[e]*=1/c[e];l=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){l=!0;break}d=r,u++,u>200&&(l=!1)}let f={};for(let e=0;e<n;e++)f[e]=[];for(let n=0;n<t;n++)e=s[n],f[e].push(a[n]);let p=[];for(let e=0;e<n;e++)p.push(f[e][0]),p.push(f[e][f[e].length-1]);p=p.sort((e,t)=>e-t),o.push(p[0]);for(let e=1;e<p.length;e+=2){let t=p[e];!isNaN(t)&&o.indexOf(t)===-1&&o.push(t)}}return o}var Kt=(e,t)=>{e=new G(e),t=new G(t);let n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},qt=.027,Jt=5e-4,Yt=.1,Xt=1.14,Zt=.022,Qt=1.414,$t=(e,t)=>{e=new G(e),t=new G(t),e.alpha()<1&&(e=Pe(t,e,e.alpha(),`rgb`));let n=en(...e.rgb()),r=en(...t.rgb()),i=n>=Zt?n:n+(Zt-n)**+Qt,a=r>=Zt?r:r+(Zt-r)**+Qt,o=a**.56-i**.57,s=a**.65-i**.62,c=Math.abs(a-i)<Jt?0:i<a?o*Xt:s*Xt;return(Math.abs(c)<Yt?0:c>0?c-qt:c+qt)*100};function en(e,t,n){return .2126729*(e/255)**2.4+.7151522*(t/255)**2.4+.072175*(n/255)**2.4}var{sqrt:tn,pow:nn,min:rn,max:an,atan2:on,abs:sn,cos:cn,sin:ln,exp:un,PI:dn}=Math;function fn(e,t,n=1,r=1,i=1){var a=function(e){return 360*e/(2*dn)},o=function(e){return 2*dn*e/360};e=new G(e),t=new G(t);let[s,c,l]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),p=(s+u)/2,m=(tn(nn(c,2)+nn(l,2))+tn(nn(d,2)+nn(f,2)))/2,h=.5*(1-tn(nn(m,7)/(nn(m,7)+nn(25,7)))),g=c*(1+h),_=d*(1+h),v=tn(nn(g,2)+nn(l,2)),y=tn(nn(_,2)+nn(f,2)),b=(v+y)/2,x=a(on(l,g)),S=a(on(f,_)),C=x>=0?x:x+360,w=S>=0?S:S+360,T=sn(C-w)>180?(C+w+360)/2:(C+w)/2,E=1-.17*cn(o(T-30))+.24*cn(o(2*T))+.32*cn(o(3*T+6))-.2*cn(o(4*T-63)),D=w-C;D=sn(D)<=180?D:w<=C?D+360:D-360,D=2*tn(v*y)*ln(o(D)/2);let O=u-s,k=y-v,A=1+.015*nn(p-50,2)/tn(20+nn(p-50,2)),ee=1+.045*b,j=1+.015*b*E,M=30*un(-nn((T-275)/25,2)),N=-(2*tn(nn(b,7)/(nn(b,7)+nn(25,7))))*ln(2*o(M));return an(0,rn(100,tn(nn(O/(n*A),2)+nn(k/(r*ee),2)+nn(D/(i*j),2)+N*(k/(r*ee))*(D/(i*j)))))}function pn(e,t,n=`lab`){e=new G(e),t=new G(t);let r=e.get(n),i=t.get(n),a=0;for(let e in r){let t=(r[e]||0)-(i[e]||0);a+=t*t}return Math.sqrt(a)}var mn=(...e)=>{try{return new G(...e),!0}catch{return!1}},hn={cool(){return Y([K.hsl(180,1,.9),K.hsl(250,.7,.4)])},hot(){return Y([`#000`,`#f00`,`#ff0`,`#fff`],[0,.25,.75,1]).mode(`rgb`)}},gn={OrRd:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`],PuBu:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`],BuPu:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`],Oranges:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`],BuGn:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`],YlOrBr:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`],YlGn:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`],Reds:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`],RdPu:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`],Greens:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`],YlGnBu:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`],Purples:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`],GnBu:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`],Greys:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`],YlOrRd:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`],PuRd:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`],Blues:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`],PuBuGn:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`],Viridis:[`#440154`,`#482777`,`#3f4a8a`,`#31678e`,`#26838f`,`#1f9d8a`,`#6cce5a`,`#b6de2b`,`#fee825`],Spectral:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],RdYlGn:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],RdBu:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],PiYG:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],PRGn:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],RdYlBu:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],BrBG:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],RdGy:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],PuOr:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],Set2:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`],Accent:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`],Set1:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`],Set3:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`],Dark2:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`],Paired:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`],Pastel2:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`],Pastel1:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},_n=Object.keys(gn),Z=new Map(_n.map(e=>[e.toLowerCase(),e])),vn=typeof Proxy==`function`?new Proxy(gn,{get(e,t){let n=t.toLowerCase();if(Z.has(n))return e[Z.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(_n)}}):gn,yn=(...e)=>{e=B(e,`cmyk`);let[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max:bn}=Math,xn=(...e)=>{let[t,n,r]=B(e,`rgb`);t/=255,n/=255,r/=255;let i=1-bn(t,bn(n,r)),a=i<1?1/(1-i):0;return[(1-t-i)*a,(1-n-i)*a,(1-r-i)*a,i]};G.prototype.cmyk=function(){return xn(this._rgb)},Object.assign(K,{cmyk:(...e)=>new G(...e,`cmyk`)}),W.format.cmyk=yn,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`cmyk`),z(e)===`array`&&e.length===4)return`cmyk`}});var Sn=(...e)=>{let t=B(e,`hsla`),n=V(e)||`lsa`;return t[0]=ne(t[0]||0)+`deg`,t[1]=ne(t[1]*100)+`%`,t[2]=ne(t[2]*100)+`%`,n===`hsla`||t.length>3&&t[3]<1?(t[3]=`/ `+(t.length>3?t[3]:1),n=`hsla`):t.length=3,`${n.substr(0,3)}(${t.join(` `)})`},Cn=(...e)=>{let t=B(e,`lab`),n=V(e)||`lab`;return t[0]=ne(t[0])+`%`,t[1]=ne(t[1]),t[2]=ne(t[2]),n===`laba`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(` `)})`},wn=(...e)=>{let t=B(e,`lch`),n=V(e)||`lab`;return t[0]=ne(t[0])+`%`,t[1]=ne(t[1]),t[2]=isNaN(t[2])?`none`:ne(t[2])+`deg`,n===`lcha`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(` `)})`},Tn=(...e)=>{let t=B(e,`lab`);return t[0]=ne(t[0]*100)+`%`,t[1]=re(t[1]),t[2]=re(t[2]),t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(` `)})`},En=(...e)=>{let[t,n,r,...i]=B(e,`rgb`),[a,o,s]=gt(t,n,r),[c,l,u]=Ue(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]},Dn=(...e)=>{let t=B(e,`lch`);return t[0]=ne(t[0]*100)+`%`,t[1]=re(t[1]),t[2]=isNaN(t[2])?`none`:ne(t[2])+`deg`,t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(` `)})`},{round:On}=Math,kn=(...e)=>{let t=B(e,`rgba`),n=V(e)||`rgb`;if(n.substr(0,3)===`hsl`)return Sn(st(t),n);if(n.substr(0,3)===`lab`){let e=ye();ve(`d50`);let r=Cn(we(t),n);return ve(e),r}if(n.substr(0,3)===`lch`){let e=ye();ve(`d50`);let r=wn(We(t),n);return ve(e),r}return n.substr(0,5)===`oklab`?Tn(gt(t)):n.substr(0,5)===`oklch`?Dn(En(t)):(t[0]=On(t[0]),t[1]=On(t[1]),t[2]=On(t[2]),(n===`rgba`||t.length>3&&t[3]<1)&&(t[3]=`/ `+(t.length>3?t[3]:1),n=`rgba`),`${n.substr(0,3)}(${t.slice(0,n===`rgb`?3:4).join(` `)})`)},An=(...e)=>{e=B(e,`lch`);let[t,n,r,...i]=e,[a,o,s]=Le(t,n,r),[c,l,u]=mt(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]},jn=`((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)`,Mn=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)`,Nn=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)`,Pn=`\\s*`,Fn=`\\s+`,In=`\\s*,\\s*`,Ln=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)`,Rn=`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?`,zn=RegExp(`^rgba?\\(`+Pn+[jn,jn,jn].join(Fn)+Rn+`\\)$`),Bn=RegExp(`^rgb\\(`+Pn+[jn,jn,jn].join(In)+Pn+`\\)$`),Vn=RegExp(`^rgba\\(`+Pn+[jn,jn,jn,Mn].join(In)+Pn+`\\)$`),Hn=RegExp(`^hsla?\\(`+Pn+[Ln,Nn,Nn].join(Fn)+Rn+`\\)$`),Un=RegExp(`^hsl?\\(`+Pn+[Ln,Nn,Nn].join(In)+Pn+`\\)$`),Wn=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Gn=RegExp(`^lab\\(`+Pn+[Mn,Mn,Mn].join(Fn)+Rn+`\\)$`),Kn=RegExp(`^lch\\(`+Pn+[Mn,Mn,Ln].join(Fn)+Rn+`\\)$`),qn=RegExp(`^oklab\\(`+Pn+[Mn,Mn,Mn].join(Fn)+Rn+`\\)$`),Jn=RegExp(`^oklch\\(`+Pn+[Mn,Mn,Ln].join(Fn)+Rn+`\\)$`),{round:Yn}=Math,Xn=e=>e.map((e,t)=>t<=2?I(Yn(e),0,255):e),Zn=(e,t=0,n=100,r=!1)=>(typeof e==`string`&&e.endsWith(`%`)&&(e=parseFloat(e.substring(0,e.length-1))/100,e=r?t+(e+1)*.5*(n-t):t+e*(n-t)),+e),Qn=(e,t)=>e===`none`?t:e,$n=e=>{if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t;if(W.format.named)try{return W.format.named(e)}catch{}if((t=e.match(zn))||(t=e.match(Bn))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+Zn(Qn(e[t],0),0,255);e=Xn(e);let n=t[4]===void 0?1:+Zn(t[4],0,1);return e[3]=n,e}if(t=e.match(Vn)){let e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+Zn(e[t],0,255);return e}if((t=e.match(Hn))||(t=e.match(Un))){let e=t.slice(1,4);e[0]=+Qn(e[0].replace(`deg`,``),0),e[1]=Zn(Qn(e[1],0),0,100)*.01,e[2]=Zn(Qn(e[2],0),0,100)*.01;let n=Xn(ot(e));return n[3]=t[4]===void 0?1:+Zn(t[4],0,1),n}if(t=e.match(Wn)){let e=t.slice(1,4);e[1]*=.01,e[2]*=.01;let n=ot(e);for(let e=0;e<3;e++)n[e]=Yn(n[e]);return n[3]=+t[4],n}if(t=e.match(Gn)){let e=t.slice(1,4);e[0]=Zn(Qn(e[0],0),0,100),e[1]=Zn(Qn(e[1],0),-125,125,!0),e[2]=Zn(Qn(e[2],0),-125,125,!0);let n=ye();ve(`d50`);let r=Xn(be(e));return ve(n),r[3]=t[4]===void 0?1:+Zn(t[4],0,1),r}if(t=e.match(Kn)){let e=t.slice(1,4);e[0]=Zn(e[0],0,100),e[1]=Zn(Qn(e[1],0),0,150,!1),e[2]=+Qn(e[2].replace(`deg`,``),0);let n=ye();ve(`d50`);let r=Xn(Re(e));return ve(n),r[3]=t[4]===void 0?1:+Zn(t[4],0,1),r}if(t=e.match(qn)){let e=t.slice(1,4);e[0]=Zn(Qn(e[0],0),0,1),e[1]=Zn(Qn(e[1],0),-.4,.4,!0),e[2]=Zn(Qn(e[2],0),-.4,.4,!0);let n=Xn(mt(e));return n[3]=t[4]===void 0?1:+Zn(t[4],0,1),n}if(t=e.match(Jn)){let e=t.slice(1,4);e[0]=Zn(Qn(e[0],0),0,1),e[1]=Zn(Qn(e[1],0),0,.4,!1),e[2]=+Qn(e[2].replace(`deg`,``),0);let n=Xn(An(e));return n[3]=t[4]===void 0?1:+Zn(t[4],0,1),n}};$n.test=e=>zn.test(e)||Hn.test(e)||Gn.test(e)||Kn.test(e)||qn.test(e)||Jn.test(e)||Bn.test(e)||Vn.test(e)||Un.test(e)||Wn.test(e)||e===`transparent`,G.prototype.css=function(e){return kn(this._rgb,e)},K.css=(...e)=>new G(...e,`css`),W.format.css=$n,W.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&z(e)===`string`&&$n.test(e))return`css`}}),W.format.gl=(...e)=>{let t=B(e,`rgba`);return t[0]*=255,t[1]*=255,t[2]*=255,t},K.gl=(...e)=>new G(...e,`gl`),G.prototype.gl=function(){let e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},G.prototype.hex=function(e){return he(this._rgb,e)},K.hex=(...e)=>new G(...e,`hex`),W.format.hex=pe,W.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&z(e)===`string`&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return`hex`}});var{log:er}=Math,tr=e=>{let t=e/100,n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*er(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*er(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*er(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*er(r),i=255),[n,r,i,1]},{round:nr}=Math,rr=(...e)=>{let t=B(e,`rgb`),n=t[0],r=t[2],i=1e3,a=4e4,o;for(;a-i>.4;){o=(a+i)*.5;let e=tr(o);e[2]/e[0]>=r/n?a=o:i=o}return nr(o)};G.prototype.temp=G.prototype.kelvin=G.prototype.temperature=function(){return rr(this._rgb)};var ir=(...e)=>new G(...e,`temp`);Object.assign(K,{temp:ir,kelvin:ir,temperature:ir}),W.format.temp=W.format.kelvin=W.format.temperature=tr,G.prototype.oklch=function(){return En(this._rgb)},Object.assign(K,{oklch:(...e)=>new G(...e,`oklch`)}),W.format.oklch=An,W.autodetect.push({p:2,test:(...e)=>{if(e=B(e,`oklch`),z(e)===`array`&&e.length===3)return`oklch`}}),Object.assign(K,{analyze:Wt,average:St,bezier:Ot,blend:At,brewer:vn,Color:G,colors:ue,contrast:Kt,contrastAPCA:$t,cubehelix:Ft,deltaE:fn,distance:pn,input:W,interpolate:Pe,limits:Gt,mix:Pe,random:zt,scale:Y,scales:hn,valid:mn});var ar=K;function or(e,t){if(!ar.valid(e))return t;try{return ar(e)}catch{return t}}function sr(e){return ar.valid(e)&&ar.contrast(e,`#fff`)>=ar.contrast(e,`#333`)?`#fff`:`#333`}var cr=4.5;function lr(e){let t=e;for(;t&&t instanceof Element;){let e=getComputedStyle(t).backgroundColor;if(e&&e!==`rgba(0, 0, 0, 0)`&&e!==`transparent`)return e;t=t.parentElement}return`#fff`}function ur(e,t=`#fff`){if(!ar.valid(e))return ar.valid(t)?sr(t):`#333`;let n=ar(e),r=or(t,ar(`#fff`));if(ar.contrast(n,r)>=cr)return n.hex();let i=r.luminance()>.5;for(let e=0;e<20&&(n=i?n.darken(.3):n.brighten(.3),!(ar.contrast(n,r)>=cr));e++);return n.hex()}var dr=12,fr=.25,pr=20;function mr(e,t){if(e.length===0)return[];let n=or(t,ar(`#fff`)),r=ar.valid(t)?t:`#fff`,i=n.luminance()>.5,a=e.map(e=>ar.valid(e)?hr(ar(e),r,i):ar(`#000`));for(let e=1;e<a.length;e++)ar.deltaE(a[e],a[e-1])>=dr||(a[e]=gr(a[e],a[e-1],r,i));return a.map(e=>e.hex())}function hr(e,t,n){for(let r=0;r<pr;r++){if(ar.contrast(e,t)>=cr)return e;e=n?e.darken(fr):e.brighten(fr)}return e}function gr(e,t,n,r){let i=_r(e,t,n,r);if(ar.deltaE(i,t)>=dr)return i;let a=_r(e,t,n,!r);return ar.deltaE(a,t)>ar.deltaE(i,t)&&ar.contrast(a,n)>=cr?a:i}function _r(e,t,n,r){let i=e,a=ar.deltaE(e,t),o=e;for(let e=0;e<pr;e++){o=r?o.darken(fr):o.brighten(fr);let e=ar.deltaE(o,t);if(e>a&&ar.contrast(o,n)>=cr&&(i=o,a=e),a>=dr)break}return i}var vr=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),yr=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),br=l(vr(),1),xr=l(yr(),1);br.default.extend(xr.default);var Sr=[`YYYY-MM-DDTHH:mm:ss`,`YYYY-MM-DD HH:mm`,`YYYY-MM-DD`,`YYYY/MM/DD`,`MM/DD/YYYY`,`M/D/YYYY`,`M/D/YY`,`DD/MM/YYYY`,`DD.MM.YYYY`,`MMM D, YYYY`,`MMMM D, YYYY`,`MMM YYYY`,`MMMM YYYY`,`YYYY-MM`,`YYYY/MM`,`YYYY`];function Cr(e){return e.includes(`HH`)||e.includes(`mm`)||e.includes(`ss`)?`datetime`:e.includes(`DD`)||/(?<![MA-Z])D(?!D)/.test(e)?`day`:e===`YYYY`?`year`:e.includes(`MM`)||e.includes(`MMM`)||e.includes(`MMMM`)||e.includes(`M/`)?`month`:`day`}function wr(e){return new Date(Date.UTC(e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()))}function Tr(e){let t=e.trim();if(!t)return null;if(/^\d{4}$/.test(t)){let e=(0,br.default)(t,`YYYY`,!0);return e.isValid()?wr(e):null}for(let e of Sr){if(e===`YYYY`)continue;let n=(0,br.default)(t,e,!0);if(n.isValid())return wr(n)}return null}function Er(e){let t=e.trim();if(!t)return;let n=Tr(t);if(n)return n.getTime();let r=parseFloat(t);if(!isNaN(r))return r}function Dr(e){if(e.length===0)return null;let t=[],n=null,r=e[0].trim();if(!r)return null;if(/^\d{4}$/.test(r)){for(let n of e){let e=n.trim();if(!/^\d{4}$/.test(e))return null;let r=(0,br.default)(e,`YYYY`,!0);if(!r.isValid())return null;t.push(wr(r))}return{dates:t,granularity:`year`}}let i=[];for(let e of Sr)e!==`YYYY`&&(0,br.default)(r,e,!0).isValid()&&i.push(e);if(i.length===0)return null;for(let r of i){let i=[],a=!0;for(let t of e){let e=(0,br.default)(t.trim(),r,!0);if(!e.isValid()){a=!1;break}i.push(wr(e))}if(a){n=r,t.push(...i);break}}return n?{dates:t,granularity:Cr(n)}:null}var Or=function(e){return e.BarVertical=`bar-vertical`,e.BarHorizontal=`bar-horizontal`,e.BarMulti=`bar-multi`,e.ColumnStacked=`column-stacked`,e.BarStacked=`bar-stacked`,e.BarSplit=`bar-split`,e.BarGrouped=`bar-grouped`,e.Line=`line`,e.LineMulti=`line-multi`,e.Area=`area`,e.AreaStacked=`area-stacked`,e.Donut=`donut`,e.Pie=`pie`,e.VerticalBar=`vertical-bar`,e.HorizontalBar=`horizontal-bar`,e}({}),kr=function(e){return e.Left=`left`,e.Right=`right`,e}({}),Ar=function(e){return e.Linear=`linear`,e.Log=`log`,e}({}),jr=function(e){return e.Solid=`solid`,e.Dashed=`dashed`,e.Dotted=`dotted`,e.None=`none`,e}({}),Mr=function(e){return e.Auto=`auto`,e.Inside=`inside`,e.Outside=`outside`,e.Off=`off`,e}({}),Nr=function(e){return e.Auto=`auto`,e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({}),Pr=function(e){return e.NW=`NW`,e.N=`N`,e.NE=`NE`,e.E=`E`,e.SE=`SE`,e.S=`S`,e.SW=`SW`,e.W=`W`,e.Center=`center`,e}({}),Fr=function(e){return e.Direct=`direct`,e.CurveLeft=`curve-left`,e.CurveRight=`curve-right`,e.Elbow=`elbow`,e}({}),Ir=function(e){return e.Solid=`solid`,e.Dotted=`dotted`,e.Dashed=`dashed`,e}({}),Lr=function(e){return e.Point=`point`,e.Range=`range`,e.Free=`free`,e}({}),Rr=function(e){return e.Start=`start`,e.Center=`center`,e.End=`end`,e}({}),zr=function(e){return e.Vertical=`vertical`,e.Horizontal=`horizontal`,e}({}),Br=function(e){return e.Circle=`circle`,e.Square=`square`,e.Diamond=`diamond`,e.Triangle=`triangle`,e.TriangleDown=`triangleDown`,e.Cross=`cross`,e.Star=`star`,e}({}),Vr=function(e){return e.All=`all`,e.First=`first`,e.Last=`last`,e.FirstLast=`firstLast`,e}({}),Hr=function(e){return e.Filled=`filled`,e.Hollow=`hollow`,e}({}),Ur=function(e){return e.Ascending=`ascending`,e.Descending=`descending`,e.None=`none`,e}({}),Wr=function(e){return e.Total=`total`,e.WithinGroups=`within-groups`,e.None=`none`,e}({}),Gr=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({}),Kr=function(e){return e.Start=`start`,e.Middle=`middle`,e.End=`end`,e}({}),qr=function(e){return e.Inside=`inside`,e.Outside=`outside`,e.Auto=`auto`,e}({}),Jr=function(e){return e.Both=`both`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e}({}),Yr=function(e){return e.Solid=`solid`,e.Dashed=`dashed`,e.Dotted=`dotted`,e}({}),Xr=function(e){return e.Normal=`normal`,e.Percent=`percent`,e}({}),Q=function(e){return e.Colors=`colors`,e.Boolean=`boolean`,e.Select=`select`,e.Text=`text`,e.NumberFormat=`numberFormat`,e.DateFormat=`dateFormat`,e}({}),Zr=function(e){return e.Off=``,e.Auto=`auto`,e.Outside=`outside`,e.Inside=`inside`,e}({}),Qr=function(e){return e.Linear=`linear`,e.MonotoneX=`monotoneX`,e.Step=`step`,e.StepBefore=`stepBefore`,e.StepAfter=`stepAfter`,e.Basis=`basis`,e.Cardinal=`cardinal`,e.CatmullRom=`catmullRom`,e}({});function $r(e){let t=e?.trim();if(!t)return;let n=Number.parseFloat(t);return Number.isFinite(n)?n:void 0}function ei(e){let t=e.split(`
|
|
237
|
+
`).map(e=>e.trim()).filter(Boolean),n=[],r=[],i=t[0]?.match(/^series\s*=\s*(.+)$/);if(i){let e=i[1].trim(),r=e.includes(`","`)?e.split(`,`).map(e=>e.trim().replace(/^"|"$/g,``)):e.replace(/^"|"$/g,``).split(`,`).map(e=>e.trim()),a=r.map(()=>[]);for(let e=1;e<t.length;e++){let i=t[e].match(/^"([^"]+)"\s*=\s*([^"]+)$/),o=t[e].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??i;if(o){n.push(o[1]);let e=o[2].split(`,`);for(let t=0;t<r.length;t++)a[t].push($r(e[t]))}}let o=r.map((e,t)=>({name:e,values:a[t]}));return{labels:n,values:a[0]??[],series:o}}for(let e of t){let t=e.match(/^"([^"]+)"\s*=\s*(.+)$/);t&&(n.push(t[1]),r.push($r(t[2])))}return{labels:n,values:r}}function ti(e,t){let n={},r=M(e.colorPalette);return r?n.colors=r:e.colors&&e.colors.length>0&&(n.colors=e.colors),e.autoContrast&&t&&n.colors&&(n.colors=mr(n.colors,t)),e.allowDarkMode!==void 0&&(n.allowDarkMode=e.allowDarkMode),n}function ni(e){let t={};return e.legend!==void 0&&(t.legend=e.legend),e.legendPosition!==void 0&&(t.legendPosition=e.legendPosition),e.legendAnchor!==void 0&&(t.legendAnchor=e.legendAnchor),e.directLabelling!==void 0&&(t.directLabelling=e.directLabelling),e.directLabelAnchor!==void 0&&(t.directLabelAnchor=e.directLabelAnchor),t}function ri(e){if(!(e.showVerticalTicks!==void 0||e.verticalGridStyle!==void 0||e.verticalNumberFormat!==void 0||e.showVerticalAxis!==void 0||e.verticalAxisDirection!==void 0||e.verticalScaleType!==void 0||e.verticalLabelPosition!==void 0||e.verticalRangeMin||e.verticalRangeMax))return{};let t={};e.showVerticalTicks!==void 0&&(t.showTicks=e.showVerticalTicks),e.verticalAxisDirection!==void 0&&(t.direction=e.verticalAxisDirection),e.verticalGridStyle!==void 0&&(t.gridStyle=e.verticalGridStyle),e.verticalNumberFormat!==void 0&&(t.numberFormat=e.verticalNumberFormat),e.showVerticalAxis!==void 0&&(t.showAxis=e.showVerticalAxis),e.verticalScaleType!==void 0&&(t.scaleType=e.verticalScaleType),e.verticalLabelPosition!==void 0&&(t.labelPosition=e.verticalLabelPosition);let n=Er(e.verticalRangeMin??``),r=Er(e.verticalRangeMax??``);return(n!==void 0||r!==void 0)&&(t.range={},n!==void 0&&(t.range.min=n),r!==void 0&&(t.range.max=r)),{verticalAxis:t}}function ii(e){if(!(e.showHorizontalTicks!==void 0||e.horizontalGridStyle!==void 0||e.horizontalNumberFormat!==void 0||e.showHorizontalAxis!==void 0||e.horizontalScaleType!==void 0||e.horizontalLabelPosition!==void 0||e.horizontalLabelRotation!==void 0||e.horizontalRangeMin||e.horizontalRangeMax))return{};let t={};e.showHorizontalTicks!==void 0&&(t.showTicks=e.showHorizontalTicks),e.horizontalGridStyle!==void 0&&(t.gridStyle=e.horizontalGridStyle),e.horizontalNumberFormat!==void 0&&(t.numberFormat=e.horizontalNumberFormat),e.showHorizontalAxis!==void 0&&(t.showAxis=e.showHorizontalAxis),e.horizontalScaleType!==void 0&&(t.scaleType=e.horizontalScaleType),e.horizontalLabelPosition!==void 0&&(t.labelPosition=e.horizontalLabelPosition),e.horizontalLabelRotation!==void 0&&(t.labelRotation=e.horizontalLabelRotation);let n=Er(e.horizontalRangeMin??``),r=Er(e.horizontalRangeMax??``);return(n!==void 0||r!==void 0)&&(t.range={},n!==void 0&&(t.range.min=n),r!==void 0&&(t.range.max=r)),{horizontalAxis:t}}function ai(e){return e.lineSymbols?{lineSymbols:{symbol:e.lineSymbolShape??Br.Circle,showOn:e.lineSymbolShowOn??Vr.FirstLast,style:e.lineSymbolStyle??Hr.Filled,size:parseFloat(e.lineSymbolSize??`3.5`)||3.5,opacity:parseFloat(e.lineSymbolOpacity??`1`)||1}}:{}}function oi(e,t){let n={...ti(e,t),...ni(e),...ri(e),...ii(e),...ai(e)};e.interpolation!==void 0&&(n.interpolation=e.interpolation),e.valueLabels!==void 0&&(n.valueLabels=e.valueLabels),e.valueLabelPosition!==void 0&&(n.valueLabelPosition=e.valueLabelPosition),e.tooltips!==void 0&&(n.tooltips=e.tooltips),e.crosshair!==void 0&&(n.crosshair=e.crosshair),e.crosshairDirection&&(n.crosshairDirection=e.crosshairDirection),e.crosshairStyle&&(n.crosshairStyle=e.crosshairStyle),e.crosshairColor&&(n.crosshairColor=e.crosshairColor),e.displayAsPercentage!==void 0&&(n.displayAsPercentage=e.displayAsPercentage),e.showTotal!==void 0&&(n.showTotal=e.showTotal),e.showLabels!==void 0&&(n.showLabels=e.showLabels),e.showValues!==void 0&&(n.showValues=e.showValues),e.swapLabelValue!==void 0&&(n.swapLabelValue=e.swapLabelValue);let r=parseInt(e.sliceMax??``,10);!isNaN(r)&&r>0&&(n.sliceMax=r),e.sliceGroupLabel!==void 0&&(n.sliceGroupLabel=e.sliceGroupLabel),e.barBackground!==void 0&&(n.barBackground=e.barBackground),e.barSeparators!==void 0&&(n.barSeparators=e.barSeparators);let i=parseFloat(e.barGap??``);isNaN(i)||(n.barGap=Math.max(0,Math.min(100,i))),e.connectedColumns!==void 0&&(n.connectedColumns=e.connectedColumns);let a=parseFloat(e.connectionsOpacity??``);isNaN(a)||(n.connectionsOpacity=Math.max(0,Math.min(1,a))),e.stackMode!==void 0&&(n.stackMode=e.stackMode),e.stacked!==void 0&&(n.stacked=e.stacked),e.stackPercent!==void 0&&(n.stackPercent=e.stackPercent),e.areaSortMode!==void 0&&(n.areaSortMode=e.areaSortMode),e.areaLines!==void 0&&(n.areaLines=e.areaLines);let o=parseFloat(e.areaFillOpacity??``);return isNaN(o)||(n.areaFillOpacity=o),e.edgePadding!==void 0&&(n.edgePadding=e.edgePadding),e.waterfall!==void 0&&(n.waterfall=e.waterfall),e.waterfallTotal!==void 0&&(n.waterfallTotal=e.waterfallTotal),e.categoryLabelLine!==void 0&&(n.categoryLabelLine=e.categoryLabelLine),n}function si(e,t){if(!t||t.min===void 0&&t.max===void 0)return e.map((e,t)=>t);let n=[];for(let r=0;r<e.length;r++){let i=Er(e[r]);if(i===void 0){n.push(r);continue}t.min!==void 0&&i<t.min||t.max!==void 0&&i>t.max||n.push(r)}return n}function ci(e){let t=Number.isFinite(e)?Math.max(0,Math.min(100,e)):60;return t/(t+100)}function li(e,t,n){let r=0,i=0,a=1/0,o=!0,s=!1;for(let t of e)Number.isFinite(t)&&(s=!0,t<r&&(r=t),t>i&&(i=t),t<=0?o=!1:t<a&&(a=t));n===Ar.Log&&s&&o&&(r=a);let c=t?.min??r,l=t?.max??i;if(c>l&&([c,l]=[l,c]),c===l){if(c===0)l=1;else{let e=Math.abs(c)*.1;c-=e,l+=e}}return[c,l]}function ui(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function di(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function fi(e){let t,n,r;e.length===2?(t=e===ui||e===di?e:pi,n=e,r=e):(t=ui,n=(t,n)=>ui(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function pi(){return 0}function mi(e){return e===null?NaN:+e}var hi=fi(ui),gi=hi.right;hi.left;var _i=fi(mi).center,vi=class extends Map{constructor(e,t=Si){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(yi(this,e))}has(e){return super.has(yi(this,e))}set(e,t){return super.set(bi(this,e),t)}delete(e){return super.delete(xi(this,e))}};function yi({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function bi({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function xi({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Si(e){return typeof e==`object`&&e?e.valueOf():e}function Ci(e){return e}function wi(e,t,...n){return Ti(e,Ci,t,n)}function Ti(e,t,n,r){return(function e(i,a){if(a>=r.length)return n(i);let o=new vi,s=r[a++],c=-1;for(let e of i){let t=s(e,++c,i),n=o.get(t);n?n.push(e):o.set(t,[e])}for(let[t,n]of o)o.set(t,e(n,a));return t(o)})(e,0)}var Ei=Math.sqrt(50),Di=Math.sqrt(10),Oi=Math.sqrt(2);function ki(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Ei?10:a>=Di?5:a>=Oi?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&&.5<=n&&n<2?ki(e,t,n*2):[s,c,l]}function Ai(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?ki(t,e,n):ki(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function ji(e,t,n){return t=+t,e=+e,n=+n,ki(e,t,n)[2]}function Mi(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?ji(t,e,n):ji(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Ni(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Pi(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function Fi(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Ii(e){return e}var Li=1,Ri=2,zi=3,Bi=4,Vi=1e-6;function Hi(e){return`translate(`+e+`,0)`}function Ui(e){return`translate(0,`+e+`)`}function Wi(e){return t=>+e(t)}function Gi(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Ki(){return!this.__axis}function qi(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=typeof window<`u`&&window.devicePixelRatio>1?0:.5,l=e===Li||e===Bi?-1:1,u=e===Bi||e===Ri?`x`:`y`,d=e===Li||e===zi?Hi:Ui;function f(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):Ii),h=Math.max(a,0)+s,g=t.range(),_=+g[0]+c,v=+g[g.length-1]+c,y=(t.bandwidth?Gi:Wi)(t.copy(),c),b=f.selection?f.selection():f,x=b.selectAll(`.domain`).data([null]),S=b.selectAll(`.tick`).data(p,t).order(),C=S.exit(),w=S.enter().append(`g`).attr(`class`,`tick`),T=S.select(`line`),E=S.select(`text`);x=x.merge(x.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),S=S.merge(w),T=T.merge(w.append(`line`).attr(`stroke`,`currentColor`).attr(u+`2`,l*a)),E=E.merge(w.append(`text`).attr(`fill`,`currentColor`).attr(u,l*h).attr(`dy`,e===Li?`0em`:e===zi?`0.71em`:`0.32em`)),f!==b&&(x=x.transition(f),S=S.transition(f),T=T.transition(f),E=E.transition(f),C=C.transition(f).attr(`opacity`,Vi).attr(`transform`,function(e){return isFinite(e=y(e))?d(e+c):this.getAttribute(`transform`)}),w.attr(`opacity`,Vi).attr(`transform`,function(e){var t=this.parentNode.__axis;return d((t&&isFinite(t=t(e))?t:y(e))+c)})),C.remove(),x.attr(`d`,e===Bi||e===Ri?o?`M`+l*o+`,`+_+`H`+c+`V`+v+`H`+l*o:`M`+c+`,`+_+`V`+v:o?`M`+_+`,`+l*o+`V`+c+`H`+v+`V`+l*o:`M`+_+`,`+c+`H`+v),S.attr(`opacity`,1).attr(`transform`,function(e){return d(y(e)+c)}),T.attr(u+`2`,l*a),E.attr(u,l*h).text(m),b.filter(Ki).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===Ri?`start`:e===Bi?`end`:`middle`),b.each(function(){this.__axis=y})}return f.scale=function(e){return arguments.length?(t=e,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),f):n.slice()},f.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),f):r&&r.slice()},f.tickFormat=function(e){return arguments.length?(i=e,f):i},f.tickSize=function(e){return arguments.length?(a=o=+e,f):a},f.tickSizeInner=function(e){return arguments.length?(a=+e,f):a},f.tickSizeOuter=function(e){return arguments.length?(o=+e,f):o},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.offset=function(e){return arguments.length?(c=+e,f):c},f}function Ji(e){return qi(Li,e)}function Yi(e){return qi(Ri,e)}function Xi(e){return qi(zi,e)}function Zi(e){return qi(Bi,e)}var Qi={value:()=>{}};function $i(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ea(n)}function ea(e){this._=e}function ta(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ea.prototype=$i.prototype={constructor:ea,on:function(e,t){var n=this._,r=ta(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=na(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=ra(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ra(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ea(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function na(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ra(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Qi,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ia={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function aa(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),ia.hasOwnProperty(t)?{space:ia[t],local:e}:e}function oa(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function sa(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ca(e){var t=aa(e);return(t.local?sa:oa)(t)}function la(){}function ua(e){return e==null?la:function(){return this.querySelector(e)}}function da(e){typeof e!=`function`&&(e=ua(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new es(r,this._parents)}function fa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function pa(){return[]}function ma(e){return e==null?pa:function(){return this.querySelectorAll(e)}}function ha(e){return function(){return fa(e.apply(this,arguments))}}function ga(e){e=typeof e==`function`?ha(e):ma(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new es(r,i)}function _a(e){return function(){return this.matches(e)}}function va(e){return function(t){return t.matches(e)}}var ya=Array.prototype.find;function ba(e){return function(){return ya.call(this.children,e)}}function xa(){return this.firstElementChild}function Sa(e){return this.select(e==null?xa:ba(typeof e==`function`?e:va(e)))}var Ca=Array.prototype.filter;function wa(){return Array.from(this.children)}function Ta(e){return function(){return Ca.call(this.children,e)}}function Ea(e){return this.selectAll(e==null?wa:Ta(typeof e==`function`?e:va(e)))}function Da(e){typeof e!=`function`&&(e=_a(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new es(r,this._parents)}function Oa(e){return Array(e.length)}function ka(){return new es(this._enter||this._groups.map(Oa),this._parents)}function Aa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Aa.prototype={constructor:Aa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ja(e){return function(){return e}}function Ma(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Aa(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Na(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Aa(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Pa(e){return e.__data__}function Fa(e,t){if(!arguments.length)return Array.from(this,Pa);var n=t?Na:Ma,r=this._parents,i=this._groups;typeof e!=`function`&&(e=ja(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Ia(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new es(o,r),o._enter=s,o._exit=c,o}function Ia(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function La(){return new es(this._exit||this._groups.map(Oa),this._parents)}function Ra(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function za(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new es(s,this._parents)}function Ba(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Va(e){e||=Ha;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new es(i,this._parents).order()}function Ha(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ua(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Wa(){return Array.from(this)}function Ga(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Ka(){let e=0;for(let t of this)++e;return e}function qa(){return!this.node()}function Ja(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Ya(e){return function(){this.removeAttribute(e)}}function Xa(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Za(e,t){return function(){this.setAttribute(e,t)}}function Qa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $a(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function eo(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function to(e,t){var n=aa(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Xa:Ya:typeof t==`function`?n.local?eo:$a:n.local?Qa:Za)(n,t))}function no(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ro(e){return function(){this.style.removeProperty(e)}}function io(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ao(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function oo(e,t,n){return arguments.length>1?this.each((t==null?ro:typeof t==`function`?ao:io)(e,t,n??``)):so(this.node(),e)}function so(e,t){return e.style.getPropertyValue(t)||no(e).getComputedStyle(e,null).getPropertyValue(t)}function co(e){return function(){delete this[e]}}function lo(e,t){return function(){this[e]=t}}function uo(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function fo(e,t){return arguments.length>1?this.each((t==null?co:typeof t==`function`?uo:lo)(e,t)):this.node()[e]}function po(e){return e.trim().split(/^|\s+/)}function mo(e){return e.classList||new ho(e)}function ho(e){this._node=e,this._names=po(e.getAttribute(`class`)||``)}ho.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function go(e,t){for(var n=mo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function _o(e,t){for(var n=mo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function vo(e){return function(){go(this,e)}}function yo(e){return function(){_o(this,e)}}function bo(e,t){return function(){(t.apply(this,arguments)?go:_o)(this,e)}}function xo(e,t){var n=po(e+``);if(arguments.length<2){for(var r=mo(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?bo:t?vo:yo)(n,t))}function So(){this.textContent=``}function Co(e){return function(){this.textContent=e}}function wo(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function To(e){return arguments.length?this.each(e==null?So:(typeof e==`function`?wo:Co)(e)):this.node().textContent}function Eo(){this.innerHTML=``}function Do(e){return function(){this.innerHTML=e}}function Oo(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function ko(e){return arguments.length?this.each(e==null?Eo:(typeof e==`function`?Oo:Do)(e)):this.node().innerHTML}function Ao(){this.nextSibling&&this.parentNode.appendChild(this)}function jo(){return this.each(Ao)}function Mo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function No(){return this.each(Mo)}function Po(e){var t=typeof e==`function`?e:ca(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Fo(){return null}function Io(e,t){var n=typeof e==`function`?e:ca(e),r=t==null?Fo:typeof t==`function`?t:ua(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Lo(){var e=this.parentNode;e&&e.removeChild(this)}function Ro(){return this.each(Lo)}function zo(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bo(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vo(e){return this.select(e?Bo:zo)}function Ho(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Uo(e){return function(t){e.call(this,t,this.__data__)}}function Wo(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Go(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Ko(e,t,n){return function(){var r=this.__on,i,a=Uo(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function qo(e,t,n){var r=Wo(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Ko:Go,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Jo(e,t,n){var r=no(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Yo(e,t){return function(){return Jo(this,e,t)}}function Xo(e,t){return function(){return Jo(this,e,t.apply(this,arguments))}}function Zo(e,t){return this.each((typeof t==`function`?Xo:Yo)(e,t))}function*Qo(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var $o=[null];function es(e,t){this._groups=e,this._parents=t}function ts(){return new es([[document.documentElement]],$o)}function ns(){return this}es.prototype=ts.prototype={constructor:es,select:da,selectAll:ga,selectChild:Sa,selectChildren:Ea,filter:Da,data:Fa,enter:ka,exit:La,join:Ra,merge:za,selection:ns,order:Ba,sort:Va,call:Ua,nodes:Wa,node:Ga,size:Ka,empty:qa,each:Ja,attr:to,style:oo,property:fo,classed:xo,text:To,html:ko,raise:jo,lower:No,append:Po,insert:Io,remove:Ro,clone:Vo,datum:Ho,on:qo,dispatch:Zo,[Symbol.iterator]:Qo};function $(e){return typeof e==`string`?new es([[document.querySelector(e)]],[document.documentElement]):new es([[e]],$o)}function rs(e){let t;for(;t=e.sourceEvent;)e=t;return e}function is(e,t){if(e=rs(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function as(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function os(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ss(){}var cs=.7,ls=1/cs,us=`\\s*([+-]?\\d+)\\s*`,ds=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,fs=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,ps=/^#([0-9a-f]{3,8})$/,ms=RegExp(`^rgb\\(${us},${us},${us}\\)$`),hs=RegExp(`^rgb\\(${fs},${fs},${fs}\\)$`),gs=RegExp(`^rgba\\(${us},${us},${us},${ds}\\)$`),_s=RegExp(`^rgba\\(${fs},${fs},${fs},${ds}\\)$`),vs=RegExp(`^hsl\\(${ds},${fs},${fs}\\)$`),ys=RegExp(`^hsla\\(${ds},${fs},${fs},${ds}\\)$`),bs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};as(ss,Ts,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xs,formatHex:xs,formatHex8:Ss,formatHsl:Cs,formatRgb:ws,toString:ws});function xs(){return this.rgb().formatHex()}function Ss(){return this.rgb().formatHex8()}function Cs(){return Rs(this).formatHsl()}function ws(){return this.rgb().formatRgb()}function Ts(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=ps.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Es(t):n===3?new As(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ds(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ds(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ms.exec(e))?new As(t[1],t[2],t[3],1):(t=hs.exec(e))?new As(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gs.exec(e))?Ds(t[1],t[2],t[3],t[4]):(t=_s.exec(e))?Ds(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vs.exec(e))?Ls(t[1],t[2]/100,t[3]/100,1):(t=ys.exec(e))?Ls(t[1],t[2]/100,t[3]/100,t[4]):bs.hasOwnProperty(e)?Es(bs[e]):e===`transparent`?new As(NaN,NaN,NaN,0):null}function Es(e){return new As(e>>16&255,e>>8&255,e&255,1)}function Ds(e,t,n,r){return r<=0&&(e=t=n=NaN),new As(e,t,n,r)}function Os(e){return e instanceof ss||(e=Ts(e)),e?(e=e.rgb(),new As(e.r,e.g,e.b,e.opacity)):new As}function ks(e,t,n,r){return arguments.length===1?Os(e):new As(e,t,n,r??1)}function As(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}as(As,ks,os(ss,{brighter(e){return e=e==null?ls:ls**+e,new As(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cs:cs**+e,new As(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new As(Fs(this.r),Fs(this.g),Fs(this.b),Ps(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:js,formatHex:js,formatHex8:Ms,formatRgb:Ns,toString:Ns}));function js(){return`#${Is(this.r)}${Is(this.g)}${Is(this.b)}`}function Ms(){return`#${Is(this.r)}${Is(this.g)}${Is(this.b)}${Is((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ns(){let e=Ps(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Fs(this.r)}, ${Fs(this.g)}, ${Fs(this.b)}${e===1?`)`:`, ${e})`}`}function Ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Is(e){return e=Fs(e),(e<16?`0`:``)+e.toString(16)}function Ls(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Bs(e,t,n,r)}function Rs(e){if(e instanceof Bs)return new Bs(e.h,e.s,e.l,e.opacity);if(e instanceof ss||(e=Ts(e)),!e)return new Bs;if(e instanceof Bs)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Bs(o,s,c,e.opacity)}function zs(e,t,n,r){return arguments.length===1?Rs(e):new Bs(e,t,n,r??1)}function Bs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}as(Bs,zs,os(ss,{brighter(e){return e=e==null?ls:ls**+e,new Bs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cs:cs**+e,new Bs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new As(Us(e>=240?e-240:e+120,i,r),Us(e,i,r),Us(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Bs(Vs(this.h),Hs(this.s),Hs(this.l),Ps(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Ps(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Vs(this.h)}, ${Hs(this.s)*100}%, ${Hs(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Vs(e){return e=(e||0)%360,e<0?e+360:e}function Hs(e){return Math.max(0,Math.min(1,e||0))}function Us(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Ws=e=>()=>e;function Gs(e,t){return function(n){return e+n*t}}function Ks(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function qs(e){return(e=+e)==1?Js:function(t,n){return n-t?Ks(t,n,e):Ws(isNaN(t)?n:t)}}function Js(e,t){var n=t-e;return n?Gs(e,n):Ws(isNaN(e)?t:e)}var Ys=(function e(t){var n=qs(t);function r(e,t){var r=n((e=ks(e)).r,(t=ks(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Js(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Xs(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Zs(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Qs(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=sc(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function $s(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ec(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function tc(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=sc(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var nc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rc=new RegExp(nc.source,`g`);function ic(e){return function(){return e}}function ac(e){return function(t){return e(t)+``}}function oc(e,t){var n=nc.lastIndex=rc.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=nc.exec(e))&&(i=rc.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ec(r,i)})),n=rc.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?ac(c[0].x):ic(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function sc(e,t){var n=typeof t,r;return t==null||n===`boolean`?Ws(t):(n===`number`?ec:n===`string`?(r=Ts(t))?(t=r,Ys):oc:t instanceof Ts?Ys:t instanceof Date?$s:Zs(t)?Xs:Array.isArray(t)?Qs:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?tc:ec)(e,t)}function cc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var lc=180/Math.PI,uc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dc(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*lc,skewX:Math.atan(c)*lc,scaleX:o,scaleY:s}}var fc;function pc(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?uc:dc(t.a,t.b,t.c,t.d,t.e,t.f)}function mc(e){return e==null||(fc||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),fc.setAttribute(`transform`,e),!(e=fc.transform.baseVal.consolidate()))?uc:(e=e.matrix,dc(e.a,e.b,e.c,e.d,e.e,e.f))}function hc(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ec(e,i)},{i:c-2,x:ec(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ec(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ec(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ec(e,n)},{i:s-2,x:ec(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var gc=hc(pc,`px, `,`px)`,`deg)`),_c=hc(mc,`, `,`)`,`)`),vc=0,yc=0,bc=0,xc=1e3,Sc,Cc,wc=0,Tc=0,Ec=0,Dc=typeof performance==`object`&&performance.now?performance:Date,Oc=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kc(){return Tc||=(Oc(Ac),Dc.now()+Ec)}function Ac(){Tc=0}function jc(){this._call=this._time=this._next=null}jc.prototype=Mc.prototype={constructor:jc,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?kc():+n)+(t==null?0:+t),!this._next&&Cc!==this&&(Cc?Cc._next=this:Sc=this,Cc=this),this._call=e,this._time=n,Lc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lc())}};function Mc(e,t,n){var r=new jc;return r.restart(e,t,n),r}function Nc(){kc(),++vc;for(var e=Sc,t;e;)(t=Tc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vc}function Pc(){Tc=(wc=Dc.now())+Ec,vc=yc=0;try{Nc()}finally{vc=0,Ic(),Tc=0}}function Fc(){var e=Dc.now(),t=e-wc;t>xc&&(Ec-=t,wc=e)}function Ic(){for(var e,t=Sc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Sc=n);Cc=e,Lc(r)}function Lc(e){vc||(yc&&=clearTimeout(yc),e-Tc>24?(e<1/0&&(yc=setTimeout(Pc,e-Dc.now()-Ec)),bc&&=clearInterval(bc)):(bc||=(wc=Dc.now(),setInterval(Fc,xc)),vc=1,Oc(Pc)))}function Rc(e,t,n){var r=new jc;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var zc=$i(`start`,`end`,`cancel`,`interrupt`),Bc=[];function Vc(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Gc(e,n,{name:t,index:r,group:i,on:zc,tween:Bc,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Hc(e,t){var n=Wc(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Uc(e,t){var n=Wc(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Wc(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Gc(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Mc(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Rc(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Rc(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Kc(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function qc(e){return this.each(function(){Kc(this,e)})}function Jc(e,t){var n,r;return function(){var i=Uc(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Yc(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Uc(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Xc(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Wc(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Jc:Yc)(n,e,t))}function Zc(e,t,n){var r=e._id;return e.each(function(){var e=Uc(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Wc(e,r).value[t]}}function Qc(e,t){var n;return(typeof t==`number`?ec:t instanceof Ts?Ys:(n=Ts(t))?(t=n,Ys):oc)(e,t)}function $c(e){return function(){this.removeAttribute(e)}}function el(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tl(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function nl(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function rl(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function il(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function al(e,t){var n=aa(e),r=n===`transform`?_c:Qc;return this.attrTween(e,typeof t==`function`?(n.local?il:rl)(n,r,Zc(this,`attr.`+e,t)):t==null?(n.local?el:$c)(n):(n.local?nl:tl)(n,r,t))}function ol(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cl(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sl(e,i)),n}return i._value=t,i}function ll(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ol(e,i)),n}return i._value=t,i}function ul(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=aa(e);return this.tween(n,(r.local?cl:ll)(r,t))}function dl(e,t){return function(){Hc(this,e).delay=+t.apply(this,arguments)}}function fl(e,t){return t=+t,function(){Hc(this,e).delay=t}}function pl(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?dl:fl)(t,e)):Wc(this.node(),t).delay}function ml(e,t){return function(){Uc(this,e).duration=+t.apply(this,arguments)}}function hl(e,t){return t=+t,function(){Uc(this,e).duration=t}}function gl(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ml:hl)(t,e)):Wc(this.node(),t).duration}function _l(e,t){if(typeof t!=`function`)throw Error();return function(){Uc(this,e).ease=t}}function vl(e){var t=this._id;return arguments.length?this.each(_l(t,e)):Wc(this.node(),t).ease}function yl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Uc(this,e).ease=n}}function bl(e){if(typeof e!=`function`)throw Error();return this.each(yl(this._id,e))}function xl(e){typeof e!=`function`&&(e=_a(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Xl(r,this._parents,this._name,this._id)}function Sl(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Xl(o,this._parents,this._name,this._id)}function Cl(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function wl(e,t,n){var r,i,a=Cl(t)?Hc:Uc;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Tl(e,t){var n=this._id;return arguments.length<2?Wc(this.node(),n).on.on(e):this.each(wl(n,e,t))}function El(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Dl(){return this.on(`end.remove`,El(this._id))}function Ol(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ua(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Vc(l[f],t,n,f,l,Wc(u,n)));return new Xl(a,this._parents,t,n)}function kl(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ma(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Wc(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Vc(p,t,n,h,f,m);a.push(f),o.push(u)}return new Xl(a,o,t,n)}var Al=ts.prototype.constructor;function jl(){return new Al(this._groups,this._parents)}function Ml(e,t){var n,r,i;return function(){var a=so(this,e),o=(this.style.removeProperty(e),so(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Nl(e){return function(){this.style.removeProperty(e)}}function Pl(e,t,n){var r,i=n+``,a;return function(){var o=so(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Fl(e,t,n){var r,i,a;return function(){var o=so(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),so(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Il(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Uc(this,e),l=c.on,u=c.value[a]==null?s||=Nl(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Ll(e,t,n){var r=(e+=``)==`transform`?gc:Qc;return t==null?this.styleTween(e,Ml(e,r)).on(`end.style.`+e,Nl(e)):typeof t==`function`?this.styleTween(e,Fl(e,r,Zc(this,`style.`+e,t))).each(Il(this._id,e)):this.styleTween(e,Pl(e,r,t),n).on(`end.style.`+e,null)}function Rl(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function zl(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Rl(e,a,n)),r}return a._value=t,a}function Bl(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,zl(e,t,n??``))}function Vl(e){return function(){this.textContent=e}}function Hl(e){return function(){var t=e(this);this.textContent=t??``}}function Ul(e){return this.tween(`text`,typeof e==`function`?Hl(Zc(this,`text`,e)):Vl(e==null?``:e+``))}function Wl(e){return function(t){this.textContent=e.call(this,t)}}function Gl(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Wl(r)),t}return r._value=e,r}function Kl(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Gl(e))}function ql(){for(var e=this._name,t=this._id,n=Ql(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Wc(c,t);Vc(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Xl(r,this._parents,e,n)}function Jl(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Uc(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Yl=0;function Xl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zl(e){return ts().transition(e)}function Ql(){return++Yl}var $l=ts.prototype;Xl.prototype=Zl.prototype={constructor:Xl,select:Ol,selectAll:kl,selectChild:$l.selectChild,selectChildren:$l.selectChildren,filter:xl,merge:Sl,selection:jl,transition:ql,call:$l.call,nodes:$l.nodes,node:$l.node,size:$l.size,empty:$l.empty,each:$l.each,on:Tl,attr:al,attrTween:ul,style:Ll,styleTween:Bl,text:Ul,textTween:Kl,remove:Dl,tween:Xc,delay:pl,duration:gl,ease:vl,easeVarying:bl,end:Jl,[Symbol.iterator]:$l[Symbol.iterator]};function eu(e){return--e*e*e+1}function tu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nu={time:null,delay:0,duration:250,ease:tu};function ru(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function iu(e){var t,n;e instanceof Xl?(t=e._id,e=e._name):(t=Ql(),(n=nu).time=kc(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Vc(c,e,t,l,o,n||ru(c,t));return new Xl(r,this._parents,e,t)}ts.prototype.interrupt=qc,ts.prototype.transition=iu;var{abs:au,max:ou,min:su}=Math;[`w`,`e`].map(cu),[`n`,`s`].map(cu),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(cu);function cu(e){return{type:e}}var lu=Math.PI,uu=2*lu,du=1e-6,fu=uu-du;function pu(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function mu(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return pu;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var hu=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?pu:mu(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>du){if(!(Math.abs(u*s-c*l)>du)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((lu-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>du&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>du||Math.abs(this._y1-l)>du)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%uu+uu),d>fu?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>du&&this._append`A${n},${n},0,${+(d>=lu)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};hu.prototype;function gu(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function _u(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function vu(e){return e=_u(Math.abs(e)),e?e[1]:NaN}function yu(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function bu(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var xu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Su(e){if(!(t=xu.exec(e)))throw Error(`invalid format: `+e);var t;return new Cu({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Su.prototype=Cu.prototype;function Cu(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Cu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function wu(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var Tu;function Eu(e,t){var n=_u(e,t);if(!n)return Tu=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Tu=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+_u(e,Math.max(0,t+a-1))[0]}function Du(e,t){var n=_u(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Ou={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:gu,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Du(e*100,t),r:Du,s:Eu,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ku(e){return e}var Au=Array.prototype.map,ju=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Mu(e){var t=e.grouping===void 0||e.thousands===void 0?ku:yu(Au.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?ku:bu(Au.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=Su(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Ou[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Ou[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=wu(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Tu!==void 0?ju[8+Tu/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(vu(t)/3)))*3,r=10**-n,i=l((e=Su(e),e.type=`f`,e),{suffix:ju[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Nu,Pu,Fu;Iu({thousands:`,`,grouping:[3],currency:[`$`,``]});function Iu(e){return Nu=Mu(e),Pu=Nu.format,Fu=Nu.formatPrefix,Nu}function Lu(e){return Math.max(0,-vu(Math.abs(e)))}function Ru(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vu(t)/3)))*3-vu(Math.abs(e)))}function zu(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vu(t)-vu(e))+1}function Bu(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Vu=Symbol(`implicit`);function Hu(){var e=new vi,t=[],n=[],r=Vu;function i(i){let a=e.get(i);if(a===void 0){if(r!==Vu)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new vi;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Hu(t,n).unknown(r)},Bu.apply(i,arguments),i}function Uu(){var e=Hu().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=Pi(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return Uu(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},Bu.apply(d(),arguments)}function Wu(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Wu(t())},e}function Gu(){return Wu(Uu.apply(null,arguments).paddingInner(1))}function Ku(e){return function(){return e}}function qu(e){return+e}var Ju=[0,1];function Yu(e){return e}function Xu(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Ku(isNaN(t)?NaN:.5)}function Zu(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Qu(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Xu(i,r),a=n(o,a)):(r=Xu(r,i),a=n(a,o)),function(e){return a(r(e))}}function $u(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Xu(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=gi(e,t,1,r)-1;return a[n](i[n](t))}}function ed(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function td(){var e=Ju,t=Ju,n=sc,r,i,a,o=Yu,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Yu&&(o=Zu(e[0],e[n-1])),s=n>2?$u:Qu,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),ec))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,qu),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=cc,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Yu,u()):o!==Yu},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function nd(){return td()(Yu,Yu)}function rd(e,t,n,r){var i=Mi(e,t,n),a;switch(r=Su(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Ru(i,o))&&(r.precision=a),Fu(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=zu(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Lu(i))&&(r.precision=a-(r.type===`%`)*2)}return Pu(r)}function id(e){var t=e.domain;return e.ticks=function(e){var n=t();return Ai(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return rd(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=ji(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function ad(){var e=nd();return e.copy=function(){return ed(e,ad())},Bu.apply(e,arguments),id(e)}function od(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function sd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function cd(e){var t=1,n=e(od(t),sd(t));return n.constant=function(n){return arguments.length?e(od(t=+n),sd(t)):t},id(n)}function ld(){var e=cd(td());return e.copy=function(){return ed(e,ld()).constant(e.constant())},Bu.apply(e,arguments)}var ud=new Date,dd=new Date;function fd(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>fd(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(ud.setTime(+t),dd.setTime(+r),e(ud),e(dd),Math.floor(n(ud,dd))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var pd=6e4,md=pd*60*24,hd=md*7;md*30,md*365;var gd=fd(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pd)/md,e=>e.getDate()-1);gd.range;var _d=fd(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/md,e=>e.getUTCDate()-1);_d.range,fd(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/md,e=>Math.floor(e/md)).range;function vd(e){return fd(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pd)/hd)}var yd=vd(0),bd=vd(1),xd=vd(2),Sd=vd(3),Cd=vd(4),wd=vd(5),Td=vd(6);yd.range,bd.range,xd.range,Sd.range,Cd.range,wd.range,Td.range;function Ed(e){return fd(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/hd)}var Dd=Ed(0),Od=Ed(1),kd=Ed(2),Ad=Ed(3),jd=Ed(4),Md=Ed(5),Nd=Ed(6);Dd.range,Od.range,kd.range,Ad.range,jd.range,Md.range,Nd.range;var Pd=fd(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Pd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fd(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Pd.range;var Fd=fd(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Fd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fd(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Fd.range;function Id(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ld(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Rd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function zd(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Kd(i),u=qd(i),d=Kd(a),f=qd(a),p=Kd(o),m=qd(o),h=Kd(s),g=qd(s),_=Kd(c),v=qd(c),y={a:M,A:N,b:P,B:F,c:null,d:hf,e:hf,f:bf,g:jf,G:Nf,H:gf,I:_f,j:vf,L:yf,m:xf,M:Sf,p:I,q:L,Q:np,s:rp,S:Cf,u:wf,U:Tf,V:Df,w:Of,W:kf,x:null,X:null,y:Af,Y:Mf,Z:Pf,"%":tp},b={a:R,A:z,b:B,B:V,c:null,d:Ff,e:Ff,f:Bf,g:Zf,G:$f,H:If,I:Lf,j:Rf,L:zf,m:Vf,M:Hf,p:H,q:U,Q:np,s:rp,S:Uf,u:Wf,U:Gf,V:qf,w:Jf,W:Yf,x:null,X:null,y:Xf,Y:Qf,Z:ep,"%":tp},x={a:E,A:D,b:O,B:k,c:A,d:af,e:af,f:df,g:ef,G:$d,H:sf,I:sf,j:of,L:uf,m:rf,M:cf,p:T,q:nf,Q:pf,s:mf,S:lf,u:Yd,U:Xd,V:Zd,w:Jd,W:Qd,x:ee,X:j,y:ef,Y:$d,Z:tf,"%":ff};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=Bd[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=Rd(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Ld(Rd(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Od.ceil(a):Od(a),a=_d.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Id(Rd(r.y,0,1)),o=a.getDay(),a=o>4||o===0?bd.ceil(a):bd(a),a=gd.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Ld(Rd(r.y,0,1)).getUTCDay():Id(Rd(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Ld(r)):Id(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in Bd?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function ee(e,t,r){return w(e,n,t,r)}function j(e,t,n){return w(e,r,t,n)}function M(e){return o[e.getDay()]}function N(e){return a[e.getDay()]}function P(e){return c[e.getMonth()]}function F(e){return s[e.getMonth()]}function I(e){return i[+(e.getHours()>=12)]}function L(e){return 1+~~(e.getMonth()/3)}function R(e){return o[e.getUTCDay()]}function z(e){return a[e.getUTCDay()]}function B(e){return c[e.getUTCMonth()]}function V(e){return s[e.getUTCMonth()]}function H(e){return i[+(e.getUTCHours()>=12)]}function U(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var Bd={"-":``,_:` `,0:`0`},Vd=/^\s*\d+/,Hd=/^%/,Ud=/[\\^$*+?|[\]().{}]/g;function Wd(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Gd(e){return e.replace(Ud,`\\$&`)}function Kd(e){return RegExp(`^(?:`+e.map(Gd).join(`|`)+`)`,`i`)}function qd(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Jd(e,t,n){var r=Vd.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Yd(e,t,n){var r=Vd.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Xd(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Zd(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Qd(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function $d(e,t,n){var r=Vd.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ef(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function tf(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function nf(e,t,n){var r=Vd.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function rf(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function af(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function of(e,t,n){var r=Vd.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function sf(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function cf(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function lf(e,t,n){var r=Vd.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function uf(e,t,n){var r=Vd.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function df(e,t,n){var r=Vd.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ff(e,t,n){var r=Hd.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function pf(e,t,n){var r=Vd.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function mf(e,t,n){var r=Vd.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hf(e,t){return Wd(e.getDate(),t,2)}function gf(e,t){return Wd(e.getHours(),t,2)}function _f(e,t){return Wd(e.getHours()%12||12,t,2)}function vf(e,t){return Wd(1+gd.count(Pd(e),e),t,3)}function yf(e,t){return Wd(e.getMilliseconds(),t,3)}function bf(e,t){return yf(e,t)+`000`}function xf(e,t){return Wd(e.getMonth()+1,t,2)}function Sf(e,t){return Wd(e.getMinutes(),t,2)}function Cf(e,t){return Wd(e.getSeconds(),t,2)}function wf(e){var t=e.getDay();return t===0?7:t}function Tf(e,t){return Wd(yd.count(Pd(e)-1,e),t,2)}function Ef(e){var t=e.getDay();return t>=4||t===0?Cd(e):Cd.ceil(e)}function Df(e,t){return e=Ef(e),Wd(Cd.count(Pd(e),e)+(Pd(e).getDay()===4),t,2)}function Of(e){return e.getDay()}function kf(e,t){return Wd(bd.count(Pd(e)-1,e),t,2)}function Af(e,t){return Wd(e.getFullYear()%100,t,2)}function jf(e,t){return e=Ef(e),Wd(e.getFullYear()%100,t,2)}function Mf(e,t){return Wd(e.getFullYear()%1e4,t,4)}function Nf(e,t){var n=e.getDay();return e=n>=4||n===0?Cd(e):Cd.ceil(e),Wd(e.getFullYear()%1e4,t,4)}function Pf(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Wd(t/60|0,`0`,2)+Wd(t%60,`0`,2)}function Ff(e,t){return Wd(e.getUTCDate(),t,2)}function If(e,t){return Wd(e.getUTCHours(),t,2)}function Lf(e,t){return Wd(e.getUTCHours()%12||12,t,2)}function Rf(e,t){return Wd(1+_d.count(Fd(e),e),t,3)}function zf(e,t){return Wd(e.getUTCMilliseconds(),t,3)}function Bf(e,t){return zf(e,t)+`000`}function Vf(e,t){return Wd(e.getUTCMonth()+1,t,2)}function Hf(e,t){return Wd(e.getUTCMinutes(),t,2)}function Uf(e,t){return Wd(e.getUTCSeconds(),t,2)}function Wf(e){var t=e.getUTCDay();return t===0?7:t}function Gf(e,t){return Wd(Dd.count(Fd(e)-1,e),t,2)}function Kf(e){var t=e.getUTCDay();return t>=4||t===0?jd(e):jd.ceil(e)}function qf(e,t){return e=Kf(e),Wd(jd.count(Fd(e),e)+(Fd(e).getUTCDay()===4),t,2)}function Jf(e){return e.getUTCDay()}function Yf(e,t){return Wd(Od.count(Fd(e)-1,e),t,2)}function Xf(e,t){return Wd(e.getUTCFullYear()%100,t,2)}function Zf(e,t){return e=Kf(e),Wd(e.getUTCFullYear()%100,t,2)}function Qf(e,t){return Wd(e.getUTCFullYear()%1e4,t,4)}function $f(e,t){var n=e.getUTCDay();return e=n>=4||n===0?jd(e):jd.ceil(e),Wd(e.getUTCFullYear()%1e4,t,4)}function ep(){return`+0000`}function tp(){return`%`}function np(e){return+e}function rp(e){return Math.floor(e/1e3)}var ip,ap;op({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function op(e){return ip=zd(e),ap=ip.format,ip.parse,ip.utcFormat,ip.utcParse,ip}function sp(e){return function(){return e}}var cp=Math.abs,lp=Math.atan2,up=Math.cos,dp=Math.max,fp=Math.min,pp=Math.sin,mp=Math.sqrt,hp=Math.PI,gp=hp/2,_p=2*hp;function vp(e){return e>1?0:e<-1?hp:Math.acos(e)}function yp(e){return e>=1?gp:e<=-1?-gp:Math.asin(e)}function bp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new hu(t)}function xp(e){return e.innerRadius}function Sp(e){return e.outerRadius}function Cp(e){return e.startAngle}function wp(e){return e.endAngle}function Tp(e){return e&&e.padAngle}function Ep(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function Dp(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/mp(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)*mp(dp(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,ee=D-_;return O*O+k*k>A*A+ee*ee&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function Op(){var e=xp,t=Sp,n=sp(0),r=null,i=Cp,a=wp,o=Tp,s=null,c=bp(l);function l(){var l,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-gp,m=a.apply(this,arguments)-gp,h=cp(m-p),g=m>p;if(s||=l=c(),f<d&&(u=f,f=d,d=u),!(f>1e-12))s.moveTo(0,0);else if(h>_p-1e-12)s.moveTo(f*up(p),f*pp(p)),s.arc(0,0,f,p,m,!g),d>1e-12&&(s.moveTo(d*up(m),d*pp(m)),s.arc(0,0,d,m,p,g));else{var _=p,v=m,y=p,b=m,x=h,S=h,C=o.apply(this,arguments)/2,w=C>1e-12&&(r?+r.apply(this,arguments):mp(d*d+f*f)),T=fp(cp(f-d)/2,+n.apply(this,arguments)),E=T,D=T,O,k;if(w>1e-12){var A=yp(w/d*pp(C)),ee=yp(w/f*pp(C));(x-=A*2)>1e-12?(A*=g?1:-1,y+=A,b-=A):(x=0,y=b=(p+m)/2),(S-=ee*2)>1e-12?(ee*=g?1:-1,_+=ee,v-=ee):(S=0,_=v=(p+m)/2)}var j=f*up(_),M=f*pp(_),N=d*up(b),P=d*pp(b);if(T>1e-12){var F=f*up(v),I=f*pp(v),L=d*up(y),R=d*pp(y),z;if(h<hp){if(z=Ep(j,M,L,R,F,I,N,P)){var B=j-z[0],V=M-z[1],H=F-z[0],U=I-z[1],te=1/pp(vp((B*H+V*U)/(mp(B*B+V*V)*mp(H*H+U*U)))/2),ne=mp(z[0]*z[0]+z[1]*z[1]);E=fp(T,(d-ne)/(te-1)),D=fp(T,(f-ne)/(te+1))}else E=D=0}}S>1e-12?D>1e-12?(O=Dp(L,R,j,M,f,D,g),k=Dp(F,I,N,P,f,D,g),s.moveTo(O.cx+O.x01,O.cy+O.y01),D<T?s.arc(O.cx,O.cy,D,lp(O.y01,O.x01),lp(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,D,lp(O.y01,O.x01),lp(O.y11,O.x11),!g),s.arc(0,0,f,lp(O.cy+O.y11,O.cx+O.x11),lp(k.cy+k.y11,k.cx+k.x11),!g),s.arc(k.cx,k.cy,D,lp(k.y11,k.x11),lp(k.y01,k.x01),!g))):(s.moveTo(j,M),s.arc(0,0,f,_,v,!g)):s.moveTo(j,M),!(d>1e-12)||!(x>1e-12)?s.lineTo(N,P):E>1e-12?(O=Dp(N,P,F,I,d,-E,g),k=Dp(j,M,L,R,d,-E,g),s.lineTo(O.cx+O.x01,O.cy+O.y01),E<T?s.arc(O.cx,O.cy,E,lp(O.y01,O.x01),lp(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,E,lp(O.y01,O.x01),lp(O.y11,O.x11),!g),s.arc(0,0,d,lp(O.cy+O.y11,O.cx+O.x11),lp(k.cy+k.y11,k.cx+k.x11),g),s.arc(k.cx,k.cy,E,lp(k.y11,k.x11),lp(k.y01,k.x01),!g))):s.arc(0,0,d,b,y,g)}if(s.closePath(),l)return s=null,l+``||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-hp/2;return[up(r)*n,pp(r)*n]},l.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:sp(+t),l):e},l.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:sp(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:sp(+e),l):n},l.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:sp(+e),l):r},l.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:sp(+e),l):i},l.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:sp(+e),l):a},l.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:sp(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}Array.prototype.slice;function kp(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ap(e){this._context=e}Ap.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function jp(e){return new Ap(e)}function Mp(e){return e[0]}function Np(e){return e[1]}function Pp(e,t){var n=sp(!0),r=null,i=jp,a=null,o=bp(s);e=typeof e==`function`?e:e===void 0?Mp:sp(e),t=typeof t==`function`?t:t===void 0?Np:sp(t);function s(s){var c,l=(s=kp(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:sp(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:sp(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:sp(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Fp(e,t,n){var r=null,i=sp(!0),a=null,o=jp,s=null,c=bp(l);e=typeof e==`function`?e:e===void 0?Mp:sp(+e),t=typeof t==`function`?t:sp(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Np:sp(+n);function l(l){var u,d,f,p=(l=kp(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Pp().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:sp(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:sp(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:sp(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:sp(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:sp(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:sp(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:sp(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}function Ip(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Lp(e){return e}function Rp(){var e=Lp,t=Ip,n=null,r=sp(0),i=sp(_p),a=sp(0);function o(o){var s,c=(o=kp(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),h=Math.min(_p,Math.max(-_p,i.apply(this,arguments)-m)),g,_=Math.min(Math.abs(h)/c,a.apply(this,arguments)),v=_*(h<0?-1:1),y;for(s=0;s<c;++s)(y=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=y);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(h-c*v)/d:0;s<c;++s,m=g)l=f[s],y=p[l],g=m+(y>0?y*u:0)+v,p[l]={data:o[l],index:s,value:y,startAngle:m,endAngle:g,padAngle:_};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:sp(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:sp(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:sp(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:sp(+e),o):a},o}var zp={draw(e,t){let n=mp(t/hp);e.moveTo(n,0),e.arc(0,0,n,0,_p)}},Bp={draw(e,t){let n=mp(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Vp=mp(1/3),Hp=Vp*2,Up={draw(e,t){let n=mp(t/Hp),r=n*Vp;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Wp={draw(e,t){let n=mp(t),r=-n/2;e.rect(r,r,n,n)}},Gp=.8908130915292852,Kp=pp(hp/10)/pp(7*hp/10),qp=pp(_p/10)*Kp,Jp=-up(_p/10)*Kp,Yp={draw(e,t){let n=mp(t*Gp),r=qp*n,i=Jp*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=_p*t/5,o=up(a),s=pp(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},Xp=mp(3),Zp={draw(e,t){let n=-mp(t/(Xp*3));e.moveTo(0,n*2),e.lineTo(-Xp*n,-n),e.lineTo(Xp*n,-n),e.closePath()}},Qp=mp(3),$p={draw(e,t){let n=mp(t)*.6824,r=n/2,i=n*Qp/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};function em(e,t){let n=null,r=bp(i);e=typeof e==`function`?e:sp(e||zp),t=typeof t==`function`?t:sp(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:sp(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:sp(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function tm(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function nm(e){this._context=e}nm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:tm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:tm(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rm(e){return new nm(e)}function im(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function am(e,t){this._context=e,this._k=(1-t)/6}am.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:im(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:im(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var om=(function e(t){function n(e){return new am(e,t)}return n.tension=function(t){return e(+t)},n})(0);function sm(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function cm(e,t){this._context=e,this._alpha=t}cm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:sm(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var lm=(function e(t){function n(e){return t?new cm(e,t):new am(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function um(e){return e<0?-1:1}function dm(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(um(a)+um(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function fm(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function pm(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function mm(e){this._context=e}mm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pm(this,this._t0,fm(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pm(this,fm(this,n=dm(this,e,t)),n);break;default:pm(this,this._t0,n=dm(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},Object.create(mm.prototype).point=function(e,t){mm.prototype.point.call(this,t,e)};function hm(e){return new mm(e)}function gm(e,t){this._context=e,this._t=t}gm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function _m(e){return new gm(e,.5)}function vm(e){return new gm(e,0)}function ym(e){return new gm(e,1)}function bm(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function xm(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Sm(e,t){return e[t]}function Cm(e){let t=[];return t.key=e,t}function wm(){var e=sp([]),t=xm,n=bm,r=Sm;function i(i){var a=Array.from(e.apply(this,arguments),Cm),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=kp(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:sp(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:sp(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?xm:typeof e==`function`?e:sp(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??bm,i):n},i}function Tm(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}bm(e,t)}}function Em(e,t){if((c=e.length)>0)for(var n,r=0,i,a,o,s,c,l=e[t[0]].length;r<l;++r)for(o=s=0,n=0;n<c;++n)(a=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function Dm(e,t,n){this.k=e,this.x=t,this.y=n}Dm.prototype={constructor:Dm,scale:function(e){return e===1?this:new Dm(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Dm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Om=new Dm(1,0,0);km.prototype=Dm.prototype;function km(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Om;return e.__zoom}function Am(e,t){if(!e)throw Error(`[d3-blueprint] ${t}`)}var jm=class{properties=new Map;define(e,t){Am(!this.properties.has(e),`config "${e}" is already defined`);let{defaultValue:n,getter:r,setter:i}=t,a=i?i(n):n;return this.properties.set(e,{value:a,getter:r,setter:i}),this}get(e){let{value:t,getter:n}=this.getProperty(e);return n?n(t):t}set(e,t){let n=this.getProperty(e);return n.value=n.setter?n.setter(t):t,this}setBatch(e){for(let[t,n]of Object.entries(e))this.set(t,n);return this}getAll(){let e={};for(let[t]of this.properties)e[t]=this.get(t);return e}has(e){return this.properties.has(e)}getProperty(e){let t=this.properties.get(e);return Am(t,`config "${e}" is not defined`),t}},Mm=[`update`,`enter`,`merge`,`exit`],Nm=new Set([...Mm,...Mm.map(e=>`${e}:transition`)]);function Pm(e){return Nm.has(e)}function Fm(e){Am(Pm(e),`"${e}" is not a valid lifecycle event. Expected one of: ${[...Nm].join(`, `)}`)}function Im(e,t,n){let r=e.exit(),i={update:e,enter:t,merge:t.merge(e),exit:r};return Mm.map(e=>({name:e,selection:i[e],handlers:n.get(e)??[],transitionHandlers:n.get(`${e}:transition`)??[]}))}function Lm(e,t){for(let n of t)n(e)}function Rm(e,t){return t.map(t=>{let n=e.transition();return t(n),zm(n)})}function zm(e){return e.end().then(()=>void 0,()=>void 0)}var Bm=class{base;dataBindFn;insertFn;handlers=new Map;constructor(e,t){if(this.base=e,this.dataBindFn=t.dataBind,this.insertFn=t.insert,t.events)for(let[e,n]of Object.entries(t.events))n&&this.on(e,n)}on(e,t){Fm(e);let n=this.handlers.get(e)??[];return n.push(t),this.handlers.set(e,n),this}off(e,t){if(Fm(e),!t)return this.handlers.delete(e),this;let n=this.handlers.get(e);if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}return this}draw(e){let t=this.dataBindFn(this.base,e),n=t.enter(),r=Im(t,this.insertFn(n),this.handlers),i=[];for(let e of r){Lm(e.selection,e.handlers);let t=Rm(e.selection,e.transitionHandlers);i.push(...t)}return Promise.all(i).then(()=>void 0)}};function Vm(e,t,n,r){if(n&&r){let i=new Bm(n,r);return e.set(t,i),i}let i=e.get(t);if(!i)throw Error(`[d3-blueprint] layer "${t}" is not defined`);return i}function Hm(e,t,n,r){return typeof n==`string`&&r===void 0?e.get(n):typeof n==`string`?(e.set(n,r),t):(e.setBatch(n),t)}function Um(e,t){let n=[];for(let r of e.values())n.push(r.draw(t));return n}function Wm(e,t){let n=[];for(let r of e.values()){let e=r.draw(t);e&&n.push(e)}return n}var Gm=[`preDraw`,`postDraw`,`postTransition`],Km=class{base;layers=new Map;attachments=new Map;configs=new jm;dispatcher;attached=new Proxy({},{get:(e,t)=>{let n=this.attachments.get(t);if(!n)throw Error(`[d3-blueprint] attachment "${t}" is not defined`);return n},has:(e,t)=>this.attachments.has(t)});constructor(e){this.base=e,this.dispatcher=$i(...Gm),this.initialize()}initialize(){}transform(e){return e}preDraw(e){}postDraw(e){}postTransition(e){}layer(e,t,n){return Vm(this.layers,e,t,n)}attach(e,t,n){if(n!==void 0){let r=t;this.attachments.set(e,new r(n))}else this.attachments.set(e,t);return this}config(e,t){return Hm(this.configs,this,e,t)}configDefine(e,t){return this.configs.define(e,t),this}on(e,t){return this.dispatcher.on(e,t),this}off(e){return this.dispatcher.on(e,null),this}use(e,t){let n=t||e.name||`plugin`;if(e.install(this),e.preDraw&&this.on(`preDraw.${n}`,t=>e.preDraw(this,t)),e.postDraw&&this.on(`postDraw.${n}`,t=>e.postDraw(this,t)),e.postTransition&&this.on(`postTransition.${n}`,t=>e.postTransition(this,t)),e.destroy){let t=this.destroy.bind(this);this.destroy=()=>{e.destroy(this),t()}}return this}async draw(e){let t=this.transform(e);this.preDraw(t),this.dispatcher.call(`preDraw`,this,t);let n=Um(this.layers,t),r=Wm(this.attachments,t);this.postDraw(t),this.dispatcher.call(`postDraw`,this,t),await Promise.all([...n,...r]),this.postTransition(t),this.dispatcher.call(`postTransition`,this,t)}destroy(){this.layers.clear(),this.attachments.clear()}},qm=class extends Km{initialize(){let e=this.base.append(`div`).attr(`class`,`bc-frame`),t=e.append(`div`).attr(`class`,`bc-frame-header`);e.append(`div`).attr(`class`,`bc-frame-body`),e.append(`p`).attr(`class`,`bc-frame-note`);let n=e.append(`div`).attr(`class`,`bc-frame-footer`).style(`display`,`flex`).style(`justify-content`,`space-between`).style(`align-items`,`center`).style(`flex-wrap`,`wrap`).style(`gap`,`0.25rem 1rem`),r=n.append(`div`).attr(`class`,`bc-frame-footer-left`).style(`display`,`flex`).style(`flex-wrap`,`wrap`).style(`gap`,`0.25rem 0.75rem`),i=n.append(`div`).attr(`class`,`bc-frame-footer-right`).style(`display`,`flex`).style(`align-items`,`center`);this.layer(`headerItems`,t,{dataBind:(e,t)=>e.selectAll(`.bc-frame-header-item`).data(t.headerItems,e=>e.className),insert:e=>e.append(e=>document.createElement(e.tag)),events:{enter:e=>{e.attr(`class`,e=>e.className).text(e=>e.text)},merge:e=>{e.attr(`class`,e=>e.className).text(e=>e.text)},exit:e=>{e.remove()}}}),this.layer(`footerLeftItems`,r,{dataBind:(e,t)=>e.selectAll(`.bc-frame-footer-item`).data(t.footerLeftItems,e=>e.className),insert:e=>e.append(e=>document.createElement(e.tag)),events:{enter:e=>{e.attr(`class`,e=>e.className).each(function(e){if(this.textContent=``,e.prefix){let t=document.createElement(`span`);t.className=`bc-frame-source-prefix`,t.textContent=e.prefix,this.appendChild(t)}if(e.href){let t=document.createElement(`a`);t.className=`bc-frame-source-link`,t.href=e.href,t.textContent=e.text,this.appendChild(t)}else this.appendChild(document.createTextNode(e.text))})},merge:e=>{e.attr(`class`,e=>e.className).each(function(e){if(this.textContent=``,e.prefix){let t=document.createElement(`span`);t.className=`bc-frame-source-prefix`,t.textContent=e.prefix,this.appendChild(t)}if(e.href){let t=document.createElement(`a`);t.className=`bc-frame-source-link`,t.href=e.href,t.textContent=e.text,this.appendChild(t)}else this.appendChild(document.createTextNode(e.text))})},exit:e=>{e.remove()}}}),this.layer(`footerRightItems`,i,{dataBind:(e,t)=>e.selectAll(`.bc-frame-footer-item`).data(t.footerRightItems,e=>e.className),insert:e=>e.append(e=>document.createElement(e.tag)),events:{enter:e=>{e.attr(`class`,e=>e.className).each(function(e){if(e.html){let t=document.createRange().createContextualFragment(e.html);this.appendChild(t)}else this.textContent=e.text}),e.filter(e=>!!e.href).attr(`href`,e=>e.href),e.filter(e=>!!e.target).attr(`target`,e=>e.target),e.filter(e=>!!e.rel).attr(`rel`,e=>e.rel)},merge:e=>{e.attr(`class`,e=>e.className).each(function(e){if(this.textContent=``,e.html){let t=document.createRange().createContextualFragment(e.html);this.appendChild(t)}else this.textContent=e.text}),e.filter(e=>!!e.href).attr(`href`,e=>e.href),e.filter(e=>!!e.target).attr(`target`,e=>e.target),e.filter(e=>!!e.rel).attr(`rel`,e=>e.rel)},exit:e=>{e.remove()}}})}};function Jm(e){let t=[];return e.title&&t.push({tag:`h3`,className:`bc-frame-title`,text:e.title}),e.description&&t.push({tag:`p`,className:`bc-frame-description`,text:e.description}),t}function Ym(e){let t=[];return e.byline&&t.push({tag:`span`,className:`bc-frame-byline`,text:e.byline}),e.source&&t.push({tag:`span`,className:`bc-frame-source`,text:e.source,prefix:`Source: `,href:e.sourceUrl||void 0}),t}function Xm(){return[{tag:`a`,className:`bc-frame-credit`,text:`Blueprint Chart`,html:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48.042969 90.607422" width="10" height="18" style="vertical-align:-3px;margin-right:3px"><path fill="currentColor" opacity="0.55" d="M 20.042969 34.607422 A 28 28 0 0 1 23.072266 34.779297 A 28 28 0 0 0 20.042969 34.607422 z M 23.34375 34.810547 A 28 28 0 0 1 26.171875 35.292969 A 28 28 0 0 0 23.34375 34.810547 z M 16.570312 34.84375 A 28 28 0 0 0 15.474609 35.033203 A 28 28 0 0 1 16.570312 34.84375 z M 26.390625 35.341797 A 28 28 0 0 1 29.316406 36.189453 A 28 28 0 0 0 26.390625 35.341797 z M 13.128906 35.511719 A 28 28 0 0 0 11.904297 35.873047 A 28 28 0 0 1 13.128906 35.511719 z M 29.373047 36.210938 A 28 28 0 0 1 32.103516 37.347656 A 28 28 0 0 0 29.373047 36.210938 z M 9.7832031 36.609375 A 28 28 0 0 0 8.5820312 37.117188 A 28 28 0 0 1 9.7832031 36.609375 z M 32.392578 37.486328 A 28 28 0 0 1 34.939453 38.90625 A 28 28 0 0 0 32.392578 37.486328 z M 6.5742188 38.128906 A 28 28 0 0 0 5.4511719 38.765625 A 28 28 0 0 1 6.5742188 38.128906 z M 35.041016 38.966797 A 28 28 0 0 1 37.523438 40.738281 A 28 28 0 0 0 35.041016 38.966797 z M 3.5273438 40.080078 A 28 28 0 0 0 2.5761719 40.771484 A 28 28 0 0 1 3.5273438 40.080078 z M 37.658203 40.851562 A 28 28 0 0 1 39.804688 42.783203 A 28 28 0 0 0 37.658203 40.851562 z M 40.011719 42.990234 A 28 28 0 0 1 42.013672 45.251953 A 28 28 0 0 0 40.011719 42.990234 z M 42.013672 45.251953 A 28 28 0 0 1 20.042969 56 A 28 28 0 0 1 14.232422 55.3125 A 16 16 0 0 1 16 62.607422 A 16 16 0 0 1 0 78.607422 L 0 82.121094 A 28 28 0 0 0 20.042969 90.607422 A 28 28 0 0 0 48.042969 62.607422 A 28 28 0 0 0 42.013672 45.251953 z M 1.3007812 46.667969 A 16 16 0 0 1 1.6191406 46.697266 A 16 16 0 0 0 1.3007812 46.667969 z M 4.2558594 47.189453 A 16 16 0 0 1 4.4355469 47.242188 A 16 16 0 0 0 4.2558594 47.189453 z "/><path fill="currentColor" opacity="0.85" d="M 6.0637516 38.376047 A 28 28 0 0 1 20.042969 34.615234 A 28 28 0 0 1 42.013672 45.259765 A 28 28 0 0 0 48.042969 28.007812 A 28 28 0 0 0 20.042969 0.0078125 A 28 28 0 0 0 0 8.4941407 L 0 16.007812 A 12 12 0 0 1 12 28.007812 A 12 12 0 0 1 6.0613693 38.364443 "/><path fill="currentColor" d="M 20.042969 34.607422 A 28 28 0 0 0 5.0878906 38.970703 A 28 28 0 0 1 6.0644531 38.376953 L 6.0605469 38.365234 A 12 12 0 0 1 0 40.007812 L 0 43.09375 L 0 43.101562 L 0 46.607422 A 16 16 0 0 1 2.8847656 46.873047 A 16 16 0 0 1 2.9199219 46.878906 A 16 16 0 0 1 5.7011719 47.662109 A 16 16 0 0 1 5.7324219 47.673828 A 16 16 0 0 1 8.3300781 48.955078 A 16 16 0 0 1 8.3398438 48.958984 A 16 16 0 0 1 8.3457031 48.962891 A 16 16 0 0 1 10.662109 50.6875 A 16 16 0 0 1 10.697266 50.71875 A 16 16 0 0 1 12.660156 52.837891 A 16 16 0 0 1 12.667969 52.845703 A 16 16 0 0 1 12.673828 52.855469 A 16 16 0 0 1 14.228516 55.306641 A 16 16 0 0 1 14.232422 55.3125 A 28 28 0 0 0 20.042969 56 A 28 28 0 0 0 42.013672 45.251953 A 28 28 0 0 0 20.042969 34.607422 z M 4.7695312 39.177734 A 28 28 0 0 0 2.5390625 40.798828 A 28 28 0 0 1 4.7695312 39.177734 z M 2.1816406 41.091797 A 28 28 0 0 0 0.11914062 42.984375 A 28 28 0 0 1 2.1816406 41.091797 z "/></svg>Blueprint Chart`,href:`/`,target:`_blank`,rel:`noopener noreferrer`}]}function Zm(e,t){if(t===null)return{wrapper:e,header:e,body:e,footer:e};let n=t??{};new qm($(e)).draw({headerItems:Jm(n),footerLeftItems:Ym(n),footerRightItems:Xm()});let r=e.querySelector(`.bc-frame`),i=r.querySelector(`.bc-frame-header`),a=r.querySelector(`.bc-frame-body`),o=r.querySelector(`.bc-frame-note`),s=r.querySelector(`.bc-frame-footer`);if(n.padding&&r.style.setProperty(`--bc-frame-padding`,n.padding),n.transparentBackground&&r.style.setProperty(`--bc-frame-bg`,`transparent`),n.note?o.textContent=n.note:o.style.display=`none`,e.isConnected){let t=getComputedStyle(e),n=t.aspectRatio&&t.aspectRatio!==`auto`&&t.aspectRatio!==``,c=t.display===`flex`&&t.flexDirection===`column`;if(n||c){let t=i.offsetHeight,n=s.offsetHeight,c=o.style.display===`none`?0:o.offsetHeight;r.classList.add(`bc-frame--constrained`),a.dataset.headerH=String(t);let l=e;a.dataset.footerH=String(l.__bcFooterH??n+c),requestAnimationFrame(()=>{l.__bcFooterH=s.offsetHeight+(o.style.display===`none`?0:o.offsetHeight)})}}return{wrapper:r,header:i,body:a,footer:s}}function Qm(e){return e&&(e.startsWith(`(`)&&e.endsWith(`)`)?e.slice(0,-1):e)}function $m(e){if(!e)return{prefix:``,d3Spec:``,suffix:``};if(e.includes(`|`)){let t=e.split(`|`);return{prefix:t[0]??``,d3Spec:Qm(t[1]??``),suffix:t[2]??``}}return{prefix:``,d3Spec:Qm(e),suffix:``}}function eh(e){if(!e)return null;let{prefix:t,d3Spec:n,suffix:r}=$m(e);if(!n)return null;let i=Pu(n);return!t&&!r?i:e=>`${t}${i(e)}${r}`}function th(e,t){return!Number.isFinite(t)||t<=0?`0%`:`${Math.round(e/t*100)}%`}function nh(e,t){if(!e)return;let n=e.stableTop??e.top,r=t.stableTop??t.top;return{dx:e.left-t.left,dy:n-r}}var rh={top:12,right:20,bottom:24,left:50},ih=600,ah=400,oh=class extends Km{initialize(){this.configDefine(`totalWidth`,{defaultValue:ih}),this.configDefine(`totalHeight`,{defaultValue:ah}),this.layer(`svg`,this.base,{dataBind:(e,t)=>e.selectAll(`svg`).data(t),insert:e=>e.append(`svg`),events:{enter:e=>{let t=this.config(`totalWidth`),n=this.config(`totalHeight`);e.attr(`width`,t).attr(`height`,n).append(`g`).attr(`transform`,e=>`translate(${e.left},${e.top})`)}}})}},sh=400,ch=2,lh=2,uh=9;function dh(e,t,n,r){let i=Math.min(0,...e),a=Math.max(0,...e),o=t?.min??i,s=t?.max??a,c=r===`log`?ld().domain([o,s]).nice():ad().domain([o,s]).nice(),l=c.ticks(),u=n?eh(n)??c.tickFormat():c.tickFormat(),d=l.map(e=>u(e));if(d.length===0)return 0;try{let e=document.createElement(`canvas`).getContext(`2d`);if(e){e.font=`10px sans-serif`;let t=0;for(let n of d){let r=e.measureText(n).width;r>t&&(t=r)}return Math.ceil(t)+lh+uh}}catch{}return Math.max(...d.map(e=>e.length))*6+lh+uh}function fh(e){if(e.length===0)return 0;try{let t=document.createElement(`canvas`).getContext(`2d`);if(t){t.font=`10px sans-serif`;let n=0;for(let r of e){let e=t.measureText(r).width;e>n&&(n=e)}return Math.ceil(n)+lh+uh}}catch{}return Math.max(...e.map(e=>e.length))*6+lh+uh}function ph(e,t,n,r,i,a){let o={},s=i??50,c=r??`left`,l=t??`auto`,u=l===`auto`?e>0&&e<sh?`inside`:`outside`:l,d=u===`inside`,f=u===`off`;return c===`right`?(o.left=0,o.right=d?ch:f?0:s):(o.right=a===!1?0:15,o.left=d?ch:f?0:s),d&&(o.top=35),(a===!1||n===`inside`||n===`off`)&&(o.bottom=5),o}function mh(e){let t=e.getBoundingClientRect(),n=getComputedStyle(e);return{width:t.width-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),height:t.height-(parseFloat(n.paddingTop)||0)-(parseFloat(n.paddingBottom)||0)}}function hh(e,t){let n=t.closest(`.bc-frame`);if(!n||n.style.getPropertyValue(`--bc-frame-bg`).trim()===`transparent`)return;e.querySelector(`.bc-canvas-bg`)?.remove();let r=e.ownerDocument.createElementNS(`http://www.w3.org/2000/svg`,`rect`);r.setAttribute(`class`,`bc-canvas-bg`),r.setAttribute(`width`,`100%`),r.setAttribute(`height`,`100%`),r.setAttribute(`fill`,lr(n)),e.insertBefore(r,e.firstChild)}function gh(e,t){let n={...rh,...t},r=e.closest(`.bc-frame--constrained`)!=null;if(r){let t=parseFloat(e.dataset.headerH||`0`),r=parseFloat(e.dataset.footerH||`0`),i=n.top;n.top=t+i,n.bottom+=r,n.stableTop=i}let i=mh(e),a=i.width>0?i.width:ih,o=i.height>0?i.height:ah,s=a-n.left-n.right,c=o-n.top-n.bottom,l=new oh($(e));l.config({totalWidth:a,totalHeight:o}),l.draw([n]);let u=e.querySelector(`svg`),d=u.querySelector(`g`);return hh(u,e),r&&(u.setAttribute(`viewBox`,`0 0 ${a} ${o}`),u.setAttribute(`preserveAspectRatio`,`none`),u.removeAttribute(`width`),u.removeAttribute(`height`),u.style.width=`100%`,u.style.height=`100%`,u.style.display=`block`),{svg:u,chartArea:d,width:s,height:c,margin:n}}function _h(e){return typeof window>`u`||typeof window.matchMedia!=`function`?e:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:e}var vh=0;function yh(e){vh=e?500:0}function bh(){return _h(vh)}function xh(e,t){let n=_h(t??500);n<=0||typeof e.animate!=`function`||e.animate([{opacity:0},{opacity:1}],{duration:n,easing:`ease-in-out`})}function Sh(e,t){let n=_h(t??500);if(e.querySelectorAll(`[data-bc-fade-overlay]`).forEach(e=>{typeof e.getAnimations==`function`&&e.getAnimations().forEach(e=>e.cancel()),e.remove()}),n<=0||e.children.length===0)return null;let r=document.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.display=`flex`,r.style.flexDirection=`column`,r.dataset.bcFadeOverlay=`true`,Array.from(e.childNodes).forEach(e=>{r.appendChild(e.cloneNode(!0))}),r.querySelectorAll(`.bc-axis-vertical, .bc-axis-horizontal`).forEach(e=>{e.remove()}),r.querySelectorAll(`.bc-frame-footer, .bc-frame-note`).forEach(e=>{e.remove()}),r.querySelectorAll(`[data-bc-fade-overlay], .bc-frame--fade-snapshot`).forEach(e=>{e.remove()}),r.querySelectorAll(`.bc-frame`).forEach(e=>{e.classList.remove(`bc-frame`),e.classList.add(`bc-frame--fade-snapshot`)}),r}function Ch(e,t,n){let r=_h(n??500);if(getComputedStyle(e).position===`static`&&(e.style.position=`relative`),e.appendChild(t),r>0&&typeof t.animate==`function`){let e=t.animate([{opacity:1},{opacity:0}],{duration:r,easing:`ease-in-out`});e.onfinish=()=>t.remove()}else t.remove()}var wh=60,Th=10,Eh=1.3,Dh=12,Oh=3,kh=14,Ah=10;function jh(e,t,n=Oh){if(e===``)return[``];if(e.length*Th<=t)return[e];let r=e.split(/\s+/).filter(Boolean);if(r.length===0)return null;let i=[],a=``;for(let e of r){if(e.length*Th>t)return null;let r=a?`${a} ${e}`:e;if(r.length*Th<=t)a=r;else if(i.push(a),a=e,i.length>=n)return null}return a&&i.push(a),i.length>n?null:i}var Mh={year:`%Y`,month:`%b %Y`,day:`%b %-d, %Y`,datetime:`%b %-d, %Y %H:%M`};function Nh(e){return typeof e.step==`function`}function Ph(e,t){let n=Dr(t);if(e&&e.includes(`%`)){if(n){let r=ap(e),i=new Map;return t.forEach((e,t)=>i.set(e,n.dates[t])),e=>{if(e instanceof Date)return r(e);let t=i.get(String(e));return t?r(t):String(e)}}return null}if(e)return eh(e)??Pu(e);if(n){let e=ap(Mh[n.granularity]??`%Y-%m-%d`),r=new Map;return t.forEach((e,t)=>r.set(e,n.dates[t])),t=>{if(t instanceof Date)return e(t);let n=r.get(String(t));return n?e(n):String(t)}}return null}function Fh(e,t){let n=0;for(let r of e){let e=(t?t(r):r).length*Th;e>n&&(n=e)}return n}function Ih(e,t,n){if(e.length<=1)return e;let r=n?Fh(e,n):e.reduce((e,t)=>Math.max(e,t.length),0)*Th,i=Math.max(16,Math.ceil(r)+8),a=Math.max(2,Math.floor(t/i));if(e.length<=a)return e;let o=Math.ceil(e.length/a),s=e.filter((e,t)=>t%o===0),c=e[e.length-1];return s[s.length-1]!==c&&s.push(c),s}function Lh(e,t,n,r){return e.length<=1||t<=0||n===`horizontal`?!1:n===`vertical`||!Dr(e)&&Fh(e,r??null)>t/e.length*Eh}function Rh(e,t){if(e.length===0)return 0;let n=Fh(e,t??null);return Math.ceil(n)+Dh}function zh(e){let t=1;for(let n of e)n.length>t&&(t=n.length);return t<=1?0:t*kh+Ah}function Bh(e,t,n={},r=24){if(e.length===0||t<=0||n.labelPosition===`off`||n.labelPosition===`inside`)return;let i=n.tickFormat?n.tickFormat:Ph(n.numberFormat??null,e),a=n.labelRotation??`auto`;if((a===`vertical`||Dr(e)===null)&&e.length>1){let n=t/e.length*Eh,o=Fh(e,i)>n;if(a!==`vertical`&&o){let t=Vh(e,n,i);if(t){let e=zh(Array.from(t.values()));return e>r?e:void 0}}}if(!Lh(e,t,a,i))return;let o=Rh(e,i);return o>r?o:void 0}function Vh(e,t,n){let r=new Map,i=!1;for(let a of e){let e=jh(n?n(a):a,t);if(e===null)return null;r.set(a,e),e.length>1&&(i=!0)}return i?r:null}function Hh(e,t){e.selectAll(`.tick`).each(function(){let e=$(this),n=e.datum(),r=n instanceof Date?n.toISOString():String(n),i=t.get(r);if(!i||i.length<=1)return;let a=e.select(`text`);a.empty()||(a.attr(`dy`,null).text(null),i.forEach((e,t)=>{a.append(`tspan`).attr(`x`,0).attr(`dy`,t===0?`0.71em`:`1em`).text(e)}))})}var Uh=class extends Km{initialize(){this.configDefine(`scale`,{defaultValue:Uu()}),this.configDefine(`height`,{defaultValue:0}),this.configDefine(`tickPosition`,{defaultValue:`below`}),this.configDefine(`showAxis`,{defaultValue:!0}),this.configDefine(`showTicks`,{defaultValue:!1}),this.configDefine(`gridStyle`,{defaultValue:`dashed`}),this.configDefine(`ticks`,{defaultValue:null}),this.configDefine(`numberFormat`,{defaultValue:null}),this.configDefine(`width`,{defaultValue:0}),this.configDefine(`labels`,{defaultValue:[]}),this.configDefine(`labelPosition`,{defaultValue:`auto`}),this.configDefine(`labelRotation`,{defaultValue:`auto`}),this.configDefine(`zeroY`,{defaultValue:null}),this.configDefine(`tickFormat`,{defaultValue:null});let e=this.base.append(`g`);this.layer(`axis`,e,{dataBind:(e,t)=>e.selectAll(`.bc-axis-horizontal`).data(t),insert:e=>e.append(`g`).attr(`class`,`bc-axis bc-axis-horizontal`),events:{"merge:transition":e=>{this.applyAxis(e,`merge`)},exit:e=>{e.remove()},enter:e=>{this.applyAxis(e,`enter`)}}})}applyAxis(e,t){let n=this.config(`scale`),r=this.config(`scale`),i=this.config(`tickPosition`),a=this.config(`height`),o=this.config(`labelPosition`),s=this.config(`labelRotation`),c=this.config(`width`),l=this.config(`numberFormat`),u=this.config(`labels`),d=this.config(`tickFormat`),f=i===`above`?Ji(n):Xi(n);this.config(`showTicks`)||f.tickSizeOuter(0);let p=d||Ph(l,u);p&&f.tickFormat(p);let m=Nh(r),h=m?r.domain():[],g=m&&s!==`vertical`&&Dr(h)!==null,_=null,v=!1;if(m&&!g&&h.length>1&&c>0){let e=c/h.length*Eh,t=Fh(h,p)>e;s===`vertical`?v=!0:t&&(_=Vh(h,e,p),!_&&s===`auto`&&(v=!0))}let y=this.config(`ticks`);if(!y&&c>0){if(m){if(g){let e=Ih(h,c,p);e.length<h.length&&(y=e)}}else{let e=Math.max(2,Math.floor(c/wh));f.ticks(e)}}y&&f.tickValues(y);let b=i===`above`?0:a,x=e.node(),S=t===`merge`?bh():0;if(t===`merge`){if(!x)return;S>0?(e.attr(`transform`,`translate(0,${b})`),e.duration(S).call(f)):$(x).attr(`transform`,`translate(0,${b})`).call(f)}else e.attr(`transform`,`translate(0,${b})`),e.call(f);let C=S>0?e:x?$(x):e;if(!this.config(`showAxis`))C.select(`.domain`).remove();else if(t===`enter`){let e=this.config(`zeroY`);if(e!=null){let t=e-(i===`above`?0:a);C.select(`.domain`).attr(`transform`,`translate(0,${t})`)}}this.config(`showTicks`)||C.selectAll(`.tick line`).remove();let w=o===`auto`?`outside`:o;w===`off`?C.selectAll(`.tick text`).remove():w===`inside`&&C.selectAll(`.tick text`).attr(`y`,0).attr(`dy`,`-0.6em`),v&&w!==`off`?C.selectAll(`.tick text`).attr(`transform`,`rotate(-90)`).attr(`text-anchor`,`end`).attr(`x`,i===`above`?9:-9).attr(`y`,0).attr(`dy`,`0.32em`):C.selectAll(`.tick text`).attr(`transform`,null),_&&w!==`off`&&Hh(C,_)}postDraw(){let e=this.config(`gridStyle`),t=this.config(`height`),n=this.base.select(`.bc-axis-horizontal`).node();n&&e!==`none`&&t>0&&Wh(n,e,t)}};function Wh(e,t,n){let r=e.ownerSVGElement?.parentElement??document.documentElement,i=getComputedStyle(r).getPropertyValue(`--bc-grid-color`).trim()||`#ccc`;$(e).selectAll(`.tick`).each(function(){let e=$(this).append(`line`).attr(`class`,`bc-grid-line`).attr(`x1`,0).attr(`x2`,0).attr(`y1`,0).attr(`y2`,-n).attr(`stroke`,i).attr(`stroke-width`,1);t===`dashed`?e.attr(`stroke-dasharray`,`4,4`):t===`dotted`&&e.attr(`stroke-dasharray`,`1,3`)})}var Gh=30,Kh=class extends Km{initialize(){this.configDefine(`scale`,{defaultValue:ad()}),this.configDefine(`direction`,{defaultValue:kr.Left}),this.configDefine(`showAxis`,{defaultValue:!0}),this.configDefine(`showTicks`,{defaultValue:!1}),this.configDefine(`gridStyle`,{defaultValue:jr.Dashed}),this.configDefine(`gridWidth`,{defaultValue:0}),this.configDefine(`height`,{defaultValue:0}),this.configDefine(`ticks`,{defaultValue:null}),this.configDefine(`numberFormat`,{defaultValue:null}),this.configDefine(`labelPosition`,{defaultValue:Mr.Auto}),this.configDefine(`topPadding`,{defaultValue:0}),this.configDefine(`tickFormat`,{defaultValue:null});let e=this.base.append(`g`);this.layer(`axis`,e,{dataBind:(e,t)=>e.selectAll(`.bc-axis-vertical`).data(t),insert:e=>e.append(`g`).attr(`class`,`bc-axis bc-axis-vertical`),events:{"merge:transition":e=>{let t=this.config(`scale`),n=this.config(`direction`),r=this.config(`showAxis`),i=this.config(`showTicks`),a=this.config(`labelPosition`),o=this.config(`gridWidth`),s=this.config(`height`),c=n===kr.Right?Yi(t):Zi(t);i||c.tickSizeOuter(0);let l=this.config(`ticks`);if(l)c.tickValues(l);else if(s>0){let e=Math.max(2,Math.floor(s/Gh));c.ticks(e)}let u=this.config(`tickFormat`);if(u)c.tickFormat(u);else{let e=this.config(`numberFormat`),t=e?eh(e):null;t&&c.tickFormat(t)}let d=bh(),f=e.node();if(f){d>0?e.duration(d).call(c):$(f).call(c),r||$(f).select(`.domain`).remove(),i||$(f).selectAll(`.tick line`).attr(`opacity`,0);let t=a===Mr.Auto?o>0&&o<400?Mr.Inside:Mr.Outside:a;if(t===Mr.Inside){let t=r?4:0,i=d>0?e.selectAll(`.tick text`):$(f).selectAll(`.tick text`);n===kr.Right?i.attr(`x`,-t).attr(`dy`,`-0.4em`).attr(`text-anchor`,`end`):i.attr(`x`,t).attr(`dy`,`-0.4em`).attr(`text-anchor`,`start`)}else t===Mr.Off&&$(f).selectAll(`.tick text`).attr(`opacity`,0)}},exit:e=>{e.remove()},enter:e=>{let t=this.config(`scale`),n=this.config(`direction`),r=this.config(`labelPosition`),i=this.config(`gridWidth`),a=this.config(`height`),o=this.config(`topPadding`),s=n===kr.Right?Yi(t):Zi(t);this.config(`showTicks`)||s.tickSizeOuter(0);let c=this.config(`ticks`);if(c)s.tickValues(c);else if(a>0){let e=Math.max(2,Math.floor(a/Gh));s.ticks(e)}let l=this.config(`tickFormat`);if(l)s.tickFormat(l);else{let e=this.config(`numberFormat`),t=e?eh(e):null;t&&s.tickFormat(t)}e.call(s);let u=this.config(`showAxis`),d=this.config(`showTicks`);u||e.select(`.domain`).remove();let f=r===Mr.Auto?i>0&&i<400?Mr.Inside:Mr.Outside:r;if(f===Mr.Inside){let t=u?4:0;if(n===kr.Right?e.selectAll(`.tick text`).attr(`x`,-t).attr(`dy`,`-0.4em`).attr(`text-anchor`,`end`):e.selectAll(`.tick text`).attr(`x`,t).attr(`dy`,`-0.4em`).attr(`text-anchor`,`start`),d?e.selectAll(`.tick line`).attr(`x2`,n===kr.Right?-6:6):e.selectAll(`.tick line`).remove(),o>0&&u){let t=e.select(`.domain`);if(!t.empty()){let e=t.attr(`d`),n=e.replace(/V[\d.]+/,`V${-o}`);n!==e&&t.attr(`d`,n)}}}else d||e.selectAll(`.tick line`).remove(),f===Mr.Off&&e.selectAll(`.tick text`).remove()}}})}postDraw(){let e=this.config(`gridStyle`),t=this.config(`gridWidth`),n=this.config(`direction`),r=this.base.select(`.bc-axis-vertical`).node();r&&e!==jr.None&&t>0&&qh(r,e,n===kr.Right?-t:t)}};function qh(e,t,n){let r=e.ownerSVGElement?.parentElement??document.documentElement,i=getComputedStyle(r).getPropertyValue(`--bc-grid-color`).trim()||`#ccc`;$(e).selectAll(`.tick`).each(function(){let e=$(this).append(`line`).attr(`class`,`bc-grid-line`).attr(`x1`,0).attr(`x2`,n).attr(`y1`,0).attr(`y2`,0).attr(`stroke`,i).attr(`stroke-width`,1);t===jr.Dashed?e.attr(`stroke-dasharray`,`4,4`):t===jr.Dotted&&e.attr(`stroke-dasharray`,`1,3`)})}function Jh(e){return typeof e.step==`function`}var Yh=new WeakMap,Xh=class e{vGroup=null;hGroup=null;vChart=null;hChart=null;container;initialized=!1;constructor(e){this.container=e}static for(t){let n=Yh.get(t);return n||(n=new e(t),Yh.set(t,n)),n}static clear(e){Yh.delete(e)}detach(){this.vGroup?.parentNode&&($(this.vGroup).interrupt().selectAll(`*`).interrupt(),this.vGroup.querySelectorAll(`.bc-grid-line`).forEach(e=>e.remove()),this.vGroup.remove()),this.hGroup?.parentNode&&($(this.hGroup).interrupt().selectAll(`*`).interrupt(),this.hGroup.querySelectorAll(`.bc-grid-line`).forEach(e=>e.remove()),this.hGroup.remove())}attach(e,t){if(!this.initialized)this.vGroup=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),this.vGroup.setAttribute(`class`,`bc-axis-service-v`),this.hGroup=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),this.hGroup.setAttribute(`class`,`bc-axis-service-h`),e.appendChild(this.vGroup),e.appendChild(this.hGroup),this.vChart=new Kh($(this.vGroup)),this.hChart=new Uh($(this.hGroup)),this.initialized=!0;else{for(let e of[this.vGroup,this.hGroup])$(e).selectAll(`.tick`).interrupt();if(e.appendChild(this.vGroup),e.appendChild(this.hGroup),t&&(Math.abs(t.dx)>=1||Math.abs(t.dy)>=1)){let{dx:e,dy:n}=t;for(let t of[this.vGroup,this.hGroup]){t.setAttribute(`transform`,`translate(${e},${n})`);let r=bh();r>0?$(t).transition().duration(r).attrTween(`transform`,()=>{let t=ec(e,0),r=ec(n,0);return e=>`translate(${t(e)},${r(e)})`}):t.removeAttribute(`transform`)}}}}update(e){let t=e.order??`vertical-first`;t===`horizontal-first`?(this.updateHorizontal(e.horizontal),this.updateVertical(e.vertical)):(this.updateVertical(e.vertical),this.updateHorizontal(e.horizontal)),t===`horizontal-first`?this.hGroup&&this.vGroup&&this.hGroup.parentNode&&this.hGroup.parentNode.insertBefore(this.hGroup,this.vGroup):this.vGroup&&this.hGroup&&this.vGroup.parentNode&&this.vGroup.parentNode.insertBefore(this.vGroup,this.hGroup)}updateVertical(e){if(!this.vChart||!this.vGroup)return;if(!e){this.vGroup.style.display=`none`;return}this.vGroup.style.display=``;let t=e.options;this.vChart.config({scale:e.scale,direction:t.direction??`left`,showAxis:t.showAxis??!0,showTicks:t.showTicks??!1,gridStyle:t.gridStyle??`dashed`,gridWidth:t.gridWidth??0,height:e.height,ticks:t.ticks??null,numberFormat:t.numberFormat??null,labelPosition:t.labelPosition??`auto`,topPadding:t.topPadding??0,tickFormat:t.tickFormat??null}),this.vChart.draw([{placeholder:!0}]);let n=this.vGroup.querySelector(`.bc-axis-vertical`);n&&(t.direction??`left`)===`right`?n.setAttribute(`transform`,`translate(${t.gridWidth??0},0)`):n&&n.removeAttribute(`transform`)}updateHorizontal(e){if(!this.hChart||!this.hGroup)return;if(!e){this.hGroup.style.display=`none`;return}this.hGroup.style.display=``;let t=e.options,n=e.scale,r=Jh(n)?n.domain():[];this.hChart.config({scale:n,height:e.height,tickPosition:t.tickPosition??`below`,showAxis:t.showAxis??!0,showTicks:t.showTicks??!1,gridStyle:t.gridStyle??`dashed`,ticks:t.ticks??null,numberFormat:t.numberFormat??null,width:t.width??0,labels:r,labelPosition:t.labelPosition??`auto`,labelRotation:t.labelRotation??`auto`,zeroY:t.zeroY??null,tickFormat:t.tickFormat??null}),this.hChart.draw([{placeholder:!0}])}destroy(){this.detach(),this.vChart=null,this.hChart=null,this.vGroup=null,this.hGroup=null,this.initialized=!1,Yh.delete(this.container)}},Zh=Math.min,Qh=Math.max,$h=Math.round,eg=e=>({x:e,y:e}),tg={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ng(e,t,n){return Qh(e,Zh(t,n))}function rg(e,t){return typeof e==`function`?e(t):e}function ig(e){return e.split(`-`)[0]}function ag(e){return e.split(`-`)[1]}function og(e){return e===`x`?`y`:`x`}function sg(e){return e===`y`?`height`:`width`}function cg(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function lg(e){return og(cg(e))}function ug(e,t,n){n===void 0&&(n=!1);let r=ag(e),i=lg(e),a=sg(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yg(o)),[o,yg(o)]}function dg(e){let t=yg(e);return[fg(e),t,fg(t)]}function fg(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pg=[`left`,`right`],mg=[`right`,`left`],hg=[`top`,`bottom`],gg=[`bottom`,`top`];function _g(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mg:pg:t?pg:mg;case`left`:case`right`:return t?hg:gg;default:return[]}}function vg(e,t,n,r){let i=ag(e),a=_g(ig(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fg)))),a}function yg(e){let t=ig(e);return tg[t]+e.slice(t.length)}function bg(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xg(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bg(e)}function Sg(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Cg(e,t,n){let{reference:r,floating:i}=e,a=cg(t),o=lg(t),s=sg(o),c=ig(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ag(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function wg(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=rg(t,e),p=xg(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sg(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Sg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Tg=50,Eg=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wg},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Cg(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Tg&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Cg(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Dg=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=rg(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ig(r),_=cg(o),v=ig(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yg(o)]:dg(o)),x=p!==`none`;!d&&x&&b.push(...vg(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ug(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===cg(t)||T.every(e=>cg(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=cg(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Og=new Set([`left`,`top`]);async function kg(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ig(n),s=ag(n),c=cg(n)===`y`,l=Og.has(o)?-1:1,u=a&&c?-1:1,d=rg(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ag=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await kg(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},jg=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=rg(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cg(i),p=og(f),m=u[p],h=u[f],g=(e,t)=>ng(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}};function Mg(){return typeof window<`u`}function Ng(e){return Ig(e)?(e.nodeName||``).toLowerCase():`#document`}function Pg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fg(e){return((Ig(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ig(e){return Mg()?e instanceof Node||e instanceof Pg(e).Node:!1}function Lg(e){return Mg()?e instanceof Element||e instanceof Pg(e).Element:!1}function Rg(e){return Mg()?e instanceof HTMLElement||e instanceof Pg(e).HTMLElement:!1}function zg(e){return!Mg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Pg(e).ShadowRoot}function Bg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Zg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Vg(e){return/^(table|td|th)$/.test(Ng(e))}function Hg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ug=/transform|translate|scale|rotate|perspective|filter/,Wg=/paint|layout|strict|content/,Gg=e=>!!e&&e!==`none`,Kg;function qg(e){let t=Lg(e)?Zg(e):e;return Gg(t.transform)||Gg(t.translate)||Gg(t.scale)||Gg(t.rotate)||Gg(t.perspective)||!Yg()&&(Gg(t.backdropFilter)||Gg(t.filter))||Ug.test(t.willChange||``)||Wg.test(t.contain||``)}function Jg(e){let t=$g(e);for(;Rg(t)&&!Xg(t);){if(qg(t))return t;if(Hg(t))return null;t=$g(t)}return null}function Yg(){return Kg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Kg}function Xg(e){return/^(html|body|#document)$/.test(Ng(e))}function Zg(e){return Pg(e).getComputedStyle(e)}function Qg(e){return Lg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $g(e){if(Ng(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||zg(e)&&e.host||Fg(e);return zg(t)?t.host:t}function e_(e){let t=$g(e);return Xg(t)?(e.ownerDocument||e).body:Rg(t)&&Bg(t)?t:e_(t)}function t_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=e_(e),i=r===e.ownerDocument?.body,a=Pg(r);if(i){let e=n_(a);return t.concat(a,a.visualViewport||[],Bg(r)?r:[],e&&n?t_(e):[])}return t.concat(r,t_(r,[],n))}function n_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r_(e){let t=Zg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Rg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$h(n)!==a||$h(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function i_(e){return Lg(e)?e:e.contextElement}function a_(e){let t=i_(e);if(!Rg(t))return eg(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=r_(t),o=(a?$h(n.width):n.width)/r,s=(a?$h(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var o_=eg(0);function s_(e){let t=Pg(e);return!Yg()||!t.visualViewport?o_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function c_(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Pg(e)}function l_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=i_(e),o=eg(1);t&&(r?Lg(r)&&(o=a_(r)):o=a_(e));let s=c_(a,n,r)?s_(a):eg(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Pg(a),t=Lg(r)?Pg(r):r,n=e,i=n_(n);for(;i&&t!==n;){let e=a_(i),t=i.getBoundingClientRect(),r=Zg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Pg(i),i=n_(n)}}return Sg({width:u,height:d,x:c,y:l})}function u_(e,t){let n=Qg(e).scrollLeft;return t?t.left+n:l_(Fg(e)).left+n}function d_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-u_(e,n),y:n.top+t.scrollTop}}function f_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Fg(r),s=t?Hg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eg(1),u=eg(0),d=Rg(r);if((d||!a)&&((Ng(r)!==`body`||Bg(o))&&(c=Qg(r)),d)){let e=l_(r);l=a_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?d_(o,c):eg(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function p_(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function m_(e){let t=Qg(e),n=e.ownerDocument.body,r=Qh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+u_(e),o=-t.scrollTop;return Zg(n).direction===`rtl`&&(a+=Qh(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var h_=25;function g_(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Pg(e),a=Fg(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Yg()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(u_(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=h_&&(s-=o)}return{width:s,height:c,x:l,y:u}}function __(e,t){let n=l_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=a_(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function v_(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=g_(e,n,t);else if(t===`document`)r=m_(Fg(e));else if(Lg(t))r=__(t,n);else{let n=s_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sg(r)}function y_(e,t){let n=t.get(e);if(n)return n;let r=t_(e,[],!1).filter(e=>Lg(e)&&Ng(e)!==`body`),i=null,a=Zg(e).position===`fixed`,o=a?$g(e):e;for(;Lg(o)&&!Xg(o);){let e=Zg(o),t=qg(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=$g(o)}return t.set(e,r),r}function b_(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Hg(t)?[]:y_(t,this._c):[].concat(n),r],o=v_(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=v_(t,a[e],i);s=Qh(n.top,s),c=Zh(n.right,c),l=Zh(n.bottom,l),u=Qh(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function x_(e){let{width:t,height:n}=r_(e);return{width:t,height:n}}function S_(e,t,n){let r=Rg(t),i=Fg(t),a=n===`fixed`,o=l_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eg(0);if((r||!a)&&((Ng(t)!==`body`||Bg(i))&&(s=Qg(t)),r)){let e=l_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=u_(i));let l=i&&!r&&!a?d_(i,s):eg(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function C_(e){return Zg(e).position===`static`}function w_(e,t){if(!Rg(e)||Zg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Fg(e)===n&&(n=n.ownerDocument.body),n}function T_(e,t){let n=Pg(e);if(Hg(e))return n;if(!Rg(e)){let t=$g(e);for(;t&&!Xg(t);){if(Lg(t)&&!C_(t))return t;t=$g(t)}return n}let r=w_(e,t);for(;r&&Vg(r)&&C_(r);)r=w_(r,t);return r&&Xg(r)&&C_(r)&&!qg(r)?n:r||Jg(e)||n}var E_=async function(e){let t=this.getOffsetParent||T_,n=this.getDimensions,r=await n(e.floating);return{reference:S_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function D_(e){return Zg(e).direction===`rtl`}var O_={convertOffsetParentRelativeRectToViewportRelativeRect:f_,getDocumentElement:Fg,getClippingRect:b_,getOffsetParent:T_,getElementRects:E_,getClientRects:p_,getDimensions:x_,getScale:a_,isElement:Lg,isRTL:D_},k_=Ag,A_=jg,j_=Dg,M_=(e,t,n)=>{let r=new Map,i=n??{},a={...O_,...i.platform,_c:r};return Eg(e,t,{...i,platform:a})},N_=`bc-tooltip`;function P_(){if(document.getElementById(`bc-tooltip-styles`))return;let e=document.createElement(`style`);e.id=`bc-tooltip-styles`,e.textContent=`
|
|
238
|
+
.${N_} {
|
|
251
239
|
position: absolute;
|
|
252
240
|
pointer-events: none;
|
|
253
241
|
background: var(--bs-body-bg, #fff);
|
|
@@ -260,9 +248,9 @@ body {
|
|
|
260
248
|
z-index: 9999;
|
|
261
249
|
display: none;
|
|
262
250
|
}
|
|
263
|
-
`,document.head.appendChild(
|
|
264
|
-
`);if(l.length>1||a.maxWidth&&a.maxWidth>0)if(a.maxWidth&&a.maxWidth>0)Bw(s,n,a.maxWidth);else for(let c=0;c<l.length;c++)s.append("tspan").attr("x",s.attr("x")).attr("dy",c===0?"0":"1.2em").text(l[c]);else s.text(n)}function Bw(t,n,e){const r=n.split(/\s+/);let a="",i=0;for(const o of r){const s=a?`${a} ${o}`:o;a&&s.length*7>e?(t.append("tspan").attr("x",t.attr("x")).attr("dy",i===0?"0":"1.2em").text(a),a=o,i++):a=s}a&&t.append("tspan").attr("x",t.attr("x")).attr("dy",i===0?"0":"1.2em").text(a)}function Do(t,n,e=of.Center){if("bandwidth"in n){const r=n,a=r(String(t))??0,i=r.bandwidth(),o=r.step()-i;return e==="start"?a-o/2:e==="end"?a+i+o/2:a+i/2}if(Dl(n)){const r=n(String(t))??0,a=n.step()/2;return e==="start"?r-a:e==="end"?r+a:r}return Eh(n)?n(new Date(String(t))):n(Number(t))}function Po(t,n){return n(Number(t))}function Rh(t,n){if(typeof t=="number")return n/2+t/100*n;const e=String(t);return e.endsWith("%")?n/2+parseFloat(e)/100*n:parseFloat(e)||0}function Rl(t,n){if(t==null)return;if(typeof t=="number")return t||void 0;const e=String(t);return e.endsWith("%")?parseFloat(e)/100*n:parseFloat(e)||void 0}function Vw(t){return t<-4?"end":t>4?"start":"middle"}function Fh(t,n,e){if("bandwidth"in n){const r=n;return{x:(r(t.label)??0)+r.bandwidth()/2,y:e(t.value)}}return{x:Dh(n,t.label),y:e(t.value)}}function Yh(t,n,e,r){const a="target"in n?n.target:void 0;if(!a)return;const i=e.data.find(S=>S.label===a);if(!i)return;const o=t.append("g").attr("data-annotation-index",String(r)),s=n.key;s&&o.attr("data-annotation-id",s);const l=n,c=l.anchorDirection??ce.N,f=Pw(i,e.scaleX,e.scaleY,c,e.orientation);let h,d;const g=n;if(g.dx!=null||g.dy!=null){const{x:S,y:z}=Fh(i,e.scaleX,e.scaleY);h=S+(Number(g.dx)||40),d=z+(Number(g.dy)||-40)}else if(g.direction!=null&&g.textOffsetX==null){const{x:S,y:z}=Fh(i,e.scaleX,e.scaleY),Y=g.direction,G=g.anchorDistance??60,_=Dw(Y,G);h=S+_.dx,d=z+_.dy}else h=f.x+(l.textOffsetX??-42),d=f.y+(l.textOffsetY??-42);const v=n.circleColor??"#666",m=n;m.showCircle&&Fw(o,f.x,f.y,{size:m.circleSize,style:m.circleStyle,color:v});const b=Math.max(4,Math.min(h,e.width-4)),x=Math.max(4,Math.min(d,e.height-4));if(n.text){const S=Vw(h-f.x);zl(o,n.text,b,x-4,{textColor:n.textColor,maxWidth:Rl(n.maxWidth,e.width),textAnchor:S,backgroundColor:e.backgroundColor,textOutline:n.textOutline})}if(g.dx!=null||g.dy!=null?l.showLine!==!1:l.showLine===!0||l.showArrow===!0){let S={x:b,y:x},z=!1;const Y=o.select(".bc-annotation-text").node();if(Y)try{const P=Y.getBBox();if(P.width>0&&P.height>0){S=zw(P,f.x,f.y);const $=P.x+P.width/2;z=Math.abs(S.x-$)<1}}catch{}const G=l.showCircle?(l.circleSize??4)+(l.lineTargetDistance??5):l.lineTargetDistance??0;let _=f.x,B=f.y;if(G>0){const P=f.x-S.x,$=f.y-S.y,N=Math.sqrt(P*P+$*$);if(N>0){const L=f.x-P/N*G,M=f.y-$/N*G,D=mr[c]??mr.N;_=Math.abs(D.dx)>.01?L:f.x,B=Math.abs(D.dy)>.01?M:f.y}}Hw(o,S,{x:_,y:B},l.lineStyle??xe.Direct,{showArrow:l.showArrow,lineWeight:l.lineWeight,color:v,departVertical:z})}}function Ih(t,n,e,r,a){if(n.kind!==we.Range)return;const i=t.append("g").attr("data-annotation-index",String(r)),o=n.key;o&&i.attr("data-annotation-id",o);const s=n.orientation??Ve.Vertical;let l,c,f,h;if(e.orientation===Ve.Horizontal)if(s===Ve.Vertical){const d=Do(n.start,e.scaleX,n.startAnchor),g=Do(n.end,e.scaleX,n.endAnchor);c=Math.min(d,g),h=Math.abs(g-d),l=0,f=e.width}else{const d=Po(n.start,e.scaleY),g=Po(n.end,e.scaleY);l=Math.min(d,g),f=Math.abs(g-d),c=0,h=e.height}else if(s===Ve.Vertical){const d=Do(n.start,e.scaleX,n.startAnchor),g=Do(n.end,e.scaleX,n.endAnchor);l=Math.min(d,g),f=Math.abs(g-d),c=0,h=e.height}else{const d=Po(n.start,e.scaleY),g=Po(n.end,e.scaleY);c=Math.min(d,g),h=Math.abs(g-d),l=0,f=e.width}if(i.append("rect").attr("class","bc-annotation-range").attr("x",l).attr("y",c).attr("width",f).attr("height",h).attr("fill",n.bgColor??"#ccc").attr("opacity",(n.bgOpacity??20)/100),n.text){const d=s===Ve.Vertical?f:h,g=Rl(n.maxWidth,e.width)??Math.max(d,50),v=n.direction??"center",m=4,b=mr[v]??mr.center,x=.5+b.dx*.5,A=.5+b.dy*.5,w=Math.max(m,Math.min(l+f*x,e.width-m));let S="middle";x<.25?S="start":x>.75&&(S="end");const Y=c+m+12,G=a?a.append("g").attr("data-annotation-index",String(r)):i;if(zl(G,n.text,w,Y,{textColor:n.textColor,maxWidth:g,textAnchor:S,backgroundColor:e.backgroundColor,textOutline:n.textOutline}),A>.25){const _=G.select(".bc-annotation-text").node();if(_)try{const B=_.getBBox();let P=0;A>.75?P=c+h-m-(B.y+B.height):P=c+h/2-(B.y+B.height/2),Math.abs(P)>.5&&_.setAttribute("transform",`translate(0, ${P})`)}catch{}}}}function Hh(t,n,e,r){if(n.kind!=="free")return;const a=t.append("g").attr("data-annotation-index",String(r)),i=n.key;i&&a.attr("data-annotation-id",i);const o=Rh(n.x,e.width),s=Rh(n.y,e.height);if(n.text){zl(a,n.text,o,s,{textColor:n.textColor,maxWidth:Rl(n.maxWidth,e.width),textAnchor:"middle",backgroundColor:e.backgroundColor,textOutline:n.textOutline});const l=a.select(".bc-annotation-text").node();if(l)try{const c=l.getBBox(),f=s-(c.y+c.height/2);Math.abs(f)>.5&&l.setAttribute("transform",`translate(0, ${f})`)}catch{}}}function Fl(t,n,e,r){const a=e+.45*(t-e);return`M ${t} ${n} L ${a} ${n} L ${e} ${r}`}function Ww(t,n){const e=t.hasAttribute("marker-end"),r=El(t.parentElement);if(e&&r){const a=ot(t),i=t.getAttribute("d"),o=`M ${r.fromX} ${r.fromY} L ${r.fromX} ${r.fromY}`;if(a.attr("d",o),r.style===xe.Elbow){const s={tipX:r.toX,tipY:r.toY,calloutX:r.fromX,calloutY:r.fromY},l={tipX:r.fromX,tipY:r.fromY,calloutX:r.fromX,calloutY:r.fromY};a.transition().duration(n).ease(Qi).attrTween("d",()=>{const c=Ia(l,s);return f=>{const h=c(f);return Fl(h.calloutX,h.calloutY,h.tipX,h.tipY)}})}else if(r.style===xe.CurveLeft||r.style===xe.CurveRight){const s={x:r.fromX,y:r.fromY},l={x:r.toX,y:r.toY},c=l.x-s.x,f=l.y-s.y,h=Math.sqrt(c*c+f*f),d=h*.8,g=r.style===xe.CurveRight?1:0,v=h/2,m=v<d?Math.sqrt(d*d-v*v):0,b=(s.x+l.x)/2,x=(s.y+l.y)/2,A=h>0?-f/h:0,w=h>0?c/h:0,S=g===1?1:-1,z=b+S*m*A,Y=x+S*m*w,G=Math.atan2(s.y-Y,s.x-z);let B=Math.atan2(l.y-Y,l.x-z)-G;g===1&&B<=0&&(B+=2*Math.PI),g===0&&B>=0&&(B-=2*Math.PI),a.transition().duration(n).ease(Qi).attrTween("d",()=>P=>{if(P>=.98)return i;const $=G+P*B,N=z+d*Math.cos($),L=Y+d*Math.sin($);return`M ${s.x} ${s.y} A ${d} ${d} 0 0 ${g} ${N} ${L}`})}else a.transition().duration(n).ease(Qi).attrTween("d",()=>{const s=De(r.fromX,r.toX),l=De(r.fromY,r.toY);return c=>`M ${r.fromX} ${r.fromY} L ${s(c)} ${l(c)}`})}else t.setAttribute("stroke-dasharray","1"),t.setAttribute("stroke-dashoffset","1"),ot(t).transition().duration(n).ease(Qi).attr("stroke-dashoffset","0").on("end",()=>{t.removeAttribute("stroke-dasharray"),t.removeAttribute("stroke-dashoffset")})}const zo=1;function Gw(t,n){return t.style!==n.style||t.departVertical!==n.departVertical?!1:Math.abs(t.fromX-n.fromX)<=zo&&Math.abs(t.fromY-n.fromY)<=zo&&Math.abs(t.toX-n.toX)<=zo&&Math.abs(t.toY-n.toY)<=zo}function qw(t,n,e){const r=El(t.parentElement);if(!r||Gw(n,r))return;const a=ot(t);if(n.style===xe.Elbow&&r.style===xe.Elbow){const i={tipX:n.toX,tipY:n.toY,calloutX:n.fromX,calloutY:n.fromY},o={tipX:r.toX,tipY:r.toY,calloutX:r.fromX,calloutY:r.fromY};a.attr("d",Fl(i.calloutX,i.calloutY,i.tipX,i.tipY)),a.transition().duration(e).ease(to).attrTween("d",()=>{const s=Ia(i,o);return l=>{const c=s(l);return Fl(c.calloutX,c.calloutY,c.tipX,c.tipY)}})}else{const i={x:n.fromX,y:n.fromY},o={x:n.toX,y:n.toY},s={x:r.fromX,y:r.fromY},l={x:r.toX,y:r.toY},c=t.getAttribute("d"),f=`M ${i.x} ${i.y} L ${o.x} ${o.y}`;a.attr("d",f),a.transition().duration(e).ease(to).attrTween("d",()=>{const h=Ia(i,s),d=Ia(o,l);return g=>{if(g>=.98)return c;const v=h(g),m=d(g);if(r.style===xe.Direct||n.style===xe.Direct)return`M ${v.x} ${v.y} L ${m.x} ${m.y}`;const b=m.x-v.x,x=m.y-v.y,w=Math.sqrt(b*b+x*x)*.8,S=r.style===xe.CurveRight?1:0;return`M ${v.x} ${v.y} A ${w} ${w} 0 0 ${S} ${m.x} ${m.y}`}})}}function Bh(t,n,e,r){if(r<=0)return;const a=[...t.querySelectorAll("g[data-annotation-id]"),...n.querySelectorAll("g[data-annotation-id]")],i=new Set;for(const o of a){const s=o.getAttribute("data-annotation-id");i.add(s);const l=e.get(s);if(l){const c=o.querySelector(".bc-annotation-line");c&&l.line&&qw(c,l.line,r);try{const f=o.getBBox(),h=l.rect.x-f.x,d=l.rect.y-f.y;if(Math.abs(h)>.5||Math.abs(d)>.5){const g=o.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");for(const v of g){const m=v;m.style.transition="none",m.setAttribute("transform",`translate(${h}, ${d})`),m.getBoundingClientRect(),m.style.transition=`transform ${r}ms ease`,m.setAttribute("transform","translate(0, 0)")}}}catch{}}else{const c=o.querySelector(".bc-annotation-line");c&&Ww(c,r);const f=o.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");for(const h of f){const d=h;d.style.opacity="0",d.getBoundingClientRect(),d.style.transition=`opacity ${r}ms ease`,d.style.opacity="1"}}}for(const[o,s]of e)if(!i.has(o)){const l=s.element.cloneNode(!0);t.appendChild(l),l.style.opacity="1",l.getBoundingClientRect(),l.style.transition=`opacity ${r}ms ease`,l.style.opacity="0",setTimeout(()=>l.remove(),r)}}function Vh(t){if(!t)return;const n=parseFloat(t.getAttribute("width")||"0"),e=parseFloat(t.getAttribute("height")||"0");if(!n||!e)return;const r=t.getBBox();if(r.width===0&&r.height===0)return;const a=8,i=r.x,o=r.y,s=r.x+r.width,l=r.y+r.height,c=i<0?i-a:0,f=o<0?o-a:0,h=s>n?s+a:n,d=l>e?l+a:e;(c<0||f<0||h>n||d>e)&&ot(t).attr("viewBox",`${c} ${f} ${h-c} ${d-f}`).attr("preserveAspectRatio","xMidYMid meet")}function Ro(t,n,e){const r=t.ownerSVGElement??t;ot(r).style("overflow","visible"),Pl(r);const a=ot(t);let i;if(e.transition)if(e.priorAnnotations&&e.priorAnnotations.size>0)i=e.priorAnnotations;else{const l=t.querySelector(".bc-annotations"),c=t.querySelector(".bc-annotations-range");if(l||c){if(i=new Map,l)for(const[f,h]of Xe(l))i.set(f,h);if(c)for(const[f,h]of Xe(c))i.set(f,h)}}t.querySelectorAll(".bc-annotations, .bc-annotations-range").forEach(l=>l.remove());const o=a.insert("g",":first-child").attr("class","bc-annotations-range"),s=a.append("g").attr("class","bc-annotations").attr("data-ctx-width",String(e.width)).attr("data-ctx-height",String(e.height));for(let l=0;l<n.length;l++){const c=n[l];switch(c.kind??we.Point){case we.Point:Yh(s,c,e,l);break;case we.Range:Ih(o,c,e,l,s);break;case we.Free:Hh(s,c,e,l);break}}if(e.transition){const l=Fr(ma);Bh(s.node(),o.node(),i??new Map,l)}Vh(r)}function wa(t,n){return{name:"annotations",install(){},postDraw(e){var d;const r=e.base,a=((d=r.node())==null?void 0:d.ownerSVGElement)??r.node();a&&ot(a).style("overflow","visible"),Pl(a);const i=r.node(),o=i==null?void 0:i.parentNode,s=o&&o!==a?ot(o):r,l=s.node();let c;if(n.transition){if(n.priorAnnotations&&n.priorAnnotations.size>0)c=n.priorAnnotations;else if(l){const g=l.querySelector(".bc-annotations"),v=l.querySelector(".bc-annotations-range");if(g||v){if(c=new Map,g)for(const[m,b]of Xe(g))c.set(m,b);if(v)for(const[m,b]of Xe(v))c.set(m,b)}}}l&&l.querySelectorAll(".bc-annotations, .bc-annotations-range").forEach(g=>g.remove());const f=s.insert("g",":first-child").attr("class","bc-annotations-range"),h=s.append("g").attr("class","bc-annotations").attr("data-ctx-width",String(n.width)).attr("data-ctx-height",String(n.height));for(let g=0;g<t.length;g++){const v=t[g];switch(v.kind??we.Point){case we.Point:Yh(h,v,n,g);break;case we.Range:Ih(f,v,n,g,h);break;case we.Free:Hh(h,v,n,g);break}}if(n.transition){const g=Fr(ma);Bh(h.node(),f.node(),c??new Map,g)}Vh(a)}}}function Vn(t){return new Map((t??[]).map(n=>[n.target,n.color]))}const Wh=new WeakMap;function mn(t){return Wh.get(t)}function bn(t,n){Wh.set(t,n)}let Xw=0;const Gh=new WeakMap;function Nn(t,n,e,r){let a=Gh.get(n);a||(a=new Map,Gh.set(n,a));let i=a.get(e);i||(i=`bc-clip-${++Xw}`,a.set(e,i));const o=ot(t).select("defs").empty()?ot(t).append("defs"):ot(t).select("defs"),s=o.select(`#${i}`);return s.empty()?o.append("clipPath").attr("id",i).append("rect").attr("x",r.x).attr("y",r.y).attr("width",r.width).attr("height",r.height):s.select("rect").attr("x",r.x).attr("y",r.y).attr("width",r.width).attr("height",r.height),i}class Uw extends zr{initialize(){}}function Hr(t){return new Uw(t)}const Fo="bc-scene",Zw=500,qh=new Set,Yl=new WeakMap;function me(t){let n=Yl.get(t);return n||(n=new Kw(t),Yl.set(t,n)),n}function jw(t){Yl.delete(t)}class Kw{constructor(n){oe(this,"container");oe(this,"_state","idle");oe(this,"_transition",null);oe(this,"_buffer",[]);this.container=n}register(n){this._buffer.push(n)}get state(){return this._state}get activeTransition(){return this._transition}beginCommit(){(this._state==="committing"||this._state==="animating")&&this.interrupt(),this._state="committing"}commit(n={}){if(this._state!=="committing"){console.warn(`[blueprint-chart] commit() called from state '${this._state}' — call beginCommit() first; ignored.`);return}const e=n.mode??"transform";if(e!=="transform"){qh.has(e)||(qh.add(e),console.warn(`[blueprint-chart] transition mode '${e}' is not yet implemented; falling back to snap.`));const s=this._buffer;this._buffer=[],this._state="animating";for(const l of s)try{l()}catch(c){console.warn("[blueprint-chart] feature flush failed:",c)}this._state="idle";return}const r=n.duration??Zw,a=this.effectiveDuration(r),i=this._buffer;if(this._buffer=[],a<=0){this._state="animating";for(const s of i)try{s()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}this._state="idle";return}this._state="animating";const o=eu(Fo).duration(a).ease(to);this._transition=o;for(const s of i)try{s()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}o.on("end",()=>{this._transition===o&&(this._transition=null,this._state="idle")}),o.on("interrupt",()=>{this._transition===o&&(this._transition=null,this._state="idle")})}effectiveDuration(n){return n<=0?0:typeof window>"u"||typeof window.matchMedia!="function"?n:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:n}interrupt(){this._buffer=[],this._transition=null,ot(this.container).interrupt(Fo),ot(this.container).selectAll("*").interrupt(Fo),this._state="idle"}run(n,e={}){this.beginCommit();try{n()}catch(r){console.warn("[blueprint-chart] scene-transition commit failed:",r),this._state="idle";return}this.commit(e)}destroy(){this.interrupt(),jw(this.container)}}function Jw(t,n){const e=new Map;return t.querySelectorAll(`[data-bc-role="${n}"]`).forEach(a=>{const i=a.getAttribute("data-bc-key");i!=null&&e.set(i,a)}),e}function Qw(t,n){return t.tagName===n.tagName}function Xh(t,n){ot(t).interrupt(Fo);const e={};for(const r of n){const a=t.getAttribute(r);a!==null&&(e[r]=a)}return e}function Uh(t,n){const e=Zh(t),r=Zh(n);if(e.skeleton!==r.skeleton||e.nums.length!==r.nums.length)return s=>s<.5?t:n;const{skeleton:a,nums:i}=e,{nums:o}=r;return s=>{if(s<=0)return t;if(s>=1)return n;let l=0;return a.replace(/#/g,()=>{const c=i[l]+(o[l]-i[l])*s;return l++,tA(c)})}}function Zh(t){const n=[];return{skeleton:t.replace(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,r=>(n.push(parseFloat(r)),"#")),nums:n}}function tA(t){const n=Math.round(t*1e3)/1e3;return Object.is(n,-0)?"0":String(n)}const eA={opacity:0},nA=new Set(["d","transform"]),rA=new Set(["stroke-dasharray"]);function ge(t,n){if(t.state==="idle"||t.state==="animating"){aA(n);return}t.register(()=>iA(t,n))}function aA(t){const e=ot(t.parent).selectAll(t.selector).data(t.data,i=>t.key(i));e.exit().remove();const r=t.insert(e.enter());jh(r,t),r.merge(e).each(function(i){ri(this,t.attrs(i))})}function iA(t,n){const e=t.activeTransition,a=ot(n.parent).selectAll(n.selector).data(n.data,c=>n.key(c)),i=oA(n),o=a.exit();e?o.each(function(){const c=this,f=ot(c).datum(),h=n.exitTo?n.exitTo(f):eA;Yo(c,h,e).on("end.featureJoin-exit",()=>{var d;return(d=c.parentNode)==null?void 0:d.removeChild(c)})}):o.remove();const s=Jw(t.container,n.role),l=n.insert(a.enter());jh(l,n),l.each(function(c){const f=this,h=n.attrs(c);if(e){const d=s.get(Kh(n.key(c)));if(d&&Qw(d,f)){const v=Xh(d,i);ri(f,v),Yo(f,h,e);return}const g=n.enterFrom?n.enterFrom(c):h;ri(f,g),Yo(f,h,e)}else ri(f,h)}),a.each(function(c){const f=this,h=n.attrs(c);e?(Xh(f,i),Yo(f,h,e)):ri(f,h)})}function jh(t,n){t.attr("data-bc-role",n.role),t.attr("data-bc-key",e=>Kh(n.key(e)))}function Kh(t){return t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"␟")}function oA(t){return t.data.length===0?[]:Object.keys(t.attrs(t.data[0]))}function ri(t,n){for(const[e,r]of Object.entries(n))t.setAttribute(e,String(r))}function Yo(t,n,e){const r=ot(t).transition(e);for(const[a,i]of Object.entries(n))if(nA.has(a)){const o=String(i);r.attrTween(a,function(){const s=this.getAttribute(a)??o;return Uh(s,o)})}else rA.has(a)?t.setAttribute(a,String(i)):r.attr(a,String(i));return r}function En(t,n){if(!n.active||!n.from)return;const e=n.svg.querySelector(`#${n.clipId} rect`);sA(t,{group:n.group,clipRect:e,from:n.from,to:n.to})}function sA(t,n){const{group:e,clipRect:r,from:a,to:i}=n,o=`translate(${i.left},${i.top})`,s=`translate(${a.left},${a.top})`;t.register(()=>{const l=t.activeTransition;if(!l){e.setAttribute("transform",o),r&&(r.setAttribute("width",String(i.width)),r.setAttribute("height",String(i.height)));return}e.setAttribute("transform",s),ot(e).transition(l).attrTween("transform",function(){const c=this.getAttribute("transform")??s;return Uh(c,o)}),r&&(r.setAttribute("width",String(a.width)),r.setAttribute("height",String(a.height)),ot(r).transition(l).attr("width",i.width).attr("height",i.height))})}const lA=.35;function Aa(t){return new Set((t??[]).map(n=>n.target))}function Ue(t,n,e=1){return t.size===0||t.has(n)?e:lA}const cA=11,fA=6.2,Jh=cA,uA=8,hA=4,dA=14;function gA(t){return t.length*fA}function Br(t){const n=gA(t.text);return t.placement==="inside"?t.orientation==="horizontal"?n<=t.barWidth-uA&&Jh<=t.barHeight:Jh<=t.barHeight-hA&&n<=t.barWidth:(t.orientation==="vertical"?t.barWidth:t.barHeight)>=dA}const _a=["#4e79a7"],Qh=13;function td(t,n,e={},r=!1){var X,O,ht,mt,vt,Tt,Ht,Ft,Yt,Ut,Gt,dt,$t,U;pn(r);let a=null,i,o,s,l=[];const c=an.for(t);if(r){const T=mn(t);o=T==null?void 0:T.margin,s=T==null?void 0:T.plotRect,c.detach(),(T==null?void 0:T.chartType)==="bar-vertical"?l=Array.from(t.querySelectorAll(".bc-frame .bc-bar")):T&&(a=nn(t)),i=new Map;for(const F of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[E,at]of Xe(F))i.set(E,at);t.replaceChildren()}const{body:f}=dn(t,e.frame),h=qe(f).width,d=e.categoryLabelLine===!0,g=Rr(n.values,(X=e.verticalAxis)==null?void 0:X.range,(O=e.verticalAxis)==null?void 0:O.numberFormat,(ht=e.verticalAxis)==null?void 0:ht.scaleType),v=d?Jt.Off:(mt=e.horizontalAxis)==null?void 0:mt.labelPosition,m=Cn(h,(vt=e.verticalAxis)==null?void 0:vt.labelPosition,v,(Tt=e.verticalAxis)==null?void 0:Tt.direction,g);if(!d){const T=Math.max(0,h-(m.left??50)-(m.right??20)),F=Ml(n.labels,T,e.horizontalAxis);F!==void 0&&(m.bottom=F)}const{chartArea:b,width:x,height:A,margin:w}=gn(f,m),z=A-(d?Qh:0),Y=Ln(o,w),G={left:w.left,top:w.top,width:x,height:z},_=bA(n,e),B=_.map(T=>({label:T,value:n.values[n.labels.indexOf(T)]})),P=e.swapLabelValue===!0,$=e.waterfall===!0,N=[];if($){let T=0;for(const F of B){const E=T;T+=F.value,N.push({label:F.label,value:F.value,y0:E,y1:T,isTotal:!1})}e.waterfallTotal&&N.push({label:"Total",value:T,y0:0,y1:T,isTotal:!0})}const L=$?N.map(T=>T.label):_,M=tn().domain(L).range([0,x]).padding(Sr(e.barGap)),D=((Ht=e.verticalAxis)==null?void 0:Ht.scaleType)==="log",q=$?N.flatMap(T=>[T.y0,T.y1]):B.map(T=>T.value);let[V,C]=oa(q,(Ft=e.verticalAxis)==null?void 0:Ft.range,(Yt=e.verticalAxis)==null?void 0:Yt.scaleType);if(e.valueLabels&&V<0&&((Gt=(Ut=e.verticalAxis)==null?void 0:Ut.range)==null?void 0:Gt.min)==null){const T=C-V;V-=T*.1}const I=D?cr().domain([V,C]).nice().range([z,0]):Pe().domain([V,C]).nice().range([z,0]);c.attach(b,Y);const W=P&&e.valueLabels&&!$?(()=>{const T=new Map(B.map(F=>[F.label,F.value]));return{...e.horizontalAxis,width:x,tickFormat:F=>String(T.get(F)??F)}})():{...e.horizontalAxis,width:x},it=d?{...W,labelPosition:Jt.Off}:W;c.update({vertical:{scale:I,height:A,options:{...e.verticalAxis,gridWidth:x,topPadding:w.top}},horizontal:{scale:M,height:A,options:it}}),!D&&V<0&&C>0&&ot(b).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",x).attr("y1",I(0)).attr("y2",I(0)).attr("stroke","#666").attr("stroke-width",1);const rt=Vn(e.colorizes),ct=new Set((e.highlights??[]).map(T=>T.target)),pt=b.ownerSVGElement,xt=Nn(pt,t,"bars",{x:0,y:0,width:x,height:z}),yt=ot(pt).select("defs"),bt=xt.replace(/^bc-clip-/,""),kt=ot(b).append("g").attr("clip-path",`url(#${xt})`);if(e.barBackground){const T=(e.colors??_a)[0],F=$?L:B.map(E=>E.label);kt.selectAll(".bc-bar-bg").data(F,E=>E).enter().append("rect").attr("class","bc-bar-bg").attr("x",E=>M(E)??0).attr("y",0).attr("width",M.bandwidth()).attr("height",z).attr("fill",T).attr("opacity",.18)}const j=$?L:B.map(T=>T.label);if(e.barSeparators&&j.length>1){const T=M.step();for(let F=1;F<j.length;F++){const E=(M(j[F-1])??0)+M.bandwidth()+(T-M.bandwidth())/2;kt.append("line").attr("class","bc-bar-separator").attr("x1",E).attr("x2",E).attr("y1",0).attr("y2",z).attr("stroke","currentColor").attr("opacity",.15)}}if(!$&&e.connectedColumns&&B.length>1){const T=e.colors??_a,F=e.connectionsOpacity??.15;for(let E=0;E<B.length-1;E++){const at=B[E],wt=B[E+1];if(at.value==null||wt.value==null||Number.isNaN(at.value)||Number.isNaN(wt.value)||at.value===0||wt.value===0)continue;const Ct=(M(at.label)??0)+M.bandwidth(),st=M(wt.label)??0,Et=Math.min(I(0),I(at.value)),Nt=Math.min(I(0),I(wt.value)),tt=I(0),St=rt.get(at.label)??T[0],Dt=rt.get(wt.label)??T[0];let Pt;if(St===Dt)Pt=St;else{const Zt=`bc-conn-grad-${bt}-${E}`,ae=yt.append("linearGradient").attr("id",Zt).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");ae.append("stop").attr("offset","0%").attr("stop-color",St),ae.append("stop").attr("offset","100%").attr("stop-color",Dt),Pt=`url(#${Zt})`}kt.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ct},${Et} ${st},${Nt} ${st},${tt} ${Ct},${tt}`).attr("fill",Pt).attr("opacity",F).attr("pointer-events","none")}}const J=ot(b).append("g");if($){const T=e.colors??_a,F="#333";if(e.connectedColumns&&N.length>1){const E=e.colors??_a,at=e.connectionsOpacity??.15;for(let wt=0;wt<N.length-1;wt++){const Ct=N[wt],st=N[wt+1];if(st.isTotal||Ct.value==null||st.value==null||Number.isNaN(Ct.value)||Number.isNaN(st.value)||Ct.value===0||st.value===0)continue;const Et=(M(Ct.label)??0)+M.bandwidth(),Nt=M(st.label)??0,tt=I(Ct.y1),St=I(st.y1),Dt=I(Ct.y0),Pt=I(st.y0),Zt=rt.get(Ct.label)??E[0],ae=rt.get(st.label)??E[0];let $e;if(Zt===ae)$e=Zt;else{const Ze=`bc-conn-grad-${bt}-${wt}`,Le=yt.append("linearGradient").attr("id",Ze).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");Le.append("stop").attr("offset","0%").attr("stop-color",Zt),Le.append("stop").attr("offset","100%").attr("stop-color",ae),$e=`url(#${Ze})`}kt.append("polygon").attr("class","bc-bar-connection").attr("points",`${Et},${tt} ${Nt},${St} ${Nt},${Pt} ${Et},${Dt}`).attr("fill",$e).attr("opacity",at).attr("pointer-events","none")}}for(let E=0;E<N.length-1;E++){const at=N[E],wt=N[E+1];if(wt.isTotal)break;kt.append("line").attr("class","bc-waterfall-connector").attr("x1",(M(at.label)??0)+M.bandwidth()).attr("x2",M(wt.label)??0).attr("y1",I(at.y1)).attr("y2",I(at.y1)).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(kt.selectAll(".bc-bar").data(N,E=>E.label).enter().append("rect").attr("class","bc-bar").attr("x",E=>M(E.label)??0).attr("y",E=>Math.min(I(E.y0),I(E.y1))).attr("width",M.bandwidth()).attr("height",E=>Math.abs(I(E.y0)-I(E.y1))).attr("fill",E=>E.isTotal?F:rt.get(E.label)??T[0]).attr("opacity",E=>ct.size>0?Ue(ct,E.label):null),e.valueLabels){const E=e.valueLabelPosition??It.Auto,at=hr(((dt=e.verticalAxis)==null?void 0:dt.numberFormat)??""),wt=Ct=>at?at(Ct):String(Ct);J.selectAll(".bc-value-label").data(N,Ct=>Ct.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("x",Ct=>(M(Ct.label)??0)+M.bandwidth()/2).attr("y",Ct=>{const st=Math.min(I(Ct.y0),I(Ct.y1)),Et=Math.abs(I(Ct.y0)-I(Ct.y1));return E===It.Inside?st+Et/2:st-4}).attr("text-anchor","middle").attr("dominant-baseline",E===It.Inside?"central":"auto").attr("fill",Ct=>E===It.Inside?hn(Ct.isTotal?F:rt.get(Ct.label)??T[0]):"currentColor").text(Ct=>P?Ct.label:wt(Ct.isTotal?Ct.y1:Ct.value))}}else{const T=me(t),F=kt.append("g").node();if(r)for(const wt of l)F.appendChild(wt);ge(T,{role:"mark-per-category",parent:F,selector:".bc-bar",data:B,key:wt=>wt.label,insert:wt=>wt.append("rect").attr("class","bc-bar"),attrs:wt=>({x:M(wt.label)??0,y:Math.min(I(0),I(wt.value)),width:M.bandwidth(),height:Math.abs(I(wt.value)-I(0)),fill:rt.get(wt.label)??(e.colors??_a)[0],opacity:Ue(ct,wt.label)})}),En(T,{svg:pt,clipId:xt,group:b,from:s,to:G,active:r&&l.length>0});const E=Hr(kt);e.tooltips&&E.use(pr({numberFormat:($t=e.verticalAxis)==null?void 0:$t.numberFormat})),e.crosshair&&E.use(Ir({width:x,height:z,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor})),(U=e.annotations)!=null&&U.length&&E.use(wa(e.annotations,{scaleX:M,scaleY:I,data:B,width:x,height:z,backgroundColor:Be(t),transition:r,priorAnnotations:i}));const at=()=>E.draw(B);T.state==="committing"?T.register(at):at(),e.valueLabels&&mA(J,B,M,I,{position:e.valueLabelPosition,colorOverrides:rt,colors:e.colors??_a,swapLabelValue:P,percent:e.valueLabels==="percent",total:hf(B,wt=>wt.value)})}if(d){const T=ot(b).append("g").attr("class","bc-category-labels");for(const F of L)T.append("text").attr("class","bc-category-label").attr("x",(M(F)??0)+M.bandwidth()/2).attr("y",z+Qh/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(F)}bn(t,{chartType:"bar-vertical",margin:w,plotRect:G}),a&&(en(kt.node()),rn(t,a))}function pA(t,n,e,r){const a=Math.abs(e(t.value)-e(0)),i=r===It.Inside,o=(n(t.label)??0)+n.bandwidth()/2,s="middle";let l,c;return t.value<0?i?(l=e(t.value)-a/2,c="central"):(l=e(t.value)+4,c="hanging"):i?(l=e(t.value)+a/2,c="central"):(l=e(t.value)-4,c="auto"),{tx:o,ty:l,anchor:s,baseline:c,isInside:i}}function mA(t,n,e,r,a){const i=a.position??It.Auto,o=d=>a.swapLabelValue?d.label:a.percent&&a.total!==void 0?xo(d.value,a.total):String(d.value);let s=t.select(".bc-value-label-group");s.empty()&&(s=t.append("g").attr("class","bc-value-label-group"));const l=t.node().ownerSVGElement,c=l==null?void 0:l.parentElement,f=me(c),h=n.filter(d=>Br({text:o(d),placement:i===It.Inside?"inside":"outside",orientation:"vertical",barWidth:e.bandwidth(),barHeight:Math.abs(r(d.value)-r(0))}));ge(f,{role:"value-label",parent:s.node(),selector:".bc-value-label",data:h,key:d=>d.label,insert:d=>d.append("text").attr("class","bc-value-label").attr("font-size","11px"),attrs:d=>{const g=pA(d,e,r,i);return{x:g.tx,y:g.ty,"text-anchor":g.anchor,"dominant-baseline":g.baseline,fill:g.isInside?hn(a.colorOverrides.get(d.label)??a.colors[0]):"currentColor"}}}),s.selectAll(".bc-value-label").data(h,d=>d.label).text(o)}function bA(t,n){const e=t.labels.map((r,a)=>({label:r,value:t.values[a]}));return n.sort===pe.Ascending?e.sort((r,a)=>r.value-a.value):n.sort===pe.Descending&&e.sort((r,a)=>a.value-r.value),e.map(r=>r.label)}const ka=["#4e79a7"],ed=13,yA="11px sans-serif",Il=4;function Hl(t){try{const e=document.createElement("canvas").getContext("2d");if(e)return e.font=yA,Math.ceil(e.measureText(t).width)}catch{}return t.length*6.5}function nd(t,n,e={},r=!1){var X,O,ht,mt,vt,Tt,Ht,Ft,Yt,Ut,Gt;pn(r);let a=null,i,o,s=[],l;const c=an.for(t);if(r){const dt=mn(t);o=dt==null?void 0:dt.margin,l=dt==null?void 0:dt.plotRect,c.detach(),(dt==null?void 0:dt.chartType)==="bar-horizontal"?s=Array.from(t.querySelectorAll(".bc-frame .bc-bar")):dt&&(a=nn(t)),i=new Map;for(const $t of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[U,T]of Xe($t))i.set(U,T);t.replaceChildren()}const{body:f}=dn(t,e.frame),h=qe(f).width,d=h>0&&h<400&&((X=e.verticalAxis)==null?void 0:X.labelPosition)!=="outside",g=e.categoryLabelLine===!0||d,v=_o(n.labels),m=g?Jt.Off:(O=e.verticalAxis)==null?void 0:O.labelPosition,b=Cn(h,m,(ht=e.horizontalAxis)==null?void 0:ht.labelPosition,(mt=e.verticalAxis)==null?void 0:mt.direction,v,(vt=e.horizontalAxis)==null?void 0:vt.showAxis),x=e.valueLabelPosition??It.Auto,A=e.swapLabelValue===!0;if(e.valueLabels&&x!==It.Inside)if(A){const dt=n.labels.reduce((U,T)=>U.length>T.length?U:T,""),$t=Hl(dt)+Il;b.right=Math.max(b.right??15,$t)}else{const dt=Math.max(...n.values),$t=Math.min(...n.values),U=dt>0?Hl(String(dt))+Il:0,T=$t<0?Hl(String($t))+Il:0;b.right=Math.max(b.right??15,U),T>0&&(b.left=(b.left??50)+T)}const{chartArea:w,width:S,height:z,margin:Y}=gn(f,b),G={left:Y.left,top:Y.top,width:S,height:z},_=g?ed:0,B=Ln(o,Y),P=wA(n,e),$=P.map(dt=>({label:dt,value:n.values[n.labels.indexOf(dt)]})),N=e.waterfall===!0,L=[];if(N){let dt=0;for(const $t of $){const U=dt;dt+=$t.value,L.push({label:$t.label,value:$t.value,x0:U,x1:dt,isTotal:!1})}e.waterfallTotal&&L.push({label:"Total",value:dt,x0:0,x1:dt,isTotal:!0})}const M=((Tt=e.horizontalAxis)==null?void 0:Tt.scaleType)==="log",D=N?L.flatMap(dt=>[dt.x0,dt.x1]):$.map(dt=>dt.value),[q,V]=oa(D,(Ht=e.horizontalAxis)==null?void 0:Ht.range,(Ft=e.horizontalAxis)==null?void 0:Ft.scaleType),C=M?cr().domain([q,V]).nice().range([0,S]):Pe().domain([q,V]).nice().range([0,S]),I=N?L.map(dt=>dt.label):P,W=tn().domain(I).range([0,z]).padding(Sr(e.barGap)),it=A&&e.valueLabels&&!N?(()=>{const dt=new Map($.map($t=>[$t.label,$t.value]));return{...e.verticalAxis,topPadding:Y.top,tickFormat:$t=>String(dt.get($t)??$t)}})():{...e.verticalAxis,topPadding:Y.top},rt=g?{...it,labelPosition:Jt.Off,...d?{showAxis:!1}:{}}:it;c.attach(w,B),c.update({horizontal:{scale:C,height:z,options:{...e.horizontalAxis,width:S}},vertical:{scale:W,height:z,options:rt},order:"horizontal-first"}),!M&&q<0&&V>0&&ot(w).append("line").attr("class","bc-zero-baseline").attr("x1",C(0)).attr("x2",C(0)).attr("y1",0).attr("y2",z).attr("stroke","#666").attr("stroke-width",1);const ct=Vn(e.colorizes),pt=new Set((e.highlights??[]).map(dt=>dt.target)),xt=w.ownerSVGElement,yt=Nn(xt,t,"bars",{x:0,y:0,width:S,height:z}),bt=ot(xt).select("defs"),kt=yt.replace(/^bc-clip-/,""),j=ot(w).append("g").attr("clip-path",`url(#${yt})`);if(e.barBackground){const dt=(e.colors??ka)[0],$t=N?I:$.map(U=>U.label);j.selectAll(".bc-bar-bg").data($t,U=>U).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",U=>(W(U)??0)+_).attr("width",S).attr("height",W.bandwidth()-_).attr("fill",dt).attr("opacity",.18)}const J=N?I:$.map(dt=>dt.label);if(e.barSeparators&&J.length>1){const dt=W.step();for(let $t=1;$t<J.length;$t++){const U=(W(J[$t-1])??0)+W.bandwidth()+(dt-W.bandwidth())/2;j.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",S).attr("y1",U).attr("y2",U).attr("stroke","currentColor").attr("opacity",.15)}}if(!N&&e.connectedColumns&&$.length>1){const dt=e.colors??ka,$t=e.connectionsOpacity??.15;for(let U=0;U<$.length-1;U++){const T=$[U],F=$[U+1];if(T.value==null||F.value==null||Number.isNaN(T.value)||Number.isNaN(F.value)||T.value===0||F.value===0)continue;const E=(W(T.label)??0)+W.bandwidth(),at=(W(F.label)??0)+_,wt=Math.max(C(0),C(T.value)),Ct=Math.max(C(0),C(F.value)),st=C(0),Et=ct.get(T.label)??dt[0],Nt=ct.get(F.label)??dt[0];let tt;if(Et===Nt)tt=Et;else{const St=`bc-conn-grad-${kt}-${U}`,Dt=bt.append("linearGradient").attr("id",St).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");Dt.append("stop").attr("offset","0%").attr("stop-color",Et),Dt.append("stop").attr("offset","100%").attr("stop-color",Nt),tt=`url(#${St})`}j.append("polygon").attr("class","bc-bar-connection").attr("points",`${wt},${E} ${Ct},${at} ${st},${at} ${st},${E}`).attr("fill",tt).attr("opacity",$t).attr("pointer-events","none")}}if(N){const dt=e.colors??ka,$t="#333";if(e.connectedColumns&&L.length>1){const U=e.colors??ka,T=e.connectionsOpacity??.15;for(let F=0;F<L.length-1;F++){const E=L[F],at=L[F+1];if(at.isTotal||E.value==null||at.value==null||Number.isNaN(E.value)||Number.isNaN(at.value)||E.value===0||at.value===0)continue;const wt=(W(E.label)??0)+W.bandwidth(),Ct=(W(at.label)??0)+_,st=C(E.x1),Et=C(at.x1),Nt=C(E.x0),tt=C(at.x0),St=ct.get(E.label)??U[0],Dt=ct.get(at.label)??U[0];let Pt;if(St===Dt)Pt=St;else{const Zt=`bc-conn-grad-${kt}-${F}`,ae=bt.append("linearGradient").attr("id",Zt).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");ae.append("stop").attr("offset","0%").attr("stop-color",St),ae.append("stop").attr("offset","100%").attr("stop-color",Dt),Pt=`url(#${Zt})`}j.append("polygon").attr("class","bc-bar-connection").attr("points",`${st},${wt} ${Et},${Ct} ${tt},${Ct} ${Nt},${wt}`).attr("fill",Pt).attr("opacity",T).attr("pointer-events","none")}}for(let U=0;U<L.length-1;U++){const T=L[U],F=L[U+1];if(F.isTotal)break;j.append("line").attr("class","bc-waterfall-connector").attr("x1",C(T.x1)).attr("x2",C(T.x1)).attr("y1",(W(T.label)??0)+W.bandwidth()).attr("y2",(W(F.label)??0)+_).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(j.selectAll(".bc-bar").data(L,U=>U.label).enter().append("rect").attr("class","bc-bar").attr("x",U=>Math.min(C(U.x0),C(U.x1))).attr("y",U=>(W(U.label)??0)+_).attr("width",U=>Math.abs(C(U.x1)-C(U.x0))).attr("height",W.bandwidth()-_).attr("fill",U=>U.isTotal?$t:ct.get(U.label)??dt[0]).attr("opacity",U=>pt.size>0?Ue(pt,U.label):null),e.valueLabels){const U=x,T=hr(((Yt=e.horizontalAxis)==null?void 0:Yt.numberFormat)??""),F=at=>T?T(at):String(at);ot(w).append("g").selectAll(".bc-value-label").data(L,at=>at.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central").attr("y",at=>(W(at.label)??0)+_+(W.bandwidth()-_)/2).attr("x",at=>{const wt=Math.max(C(at.x0),C(at.x1));return U===It.Inside?wt-4:wt+4}).attr("text-anchor",U===It.Inside?"end":"start").attr("fill",at=>U===It.Inside?hn(at.isTotal?$t:ct.get(at.label)??dt[0]):"currentColor").text(at=>A?at.label:F(at.isTotal?at.x1:at.value))}}else{const dt=me(t),$t=j.append("g").node();if(r)for(const F of s)$t.appendChild(F);ge(dt,{role:"mark-per-category",parent:$t,selector:".bc-bar",data:$,key:F=>F.label,insert:F=>F.append("rect").attr("class","bc-bar"),attrs:F=>({x:Math.min(C(0),C(F.value)),y:(W(F.label)??0)+_,width:Math.abs(C(F.value)-C(0)),height:W.bandwidth()-_,fill:ct.get(F.label)??(e.colors??ka)[0],opacity:Ue(pt,F.label)})}),En(dt,{svg:xt,clipId:yt,group:w,from:l,to:G,active:r&&s.length>0});const U=Hr(j);e.tooltips&&U.use(pr({numberFormat:(Ut=e.horizontalAxis)==null?void 0:Ut.numberFormat})),e.crosshair&&U.use(Ir({width:S,height:z,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor,orientation:Ve.Horizontal})),(Gt=e.annotations)!=null&&Gt.length&&U.use(wa(e.annotations,{scaleX:W,scaleY:C,data:$,width:S,height:z,backgroundColor:Be(t),orientation:Ve.Horizontal,transition:r,priorAnnotations:i}));const T=()=>U.draw($);if(dt.state==="committing"?dt.register(T):T(),e.valueLabels){const F=ot(w).append("g");xA(F,$,C,W,{position:x,colorOverrides:ct,colors:e.colors??ka,swapLabelValue:A,categoryLabelOffset:_,percent:e.valueLabels==="percent",total:hf($,E=>E.value)})}}if(g){const dt=ot(w).append("g").attr("class","bc-category-labels");for(const $t of I){const U=W($t)??0;dt.append("text").attr("class","bc-category-label").attr("x",2).attr("y",U+ed/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text($t)}}bn(t,{chartType:"bar-horizontal",margin:Y,plotRect:G}),a&&(en(j.node()),rn(t,a))}function vA(t,n,e,r,a=0){const i=r===It.Inside,o=(e(t.label)??0)+a+(e.bandwidth()-a)/2;let s,l;if(t.value<0){const c=Math.min(n(0),n(t.value));i?(s=c+4,l="start"):(s=c-4,l="end")}else{const c=n(t.value);i?(s=c-4,l="end"):(s=c+4,l="start")}return{tx:s,ty:o,anchor:l,isInside:i}}function xA(t,n,e,r,a){const i=a.position??It.Auto,o=a.categoryLabelOffset??0,s=g=>a.swapLabelValue?g.label:a.percent&&a.total!==void 0?xo(g.value,a.total):String(g.value);let l=t.select(".bc-value-label-group");l.empty()&&(l=t.append("g").attr("class","bc-value-label-group"));const c=t.node().ownerSVGElement,f=c==null?void 0:c.parentElement,h=me(f),d=n.filter(g=>Br({text:s(g),placement:i===It.Inside?"inside":"outside",orientation:"horizontal",barWidth:Math.abs(e(g.value)-e(0)),barHeight:r.bandwidth()}));ge(h,{role:"value-label",parent:l.node(),selector:".bc-value-label",data:d,key:g=>g.label,insert:g=>g.append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central"),attrs:g=>{const v=vA(g,e,r,i,o);return{x:v.tx,y:v.ty,"text-anchor":v.anchor,fill:v.isInside?hn(a.colorOverrides.get(g.label)??a.colors[0]):"currentColor"}}}),l.selectAll(".bc-value-label").data(d,g=>g.label).text(s)}function wA(t,n){const e=t.labels.map((r,a)=>({label:r,value:t.values[a]}));return n.sort===pe.Ascending?e.sort((r,a)=>r.value-a.value):n.sort===pe.Descending&&e.sort((r,a)=>a.value-r.value),e.map(r=>r.label)}const rd=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],AA=200,ad=.2;class _A extends zr{initialize(){this.configDefine("colors",{defaultValue:rd}),this.configDefine("yOffset",{defaultValue:-10}),this.configDefine("layout",{defaultValue:"horizontal"}),this.configDefine("valueSuffixes",{defaultValue:[]}),this.configDefine("maxWidth",{defaultValue:0});const n=this.base.append("g").attr("class","bc-legend"),e=r=>{var d,g;const a=this.config("colors"),i=this.config("layout"),o=this.config("valueSuffixes"),s=((g=(d=this.base.node())==null?void 0:d.ownerSVGElement)==null?void 0:g.parentElement)??document.documentElement,l=getComputedStyle(s).getPropertyValue("--bc-text-color").trim()||"#555",c=this.config("maxWidth");let f=0,h=0;r.each(function(v,m){const b=ot(this),x=o[m],w=16+(x?v.length+1+x.length:v.length)*7+12;i==="horizontal"&&c>0&&f>0&&f+w>c&&(f=0,h+=20),b.attr("transform",`translate(${f},${h})`).attr("data-series",v).style("cursor","default");let S=b.select("rect");S.empty()&&(S=b.append("rect").attr("width",12).attr("height",12)),S.attr("fill",a[m%a.length]);let z=b.select("text");z.empty()&&(z=b.append("text").attr("x",16).attr("y",10).attr("font-size","12px")),z.attr("fill",l),z.selectAll("tspan").remove(),x?(z.text(null),z.append("tspan").attr("font-weight","bold").text(v),z.append("tspan").text(` ${x}`)):z.text(v),i==="vertical"?h+=20:f+=w})};this.layer("items",n,{dataBind:(r,a)=>r.selectAll(".bc-legend-item").data(a,i=>i),insert:r=>r.append("g").attr("class","bc-legend-item"),events:{enter:e,update:e}})}preDraw(){const n=this.config("yOffset");this.base.select(".bc-legend").attr("transform",`translate(0,${n})`)}}function kA(t){const n=ot(t).selectAll(".bc-legend-item");if(n.empty())return;let e=null,r=null;function a(o){r=o,n.each(function(){const l=ot(this),c=l.attr("data-series")===o;l.transition().duration(150).style("opacity",c?1:ad)}),ot(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).each(function(){const l=ot(this),c=l.attr("data-series")===o,f=this.classList.contains("bc-direct-label")||this.classList.contains("bc-value-label");l.transition().duration(150).style("opacity",c?1:f?0:ad)})}function i(){r=null,n.transition().duration(150).style("opacity",1),ot(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).transition().duration(150).style("opacity",null)}n.on("mouseenter.bcHighlight",null).on("mouseleave.bcHighlight",null).on("mouseenter.bcHighlight",function(){const o=ot(this).attr("data-series")??"";e&&clearTimeout(e),e=setTimeout(()=>a(o),Fr(AA))}).on("mouseleave.bcHighlight",()=>{e&&(clearTimeout(e),e=null),r!==null&&i()})}function br(t,n,e=rd,r=-10,a="top",i="start",o=0,s=0,l=0,c=[],f={}){const h=a==="left"||a==="right"?"vertical":"horizontal",d=new _A(ot(t));d.config({colors:e,yOffset:r,layout:h,valueSuffixes:c,maxWidth:o}),d.draw(n);const g=t.querySelector(".bc-legend");if(g){let v=0,m=0;const b=n.map((z,Y)=>{const G=c[Y];return G?z.length+1+G.length:z.length});if(h==="horizontal"){const z=b.map(B=>16+B*7+12);let Y=1,G=0,_=0;for(const B of z)o>0&&G>0&&G+B>o?(_=Math.max(_,G),Y++,G=B):G+=B;_=Math.max(_,G),v=_,m=Y*20}else v=Math.max(...b)*7+16+8,m=n.length*20;const x=f.left??0,A=f.right??0;let w=l,S=r;h==="horizontal"?i==="middle"?w+=-x+(o+x+A-v)/2:i==="end"?w+=o+A-v:w+=-x:i==="middle"?S+=(s-m)/2:i==="end"&&(S+=s-m),g.setAttribute("transform",`translate(${w},${S})`)}return kA(t),g}function yr(t,n,e){if(t.length===0)return{width:0,height:0};if(n==="left"||n==="right"){const f=Math.max(...t.map(d=>d.length))*7+16+8,h=t.length*20;return{width:f,height:h}}const a=20,i=t.map(c=>16+c.length*7+12);if(!e||e<=0)return{width:i.reduce((f,h)=>f+h,0),height:a};let o=1,s=0,l=0;for(const c of i)s>0&&s+c>e?(l=Math.max(l,s),o++,s=c):s+=c;return l=Math.max(l,s),{width:l,height:o*a}}function id(t){return t.length===0?0:Math.max(...t.map(e=>e.length))*7+10}function tr(t,n){return n==null?void 0:n.find(e=>e.name===t)}function re(t,n,e,r){const a=tr(t,r);return(a==null?void 0:a.color)??e[n%e.length]}function SA(t,n){const e=tr(t,n);return(e==null?void 0:e.dash)??"solid"}function MA(t,n){const e=tr(t,n);return(e==null?void 0:e.lineWidth)??2}function od(t,n,e){const r=tr(t,e);return!(r!=null&&r.interpolation)||r.interpolation==="global"?n:r.interpolation}function Vr(t,n){const e=tr(t,n);return(e==null?void 0:e.hidden)??!1}function vr(t,n,e){const r=tr(t,e);return!(r!=null&&r.labelMode)||r.labelMode==="global"?n:r.labelMode}function Sa(t,n,e){const r=tr(t,e);return(r==null?void 0:r.valueLabels)!==void 0?r.valueLabels:n}function ai(t,n){const e=tr(t,n);return(e==null?void 0:e.opacity)??1}function $A(t,n,e){const r=tr(t,e);if((r==null?void 0:r.lineSymbols)!==!1&&((r==null?void 0:r.lineSymbols)===!0||n))return{name:t,symbolShape:(r==null?void 0:r.symbolShape)??(n==null?void 0:n.symbolShape),symbolShowOn:(r==null?void 0:r.symbolShowOn)??(n==null?void 0:n.symbolShowOn),symbolStyle:(r==null?void 0:r.symbolStyle)??(n==null?void 0:n.symbolStyle),symbolSize:(r==null?void 0:r.symbolSize)??(n==null?void 0:n.symbolSize),symbolOpacity:(r==null?void 0:r.symbolOpacity)??(n==null?void 0:n.symbolOpacity),lineSymbols:!0}}const LA=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];function CA(t,n,e={},r=!1){var tt,St,Dt,Pt,Zt,ae,$e,Ze,Le,yn,fe,ie,sn;pn(r);let a=null,i,o,s=[],l;const c=an.for(t);if(r){const ft=mn(t);o=ft==null?void 0:ft.margin,l=ft==null?void 0:ft.plotRect,c.detach(),(ft==null?void 0:ft.chartType)==="bar-multi"?s=Array.from(t.querySelectorAll(".bc-frame .bc-bar-multi")):ft&&(a=nn(t)),i=new Map;for(const et of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[gt,Lt]of Xe(et))i.set(gt,Lt);t.replaceChildren()}const{body:f}=dn(t,e.frame),h=n.series??[],d=h.filter(ft=>!Vr(ft.name,e.seriesOverrides)),g=d.map(ft=>ft.name),v=e.colors??LA,m=e.seriesOverrides,b=e.directLabelling===!0||e.directLabelling==="auto"&&e.legend!==!0||!!e.directLabelling&&e.directLabelling!=="auto",x=b?"direct":e.legend!==!1?"legend":"none",A=e.legend!==!1&&!b,w=qe(f).width,S=350,z=e.legendPosition??"top",Y=w>0&&w<S&&(z==="left"||z==="right")?"top":z,G=e.legendAnchor??"start",_=d.flatMap(ft=>ft.values),B=Rr(_,(tt=e.verticalAxis)==null?void 0:tt.range,(St=e.verticalAxis)==null?void 0:St.numberFormat,(Dt=e.verticalAxis)==null?void 0:Dt.scaleType),P=Cn(w,(Pt=e.verticalAxis)==null?void 0:Pt.labelPosition,(Zt=e.horizontalAxis)==null?void 0:Zt.labelPosition,(ae=e.verticalAxis)==null?void 0:ae.direction,B),$=Math.max(0,w-(P.left??50)-(P.right??20)),N=Ml(n.labels,$,e.horizontalAxis);N!==void 0&&(P.bottom=N);const L=P.top!=null,M=Math.max(0,w-(P.left??50)-(P.right??20)),D=A?yr(g,Y,M):{width:0,height:0},q=A?D.height+15:0,V={...P};if(A&&Y==="top"){const ft=L?15:0;V.top=q+ft}A&&Y==="bottom"&&(V.bottom=(V.bottom??24)+q),A&&Y==="left"&&(V.left=(V.left??50)+D.width+10),A&&Y==="right"&&(V.right=(V.right??20)+D.width+10);const{chartArea:C,width:I,height:W,margin:it}=gn(f,V),rt=Ln(o,it);let[ct,pt]=oa(_,($e=e.verticalAxis)==null?void 0:$e.range,(Ze=e.verticalAxis)==null?void 0:Ze.scaleType);if(e.valueLabels&&ct<0&&((yn=(Le=e.verticalAxis)==null?void 0:Le.range)==null?void 0:yn.min)==null){const ft=pt-ct;ct-=ft*.1}let xt=n.labels;if(e.sortMode==="total"){const ft=n.labels.map((et,gt)=>({label:et,index:gt,total:d.reduce((Lt,At)=>Lt+(At.values[gt]??0),0)}));ft.sort((et,gt)=>gt.total-et.total),xt=ft.map(et=>et.label)}const yt=tn().domain(xt).range([0,I]).padding(Sr(e.barGap)),bt=tn().domain(g).range([0,yt.bandwidth()]).padding(.05),kt=((fe=e.verticalAxis)==null?void 0:fe.scaleType)==="log",j=kt?cr().domain([ct,pt]).nice().range([W,0]):Pe().domain([ct,pt]).nice().range([W,0]);c.attach(C,rt),c.update({vertical:{scale:j,height:W,options:{...e.verticalAxis,gridWidth:I,topPadding:it.top}},horizontal:{scale:yt,height:W,options:{...e.horizontalAxis,width:I}}}),!kt&&ct<0&&pt>0&&ot(C).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",I).attr("y1",j(0)).attr("y2",j(0)).attr("stroke","#666").attr("stroke-width",1);const J=new Map;e.sortMode==="within-groups"&&n.labels.forEach((ft,et)=>{const gt=d.map(Lt=>({name:Lt.name,value:Lt.values[et]}));gt.sort((Lt,At)=>At.value-Lt.value),gt.forEach((Lt,At)=>{J.set(`${ft}\0${Lt.name}`,g[At])})});const X=[];n.labels.forEach((ft,et)=>{d.forEach(gt=>{const Lt=h.findIndex(Kt=>Kt.name===gt.name),At=e.sortMode==="within-groups"?J.get(`${ft}\0${gt.name}`)??gt.name:gt.name;X.push({label:ft,series:At,seriesName:gt.name,value:gt.values[et],seriesIndex:Lt})})});const O=e.valueLabels??!1,ht=C.ownerSVGElement,mt=Nn(ht,t,"bars",{x:0,y:0,width:I,height:W}),vt=ot(C).append("g").attr("clip-path",`url(#${mt})`),Tt=me(t),Ht=Aa(e.highlights),Ft=Vn(e.colorizes),Yt=vt.append("g").node();if(r)for(const ft of s)ft.removeAttribute("opacity"),ft.removeAttribute("fill-opacity"),Yt.appendChild(ft);ge(Tt,{role:"mark-per-cell",parent:Yt,selector:".bc-bar-multi",data:X,key:ft=>`${ft.label}\0${ft.seriesName}`,insert:ft=>ft.append("rect").attr("class","bc-bar bc-bar-multi"),attrs:ft=>{const et=re(ft.seriesName,ft.seriesIndex,v,m),gt=ai(ft.seriesName,m),Lt={"data-series":ft.seriesName,x:(yt(ft.label)??0)+(bt(ft.series)??0),y:Math.min(j(0),j(ft.value)),width:bt.bandwidth(),height:Math.abs(j(ft.value)-j(0)),fill:Ft.get(ft.seriesName)??et};return gt<1&&(Lt["fill-opacity"]=gt),Ht.size>0?{...Lt,opacity:Ue(Ht,ft.seriesName)}:Lt}});const Ut={left:it.left,top:it.top,width:I,height:W};En(Tt,{svg:ht,clipId:mt,group:C,from:l,to:Ut,active:r&&s.length>0});const Gt=Hr(vt);if(e.tooltips&&Gt.use(pr({numberFormat:(ie=e.verticalAxis)==null?void 0:ie.numberFormat})),e.crosshair&&Gt.use(Ir({width:I,height:W,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor})),(sn=e.annotations)!=null&&sn.length){const ft=n.labels.map((et,gt)=>({label:et,value:Math.max(...d.map(Lt=>Lt.values[gt]??0))}));Gt.use(wa(e.annotations,{scaleX:yt,scaleY:j,data:ft,width:I,height:W,backgroundColor:Be(t),transition:r,priorAnnotations:i}))}const dt=()=>Gt.draw(X);Tt.state==="committing"?Tt.register(dt):dt(),bn(t,{chartType:"bar-multi",margin:it,plotRect:Ut}),a&&(en(vt.node()),rn(t,a));const $t=new Set;d.forEach(ft=>{vr(ft.name,x,m)==="direct"&&$t.add(ft.name)});const U=$t.size>0,T=Be(t),F=typeof e.directLabelling=="string"?e.directLabelling:e.directLabelling?_e.Auto:_e.Off,E=e.directLabelAnchor??"middle",at=e.valueLabelPosition??It.Auto;function wt(){return at===It.Inside?It.Inside:(at===It.Outside,It.Outside)}function Ct(ft){return F===_e.Inside?It.Inside:F===_e.Outside?It.Outside:O?wt():It.Outside}function st(ft,et,gt){return gt==="start"?ft+12:gt==="end"?ft+et-4:ft+et/2}const Et=ot(C).append("g").attr("class","bc-value-labels");X.forEach(ft=>{if(!Sa(ft.seriesName,O,m))return;const et=(yt(ft.label)??0)+(bt(ft.series)??0)+bt.bandwidth()/2,gt=Math.min(j(0),j(ft.value)),Lt=Math.abs(j(ft.value)-j(0)),At=wt(),Kt=U&&$t.has(ft.seriesName),He=ft.value<0,ln=gt+Lt;let Ce,Te,ar;if(At===It.Inside){const ir=re(ft.seriesName,ft.seriesIndex,v,m);Te=hn(ir),ar="central",Kt&&Ct()===It.Inside?Ce=st(gt,Lt,E)+14:Ce=gt+Lt/2}else Te="currentColor",He?(Ce=Kt&&Ct()===It.Outside?ln+16:ln+4,ar="hanging"):(Ce=Kt&&Ct()===It.Outside?gt-16:gt-4,ar="auto");Br({text:String(ft.value),placement:At===It.Inside?"inside":"outside",orientation:"vertical",barWidth:bt.bandwidth(),barHeight:Lt})&&Et.append("text").attr("class","bc-value-label").attr("data-series",ft.seriesName).attr("x",et).attr("y",Ce).attr("text-anchor","middle").attr("dominant-baseline",ar).attr("font-size","11px").attr("fill",Te).text(String(ft.value))}),X.forEach(ft=>{var Ce;if(!$t.has(ft.seriesName))return;const et=(yt(ft.label)??0)+(bt(ft.series)??0)+bt.bandwidth()/2,gt=Math.min(j(0),j(ft.value)),Lt=Math.abs(j(ft.value)-j(0)),At=((Ce=m==null?void 0:m.find(Te=>Te.name===ft.seriesName))==null?void 0:Ce.labelText)||ft.seriesName,Kt=Ct(),He=re(ft.seriesName,ft.seriesIndex,v,m),ln=ot(C).append("text").attr("class","bc-direct-label").attr("data-series",ft.seriesName).attr("x",et).attr("text-anchor","middle").attr("font-size","10px").text(At);if(Kt===It.Inside){const Te=st(gt,Lt,E);ln.attr("y",Te).attr("fill",hn(He)),E==="middle"&&ln.attr("dominant-baseline","central")}else ln.attr("y",gt-4).attr("fill",Jc(He,T))});const Nt=g.filter(ft=>vr(ft,x,m)==="legend");if(A&&Nt.length>0){const ft=Nt.map(Lt=>{const At=h.findIndex(Kt=>Kt.name===Lt);return re(Lt,At,v,m)});let et=0,gt=0;if(Y==="top"){const Lt=L?15:0;gt=-(D.height+10+Lt)}else Y==="bottom"?gt=W+25:Y==="left"?et=-(D.width+10):Y==="right"&&(et=I+10);br(C,Nt,ft,gt,Y,G,I,W,et,[],{left:it.left,right:it.right})}}const TA={linear:po,monotoneX:Zx,step:jx,stepBefore:Kx,stepAfter:Jx,basis:Gx,cardinal:qx,catmullRom:Ux};function Wr(t){return t&&TA[t]||po}const sd="bc-tooltip",Ma=new WeakMap;function Io(t){const n=Ma.get(t);n&&(Ma.delete(t),n())}function OA(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
265
|
-
.${
|
|
251
|
+
`,document.head.appendChild(e)}function F_(e){let t=e?eh(e):null,n=e=>typeof e==`number`&&t?t(e):String(e);return e=>{if(e&&typeof e==`object`){if(`data`in e&&typeof e.data==`number`)return n(e.data);let t=e;if(`label`in t&&`value`in t)return`${t.label}: ${n(t.value)}`;if(`series`in t&&`value`in t)return`${t.series}: ${n(t.value)}`;if(`value`in t)return n(t.value)}return String(e)}}function I_(e){let t=e?.format??F_(e?.numberFormat),n=null,r=[];return{name:`tooltip`,install(){P_(),n=document.createElement(`div`),n.className=N_,document.body.appendChild(n)},postDraw(e){e.base.selectAll(`.bc-bar, .bc-dot, .bc-arc`).each(function(){let e=this,i=()=>{if(!n)return;let r=$(e).datum();n.textContent=t(r),n.style.display=`block`,M_(e,n,{placement:`top`,middleware:[k_(8),j_(),A_()]}).then(({x:e,y:t})=>{n&&(n.style.left=`${e}px`,n.style.top=`${t}px`)})},a=()=>{n&&(n.style.display=`none`)};e.addEventListener(`mouseenter`,i),e.addEventListener(`mouseleave`,a),r.push(()=>{e.removeEventListener(`mouseenter`,i),e.removeEventListener(`mouseleave`,a)})})},destroy(){for(let e of r)e();r.length=0,n&&=(n.remove(),null)}}}function L_(e){switch(e){case Yr.Solid:return`none`;case Yr.Dotted:return`2,2`;case Yr.Dashed:default:return`4,3`}}function R_(e){let t=e?.color??`#999`,n=e?.dashArray??L_(e?.style),r=e?.direction??Jr.Both,i=e?.orientation??zr.Vertical,a=[];return{name:`crosshair`,install(){},postDraw(o){let s=o.base,c=e?.width??0,l=e?.height??0,u=r===Jr.Both||r===Jr.Vertical,d=r===Jr.Both||r===Jr.Horizontal,f=u?s.append(`line`).attr(`class`,`bc-crosshair bc-crosshair-v`).attr(`y1`,0).attr(`y2`,l).attr(`stroke`,t).attr(`stroke-width`,1).style(`stroke-dasharray`,n).attr(`pointer-events`,`none`).style(`display`,`none`):null,p=d?s.append(`line`).attr(`class`,`bc-crosshair bc-crosshair-h`).attr(`x1`,0).attr(`x2`,c).attr(`stroke`,t).attr(`stroke-width`,1).style(`stroke-dasharray`,n).attr(`pointer-events`,`none`).style(`display`,`none`):null;s.selectAll(`.bc-dot, .bc-bar`).each(function(){let e=this,t=()=>{let t=$(e),n,r;if(e.tagName===`circle`)n=parseFloat(t.attr(`cx`)),r=parseFloat(t.attr(`cy`));else{let e=parseFloat(t.attr(`x`)),a=parseFloat(t.attr(`width`)),o=parseFloat(t.attr(`y`)),s=parseFloat(t.attr(`height`));i===zr.Horizontal?(n=e+a,r=o+s/2):(n=e+a/2,r=o)}f&&f.attr(`x1`,n).attr(`x2`,n).style(`display`,null),p&&p.attr(`y1`,r).attr(`y2`,r).style(`display`,null)},n=()=>{f&&f.style(`display`,`none`),p&&p.style(`display`,`none`)};e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,n),a.push(()=>{e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,n)})})},destroy(){for(let e of a)e();a.length=0}}}function z_(e){let t=e.querySelector(`.bc-annotation-line`);if(!(!t||!t.hasAttribute(`data-line-style`)))return{style:t.getAttribute(`data-line-style`),fromX:parseFloat(t.getAttribute(`data-line-from-x`)||`0`),fromY:parseFloat(t.getAttribute(`data-line-from-y`)||`0`),toX:parseFloat(t.getAttribute(`data-line-to-x`)||`0`),toY:parseFloat(t.getAttribute(`data-line-to-y`)||`0`),departVertical:t.getAttribute(`data-line-depart-vertical`)===`true`}}function B_(e){let t=new Map,n=e.querySelectorAll(`g[data-annotation-id]`);for(let e of n){let n=e.getAttribute(`data-annotation-id`),r=z_(e);try{let i=e.getBBox();t.set(n,{id:n,element:e,rect:{x:i.x,y:i.y,width:i.width,height:i.height},line:r})}catch{t.set(n,{id:n,element:e,rect:{x:0,y:0,width:0,height:0},line:r})}}return t}var V_={N:{dx:0,dy:-1},NE:{dx:.707,dy:-.707},E:{dx:1,dy:0},SE:{dx:.707,dy:.707},S:{dx:0,dy:1},SW:{dx:-.707,dy:.707},W:{dx:-1,dy:0},NW:{dx:-.707,dy:-.707},center:{dx:0,dy:0}},H_={N:{nx:0,ny:-1},NE:{nx:1,ny:-1},E:{nx:1,ny:0},SE:{nx:1,ny:1},S:{nx:0,ny:1},SW:{nx:-1,ny:1},W:{nx:-1,ny:0},NW:{nx:-1,ny:-1},center:{nx:0,ny:0}};Pr.N,Pr.W,Pr.NE,Pr.NW,Pr.E,Pr.N,Pr.SE,Pr.NE,Pr.S,Pr.E,Pr.SW,Pr.SE,Pr.W,Pr.S,Pr.NW,Pr.SW,Pr.Center,Pr.Center;function U_(e,t){let n=V_[e]??V_.NW;return{dx:n.dx*t,dy:n.dy*t}}function W_(e){return`step`in e&&!(`bandwidth`in e)}function G_(e){if(`bandwidth`in e||W_(e))return!1;let t=e.domain();return t.length>0&&t[0]instanceof Date}function K_(e,t){if(`bandwidth`in e){let n=e;return(n(t)??0)+n.bandwidth()/2}return W_(e)?e(t)??0:G_(e)?e(new Date(t)):e(Number(t))}function q_(e,t){let n=(t.left+t.right)/2,r=(t.top+t.bottom)/2,i=H_[e]??H_.N;return{x:n+i.nx*(t.right-t.left)/2,y:r+i.ny*(t.bottom-t.top)/2}}function J_(e,t,n,r,i){if(`bandwidth`in t){let a=t,o=a(e.label)??0,s=a.bandwidth(),c=n(e.value),l=n(0);return i===`horizontal`?q_(r,{left:l,right:c,top:o,bottom:o+s}):q_(r,{left:o,right:o+s,top:c,bottom:l})}let a=K_(t,e.label),o=n(e.value),s=V_[r]??V_.N;return{x:a+s.dx*2,y:o+s.dy*2}}function Y_(e,t,n,r=4){let i=e.x+e.width/2,a=e.y+e.height/2;if(t===i&&n===a)return{x:i,y:a};let o=t>=e.x&&t<=e.x+e.width,s=n>=e.y&&n<=e.y+e.height,c=[];if(o&&(n<a?c.push({x:i,y:e.y-r,dist:Math.abs(a-n)}):c.push({x:i,y:e.y+e.height+r,dist:Math.abs(n-a)})),s&&(t>i?c.push({x:e.x+e.width+r,y:a,dist:Math.abs(t-i)}):c.push({x:e.x-r,y:a,dist:Math.abs(i-t)})),c.length>0){c.sort((e,t)=>e.dist-t.dist);let{x:e,y:t}=c[0];return{x:e,y:t}}let l=[{x:i,y:e.y-r},{x:i,y:e.y+e.height+r},{x:e.x+e.width+r,y:a},{x:e.x-r,y:a}],u=l[0],d=(u.x-t)**2+(u.y-n)**2;for(let e=1;e<l.length;e++){let r=(l[e].x-t)**2+(l[e].y-n)**2;r<d&&(u=l[e],d=r)}return u}function X_(e,t){if(!e)return`bc-arrow`;let n=t??`#666`,r=`bc-arrow-${n.replace(/[^a-zA-Z0-9]/g,``)}`;return e.querySelector(`#${r}`)||($(e).select(`defs`).empty()?$(e).append(`defs`):$(e).select(`defs`)).append(`marker`).attr(`id`,r).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1 1 L 9 5 L 1 9`).attr(`fill`,`none`).attr(`stroke`,n).attr(`stroke-width`,1.5).attr(`stroke-linecap`,`round`).attr(`stroke-linejoin`,`round`),r}function Z_(e){switch(e){case Ir.Dotted:return`2,3`;case Ir.Dashed:return`5,4`;default:return``}}function Q_(e,t,n,r={}){let i=e.append(`circle`).attr(`class`,`bc-annotation-circle`).attr(`cx`,t).attr(`cy`,n).attr(`r`,r.size??4).attr(`fill`,`none`).attr(`stroke`,r.color??`#666`).attr(`stroke-width`,1.5),a=Z_(r.style??Ir.Solid);a&&i.attr(`stroke-dasharray`,a)}var $_=1/Math.tan(40*Math.PI/180);function ev(e,t,n){if(n){let n=t.y>=e.y?1:-1,r=Math.max(Math.abs(t.y-e.y)-Math.abs(t.x-e.x)*$_,12);return{x:e.x,y:e.y+n*r}}let r=t.x>=e.x?1:-1,i=Math.max(Math.abs(t.x-e.x)-Math.abs(t.y-e.y)*$_,12);return{x:e.x+r*i,y:e.y}}function tv(e,t,n){let r=ev(e,t,n);return`M ${e.x} ${e.y} L ${r.x} ${r.y} L ${t.x} ${t.y}`}function nv(e,t,n,r=Fr.Direct,i={}){let a;switch(r){case Fr.CurveLeft:case Fr.CurveRight:{let e=n.x-t.x,i=n.y-t.y,o=Math.sqrt(e*e+i*i)*.8,s=+(r===Fr.CurveRight);a=`M ${t.x} ${t.y} A ${o} ${o} 0 0 ${s} ${n.x} ${n.y}`;break}case Fr.Elbow:a=tv(t,n,i.departVertical??!1);break;default:a=`M ${t.x} ${t.y} L ${n.x} ${n.y}`}let o=i.color??`#666`,s=e.append(`path`).attr(`class`,`bc-annotation-line`).attr(`d`,a).attr(`fill`,`none`).attr(`stroke`,o).attr(`stroke-width`,i.lineWeight??1).attr(`pathLength`,`1`).attr(`data-line-style`,r).attr(`data-line-from-x`,String(t.x)).attr(`data-line-from-y`,String(t.y)).attr(`data-line-to-x`,String(n.x)).attr(`data-line-to-y`,String(n.y)).attr(`data-line-depart-vertical`,String(i.departVertical??!1));if(i.showArrow===!0){let t=X_(e.node()?.ownerSVGElement??null,o);s.attr(`marker-end`,`url(#${t})`)}}function rv(e,t,n,r,i={}){let a=i.textAnchor??`middle`,o=i.textOutline!==!1,s=e.append(`text`).attr(`class`,`bc-annotation-text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,a).attr(`font-size`,`12px`).attr(`fill`,i.textColor??`currentColor`);o&&s.attr(`stroke`,i.backgroundColor??`#fff`).attr(`stroke-width`,3).attr(`paint-order`,`stroke`);let c=t.split(`
|
|
252
|
+
`);if(c.length>1||i.maxWidth&&i.maxWidth>0){if(i.maxWidth&&i.maxWidth>0)iv(s,t,i.maxWidth);else for(let e=0;e<c.length;e++)s.append(`tspan`).attr(`x`,s.attr(`x`)).attr(`dy`,e===0?`0`:`1.2em`).text(c[e])}else s.text(t)}function iv(e,t,n){let r=t.split(/\s+/),i=``,a=0;for(let t of r){let r=i?`${i} ${t}`:t;i&&r.length*7>n?(e.append(`tspan`).attr(`x`,e.attr(`x`)).attr(`dy`,a===0?`0`:`1.2em`).text(i),i=t,a++):i=r}i&&e.append(`tspan`).attr(`x`,e.attr(`x`)).attr(`dy`,a===0?`0`:`1.2em`).text(i)}function av(e,t,n=Rr.Center){if(`bandwidth`in t){let r=t,i=r(String(e))??0,a=r.bandwidth(),o=r.step()-a;return n===`start`?i-o/2:n===`end`?i+a+o/2:i+a/2}if(W_(t)){let r=t(String(e))??0,i=t.step()/2;return n===`start`?r-i:n===`end`?r+i:r}return G_(t)?t(new Date(String(e))):t(Number(e))}function ov(e,t){return t(Number(e))}function sv(e,t){if(typeof e==`number`)return t/2+e/100*t;let n=String(e);return n.endsWith(`%`)?t/2+parseFloat(n)/100*t:parseFloat(n)||0}function cv(e,t){if(e==null)return;if(typeof e==`number`)return e||void 0;let n=String(e);return n.endsWith(`%`)?parseFloat(n)/100*t:parseFloat(n)||void 0}function lv(e){return e<-4?`end`:e>4?`start`:`middle`}function uv(e,t,n){if(`bandwidth`in t){let r=t;return{x:(r(e.label)??0)+r.bandwidth()/2,y:n(e.value)}}return{x:K_(t,e.label),y:n(e.value)}}function dv(e,t,n,r){let i=`target`in t?t.target:void 0;if(!i)return;let a=n.data.find(e=>e.label===i);if(!a)return;let o=e.append(`g`).attr(`data-annotation-index`,String(r)),s=t.key;s&&o.attr(`data-annotation-id`,s);let c=t,l=c.anchorDirection??Pr.N,u=J_(a,n.scaleX,n.scaleY,l,n.orientation),d,f,p=t;if(p.dx!=null||p.dy!=null){let{x:e,y:t}=uv(a,n.scaleX,n.scaleY);d=e+(Number(p.dx)||40),f=t+(Number(p.dy)||-40)}else if(p.direction!=null&&p.textOffsetX==null){let{x:e,y:t}=uv(a,n.scaleX,n.scaleY),r=p.direction,i=U_(r,p.anchorDistance??60);d=e+i.dx,f=t+i.dy}else d=u.x+(c.textOffsetX??-42),f=u.y+(c.textOffsetY??-42);let m=t.circleColor??`#666`,h=t;h.showCircle&&Q_(o,u.x,u.y,{size:h.circleSize,style:h.circleStyle,color:m});let g=Math.max(4,Math.min(d,n.width-4)),_=Math.max(4,Math.min(f,n.height-4));if(t.text){let e=lv(d-u.x);rv(o,t.text,g,_-4,{textColor:t.textColor,maxWidth:cv(t.maxWidth,n.width),textAnchor:e,backgroundColor:n.backgroundColor,textOutline:t.textOutline})}if(p.dx!=null||p.dy!=null?c.showLine!==!1:c.showLine===!0||c.showArrow===!0){let e={x:g,y:_},t=!1,n=o.select(`.bc-annotation-text`).node();if(n)try{let r=n.getBBox();if(r.width>0&&r.height>0){e=Y_(r,u.x,u.y);let n=r.x+r.width/2;t=Math.abs(e.x-n)<1}}catch{}let r=c.showCircle?(c.circleSize??4)+(c.lineTargetDistance??5):c.lineTargetDistance??0,i=u.x,a=u.y;if(r>0){let t=u.x-e.x,n=u.y-e.y,o=Math.sqrt(t*t+n*n);if(o>0){let e=u.x-t/o*r,s=u.y-n/o*r,c=V_[l]??V_.N;i=Math.abs(c.dx)>.01?e:u.x,a=Math.abs(c.dy)>.01?s:u.y}}nv(o,e,{x:i,y:a},c.lineStyle??Fr.Direct,{showArrow:c.showArrow,lineWeight:c.lineWeight,color:m,departVertical:t})}}function fv(e,t,n,r,i){if(t.kind!==Lr.Range)return;let a=e.append(`g`).attr(`data-annotation-index`,String(r)),o=t.key;o&&a.attr(`data-annotation-id`,o);let s=t.orientation??zr.Vertical,c,l,u,d;if(n.orientation===zr.Horizontal){if(s===zr.Vertical){let e=av(t.start,n.scaleX,t.startAnchor),r=av(t.end,n.scaleX,t.endAnchor);l=Math.min(e,r),d=Math.abs(r-e),c=0,u=n.width}else{let e=ov(t.start,n.scaleY),r=ov(t.end,n.scaleY);c=Math.min(e,r),u=Math.abs(r-e),l=0,d=n.height}}else if(s===zr.Vertical){let e=av(t.start,n.scaleX,t.startAnchor),r=av(t.end,n.scaleX,t.endAnchor);c=Math.min(e,r),u=Math.abs(r-e),l=0,d=n.height}else{let e=ov(t.start,n.scaleY),r=ov(t.end,n.scaleY);l=Math.min(e,r),d=Math.abs(r-e),c=0,u=n.width}if(a.append(`rect`).attr(`class`,`bc-annotation-range`).attr(`x`,c).attr(`y`,l).attr(`width`,u).attr(`height`,d).attr(`fill`,t.bgColor??`#ccc`).attr(`opacity`,(t.bgOpacity??20)/100),t.text){let e=s===zr.Vertical?u:d,o=cv(t.maxWidth,n.width)??Math.max(e,50),f=V_[t.direction??`center`]??V_.center,p=.5+f.dx*.5,m=.5+f.dy*.5,h=Math.max(4,Math.min(c+u*p,n.width-4)),g=`middle`;p<.25?g=`start`:p>.75&&(g=`end`);let _=l+4+12,v=i?i.append(`g`).attr(`data-annotation-index`,String(r)):a;if(rv(v,t.text,h,_,{textColor:t.textColor,maxWidth:o,textAnchor:g,backgroundColor:n.backgroundColor,textOutline:t.textOutline}),m>.25){let e=v.select(`.bc-annotation-text`).node();if(e)try{let t=e.getBBox(),n=0;n=m>.75?l+d-4-(t.y+t.height):l+d/2-(t.y+t.height/2),Math.abs(n)>.5&&e.setAttribute(`transform`,`translate(0, ${n})`)}catch{}}}}function pv(e,t,n,r){if(t.kind!==`free`)return;let i=e.append(`g`).attr(`data-annotation-index`,String(r)),a=t.key;a&&i.attr(`data-annotation-id`,a);let o=sv(t.x,n.width),s=sv(t.y,n.height);if(t.text){rv(i,t.text,o,s,{textColor:t.textColor,maxWidth:cv(t.maxWidth,n.width),textAnchor:`middle`,backgroundColor:n.backgroundColor,textOutline:t.textOutline});let e=i.select(`.bc-annotation-text`).node();if(e)try{let t=e.getBBox(),n=s-(t.y+t.height/2);Math.abs(n)>.5&&e.setAttribute(`transform`,`translate(0, ${n})`)}catch{}}}function mv(e,t,n,r){return`M ${e} ${t} L ${n+.45*(e-n)} ${t} L ${n} ${r}`}function hv(e,t){let n=e.hasAttribute(`marker-end`),r=z_(e.parentElement);if(n&&r){let n=$(e),i=e.getAttribute(`d`),a=`M ${r.fromX} ${r.fromY} L ${r.fromX} ${r.fromY}`;if(n.attr(`d`,a),r.style===Fr.Elbow){let e={tipX:r.toX,tipY:r.toY,calloutX:r.fromX,calloutY:r.fromY},i={tipX:r.fromX,tipY:r.fromY,calloutX:r.fromX,calloutY:r.fromY};n.transition().duration(t).ease(eu).attrTween(`d`,()=>{let t=tc(i,e);return e=>{let n=t(e);return mv(n.calloutX,n.calloutY,n.tipX,n.tipY)}})}else if(r.style===Fr.CurveLeft||r.style===Fr.CurveRight){let e={x:r.fromX,y:r.fromY},a={x:r.toX,y:r.toY},o=a.x-e.x,s=a.y-e.y,c=Math.sqrt(o*o+s*s),l=c*.8,u=+(r.style===Fr.CurveRight),d=c/2,f=d<l?Math.sqrt(l*l-d*d):0,p=(e.x+a.x)/2,m=(e.y+a.y)/2,h=c>0?-s/c:0,g=c>0?o/c:0,_=u===1?1:-1,v=p+_*f*h,y=m+_*f*g,b=Math.atan2(e.y-y,e.x-v),x=Math.atan2(a.y-y,a.x-v)-b;u===1&&x<=0&&(x+=2*Math.PI),u===0&&x>=0&&(x-=2*Math.PI),n.transition().duration(t).ease(eu).attrTween(`d`,()=>t=>{if(t>=.98)return i;let n=b+t*x,r=v+l*Math.cos(n),a=y+l*Math.sin(n);return`M ${e.x} ${e.y} A ${l} ${l} 0 0 ${u} ${r} ${a}`})}else n.transition().duration(t).ease(eu).attrTween(`d`,()=>{let e=ec(r.fromX,r.toX),t=ec(r.fromY,r.toY);return n=>`M ${r.fromX} ${r.fromY} L ${e(n)} ${t(n)}`})}else e.setAttribute(`stroke-dasharray`,`1`),e.setAttribute(`stroke-dashoffset`,`1`),$(e).transition().duration(t).ease(eu).attr(`stroke-dashoffset`,`0`).on(`end`,()=>{e.removeAttribute(`stroke-dasharray`),e.removeAttribute(`stroke-dashoffset`)})}var gv=1;function _v(e,t){return e.style!==t.style||e.departVertical!==t.departVertical?!1:Math.abs(e.fromX-t.fromX)<=gv&&Math.abs(e.fromY-t.fromY)<=gv&&Math.abs(e.toX-t.toX)<=gv&&Math.abs(e.toY-t.toY)<=gv}function vv(e,t,n){let r=z_(e.parentElement);if(!r||_v(t,r))return;let i=$(e);if(t.style===Fr.Elbow&&r.style===Fr.Elbow){let e={tipX:t.toX,tipY:t.toY,calloutX:t.fromX,calloutY:t.fromY},a={tipX:r.toX,tipY:r.toY,calloutX:r.fromX,calloutY:r.fromY};i.attr(`d`,mv(e.calloutX,e.calloutY,e.tipX,e.tipY)),i.transition().duration(n).ease(tu).attrTween(`d`,()=>{let t=tc(e,a);return e=>{let n=t(e);return mv(n.calloutX,n.calloutY,n.tipX,n.tipY)}})}else{let a={x:t.fromX,y:t.fromY},o={x:t.toX,y:t.toY},s={x:r.fromX,y:r.fromY},c={x:r.toX,y:r.toY},l=e.getAttribute(`d`),u=`M ${a.x} ${a.y} L ${o.x} ${o.y}`;i.attr(`d`,u),i.transition().duration(n).ease(tu).attrTween(`d`,()=>{let e=tc(a,s),n=tc(o,c);return i=>{if(i>=.98)return l;let a=e(i),o=n(i);if(r.style===Fr.Direct||t.style===Fr.Direct)return`M ${a.x} ${a.y} L ${o.x} ${o.y}`;let s=o.x-a.x,c=o.y-a.y,u=Math.sqrt(s*s+c*c)*.8,d=+(r.style===Fr.CurveRight);return`M ${a.x} ${a.y} A ${u} ${u} 0 0 ${d} ${o.x} ${o.y}`}})}}function yv(e,t,n,r){if(r<=0)return;let i=[...e.querySelectorAll(`g[data-annotation-id]`),...t.querySelectorAll(`g[data-annotation-id]`)],a=new Set;for(let e of i){let t=e.getAttribute(`data-annotation-id`);a.add(t);let i=n.get(t);if(i){let t=e.querySelector(`.bc-annotation-line`);t&&i.line&&vv(t,i.line,r);try{let t=e.getBBox(),n=i.rect.x-t.x,a=i.rect.y-t.y;if(Math.abs(n)>.5||Math.abs(a)>.5){let t=e.querySelectorAll(`.bc-annotation-text, .bc-annotation-circle`);for(let e of t){let t=e;t.style.transition=`none`,t.setAttribute(`transform`,`translate(${n}, ${a})`),t.getBoundingClientRect(),t.style.transition=`transform ${r}ms ease`,t.setAttribute(`transform`,`translate(0, 0)`)}}}catch{}}else{let t=e.querySelector(`.bc-annotation-line`);t&&hv(t,r);let n=e.querySelectorAll(`.bc-annotation-text, .bc-annotation-circle`);for(let e of n){let t=e;t.style.opacity=`0`,t.getBoundingClientRect(),t.style.transition=`opacity ${r}ms ease`,t.style.opacity=`1`}}}for(let[t,i]of n)if(!a.has(t)){let t=i.element.cloneNode(!0);e.appendChild(t),t.style.opacity=`1`,t.getBoundingClientRect(),t.style.transition=`opacity ${r}ms ease`,t.style.opacity=`0`,setTimeout(()=>t.remove(),r)}}function bv(e){if(!e)return;let t=parseFloat(e.getAttribute(`width`)||`0`),n=parseFloat(e.getAttribute(`height`)||`0`);if(!t||!n)return;let r=e.getBBox();if(r.width===0&&r.height===0)return;let i=r.x,a=r.y,o=r.x+r.width,s=r.y+r.height,c=i<0?i-8:0,l=a<0?a-8:0,u=o>t?o+8:t,d=s>n?s+8:n;(c<0||l<0||u>t||d>n)&&$(e).attr(`viewBox`,`${c} ${l} ${u-c} ${d-l}`).attr(`preserveAspectRatio`,`xMidYMid meet`)}function xv(e,t,n){let r=e.ownerSVGElement??e;$(r).style(`overflow`,`visible`),X_(r);let i=$(e),a;if(n.transition){if(n.priorAnnotations&&n.priorAnnotations.size>0)a=n.priorAnnotations;else{let t=e.querySelector(`.bc-annotations`),n=e.querySelector(`.bc-annotations-range`);if(t||n){if(a=new Map,t)for(let[e,n]of B_(t))a.set(e,n);if(n)for(let[e,t]of B_(n))a.set(e,t)}}}e.querySelectorAll(`.bc-annotations, .bc-annotations-range`).forEach(e=>e.remove());let o=i.insert(`g`,`:first-child`).attr(`class`,`bc-annotations-range`),s=i.append(`g`).attr(`class`,`bc-annotations`).attr(`data-ctx-width`,String(n.width)).attr(`data-ctx-height`,String(n.height));for(let e=0;e<t.length;e++){let r=t[e];switch(r.kind??Lr.Point){case Lr.Point:dv(s,r,n,e);break;case Lr.Range:fv(o,r,n,e,s);break;case Lr.Free:pv(s,r,n,e)}}if(n.transition){let e=_h(500);yv(s.node(),o.node(),a??new Map,e)}bv(r)}function Sv(e,t){return{name:`annotations`,install(){},postDraw(n){let r=n.base,i=r.node()?.ownerSVGElement??r.node();i&&$(i).style(`overflow`,`visible`),X_(i);let a=r.node()?.parentNode,o=a&&a!==i?$(a):r,s=o.node(),c;if(t.transition){if(t.priorAnnotations&&t.priorAnnotations.size>0)c=t.priorAnnotations;else if(s){let e=s.querySelector(`.bc-annotations`),t=s.querySelector(`.bc-annotations-range`);if(e||t){if(c=new Map,e)for(let[t,n]of B_(e))c.set(t,n);if(t)for(let[e,n]of B_(t))c.set(e,n)}}}s&&s.querySelectorAll(`.bc-annotations, .bc-annotations-range`).forEach(e=>e.remove());let l=o.insert(`g`,`:first-child`).attr(`class`,`bc-annotations-range`),u=o.append(`g`).attr(`class`,`bc-annotations`).attr(`data-ctx-width`,String(t.width)).attr(`data-ctx-height`,String(t.height));for(let n=0;n<e.length;n++){let r=e[n];switch(r.kind??Lr.Point){case Lr.Point:dv(u,r,t,n);break;case Lr.Range:fv(l,r,t,n,u);break;case Lr.Free:pv(u,r,t,n)}}if(t.transition){let e=_h(500);yv(u.node(),l.node(),c??new Map,e)}bv(i)}}}function Cv(e){return new Map((e??[]).map(e=>[e.target,e.color]))}var wv=new WeakMap;function Tv(e){return wv.get(e)}function Ev(e,t){wv.set(e,t)}var Dv=0,Ov=new WeakMap;function kv(e,t,n,r){let i=Ov.get(t);i||(i=new Map,Ov.set(t,i));let a=i.get(n);a||(a=`bc-clip-${++Dv}`,i.set(n,a));let o=$(e).select(`defs`).empty()?$(e).append(`defs`):$(e).select(`defs`),s=o.select(`#${a}`);return s.empty()?o.append(`clipPath`).attr(`id`,a).append(`rect`).attr(`x`,r.x).attr(`y`,r.y).attr(`width`,r.width).attr(`height`,r.height):s.select(`rect`).attr(`x`,r.x).attr(`y`,r.y).attr(`width`,r.width).attr(`height`,r.height),a}var Av=class extends Km{initialize(){}};function jv(e){return new Av(e)}var Mv=`bc-scene`,Nv=500,Pv=new Set,Fv=new WeakMap;function Iv(e){let t=Fv.get(e);return t||(t=new Rv(e),Fv.set(e,t)),t}function Lv(e){Fv.delete(e)}var Rv=class{container;_state=`idle`;_transition=null;_buffer=[];register(e){this._buffer.push(e)}constructor(e){this.container=e}get state(){return this._state}get activeTransition(){return this._transition}beginCommit(){(this._state===`committing`||this._state===`animating`)&&this.interrupt(),this._state=`committing`}commit(e={}){if(this._state!==`committing`){console.warn(`[blueprint-chart] commit() called from state '${this._state}' — call beginCommit() first; ignored.`);return}let t=e.mode??`transform`;if(t!==`transform`){Pv.has(t)||(Pv.add(t),console.warn(`[blueprint-chart] transition mode '${t}' is not yet implemented; falling back to snap.`));let e=this._buffer;this._buffer=[],this._state=`animating`;for(let t of e)try{t()}catch(e){console.warn(`[blueprint-chart] feature flush failed:`,e)}this._state=`idle`;return}let n=e.duration??Nv,r=this.effectiveDuration(n),i=this._buffer;if(this._buffer=[],r<=0){this._state=`animating`;for(let e of i)try{e()}catch(e){console.warn(`[blueprint-chart] feature flush failed:`,e)}this._state=`idle`;return}this._state=`animating`;let a=Zl(Mv).duration(r).ease(tu);this._transition=a;for(let e of i)try{e()}catch(e){console.warn(`[blueprint-chart] feature flush failed:`,e)}a.on(`end`,()=>{this._transition===a&&(this._transition=null,this._state=`idle`)}),a.on(`interrupt`,()=>{this._transition===a&&(this._transition=null,this._state=`idle`)})}effectiveDuration(e){return e<=0?0:typeof window>`u`||typeof window.matchMedia!=`function`?e:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:e}interrupt(){this._buffer=[],this._transition=null,$(this.container).interrupt(Mv),$(this.container).selectAll(`*`).interrupt(Mv),this._state=`idle`}run(e,t={}){this.beginCommit();try{e()}catch(e){console.warn(`[blueprint-chart] scene-transition commit failed:`,e),this._state=`idle`;return}this.commit(t)}destroy(){this.interrupt(),Lv(this.container)}};function zv(e,t){let n=new Map;return e.querySelectorAll(`[data-bc-role="${t}"]`).forEach(e=>{let t=e.getAttribute(`data-bc-key`);t!=null&&n.set(t,e)}),n}function Bv(e,t){return e.tagName===t.tagName}function Vv(e,t){$(e).interrupt(Mv);let n={};for(let r of t){let t=e.getAttribute(r);t!==null&&(n[r]=t)}return n}function Hv(e,t){let n=Uv(e),r=Uv(t);if(n.skeleton!==r.skeleton||n.nums.length!==r.nums.length)return n=>n<.5?e:t;let{skeleton:i,nums:a}=n,{nums:o}=r;return n=>{if(n<=0)return e;if(n>=1)return t;let r=0;return i.replace(/#/g,()=>{let e=a[r]+(o[r]-a[r])*n;return r++,Wv(e)})}}function Uv(e){let t=[];return{skeleton:e.replace(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,e=>(t.push(parseFloat(e)),`#`)),nums:t}}function Wv(e){let t=Math.round(e*1e3)/1e3;return Object.is(t,-0)?`0`:String(t)}var Gv={opacity:0},Kv=new Set([`d`,`transform`]),qv=new Set([`stroke-dasharray`]);function Jv(e,t){if(e.state===`idle`||e.state===`animating`){Yv(t);return}e.register(()=>Xv(e,t))}function Yv(e){let t=$(e.parent).selectAll(e.selector).data(e.data,t=>e.key(t));t.exit().remove();let n=e.insert(t.enter());Zv(n,e),n.merge(t).each(function(t){ey(this,e.attrs(t))})}function Xv(e,t){let n=e.activeTransition,r=$(t.parent).selectAll(t.selector).data(t.data,e=>t.key(e)),i=$v(t),a=r.exit();n?a.each(function(){let e=this,r=$(e).datum();ty(e,t.exitTo?t.exitTo(r):Gv,n).on(`end.featureJoin-exit`,()=>e.parentNode?.removeChild(e))}):a.remove();let o=zv(e.container,t.role),s=t.insert(r.enter());Zv(s,t),s.each(function(e){let r=this,a=t.attrs(e);if(n){let s=o.get(Qv(t.key(e)));if(s&&Bv(s,r)){ey(r,Vv(s,i)),ty(r,a,n);return}ey(r,t.enterFrom?t.enterFrom(e):a),ty(r,a,n)}else ey(r,a)}),r.each(function(e){let r=this,a=t.attrs(e);n?(Vv(r,i),ty(r,a,n)):ey(r,a)})}function Zv(e,t){e.attr(`data-bc-role`,t.role),e.attr(`data-bc-key`,e=>Qv(t.key(e)))}function Qv(e){return e.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,`␟`)}function $v(e){return e.data.length===0?[]:Object.keys(e.attrs(e.data[0]))}function ey(e,t){for(let[n,r]of Object.entries(t))e.setAttribute(n,String(r))}function ty(e,t,n){let r=$(e).transition(n);for(let[n,i]of Object.entries(t))if(Kv.has(n)){let e=String(i);r.attrTween(n,function(){return Hv(this.getAttribute(n)??e,e)})}else qv.has(n)?e.setAttribute(n,String(i)):r.attr(n,String(i));return r}function ny(e,t){if(!t.active||!t.from)return;let n=t.svg.querySelector(`#${t.clipId} rect`);ry(e,{group:t.group,clipRect:n,from:t.from,to:t.to})}function ry(e,t){let{group:n,clipRect:r,from:i,to:a}=t,o=`translate(${a.left},${a.top})`,s=`translate(${i.left},${i.top})`;e.register(()=>{let t=e.activeTransition;if(!t){n.setAttribute(`transform`,o),r&&(r.setAttribute(`width`,String(a.width)),r.setAttribute(`height`,String(a.height)));return}n.setAttribute(`transform`,s),$(n).transition(t).attrTween(`transform`,function(){return Hv(this.getAttribute(`transform`)??s,o)}),r&&(r.setAttribute(`width`,String(i.width)),r.setAttribute(`height`,String(i.height)),$(r).transition(t).attr(`width`,a.width).attr(`height`,a.height))})}var iy=.35;function ay(e){return new Set((e??[]).map(e=>e.target))}function oy(e,t,n=1){return e.size===0||e.has(t)?n:iy}var sy=11,cy=6.2,ly=sy,uy=8,dy=4,fy=14;function py(e){return e.length*cy}function my(e){let t=py(e.text);return e.placement===`inside`?e.orientation===`horizontal`?t<=e.barWidth-uy&&ly<=e.barHeight:ly<=e.barHeight-dy&&t<=e.barWidth:(e.orientation===`vertical`?e.barWidth:e.barHeight)>=fy}var hy=[`#4e79a7`],gy=13;function _y(e,t,n={},r=!1){yh(r);let i=null,a,o,s,c=[],l=Xh.for(e);if(r){let t=Tv(e);o=t?.margin,s=t?.plotRect,l.detach(),t?.chartType===`bar-vertical`?c=Array.from(e.querySelectorAll(`.bc-frame .bc-bar`)):t&&(i=Sh(e)),a=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))a.set(e,n);e.replaceChildren()}let{body:u}=Zm(e,n.frame),d=mh(u).width,f=n.categoryLabelLine===!0,p=dh(t.values,n.verticalAxis?.range,n.verticalAxis?.numberFormat,n.verticalAxis?.scaleType),m=f?Mr.Off:n.horizontalAxis?.labelPosition,h=ph(d,n.verticalAxis?.labelPosition,m,n.verticalAxis?.direction,p);if(!f){let e=Math.max(0,d-(h.left??50)-(h.right??20)),r=Bh(t.labels,e,n.horizontalAxis);r!==void 0&&(h.bottom=r)}let{chartArea:g,width:_,height:v,margin:y}=gh(u,h),b=v-(f?gy:0),x=nh(o,y),S={left:y.left,top:y.top,width:_,height:b},C=by(t,n),w=C.map(e=>({label:e,value:t.values[t.labels.indexOf(e)]})),T=n.swapLabelValue===!0,E=n.waterfall===!0,D=[];if(E){let e=0;for(let t of w){let n=e;e+=t.value,D.push({label:t.label,value:t.value,y0:n,y1:e,isTotal:!1})}n.waterfallTotal&&D.push({label:`Total`,value:e,y0:0,y1:e,isTotal:!0})}let O=E?D.map(e=>e.label):C,k=Uu().domain(O).range([0,_]).padding(ci(n.barGap)),A=n.verticalAxis?.scaleType===`log`,[ee,j]=li(E?D.flatMap(e=>[e.y0,e.y1]):w.map(e=>e.value),n.verticalAxis?.range,n.verticalAxis?.scaleType);if(n.valueLabels&&ee<0&&n.verticalAxis?.range?.min==null){let e=j-ee;ee-=e*.1}let M=A?ld().domain([ee,j]).nice().range([b,0]):ad().domain([ee,j]).nice().range([b,0]);l.attach(g,x);let N=T&&n.valueLabels&&!E?(()=>{let e=new Map(w.map(e=>[e.label,e.value]));return{...n.horizontalAxis,width:_,tickFormat:t=>String(e.get(t)??t)}})():{...n.horizontalAxis,width:_},P=f?{...N,labelPosition:Mr.Off}:N;l.update({vertical:{scale:M,height:v,options:{...n.verticalAxis,gridWidth:_,topPadding:y.top}},horizontal:{scale:k,height:v,options:P}}),!A&&ee<0&&j>0&&$(g).append(`line`).attr(`class`,`bc-zero-baseline`).attr(`x1`,0).attr(`x2`,_).attr(`y1`,M(0)).attr(`y2`,M(0)).attr(`stroke`,`#666`).attr(`stroke-width`,1);let F=Cv(n.colorizes),I=new Set((n.highlights??[]).map(e=>e.target)),L=g.ownerSVGElement,R=kv(L,e,`bars`,{x:0,y:0,width:_,height:b}),z=$(L).select(`defs`),B=R.replace(/^bc-clip-/,``),V=$(g).append(`g`).attr(`clip-path`,`url(#${R})`);if(n.barBackground){let e=(n.colors??hy)[0],t=E?O:w.map(e=>e.label);V.selectAll(`.bc-bar-bg`).data(t,e=>e).enter().append(`rect`).attr(`class`,`bc-bar-bg`).attr(`x`,e=>k(e)??0).attr(`y`,0).attr(`width`,k.bandwidth()).attr(`height`,b).attr(`fill`,e).attr(`opacity`,.18)}let H=E?O:w.map(e=>e.label);if(n.barSeparators&&H.length>1){let e=k.step();for(let t=1;t<H.length;t++){let n=(k(H[t-1])??0)+k.bandwidth()+(e-k.bandwidth())/2;V.append(`line`).attr(`class`,`bc-bar-separator`).attr(`x1`,n).attr(`x2`,n).attr(`y1`,0).attr(`y2`,b).attr(`stroke`,`currentColor`).attr(`opacity`,.15)}}if(!E&&n.connectedColumns&&w.length>1){let e=n.colors??hy,t=n.connectionsOpacity??.15;for(let n=0;n<w.length-1;n++){let r=w[n],i=w[n+1];if(r.value==null||i.value==null||Number.isNaN(r.value)||Number.isNaN(i.value)||r.value===0||i.value===0)continue;let a=(k(r.label)??0)+k.bandwidth(),o=k(i.label)??0,s=Math.min(M(0),M(r.value)),c=Math.min(M(0),M(i.value)),l=M(0),u=F.get(r.label)??e[0],d=F.get(i.label)??e[0],f;if(u===d)f=u;else{let e=`bc-conn-grad-${B}-${n}`,t=z.append(`linearGradient`).attr(`id`,e).attr(`x1`,`0%`).attr(`x2`,`100%`).attr(`y1`,`0%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,u),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,d),f=`url(#${e})`}V.append(`polygon`).attr(`class`,`bc-bar-connection`).attr(`points`,`${a},${s} ${o},${c} ${o},${l} ${a},${l}`).attr(`fill`,f).attr(`opacity`,t).attr(`pointer-events`,`none`)}}let U=$(g).append(`g`);if(E){let e=n.colors??hy,t=`#333`;if(n.connectedColumns&&D.length>1){let e=n.colors??hy,t=n.connectionsOpacity??.15;for(let n=0;n<D.length-1;n++){let r=D[n],i=D[n+1];if(i.isTotal||r.value==null||i.value==null||Number.isNaN(r.value)||Number.isNaN(i.value)||r.value===0||i.value===0)continue;let a=(k(r.label)??0)+k.bandwidth(),o=k(i.label)??0,s=M(r.y1),c=M(i.y1),l=M(r.y0),u=M(i.y0),d=F.get(r.label)??e[0],f=F.get(i.label)??e[0],p;if(d===f)p=d;else{let e=`bc-conn-grad-${B}-${n}`,t=z.append(`linearGradient`).attr(`id`,e).attr(`x1`,`0%`).attr(`x2`,`100%`).attr(`y1`,`0%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,d),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,f),p=`url(#${e})`}V.append(`polygon`).attr(`class`,`bc-bar-connection`).attr(`points`,`${a},${s} ${o},${c} ${o},${u} ${a},${l}`).attr(`fill`,p).attr(`opacity`,t).attr(`pointer-events`,`none`)}}for(let e=0;e<D.length-1;e++){let t=D[e],n=D[e+1];if(n.isTotal)break;V.append(`line`).attr(`class`,`bc-waterfall-connector`).attr(`x1`,(k(t.label)??0)+k.bandwidth()).attr(`x2`,k(n.label)??0).attr(`y1`,M(t.y1)).attr(`y2`,M(t.y1)).attr(`stroke`,`currentColor`).attr(`stroke-dasharray`,`2,2`).attr(`opacity`,.3)}if(V.selectAll(`.bc-bar`).data(D,e=>e.label).enter().append(`rect`).attr(`class`,`bc-bar`).attr(`x`,e=>k(e.label)??0).attr(`y`,e=>Math.min(M(e.y0),M(e.y1))).attr(`width`,k.bandwidth()).attr(`height`,e=>Math.abs(M(e.y0)-M(e.y1))).attr(`fill`,n=>n.isTotal?t:F.get(n.label)??e[0]).attr(`opacity`,e=>I.size>0?oy(I,e.label):null),n.valueLabels){let r=n.valueLabelPosition??qr.Auto,i=eh(n.verticalAxis?.numberFormat??``),a=e=>i?i(e):String(e);U.selectAll(`.bc-value-label`).data(D,e=>e.label).enter().append(`text`).attr(`class`,`bc-value-label`).attr(`font-size`,`11px`).attr(`x`,e=>(k(e.label)??0)+k.bandwidth()/2).attr(`y`,e=>{let t=Math.min(M(e.y0),M(e.y1)),n=Math.abs(M(e.y0)-M(e.y1));return r===qr.Inside?t+n/2:t-4}).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,r===qr.Inside?`central`:`auto`).attr(`fill`,n=>r===qr.Inside?sr(n.isTotal?t:F.get(n.label)??e[0]):`currentColor`).text(e=>T?e.label:a(e.isTotal?e.y1:e.value))}}else{let t=Iv(e),i=V.append(`g`).node();if(r)for(let e of c)i.appendChild(e);Jv(t,{role:`mark-per-category`,parent:i,selector:`.bc-bar`,data:w,key:e=>e.label,insert:e=>e.append(`rect`).attr(`class`,`bc-bar`),attrs:e=>({x:k(e.label)??0,y:Math.min(M(0),M(e.value)),width:k.bandwidth(),height:Math.abs(M(e.value)-M(0)),fill:F.get(e.label)??(n.colors??hy)[0],opacity:oy(I,e.label)})}),ny(t,{svg:L,clipId:R,group:g,from:s,to:S,active:r&&c.length>0});let o=jv(V);n.tooltips&&o.use(I_({numberFormat:n.verticalAxis?.numberFormat})),n.crosshair&&o.use(R_({width:_,height:b,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),n.annotations?.length&&o.use(Sv(n.annotations,{scaleX:k,scaleY:M,data:w,width:_,height:b,backgroundColor:lr(e),transition:r,priorAnnotations:a}));let l=()=>o.draw(w);t.state===`committing`?t.register(l):l(),n.valueLabels&&yy(U,w,k,M,{position:n.valueLabelPosition,colorOverrides:F,colors:n.colors??hy,transition:r,swapLabelValue:T,percent:n.valueLabels===`percent`,total:Fi(w,e=>e.value)})}if(f){let e=$(g).append(`g`).attr(`class`,`bc-category-labels`);for(let t of O)e.append(`text`).attr(`class`,`bc-category-label`).attr(`x`,(k(t)??0)+k.bandwidth()/2).attr(`y`,b+gy/2).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,`10px`).attr(`font-weight`,`600`).attr(`fill`,`currentColor`).text(t)}Ev(e,{chartType:`bar-vertical`,margin:y,plotRect:S}),i&&(xh(V.node()),Ch(e,i))}function vy(e,t,n,r){let i=Math.abs(n(e.value)-n(0)),a=r===qr.Inside,o=(t(e.label)??0)+t.bandwidth()/2,s,c;return e.value<0?a?(s=n(e.value)-i/2,c=`central`):(s=n(e.value)+4,c=`hanging`):a?(s=n(e.value)+i/2,c=`central`):(s=n(e.value)-4,c=`auto`),{tx:o,ty:s,anchor:`middle`,baseline:c,isInside:a}}function yy(e,t,n,r,i){let a=i.position??qr.Auto,o=e=>i.swapLabelValue?e.label:i.percent&&i.total!==void 0?th(e.value,i.total):String(e.value),s=e.select(`.bc-value-label-group`);s.empty()&&(s=e.append(`g`).attr(`class`,`bc-value-label-group`));let c=e.node().ownerSVGElement?.parentElement,l=Iv(c),u=t.filter(e=>my({text:o(e),placement:a===qr.Inside?`inside`:`outside`,orientation:`vertical`,barWidth:n.bandwidth(),barHeight:Math.abs(r(e.value)-r(0))}));Jv(l,{role:`value-label`,parent:s.node(),selector:`.bc-value-label`,data:u,key:e=>e.label,insert:e=>e.append(`text`).attr(`class`,`bc-value-label`).attr(`font-size`,`11px`),attrs:e=>{let t=vy(e,n,r,a);return{x:t.tx,y:t.ty,"text-anchor":t.anchor,"dominant-baseline":t.baseline,fill:t.isInside?sr(i.colorOverrides.get(e.label)??i.colors[0]):`currentColor`}}}),s.selectAll(`.bc-value-label`).data(u,e=>e.label).text(o)}function by(e,t){let n=e.labels.map((t,n)=>({label:t,value:e.values[n]}));return t.sort===Ur.Ascending?n.sort((e,t)=>e.value-t.value):t.sort===Ur.Descending&&n.sort((e,t)=>t.value-e.value),n.map(e=>e.label)}var xy=[`#4e79a7`],Sy=13,Cy=`11px sans-serif`,wy=4;function Ty(e){try{let t=document.createElement(`canvas`).getContext(`2d`);if(t)return t.font=Cy,Math.ceil(t.measureText(e).width)}catch{}return e.length*6.5}function Ey(e,t,n={},r=!1){yh(r);let i=null,a,o,s=[],c,l=Xh.for(e);if(r){let t=Tv(e);o=t?.margin,c=t?.plotRect,l.detach(),t?.chartType===`bar-horizontal`?s=Array.from(e.querySelectorAll(`.bc-frame .bc-bar`)):t&&(i=Sh(e)),a=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))a.set(e,n);e.replaceChildren()}let{body:u}=Zm(e,n.frame),d=mh(u).width,f=d>0&&d<400&&n.verticalAxis?.labelPosition!==`outside`,p=n.categoryLabelLine===!0||f,m=fh(t.labels),h=ph(d,p?Mr.Off:n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,m,n.horizontalAxis?.showAxis),g=n.valueLabelPosition??qr.Auto,_=n.swapLabelValue===!0;if(n.valueLabels&&g!==qr.Inside){if(_){let e=Ty(t.labels.reduce((e,t)=>e.length>t.length?e:t,``))+wy;h.right=Math.max(h.right??15,e)}else{let e=Math.max(...t.values),n=Math.min(...t.values),r=e>0?Ty(String(e))+wy:0,i=n<0?Ty(String(n))+wy:0;h.right=Math.max(h.right??15,r),i>0&&(h.left=(h.left??50)+i)}}let{chartArea:v,width:y,height:b,margin:x}=gh(u,h),S={left:x.left,top:x.top,width:y,height:b},C=p?Sy:0,w=nh(o,x),T=ky(t,n),E=T.map(e=>({label:e,value:t.values[t.labels.indexOf(e)]})),D=n.waterfall===!0,O=[];if(D){let e=0;for(let t of E){let n=e;e+=t.value,O.push({label:t.label,value:t.value,x0:n,x1:e,isTotal:!1})}n.waterfallTotal&&O.push({label:`Total`,value:e,x0:0,x1:e,isTotal:!0})}let k=n.horizontalAxis?.scaleType===`log`,[A,ee]=li(D?O.flatMap(e=>[e.x0,e.x1]):E.map(e=>e.value),n.horizontalAxis?.range,n.horizontalAxis?.scaleType),j=k?ld().domain([A,ee]).nice().range([0,y]):ad().domain([A,ee]).nice().range([0,y]),M=D?O.map(e=>e.label):T,N=Uu().domain(M).range([0,b]).padding(ci(n.barGap)),P=_&&n.valueLabels&&!D?(()=>{let e=new Map(E.map(e=>[e.label,e.value]));return{...n.verticalAxis,topPadding:x.top,tickFormat:t=>String(e.get(t)??t)}})():{...n.verticalAxis,topPadding:x.top},F=p?{...P,labelPosition:Mr.Off,...f?{showAxis:!1}:{}}:P;l.attach(v,w),l.update({horizontal:{scale:j,height:b,options:{...n.horizontalAxis,width:y}},vertical:{scale:N,height:b,options:F},order:`horizontal-first`}),!k&&A<0&&ee>0&&$(v).append(`line`).attr(`class`,`bc-zero-baseline`).attr(`x1`,j(0)).attr(`x2`,j(0)).attr(`y1`,0).attr(`y2`,b).attr(`stroke`,`#666`).attr(`stroke-width`,1);let I=Cv(n.colorizes),L=new Set((n.highlights??[]).map(e=>e.target)),R=v.ownerSVGElement,z=kv(R,e,`bars`,{x:0,y:0,width:y,height:b}),B=$(R).select(`defs`),V=z.replace(/^bc-clip-/,``),H=$(v).append(`g`).attr(`clip-path`,`url(#${z})`);if(n.barBackground){let e=(n.colors??xy)[0],t=D?M:E.map(e=>e.label);H.selectAll(`.bc-bar-bg`).data(t,e=>e).enter().append(`rect`).attr(`class`,`bc-bar-bg`).attr(`x`,0).attr(`y`,e=>(N(e)??0)+C).attr(`width`,y).attr(`height`,N.bandwidth()-C).attr(`fill`,e).attr(`opacity`,.18)}let U=D?M:E.map(e=>e.label);if(n.barSeparators&&U.length>1){let e=N.step();for(let t=1;t<U.length;t++){let n=(N(U[t-1])??0)+N.bandwidth()+(e-N.bandwidth())/2;H.append(`line`).attr(`class`,`bc-bar-separator`).attr(`x1`,0).attr(`x2`,y).attr(`y1`,n).attr(`y2`,n).attr(`stroke`,`currentColor`).attr(`opacity`,.15)}}if(!D&&n.connectedColumns&&E.length>1){let e=n.colors??xy,t=n.connectionsOpacity??.15;for(let n=0;n<E.length-1;n++){let r=E[n],i=E[n+1];if(r.value==null||i.value==null||Number.isNaN(r.value)||Number.isNaN(i.value)||r.value===0||i.value===0)continue;let a=(N(r.label)??0)+N.bandwidth(),o=(N(i.label)??0)+C,s=Math.max(j(0),j(r.value)),c=Math.max(j(0),j(i.value)),l=j(0),u=I.get(r.label)??e[0],d=I.get(i.label)??e[0],f;if(u===d)f=u;else{let e=`bc-conn-grad-${V}-${n}`,t=B.append(`linearGradient`).attr(`id`,e).attr(`x1`,`0%`).attr(`x2`,`0%`).attr(`y1`,`0%`).attr(`y2`,`100%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,u),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,d),f=`url(#${e})`}H.append(`polygon`).attr(`class`,`bc-bar-connection`).attr(`points`,`${s},${a} ${c},${o} ${l},${o} ${l},${a}`).attr(`fill`,f).attr(`opacity`,t).attr(`pointer-events`,`none`)}}if(D){let e=n.colors??xy,t=`#333`;if(n.connectedColumns&&O.length>1){let e=n.colors??xy,t=n.connectionsOpacity??.15;for(let n=0;n<O.length-1;n++){let r=O[n],i=O[n+1];if(i.isTotal||r.value==null||i.value==null||Number.isNaN(r.value)||Number.isNaN(i.value)||r.value===0||i.value===0)continue;let a=(N(r.label)??0)+N.bandwidth(),o=(N(i.label)??0)+C,s=j(r.x1),c=j(i.x1),l=j(r.x0),u=j(i.x0),d=I.get(r.label)??e[0],f=I.get(i.label)??e[0],p;if(d===f)p=d;else{let e=`bc-conn-grad-${V}-${n}`,t=B.append(`linearGradient`).attr(`id`,e).attr(`x1`,`0%`).attr(`x2`,`0%`).attr(`y1`,`0%`).attr(`y2`,`100%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,d),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,f),p=`url(#${e})`}H.append(`polygon`).attr(`class`,`bc-bar-connection`).attr(`points`,`${s},${a} ${c},${o} ${u},${o} ${l},${a}`).attr(`fill`,p).attr(`opacity`,t).attr(`pointer-events`,`none`)}}for(let e=0;e<O.length-1;e++){let t=O[e],n=O[e+1];if(n.isTotal)break;H.append(`line`).attr(`class`,`bc-waterfall-connector`).attr(`x1`,j(t.x1)).attr(`x2`,j(t.x1)).attr(`y1`,(N(t.label)??0)+N.bandwidth()).attr(`y2`,(N(n.label)??0)+C).attr(`stroke`,`currentColor`).attr(`stroke-dasharray`,`2,2`).attr(`opacity`,.3)}if(H.selectAll(`.bc-bar`).data(O,e=>e.label).enter().append(`rect`).attr(`class`,`bc-bar`).attr(`x`,e=>Math.min(j(e.x0),j(e.x1))).attr(`y`,e=>(N(e.label)??0)+C).attr(`width`,e=>Math.abs(j(e.x1)-j(e.x0))).attr(`height`,N.bandwidth()-C).attr(`fill`,n=>n.isTotal?t:I.get(n.label)??e[0]).attr(`opacity`,e=>L.size>0?oy(L,e.label):null),n.valueLabels){let r=g,i=eh(n.horizontalAxis?.numberFormat??``),a=e=>i?i(e):String(e);$(v).append(`g`).selectAll(`.bc-value-label`).data(O,e=>e.label).enter().append(`text`).attr(`class`,`bc-value-label`).attr(`font-size`,`11px`).attr(`dominant-baseline`,`central`).attr(`y`,e=>(N(e.label)??0)+C+(N.bandwidth()-C)/2).attr(`x`,e=>{let t=Math.max(j(e.x0),j(e.x1));return r===qr.Inside?t-4:t+4}).attr(`text-anchor`,r===qr.Inside?`end`:`start`).attr(`fill`,n=>r===qr.Inside?sr(n.isTotal?t:I.get(n.label)??e[0]):`currentColor`).text(e=>_?e.label:a(e.isTotal?e.x1:e.value))}}else{let t=Iv(e),i=H.append(`g`).node();if(r)for(let e of s)i.appendChild(e);Jv(t,{role:`mark-per-category`,parent:i,selector:`.bc-bar`,data:E,key:e=>e.label,insert:e=>e.append(`rect`).attr(`class`,`bc-bar`),attrs:e=>({x:Math.min(j(0),j(e.value)),y:(N(e.label)??0)+C,width:Math.abs(j(e.value)-j(0)),height:N.bandwidth()-C,fill:I.get(e.label)??(n.colors??xy)[0],opacity:oy(L,e.label)})}),ny(t,{svg:R,clipId:z,group:v,from:c,to:S,active:r&&s.length>0});let o=jv(H);n.tooltips&&o.use(I_({numberFormat:n.horizontalAxis?.numberFormat})),n.crosshair&&o.use(R_({width:y,height:b,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:zr.Horizontal})),n.annotations?.length&&o.use(Sv(n.annotations,{scaleX:N,scaleY:j,data:E,width:y,height:b,backgroundColor:lr(e),orientation:zr.Horizontal,transition:r,priorAnnotations:a}));let l=()=>o.draw(E);t.state===`committing`?t.register(l):l(),n.valueLabels&&Oy($(v).append(`g`),E,j,N,{position:g,colorOverrides:I,colors:n.colors??xy,transition:r,swapLabelValue:_,categoryLabelOffset:C,percent:n.valueLabels===`percent`,total:Fi(E,e=>e.value)})}if(p){let e=$(v).append(`g`).attr(`class`,`bc-category-labels`);for(let t of M){let n=N(t)??0;e.append(`text`).attr(`class`,`bc-category-label`).attr(`x`,2).attr(`y`,n+Sy/2).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`central`).attr(`font-size`,`10px`).attr(`font-weight`,`600`).attr(`fill`,`currentColor`).text(t)}}Ev(e,{chartType:`bar-horizontal`,margin:x,plotRect:S}),i&&(xh(H.node()),Ch(e,i))}function Dy(e,t,n,r,i=0){let a=r===qr.Inside,o=(n(e.label)??0)+i+(n.bandwidth()-i)/2,s,c;if(e.value<0){let n=Math.min(t(0),t(e.value));a?(s=n+4,c=`start`):(s=n-4,c=`end`)}else{let n=t(e.value);a?(s=n-4,c=`end`):(s=n+4,c=`start`)}return{tx:s,ty:o,anchor:c,isInside:a}}function Oy(e,t,n,r,i){let a=i.position??qr.Auto,o=i.categoryLabelOffset??0,s=e=>i.swapLabelValue?e.label:i.percent&&i.total!==void 0?th(e.value,i.total):String(e.value),c=e.select(`.bc-value-label-group`);c.empty()&&(c=e.append(`g`).attr(`class`,`bc-value-label-group`));let l=e.node().ownerSVGElement?.parentElement,u=Iv(l),d=t.filter(e=>my({text:s(e),placement:a===qr.Inside?`inside`:`outside`,orientation:`horizontal`,barWidth:Math.abs(n(e.value)-n(0)),barHeight:r.bandwidth()}));Jv(u,{role:`value-label`,parent:c.node(),selector:`.bc-value-label`,data:d,key:e=>e.label,insert:e=>e.append(`text`).attr(`class`,`bc-value-label`).attr(`font-size`,`11px`).attr(`dominant-baseline`,`central`),attrs:e=>{let t=Dy(e,n,r,a,o);return{x:t.tx,y:t.ty,"text-anchor":t.anchor,fill:t.isInside?sr(i.colorOverrides.get(e.label)??i.colors[0]):`currentColor`}}}),c.selectAll(`.bc-value-label`).data(d,e=>e.label).text(s)}function ky(e,t){let n=e.labels.map((t,n)=>({label:t,value:e.values[n]}));return t.sort===Ur.Ascending?n.sort((e,t)=>e.value-t.value):t.sort===Ur.Descending&&n.sort((e,t)=>t.value-e.value),n.map(e=>e.label)}var Ay=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`],jy=200,My=.2,Ny=class extends Km{initialize(){this.configDefine(`colors`,{defaultValue:Ay}),this.configDefine(`yOffset`,{defaultValue:-10}),this.configDefine(`layout`,{defaultValue:`horizontal`}),this.configDefine(`valueSuffixes`,{defaultValue:[]}),this.configDefine(`maxWidth`,{defaultValue:0});let e=this.base.append(`g`).attr(`class`,`bc-legend`),t=e=>{let t=this.config(`colors`),n=this.config(`layout`),r=this.config(`valueSuffixes`),i=this.base.node()?.ownerSVGElement?.parentElement??document.documentElement,a=getComputedStyle(i).getPropertyValue(`--bc-text-color`).trim()||`#555`,o=this.config(`maxWidth`),s=0,c=0;e.each(function(e,i){let l=$(this),u=r[i],d=16+(u?e.length+1+u.length:e.length)*7+12;n===`horizontal`&&o>0&&s>0&&s+d>o&&(s=0,c+=20),l.attr(`transform`,`translate(${s},${c})`).attr(`data-series`,e).style(`cursor`,`default`);let f=l.select(`rect`);f.empty()&&(f=l.append(`rect`).attr(`width`,12).attr(`height`,12)),f.attr(`fill`,t[i%t.length]);let p=l.select(`text`);p.empty()&&(p=l.append(`text`).attr(`x`,16).attr(`y`,10).attr(`font-size`,`12px`)),p.attr(`fill`,a),p.selectAll(`tspan`).remove(),u?(p.text(null),p.append(`tspan`).attr(`font-weight`,`bold`).text(e),p.append(`tspan`).text(` ${u}`)):p.text(e),n===`vertical`?c+=20:s+=d})};this.layer(`items`,e,{dataBind:(e,t)=>e.selectAll(`.bc-legend-item`).data(t,e=>e),insert:e=>e.append(`g`).attr(`class`,`bc-legend-item`),events:{enter:t,update:t}})}preDraw(){let e=this.config(`yOffset`);this.base.select(`.bc-legend`).attr(`transform`,`translate(0,${e})`)}};function Py(e){let t=$(e).selectAll(`.bc-legend-item`);if(t.empty())return;let n=null,r=null;function i(n){r=n,t.each(function(){let e=$(this),t=e.attr(`data-series`)===n;e.transition().duration(150).style(`opacity`,t?1:My)}),$(e).selectAll(`[data-series]`).filter(function(){return!this.closest(`.bc-legend`)}).each(function(){let e=$(this),t=e.attr(`data-series`)===n,r=this.classList.contains(`bc-direct-label`)||this.classList.contains(`bc-value-label`);e.transition().duration(150).style(`opacity`,t?1:r?0:My)})}function a(){r=null,t.transition().duration(150).style(`opacity`,1),$(e).selectAll(`[data-series]`).filter(function(){return!this.closest(`.bc-legend`)}).transition().duration(150).style(`opacity`,null)}t.on(`mouseenter.bcHighlight`,null).on(`mouseleave.bcHighlight`,null).on(`mouseenter.bcHighlight`,function(){let e=$(this).attr(`data-series`)??``;n&&clearTimeout(n),n=setTimeout(()=>i(e),_h(jy))}).on(`mouseleave.bcHighlight`,()=>{n&&=(clearTimeout(n),null),r!==null&&a()})}function Fy(e,t,n=Ay,r=-10,i=`top`,a=`start`,o=0,s=0,c=0,l=[],u={}){let d=i===`left`||i===`right`?`vertical`:`horizontal`,f=new Ny($(e));f.config({colors:n,yOffset:r,layout:d,valueSuffixes:l,maxWidth:o}),f.draw(t);let p=e.querySelector(`.bc-legend`);if(p){let e,n,i=t.map((e,t)=>{let n=l[t];return n?e.length+1+n.length:e.length});if(d===`horizontal`){let t=i.map(e=>16+e*7+12),r=1,a=0,s=0;for(let e of t)o>0&&a>0&&a+e>o?(s=Math.max(s,a),r++,a=e):a+=e;s=Math.max(s,a),e=s,n=r*20}else e=Math.max(...i)*7+16+8,n=t.length*20;let f=u.left??0,m=u.right??0,h=c,g=r;d===`horizontal`?h+=a===`middle`?-f+(o+f+m-e)/2:a===`end`?o+m-e:-f:a===`middle`?g+=(s-n)/2:a===`end`&&(g+=s-n),p.setAttribute(`transform`,`translate(${h},${g})`)}return Py(e),p}function Iy(e,t,n){if(e.length===0)return{width:0,height:0};if(t===`left`||t===`right`)return{width:Math.max(...e.map(e=>e.length))*7+16+8,height:e.length*20};let r=e.map(e=>16+e.length*7+12);if(!n||n<=0)return{width:r.reduce((e,t)=>e+t,0),height:20};let i=1,a=0,o=0;for(let e of r)a>0&&a+e>n?(o=Math.max(o,a),i++,a=e):a+=e;return o=Math.max(o,a),{width:o,height:i*20}}function Ly(e){return e.length===0?0:Math.max(...e.map(e=>e.length))*7+10}function Ry(e,t){return t?.find(t=>t.name===e)}function zy(e,t,n,r){return Ry(e,r)?.color??n[t%n.length]}function By(e,t){return Ry(e,t)?.dash??`solid`}function Vy(e,t){return Ry(e,t)?.lineWidth??2}function Hy(e,t,n){let r=Ry(e,n);return!r?.interpolation||r.interpolation===`global`?t:r.interpolation}function Uy(e,t){return Ry(e,t)?.hidden??!1}function Wy(e,t,n){let r=Ry(e,n);return!r?.labelMode||r.labelMode===`global`?t:r.labelMode}function Gy(e,t,n){let r=Ry(e,n);return r?.valueLabels===void 0?t:r.valueLabels}function Ky(e,t){return Ry(e,t)?.opacity??1}function qy(e,t,n){let r=Ry(e,n);if(r?.lineSymbols!==!1&&(r?.lineSymbols===!0||t))return{name:e,symbolShape:r?.symbolShape??t?.symbolShape,symbolShowOn:r?.symbolShowOn??t?.symbolShowOn,symbolStyle:r?.symbolStyle??t?.symbolStyle,symbolSize:r?.symbolSize??t?.symbolSize,symbolOpacity:r?.symbolOpacity??t?.symbolOpacity,lineSymbols:!0}}var Jy=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`];function Yy(e,t,n={},r=!1){yh(r);let i=null,a,o,s=[],c,l=Xh.for(e);if(r){let t=Tv(e);o=t?.margin,c=t?.plotRect,l.detach(),t?.chartType===`bar-multi`?s=Array.from(e.querySelectorAll(`.bc-frame .bc-bar-multi`)):t&&(i=Sh(e)),a=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))a.set(e,n);e.replaceChildren()}let{body:u}=Zm(e,n.frame),d=t.series??[],f=d.filter(e=>!Uy(e.name,n.seriesOverrides)),p=f.map(e=>e.name),m=n.colors??Jy,h=n.seriesOverrides,g=n.directLabelling===!0||n.directLabelling===`auto`&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!==`auto`,_=g?`direct`:n.legend===!1?`none`:`legend`,v=n.legend!==!1&&!g,y=mh(u).width,b=n.legendPosition??`top`,x=y>0&&y<350&&(b===`left`||b===`right`)?`top`:b,S=n.legendAnchor??`start`,C=f.flatMap(e=>e.values),w=dh(C,n.verticalAxis?.range,n.verticalAxis?.numberFormat,n.verticalAxis?.scaleType),T=ph(y,n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,w),E=Math.max(0,y-(T.left??50)-(T.right??20)),D=Bh(t.labels,E,n.horizontalAxis);D!==void 0&&(T.bottom=D);let O=T.top!=null,k=Math.max(0,y-(T.left??50)-(T.right??20)),A=v?Iy(p,x,k):{width:0,height:0},ee=v?A.height+15:0,j={...T};v&&x===`top`&&(j.top=ee+(O?15:0)),v&&x===`bottom`&&(j.bottom=(j.bottom??24)+ee),v&&x===`left`&&(j.left=(j.left??50)+A.width+10),v&&x===`right`&&(j.right=(j.right??20)+A.width+10);let{chartArea:M,width:N,height:P,margin:F}=gh(u,j),I=nh(o,F),[L,R]=li(C,n.verticalAxis?.range,n.verticalAxis?.scaleType);if(n.valueLabels&&L<0&&n.verticalAxis?.range?.min==null){let e=R-L;L-=e*.1}let z=t.labels;if(n.sortMode===`total`){let e=t.labels.map((e,t)=>({label:e,index:t,total:f.reduce((e,n)=>e+(n.values[t]??0),0)}));e.sort((e,t)=>t.total-e.total),z=e.map(e=>e.label)}let B=Uu().domain(z).range([0,N]).padding(ci(n.barGap)),V=Uu().domain(p).range([0,B.bandwidth()]).padding(.05),H=n.verticalAxis?.scaleType===`log`,U=H?ld().domain([L,R]).nice().range([P,0]):ad().domain([L,R]).nice().range([P,0]);l.attach(M,I),l.update({vertical:{scale:U,height:P,options:{...n.verticalAxis,gridWidth:N,topPadding:F.top}},horizontal:{scale:B,height:P,options:{...n.horizontalAxis,width:N}}}),!H&&L<0&&R>0&&$(M).append(`line`).attr(`class`,`bc-zero-baseline`).attr(`x1`,0).attr(`x2`,N).attr(`y1`,U(0)).attr(`y2`,U(0)).attr(`stroke`,`#666`).attr(`stroke-width`,1);let te=new Map;n.sortMode===`within-groups`&&t.labels.forEach((e,t)=>{let n=f.map(e=>({name:e.name,value:e.values[t]}));n.sort((e,t)=>t.value-e.value),n.forEach((t,n)=>{te.set(`${e}\0${t.name}`,p[n])})});let ne=[];t.labels.forEach((e,t)=>{f.forEach(r=>{let i=d.findIndex(e=>e.name===r.name),a=n.sortMode===`within-groups`?te.get(`${e}\0${r.name}`)??r.name:r.name;ne.push({label:e,series:a,seriesName:r.name,value:r.values[t],seriesIndex:i})})});let re=n.valueLabels??!1,ie=M.ownerSVGElement,ae=kv(ie,e,`bars`,{x:0,y:0,width:N,height:P}),oe=$(M).append(`g`).attr(`clip-path`,`url(#${ae})`),se=Iv(e),ce=ay(n.highlights),W=Cv(n.colorizes),G=oe.append(`g`).node();if(r)for(let e of s)e.removeAttribute(`opacity`),e.removeAttribute(`fill-opacity`),G.appendChild(e);Jv(se,{role:`mark-per-cell`,parent:G,selector:`.bc-bar-multi`,data:ne,key:e=>`${e.label}\0${e.seriesName}`,insert:e=>e.append(`rect`).attr(`class`,`bc-bar bc-bar-multi`),attrs:e=>{let t=zy(e.seriesName,e.seriesIndex,m,h),n=Ky(e.seriesName,h),r={"data-series":e.seriesName,x:(B(e.label)??0)+(V(e.series)??0),y:Math.min(U(0),U(e.value)),width:V.bandwidth(),height:Math.abs(U(e.value)-U(0)),fill:W.get(e.seriesName)??t};return n<1&&(r[`fill-opacity`]=n),ce.size>0?{...r,opacity:oy(ce,e.seriesName)}:r}});let le={left:F.left,top:F.top,width:N,height:P};ny(se,{svg:ie,clipId:ae,group:M,from:c,to:le,active:r&&s.length>0});let K=jv(oe);if(n.tooltips&&K.use(I_({numberFormat:n.verticalAxis?.numberFormat})),n.crosshair&&K.use(R_({width:N,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),n.annotations?.length){let i=t.labels.map((e,t)=>({label:e,value:Math.max(...f.map(e=>e.values[t]??0))}));K.use(Sv(n.annotations,{scaleX:B,scaleY:U,data:i,width:N,height:P,backgroundColor:lr(e),transition:r,priorAnnotations:a}))}let ue=()=>K.draw(ne);se.state===`committing`?se.register(ue):ue(),Ev(e,{chartType:`bar-multi`,margin:F,plotRect:le}),i&&(xh(oe.node()),Ch(e,i));let de=new Set;f.forEach(e=>{Wy(e.name,_,h)===`direct`&&de.add(e.name)});let fe=de.size>0,pe=lr(e),me=typeof n.directLabelling==`string`?n.directLabelling:n.directLabelling?Zr.Auto:Zr.Off,he=n.directLabelAnchor??`middle`,ge=n.valueLabelPosition??qr.Auto;function _e(){return ge===qr.Inside?qr.Inside:(qr.Outside,qr.Outside)}function ve(e){return me===Zr.Inside?qr.Inside:me===Zr.Outside?qr.Outside:re?_e():qr.Outside}function ye(e,t,n){return n===`start`?e+12:n===`end`?e+t-4:e+t/2}let be=$(M).append(`g`).attr(`class`,`bc-value-labels`);ne.forEach(e=>{if(!Gy(e.seriesName,re,h))return;let t=(B(e.label)??0)+(V(e.series)??0)+V.bandwidth()/2,n=Math.min(U(0),U(e.value)),r=Math.abs(U(e.value)-U(0)),i=_e(),a=fe&&de.has(e.seriesName),o=e.value<0,s=n+r,c,l,u;i===qr.Inside?(l=sr(zy(e.seriesName,e.seriesIndex,m,h)),u=`central`,c=a&&ve(r)===qr.Inside?ye(n,r,he)+14:n+r/2):(l=`currentColor`,o?(c=a&&ve(r)===qr.Outside?s+16:s+4,u=`hanging`):(c=a&&ve(r)===qr.Outside?n-16:n-4,u=`auto`)),my({text:String(e.value),placement:i===qr.Inside?`inside`:`outside`,orientation:`vertical`,barWidth:V.bandwidth(),barHeight:r})&&be.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`x`,t).attr(`y`,c).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,u).attr(`font-size`,`11px`).attr(`fill`,l).text(String(e.value))}),ne.forEach(e=>{if(!de.has(e.seriesName))return;let t=(B(e.label)??0)+(V(e.series)??0)+V.bandwidth()/2,n=Math.min(U(0),U(e.value)),r=Math.abs(U(e.value)-U(0)),i=h?.find(t=>t.name===e.seriesName)?.labelText||e.seriesName,a=ve(r),o=zy(e.seriesName,e.seriesIndex,m,h),s=$(M).append(`text`).attr(`class`,`bc-direct-label`).attr(`data-series`,e.seriesName).attr(`x`,t).attr(`text-anchor`,`middle`).attr(`font-size`,`10px`).text(i);if(a===qr.Inside){let e=ye(n,r,he);s.attr(`y`,e).attr(`fill`,sr(o)),he===`middle`&&s.attr(`dominant-baseline`,`central`)}else s.attr(`y`,n-4).attr(`fill`,ur(o,pe))});let xe=p.filter(e=>Wy(e,_,h)===`legend`);if(v&&xe.length>0){let e=xe.map(e=>zy(e,d.findIndex(t=>t.name===e),m,h)),t=0,n=0;if(x===`top`){let e=O?15:0;n=-(A.height+10+e)}else x===`bottom`?n=P+25:x===`left`?t=-(A.width+10):x===`right`&&(t=N+10);Fy(M,xe,e,n,x,S,N,P,t,[],{left:F.left,right:F.right})}}var Xy={linear:jp,monotoneX:hm,step:_m,stepBefore:vm,stepAfter:ym,basis:rm,cardinal:om,catmullRom:lm};function Zy(e){return e&&Xy[e]||jp}var Qy=`bc-tooltip`,$y=new WeakMap;function eb(e){let t=$y.get(e);t&&($y.delete(e),t())}function tb(){if(document.getElementById(`bc-tooltip-styles`))return;let e=document.createElement(`style`);e.id=`bc-tooltip-styles`,e.textContent=`
|
|
253
|
+
.${Qy} {
|
|
266
254
|
position: absolute;
|
|
267
255
|
pointer-events: none;
|
|
268
256
|
background: var(--bs-body-bg, #fff);
|
|
@@ -275,6 +263,5 @@ body {
|
|
|
275
263
|
z-index: 9999;
|
|
276
264
|
display: none;
|
|
277
265
|
}
|
|
278
|
-
`,document.head.appendChild(t)}function NA(t){const n=t?hr(t):null,e=r=>n?n(r):String(r);return r=>r.series?`${r.series} – ${r.label}: ${e(r.value)}`:`${r.label}: ${e(r.value)}`}function Ho(t,n){const{width:e,height:r,points:a,tooltip:i=!0,crosshair:o=!1,crosshairDirection:s=Ae.Both,crosshairStyle:l=kn.Dashed,crosshairColor:c="#999",format:f=NA(n.numberFormat),container:h}=n;if(a.length===0){const M=()=>{};return h&&Ma.set(h,M),M}const d=l===kn.Solid?"none":l===kn.Dotted?"2,2":"4,3",g=[...new Set(a.map(M=>M.cx))].sort((M,D)=>M-D),v=ot(t);let m=null;i&&(OA(),m=document.createElement("div"),m.className=sd,document.body.appendChild(m));const b=".bc-annotations",x=!v.select(b).empty(),A=M=>x?v.insert(M,b):v.append(M),w=o&&(s===Ae.Both||s===Ae.Vertical),S=o&&(s===Ae.Both||s===Ae.Horizontal);let z=null,Y=null;w&&(z=A("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",r).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",d).attr("pointer-events","none").style("display","none")),S&&(Y=A("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",e).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",d).attr("pointer-events","none").style("display","none"));const G=A("circle").attr("class","bc-proximity-dot").attr("r",6).attr("fill","none").attr("stroke","#333").attr("stroke-width",1).attr("opacity",.45).attr("pointer-events","none").style("display","none"),_=A("rect").attr("class","bc-proximity-overlay").attr("width",e).attr("height",r).attr("fill","none").attr("pointer-events","all");function B(M,D){if(g.length===0)return null;const q=im(g,M),V=g[q],C=a.filter(it=>it.cx===V);if(C.length===0)return null;let I=C[0],W=Math.abs(C[0].cy-D);for(let it=1;it<C.length;it++){const rt=Math.abs(C[it].cy-D);rt<W&&(I=C[it],W=rt)}return I}const P=M=>{const[D,q]=sy(M,t),V=B(D,q);V&&(G.attr("cx",V.cx).attr("cy",V.cy).attr("stroke",V.color).style("display",null),m&&(m.textContent=f(V),m.style.display="block",Th(G.node(),m,{placement:"top",middleware:[$h(8),Ch(),Lh()]}).then(({x:C,y:I})=>{m&&(m.style.left=`${C}px`,m.style.top=`${I}px`)})),z&&z.attr("x1",V.cx).attr("x2",V.cx).style("display",null),Y&&Y.attr("y1",V.cy).attr("y2",V.cy).style("display",null))},$=()=>{G.style("display","none"),m&&(m.style.display="none"),z&&z.style("display","none"),Y&&Y.style("display","none")},N=_.node();N.addEventListener("mousemove",P),N.addEventListener("mouseleave",$);const L=()=>{N.removeEventListener("mousemove",P),N.removeEventListener("mouseleave",$),_.remove(),G.remove(),m&&(m.remove(),m=null),z&&z.remove(),Y&&Y.remove(),h&&Ma.get(h)===L&&Ma.delete(h)};return h&&Ma.set(h,L),L}const EA={circle:vl,square:Rx,diamond:zx,triangle:Bu,triangleDown:Vx??Bu,cross:Dx,star:Hx};function DA(t,n,e){switch(e){case Je.First:return t===0;case Je.Last:return t===n-1;case Je.FirstLast:return t===0||t===n-1;case Je.All:default:return!0}}function Bl(t,n,e,r,a=!1){const i=r.symbol??Ke.Circle,o=r.showOn??Je.FirstLast,s=r.style??Ee.Filled,l=r.size??3.5,c=r.opacity??1,f="var(--bs-body-bg, #fff)",h=n.filter(g=>DA(g.index,e,o)),d=a?Ja():0;if(i===Ke.Circle){t.selectAll("path.bc-symbol").remove();const g=t.selectAll("circle.bc-symbol").data(h).join(m=>m.append("circle").attr("class","bc-symbol").attr("cx",b=>b.cx).attr("cy",b=>b.cy).attr("r",l).attr("fill",b=>s===Ee.Filled?b.color:f).attr("stroke",b=>b.color).attr("stroke-width",s===Ee.Hollow?1.5:0).attr("opacity",c),m=>m,m=>m.remove());(a?g.transition().duration(d):g).attr("cx",m=>m.cx).attr("cy",m=>m.cy).attr("r",l).attr("fill",m=>s===Ee.Filled?m.color:f).attr("stroke",m=>m.color).attr("stroke-width",s===Ee.Hollow?1.5:0).attr("opacity",c)}else{const g=EA[i]??vl,v=Math.PI*l*l,m=Wx().type(g).size(v);t.selectAll("circle.bc-symbol").remove();const b=t.selectAll("path.bc-symbol").data(h).join(A=>A.append("path").attr("class","bc-symbol").attr("transform",w=>`translate(${w.cx},${w.cy})`).attr("d",m).attr("fill",w=>s===Ee.Filled?w.color:f).attr("stroke",w=>w.color).attr("stroke-width",s===Ee.Hollow?1.5:0).attr("opacity",c),A=>A,A=>A.remove());(a?b.transition().duration(d):b).attr("transform",A=>`translate(${A.cx},${A.cy})`).attr("d",m).attr("fill",A=>s===Ee.Filled?A.color:f).attr("stroke",A=>A.color).attr("stroke-width",s===Ee.Hollow?1.5:0).attr("opacity",c)}}const PA="#4e79a7";function zA(t,n,e={},r=!1){var mt,vt,Tt,Ht,Ft,Yt,Ut,Gt,dt,$t,U,T,F;pn(r),Io(t);let a=[],i=[],o=null,s=null,l,c,f;const h=an.for(t);if(r){const E=mn(t);c=E==null?void 0:E.margin,f=E==null?void 0:E.plotRect,h.detach(),(E==null?void 0:E.chartType)==="line"?(a=Array.from(t.querySelectorAll(".bc-frame .bc-area")),i=Array.from(t.querySelectorAll(".bc-frame .bc-line")),o=t.querySelector(".bc-frame .bc-symbols")):E&&(s=nn(t)),l=new Map;for(const at of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[wt,Ct]of Xe(at))l.set(wt,Ct);t.replaceChildren()}const{body:d}=dn(t,e.frame),g=qe(d).width,v=Rr(n.values,(mt=e.verticalAxis)==null?void 0:mt.range,(vt=e.verticalAxis)==null?void 0:vt.numberFormat,(Tt=e.verticalAxis)==null?void 0:Tt.scaleType),m=Cn(g,(Ht=e.verticalAxis)==null?void 0:Ht.labelPosition,(Ft=e.horizontalAxis)==null?void 0:Ft.labelPosition,(Yt=e.verticalAxis)==null?void 0:Yt.direction,v),{chartArea:b,width:x,height:A,margin:w}=gn(d,m),S=Ln(c,w),z=Oi(n.labels,(Ut=e.horizontalAxis)==null?void 0:Ut.range),Y=z.map(E=>n.labels[E]),G=z.map(E=>n.values[E]),_=Y.map((E,at)=>({label:E,value:G[at]})),B=so().domain(Y).range([0,x]).padding(e.edgePadding?.6:0),P=B,$=E=>B(E.label)??0,N=((Gt=e.verticalAxis)==null?void 0:Gt.scaleType)==="log",[L,M]=oa(G,(dt=e.verticalAxis)==null?void 0:dt.range,($t=e.verticalAxis)==null?void 0:$t.scaleType),D=N?cr().domain([L,M]).nice().range([A,0]):Pe().domain([L,M]).nice().range([A,0]),q=D.domain(),V=q[0]<0&&q[1]>0?D(0):void 0;h.attach(b,S),h.update({vertical:{scale:D,height:A,options:{...e.verticalAxis,gridWidth:x,topPadding:w.top}},horizontal:{scale:P,height:A,options:{...e.horizontalAxis,width:x,zeroY:V}}});const C=b.ownerSVGElement,I=Nn(C,t,"plot",{x:-1,y:-1,width:x+2,height:A+2}),W=ot(b).append("g").attr("clip-path",`url(#${I})`),it=W.node(),rt=((U=e.colors)==null?void 0:U[0])??PA,ct=Wr(e.interpolation),pt=e.areaFill??!1,xt=e.areaFillOpacity??.2,yt=ja().curve(ct).x(E=>$(E)).y0(A).y1(E=>D(E.value)),bt=Za().curve(ct).x(E=>$(E)).y(E=>D(E.value)),kt=ot(it).append("g").node(),j=ot(it).append("g").node();if(r){for(const E of a)kt.appendChild(E);for(const E of i)j.appendChild(E)}const J=me(t),X=[{name:"line",points:_}];ge(J,{role:"series-area",parent:kt,selector:".bc-area",data:pt?X:[],key:E=>E.name,insert:E=>E.append("path").attr("class","bc-area"),attrs:E=>({d:yt(E.points)??"",fill:rt,opacity:xt})}),ge(J,{role:"series-line",parent:j,selector:".bc-line",data:X,key:E=>E.name,insert:E=>E.append("path").attr("class","bc-line"),attrs:E=>({d:bt(E.points)??"",fill:"none",stroke:rt})}),ot(it).append("g").selectAll(".bc-dot").data(_,E=>E.label).enter().append("circle").attr("class","bc-dot").attr("cx",E=>$(E)).attr("cy",E=>D(E.value)).attr("r",3).attr("fill",rt).attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none");const ht={left:w.left,top:w.top,width:x+2,height:A+2};if(En(J,{svg:C,clipId:I,group:b,from:f,to:ht,active:r&&(a.length>0||i.length>0)}),(T=e.annotations)!=null&&T.length&&Ro(b,e.annotations,{scaleX:P,scaleY:D,data:_,width:x,height:A,backgroundColor:Be(t),transition:r,priorAnnotations:l}),e.tooltips||e.crosshair){const E=_.map(at=>({cx:$(at),cy:D(at.value),label:at.label,value:at.value,color:rt}));Ho(b,{width:x,height:A,points:E,tooltip:e.tooltips,crosshair:e.crosshair,crosshairDirection:e.crosshairDirection,crosshairStyle:e.crosshairStyle,crosshairColor:e.crosshairColor,numberFormat:(F=e.verticalAxis)==null?void 0:F.numberFormat,container:t})}if(e.valueLabels&&ot(it).append("g").selectAll(".bc-value-label").data(_,at=>at.label).enter().append("text").attr("class","bc-value-label").attr("x",at=>$(at)).attr("y",at=>D(at.value)-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(at=>String(at.value)),e.lineSymbols){const E=_.map((wt,Ct)=>({cx:$(wt),cy:D(wt.value),color:rt,index:Ct}));let at;o?(b.appendChild(o),at=ot(o)):at=ot(b).append("g").attr("class","bc-symbols"),Bl(at,E,_.length,e.lineSymbols,r)}bn(t,{chartType:"line",margin:w,plotRect:ht}),s&&(en(W.node()),rn(t,s))}const Vl=28,ld=18,cd=20;function Wl(t,n,e,r=Vl){if(t.length===0)return[];if(t.length===1)return[Math.max(n,Math.min(e,t[0]))];const a=t.length,i=e-n,s=(a-1)*r>i?Math.max(0,i/(a-1)):r,l=[...t];for(let c=0;c<10;c++){for(let f=1;f<l.length;f++)l[f]-l[f-1]<s&&(l[f]=l[f-1]+s);l[l.length-1]>e&&(l[l.length-1]=e);for(let f=l.length-2;f>=0;f--)l[f+1]-l[f]<s&&(l[f]=l[f+1]-s);l[0]<n&&(l[0]=n)}return l}function fd(t,n,e){const{outerRadius:r,fontSize:a=12,bgColor:i="#fff"}=e,o=r+2,s=o+ld,l=Vl/s,c=[],f=[];for(const d of n){const g=(d.startAngle+d.endAngle)/2;g<Math.PI?f.push({...d,midAngle:g}):c.push({...d,midAngle:g})}function h(d,g){if(d.length===0)return;d.sort((S,z)=>S.midAngle-z.midAngle);const v=g?.05:Math.PI+.05,m=g?Math.PI-.05:2*Math.PI-.05,b=d.map(S=>S.midAngle),x=Wl(b,v,m,l),A=g?1:-1,w=t.append("g").attr("class","bc-arc-labels");d.forEach((S,z)=>{const Y=S.showLabel!==!1,G=S.showValue!==!1;if(!Y&&!G)return;const B=x[z]-Math.PI/2,P=Math.cos(B)*o,$=Math.sin(B)*o,N=Math.cos(B)*s,L=Math.sin(B)*s,M=N+A*cd;w.append("polyline").attr("class","bc-arc-label-line").attr("points",`${P},${$} ${N},${L} ${M},${L}`).attr("fill","none").attr("stroke","var(--bc-text-color, #999)").attr("stroke-width",1).attr("opacity",.5);const D=M+A*4,q=w.append("text").attr("class","bc-arc-direct-label").attr("x",D).attr("y",L).attr("text-anchor",g?"start":"end").attr("font-size",`${a}px`);if(Y&&q.append("tspan").attr("x",D).attr("dy",G?"-0.1em":"0.35em").attr("font-weight","bold").attr("fill",Jc(S.color,i)).text(S.label),G){const V=S.displayAsPercentage&&S.percentage!=null?`${Math.round(S.percentage)}%`:String(S.value);q.append("tspan").attr("x",D).attr("dy",Y?"1.2em":"0.35em").attr("fill","var(--bc-text-color, #666)").text(V)}})}h(f,!0),h(c,!1)}const ud=.3;function hd(t,n,e){const{outerRadius:r,innerRadius:a=0,fontSize:i=12}=e,o=(a+r)/2,s=t.append("g").attr("class","bc-arc-labels-inside");for(const l of n){if(l.endAngle-l.startAngle<ud)continue;const f=l.showLabel!==!1,h=l.showValue!==!1;if(!f&&!h)continue;const d=(l.startAngle+l.endAngle)/2-Math.PI/2,g=Math.cos(d)*o,v=Math.sin(d)*o,m=s.append("text").attr("class","bc-arc-inside-label").attr("x",g).attr("y",v).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",`${i}px`),b=hn(l.color);if(f&&m.append("tspan").attr("x",g).attr("dy",h?"-0.5em":"0em").attr("font-weight","bold").attr("fill",b).text(l.label),h){const x=l.displayAsPercentage&&l.percentage!=null?`${Math.round(l.percentage)}%`:String(l.value);m.append("tspan").attr("x",g).attr("dy",f?"1.2em":"0em").attr("fill",b).attr("opacity",.85).text(x)}}}function RA(t,n,e){const{outerRadius:r,innerRadius:a=0,fontSize:i=12,bgColor:o}=e,s=(a+r)/2,l=[],c=[];for(const f of n){const h=f.endAngle-f.startAngle,d=h*s,g=f.label.length*7;d>g*1.2&&h>=ud?l.push(f):c.push(f)}l.length>0&&hd(t,l,{outerRadius:r,innerRadius:a,fontSize:i}),c.length>0&&fd(t,c,{outerRadius:r,fontSize:i,bgColor:o})}function FA(t,n){if(t.length===0)return{left:0,right:0,top:0,bottom:0};const e=Math.max(...t.map(s=>s.length)),r=ld+cd+6+4+e*7+6,i=t.length*Vl/2,o=Math.max(10,i-n+20);return{left:r,right:r,top:o,bottom:o}}const YA=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];function IA(t,n,e={},r=!1){var sn,ft,et,gt,Lt,At,Kt,He,ln,Ce,Te,ar,ir,fi,ui;pn(r),Io(t);let a=n,i=[],o=[],s=[],l=null,c,f,h;const d=an.for(t);if(r){const nt=mn(t);f=nt==null?void 0:nt.margin,h=nt==null?void 0:nt.plotRect,d.detach(),(nt==null?void 0:nt.chartType)==="line-multi"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),o=Array.from(t.querySelectorAll(".bc-frame .bc-line")),s=Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))):nt&&(l=nn(t)),c=new Map;for(const Xt of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ee,Qt]of Xe(Xt))c.set(ee,Qt);t.replaceChildren()}const{body:g}=dn(t,e.frame),v=a.series??[];let m=v.filter(nt=>!Vr(nt.name,e.seriesOverrides));(e.sortMode==="total"||e.sortMode==="within-groups")&&(m=[...m].sort((nt,Xt)=>{const ee=nt.values.reduce((be,je)=>be+je,0);return Xt.values.reduce((be,je)=>be+je,0)-ee}));const b=e.colors??YA,x=m.map(nt=>nt.name),A=Vn(e.colorizes),w=e.seriesOverrides,S=e.directLabelling===!0||e.directLabelling==="auto"&&e.legend!==!0||!!e.directLabelling&&e.directLabelling!=="auto",z=S?"direct":e.legend!==!1?"legend":"none",Y=x.filter(nt=>vr(nt,z,w)==="direct"),G=e.legend!==!1&&!S,_=qe(g).width,B=350,P=e.legendPosition??"top",$=_>0&&_<B&&(P==="left"||P==="right")?"top":P,N=e.legendAnchor??"start",L=Oi(a.labels,(sn=e.horizontalAxis)==null?void 0:sn.range),M=L.map(nt=>a.labels[nt]);m=m.map(nt=>({...nt,values:L.map(Xt=>nt.values[Xt])})),a={...a,labels:M,series:m};const D=m.flatMap(nt=>nt.values),q=Rr(D,(ft=e.verticalAxis)==null?void 0:ft.range,(et=e.verticalAxis)==null?void 0:et.numberFormat,(gt=e.verticalAxis)==null?void 0:gt.scaleType),V=Cn(_,(Lt=e.verticalAxis)==null?void 0:Lt.labelPosition,(At=e.horizontalAxis)==null?void 0:At.labelPosition,(Kt=e.verticalAxis)==null?void 0:Kt.direction,q),C=Y.length>0?id(Y):0,I=V.top!=null,W=Math.max(0,_-(V.left??50)-(V.right??20)-C),it=G?yr(x,$,W):{width:0,height:0},rt=G?it.height+15:0,ct={...V};if(G&&$==="top"){const nt=I?15:0;ct.top=rt+nt}G&&$==="bottom"&&(ct.bottom=(ct.bottom??24)+rt),G&&$==="left"&&(ct.left=(ct.left??50)+it.width+10),G&&$==="right"&&(ct.right=(ct.right??20)+it.width+10),C>0&&(ct.right=(ct.right??20)+C);const{chartArea:pt,width:xt,height:yt,margin:bt}=gn(g,ct),kt=Ln(f,bt),[j,J]=oa(D,(He=e.verticalAxis)==null?void 0:He.range,(ln=e.verticalAxis)==null?void 0:ln.scaleType),X=so().domain(a.labels).range([0,xt]).padding(e.edgePadding?.6:0),O=X,ht=nt=>X(a.labels[nt])??0,vt=((Ce=e.verticalAxis)==null?void 0:Ce.scaleType)==="log"?cr().domain([j,J]).nice().range([yt,0]):Pe().domain([j,J]).nice().range([yt,0]),Tt=vt.domain(),Ht=Tt[0]<0&&Tt[1]>0?vt(0):void 0;d.attach(pt,kt),d.update({vertical:{scale:vt,height:yt,options:{...e.verticalAxis,gridWidth:xt,topPadding:bt.top}},horizontal:{scale:O,height:yt,options:{...e.horizontalAxis,width:xt,zeroY:Ht}}});const Ft=pt.ownerSVGElement,Yt=Nn(Ft,t,"plot",{x:0,y:0,width:xt,height:yt}),Ut=ot(pt).append("g").attr("clip-path",`url(#${Yt})`),Gt=Ut.node(),dt=m.map(nt=>({name:nt.name,values:nt.values,colorIndex:v.findIndex(Xt=>Xt.name===nt.name)})),$t=Wr(e.interpolation);(Te=e.areaFills)!=null&&Te.length&&HA(Gt,e.areaFills,m,ht,a.labels.length,vt,$t);const U=[];m.forEach((nt,Xt)=>{a.labels.forEach((ee,Qt)=>{U.push({label:ee,value:nt.values[Qt],series:nt.name,colorIndex:Xt})})});const T=e.lineSymbols,F={solid:"",dotted:"2,4",dashed:"8,4","dash-dot":"8,4,2,4"},E=e.valueLabels??!1,at=new Set((e.highlights??[]).map(nt=>nt.target)),wt=e.areaFill??!1,Ct=e.areaFillOpacity??.2,st=nt=>A.get(nt.name)??re(nt.name,nt.colorIndex,b,w),Et=ja().curve($t).x((nt,Xt)=>ht(Xt)).y0(yt).y1(nt=>vt(nt)),Nt=me(t),tt=ot(Gt).append("g").node(),St=ot(Gt).append("g").node(),Dt=new Set(dt.map(nt=>nt.name));if(r){for(const nt of i)Dt.has(((ar=nt.__data__)==null?void 0:ar.name)??"")&&tt.appendChild(nt);for(const nt of o)Dt.has(((ir=nt.__data__)==null?void 0:ir.name)??"")&&St.appendChild(nt)}ge(Nt,{role:"series-area",parent:tt,selector:".bc-area",data:wt?dt:[],key:nt=>nt.name,insert:nt=>nt.append("path").attr("class","bc-area"),attrs:nt=>({"data-series":nt.colorIndex,d:Et(nt.values)??"",fill:st(nt),opacity:Ue(at,nt.name,Ct)})}),ge(Nt,{role:"series-line",parent:St,selector:".bc-line",data:dt,key:nt=>nt.name,insert:nt=>nt.append("path").attr("class","bc-line"),attrs:nt=>{const Xt=od(nt.name,e.interpolation??"linear",w),ee=Za().curve(Wr(Xt)).x((Qt,be)=>ht(be)).y(Qt=>vt(Qt));return{"data-series":nt.colorIndex,d:ee(nt.values)??"",fill:"none",stroke:st(nt),"stroke-width":MA(nt.name,w),"stroke-dasharray":F[SA(nt.name,w)]??"",opacity:Ue(at,nt.name,1)}}}),ot(Gt).append("g").selectAll(".bc-dot").data(U,nt=>nt.label+"\0"+nt.series).enter().append("circle").attr("class","bc-dot").attr("data-series",nt=>nt.colorIndex).attr("cx",nt=>ht(a.labels.indexOf(nt.label))).attr("cy",nt=>vt(nt.value)).attr("r",3).attr("fill",nt=>st({name:nt.series,colorIndex:nt.colorIndex})).attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none");const Zt={left:bt.left,top:bt.top,width:xt,height:yt};if(En(Nt,{svg:Ft,clipId:Yt,group:pt,from:h,to:Zt,active:r&&(o.length>0||i.length>0)}),(fi=e.annotations)!=null&&fi.length){const nt=a.labels.map((Xt,ee)=>{var Qt;return{label:Xt,value:((Qt=m[0])==null?void 0:Qt.values[ee])??0}});Ro(pt,e.annotations,{scaleX:O,scaleY:vt,data:nt,width:xt,height:yt,backgroundColor:Be(t),transition:r,priorAnnotations:c})}const ae=ot(Gt).append("g").attr("class","bc-value-labels");if(U.forEach(nt=>{if(!Sa(nt.series,E,w))return;const Xt=ht(a.labels.indexOf(nt.label)),ee=vt(nt.value);ae.append("text").attr("class","bc-value-label").attr("data-series",nt.colorIndex).attr("x",Xt).attr("y",ee-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(String(nt.value))}),e.tooltips||e.crosshair){const nt=U.map(Xt=>({cx:ht(a.labels.indexOf(Xt.label)),cy:vt(Xt.value),label:Xt.label,value:Xt.value,series:Xt.series,color:re(Xt.series,Xt.colorIndex,b,w)}));Ho(pt,{width:xt,height:yt,points:nt,tooltip:e.tooltips,crosshair:e.crosshair,crosshairDirection:e.crosshairDirection,crosshairStyle:e.crosshairStyle,crosshairColor:e.crosshairColor,numberFormat:(ui=e.verticalAxis)==null?void 0:ui.numberFormat,container:t})}const $e=T?{symbolShape:T.symbol,symbolShowOn:T.showOn,symbolStyle:T.style,symbolSize:T.size,symbolOpacity:T.opacity}:void 0,Ze=a.labels.length;m.forEach((nt,Xt)=>{const ee=$A(nt.name,$e,w);if(!ee)return;const Qt={symbol:ee.symbolShape??(T==null?void 0:T.symbol)??Ke.Circle,showOn:ee.symbolShowOn??(T==null?void 0:T.showOn)??Je.FirstLast,style:ee.symbolStyle??(T==null?void 0:T.style)??Ee.Filled,size:ee.symbolSize??(T==null?void 0:T.size)??3.5,opacity:ee.symbolOpacity??(T==null?void 0:T.opacity)??1},be=a.labels.map((os,hi)=>({cx:ht(hi),cy:vt(nt.values[hi]),color:re(nt.name,Xt,b,w),index:hi})),je=s.find(os=>os.getAttribute("data-series-name")===nt.name);let Xr,is=!1;je?(pt.appendChild(je),Xr=ot(je),is=!0):Xr=ot(pt).append("g").attr("class","bc-symbols").attr("data-series",Xt).attr("data-series-name",nt.name),Bl(Xr,be,Ze,Qt,r&&is)});const Le=a.labels.length-1,yn=ht(Le)+6,fe=[];if(m.forEach((nt,Xt)=>{var je;if(vr(nt.name,z,w)!=="direct")return;const Qt=nt.values[Le],be=((je=w==null?void 0:w.find(Xr=>Xr.name===nt.name))==null?void 0:je.labelText)||nt.name;fe.push({name:nt.name,index:Xt,naturalY:vt(Qt),text:be})}),fe.length>0){fe.sort((Qt,be)=>Qt.naturalY-be.naturalY);const nt=fe.map(Qt=>Qt.naturalY),ee=Wl(nt,0,yt,14);fe.forEach((Qt,be)=>{ot(pt).append("text").attr("class","bc-direct-label").attr("data-series",Qt.index).attr("x",yn).attr("y",ee[be]).attr("dy","0.35em").attr("font-size","11px").attr("fill",re(Qt.name,Qt.index,b,w)).text(Qt.text)})}const ie=x.filter(nt=>vr(nt,z,w)==="legend");if(G&&ie.length>0){const nt=ie.map(Qt=>{const be=v.findIndex(je=>je.name===Qt);return re(Qt,be,b,w)});let Xt=0,ee=0;if($==="top"){const Qt=I?15:0;ee=-(it.height+10+Qt)}else $==="bottom"?ee=yt+25:$==="left"?Xt=-(it.width+10):$==="right"&&(Xt=xt+10);br(pt,ie,nt,ee,$,N,xt,yt,Xt,[],{left:bt.left,right:bt.right})}bn(t,{chartType:"line-multi",margin:bt,plotRect:Zt}),l&&(en(Ut.node()),rn(t,l))}function HA(t,n,e,r,a,i,o){const s=ot(t).append("g").attr("class","bc-area-fills");for(const l of n){const c=e.find(m=>m.name===l.from),f=e.find(m=>m.name===l.to);if(!c||!f)continue;const h=l.interpolation?Wr(l.interpolation):o,d=(l.opacity??30)/100,g=l.color??"#ccc",v=l.negativeColor;if(v)VA(s,c.values,f.values,r,i,h,g,v,d);else{const m=ja().curve(h).x((b,x)=>r(x)).y0((b,x)=>i(f.values[x])).y1(b=>i(b));s.append("path").attr("class","bc-area-fill").attr("d",m(c.values)??"").attr("fill",g).attr("opacity",d)}}}function BA(t,n,e,r){const a=t-e,i=n-r;if(a===0&&i===0||a>0&&i>0||a<0&&i<0)return null;const o=i-a;if(o===0)return null;const s=-a/o;return s<0||s>1?null:s}function VA(t,n,e,r,a,i,o,s,l){const c=n.length;if(c===0)return;const f=[];for(let v=0;v<c;v++){const m=r(v),b=a(n[v]),x=a(e[v]);if(f.push({x:m,fromY:b,toY:x}),v<c-1){const A=a(n[v+1]),w=a(e[v+1]),S=BA(b,A,x,w);if(S!==null&&S>0&&S<1){const z=m+S*(r(v+1)-m),Y=b+S*(A-b),G=x+S*(w-x);f.push({x:z,fromY:Y,toY:G})}}}const h=[];let d=[],g=null;for(const v of f){const m=v.fromY-v.toY,b=m<0;g===null?(g=m===0?null:b,d.push(v)):m===0?(d.push(v),d.length>=2&&h.push({points:d,positive:g}),d=[v],g=null):g===b?d.push(v):(d.push(v),d.length>=2&&h.push({points:d,positive:g}),d=[v],g=b)}d.length>=2&&g!==null&&h.push({points:d,positive:g});for(const v of h){const m=v.points;let b=`M${m[0].x},${m[0].fromY}`;for(let x=1;x<m.length;x++)b+=`L${m[x].x},${m[x].fromY}`;for(let x=m.length-1;x>=0;x--)b+=`L${m[x].x},${m[x].toY}`;b+="Z",t.append("path").attr("class",`bc-area-fill ${v.positive?"bc-area-fill-pos":"bc-area-fill-neg"}`).attr("d",b).attr("fill",v.positive?o:s).attr("opacity",l)}}const WA=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class GA extends zr{initialize(){}}function qA(t,n,e={},r=!1){dd(t,n,e,.6,r)}function dd(t,n,e,r,a=!1){var J;pn(a);let i=null,o;if(a){const X=mn(t),O=r>0?"donut":"pie";X&&X.chartType!==O&&(i=nn(t)),o=new Map;for(const ht of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[mt,vt]of Xe(ht))o.set(mt,vt);t.replaceChildren()}const{body:s}=dn(t,e.frame);let l=[...n.labels],c=[...n.values];if(e.sort===pe.Ascending||e.sort===pe.Descending){const X=l.map((O,ht)=>({label:O,value:c[ht]}));X.sort((O,ht)=>e.sort===pe.Ascending?O.value-ht.value:ht.value-O.value),l=X.map(O=>O.label),c=X.map(O=>O.value)}if(e.sliceMax&&e.sliceMax>0&&l.length>e.sliceMax){const X=e.sliceMax-1,O=l.slice(0,X),ht=c.slice(0,X),mt=c.slice(X).reduce((vt,Tt)=>vt+Tt,0);O.push(e.sliceGroupLabel??"Others"),ht.push(mt),l=O,c=ht}const f=c.reduce((X,O)=>X+O,0),h=c.map(X=>f>0?X/f*100:0),d=e.colors??WA,g=d.length<l.length&&d.length>=2?Ot.scale(d).mode("lch").colors(l.length):d,v=typeof e.directLabelling=="string"?e.directLabelling:e.directLabelling?_e.Auto:_e.Off,m=!!v&&!(v===_e.Auto&&e.legend===!0),x=(e.showValues??!0)&&!m?c.map((X,O)=>`(${e.displayAsPercentage?`${Math.round(h[O])}%`:String(X)})`):[],A=e.legend!==!1&&!m,w=qe(s).width,S=350,z=e.legendPosition??"top",Y=w>0&&w<S&&(z==="left"||z==="right")?"top":z,G=e.legendAnchor??"start",_=x.length>0?l.map((X,O)=>`${X} ${x[O]}`):l,B=Math.max(0,w-50-20),P=A?yr(_,Y,B):{width:0,height:0},$=A?P.height+15:0,N={};if(A&&Y==="top"&&(N.top=$),A&&Y==="bottom"&&(N.bottom=24+$),A&&Y==="left"&&(N.left=50+P.width+10),A&&Y==="right"&&(N.right=20+P.width+10),m){const X=qe(s),O=20,ht=X.width-2*O,mt=(X.height>0?X.height:400)-2*O,vt=Math.min(ht,mt)/2,Tt=FA(l,vt);N.left=(N.left??O)+Tt.left,N.right=(N.right??O)+Tt.right,N.top=(N.top??O)+Tt.top,N.bottom=(N.bottom??O)+Tt.bottom}const{chartArea:L,width:M,height:D,margin:q}=gn(s,N),V=Math.min(M,D)/2,C=V*r,I=ll().domain(l).range(g),W=Ex().sort(null),it=Tx().innerRadius(C).outerRadius(V),rt=ot(L).append("g").attr("transform",`translate(${M/2},${D/2})`),ct=Vn(e.colorizes),pt=W(c),xt=pt.map((X,O)=>({label:l[O],arc:X,color:ct.get(l[O])??I(l[O])})),yt=me(t),bt=Aa(e.highlights),kt=rt.append("g").node();ge(yt,{role:"mark-per-category",parent:kt,selector:".bc-arc",data:xt,key:X=>X.label,insert:X=>X.append("path").attr("class","bc-arc"),attrs:X=>{const O={d:it(X.arc)??"",fill:X.color};return bt.size>0?{...O,opacity:Ue(bt,X.label)}:O}});const j=new GA(rt);if(e.tooltips&&j.use(pr()),j.draw(xt),(J=e.annotations)!=null&&J.length){const X=e.annotations.filter(O=>O.kind==="free");X.length&&wa(X,{scaleX:tn().domain([]).range([0,M]),scaleY:Pe().domain([0,1]).range([D,0]),data:[],width:M,height:D,backgroundColor:Be(t),transition:a,priorAnnotations:o}).postDraw({base:ot(L)},void 0)}if(m){const X=pt.map((vt,Tt)=>({label:l[Tt],value:vt.data,startAngle:vt.startAngle,endAngle:vt.endAngle,color:I(l[Tt]),percentage:h[Tt],displayAsPercentage:e.displayAsPercentage,showLabel:e.showLabels??!0,showValue:e.showValues??!0})),O=rt,ht=Be(t),mt={outerRadius:V,innerRadius:C,bgColor:ht};v===_e.Inside?hd(O,X,mt):v===_e.Auto?RA(O,X,mt):fd(O,X,mt)}if(e.showTotal&&r>0&&!e.displayAsPercentage){const X=String(f);rt.append("text").attr("class","bc-arc-total-label").attr("text-anchor","middle").attr("dy","-0.3em").attr("font-size","11px").attr("fill","var(--bc-text-color, #555)").attr("opacity",.7).text("Total"),rt.append("text").attr("class","bc-arc-total-value").attr("text-anchor","middle").attr("dy","1em").attr("font-size","18px").attr("font-weight","bold").attr("fill","var(--bc-text-color, #555)").text(X)}if(A){let X=0,O=0;Y==="top"?O=-(P.height+10):Y==="bottom"?O=D+25:Y==="left"?X=-(P.width+10):Y==="right"&&(X=M+10),br(L,l,g,O,Y,G,M,D,X,x,{left:q.left,right:q.right})}bn(t,{chartType:r>0?"donut":"pie"}),i&&(en(rt.node()),rn(t,i))}function XA(t,n,e={},r=!1){dd(t,n,e,0,r)}const UA="#4e79a7";function ZA(t,n,e={},r=!1){var ht,mt,vt,Tt,Ht,Ft,Yt,Ut,Gt,dt,$t,U,T;pn(r),Io(t);let a=[],i=[],o=null,s=null,l,c,f;const h=an.for(t);if(r){const F=mn(t);c=F==null?void 0:F.margin,f=F==null?void 0:F.plotRect,h.detach(),(F==null?void 0:F.chartType)==="area"?(a=Array.from(t.querySelectorAll(".bc-frame .bc-area")),i=Array.from(t.querySelectorAll(".bc-frame .bc-line")),o=t.querySelector(".bc-frame .bc-symbols")):F&&(s=nn(t)),l=new Map;for(const E of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[at,wt]of Xe(E))l.set(at,wt);t.replaceChildren()}const{body:d}=dn(t,e.frame),g=qe(d).width,v=Rr(n.values,(ht=e.verticalAxis)==null?void 0:ht.range,(mt=e.verticalAxis)==null?void 0:mt.numberFormat,(vt=e.verticalAxis)==null?void 0:vt.scaleType),m=Cn(g,(Tt=e.verticalAxis)==null?void 0:Tt.labelPosition,(Ht=e.horizontalAxis)==null?void 0:Ht.labelPosition,(Ft=e.verticalAxis)==null?void 0:Ft.direction,v),{chartArea:b,width:x,height:A,margin:w}=gn(d,m),S=Ln(c,w),z=Oi(n.labels,(Yt=e.horizontalAxis)==null?void 0:Yt.range),Y=z.map(F=>n.labels[F]),G=z.map(F=>n.values[F]),_=Y.map((F,E)=>({label:F,value:G[E]})),B=so().domain(Y).range([0,x]).padding(e.edgePadding?.6:0),P=B,$=F=>B(F.label)??0,N=((Ut=e.verticalAxis)==null?void 0:Ut.scaleType)==="log",[L,M]=oa(G,(Gt=e.verticalAxis)==null?void 0:Gt.range,(dt=e.verticalAxis)==null?void 0:dt.scaleType),D=N?cr().domain([L,M]).nice().range([A,0]):Pe().domain([L,M]).nice().range([A,0]),q=D.domain(),V=q[0]<0&&q[1]>0?D(0):void 0;h.attach(b,S),h.update({vertical:{scale:D,height:A,options:{...e.verticalAxis,gridWidth:x,topPadding:w.top}},horizontal:{scale:P,height:A,options:{...e.horizontalAxis,width:x,zeroY:V}}});const C=b.ownerSVGElement,I=Nn(C,t,"plot",{x:0,y:0,width:x,height:A}),W=ot(b).append("g").attr("clip-path",`url(#${I})`),it=W.node(),rt=(($t=e.colors)==null?void 0:$t[0])??UA,ct=Wr(e.interpolation??"monotoneX"),pt=e.areaFillOpacity??.25,xt=ja().curve(ct).x(F=>$(F)).y0(A).y1(F=>D(F.value)),yt=Za().curve(ct).x(F=>$(F)).y(F=>D(F.value)),bt=ot(it).append("g").node(),kt=ot(it).append("g").node();if(r){for(const F of a)bt.appendChild(F);for(const F of i)kt.appendChild(F)}const j=me(t),J=[{name:"area",points:_}];ge(j,{role:"series-area",parent:bt,selector:".bc-area",data:J,key:F=>F.name,insert:F=>F.append("path").attr("class","bc-area"),attrs:F=>({d:xt(F.points)??"",fill:rt,opacity:pt})}),ge(j,{role:"series-line",parent:kt,selector:".bc-line",data:J,key:F=>F.name,insert:F=>F.append("path").attr("class","bc-line"),attrs:F=>({d:yt(F.points)??"",fill:"none",stroke:rt,"stroke-width":2})}),ot(it).append("g").selectAll(".bc-dot").data(_,F=>F.label).enter().append("circle").attr("class","bc-dot").attr("cx",F=>$(F)).attr("cy",F=>D(F.value)).attr("r",3).attr("fill",rt).attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none");const O={left:w.left,top:w.top,width:x,height:A};if(En(j,{svg:C,clipId:I,group:b,from:f,to:O,active:r&&(a.length>0||i.length>0)}),(U=e.annotations)!=null&&U.length&&Ro(b,e.annotations,{scaleX:P,scaleY:D,data:_,width:x,height:A,backgroundColor:Be(t),transition:r,priorAnnotations:l}),e.tooltips||e.crosshair){const F=_.map(E=>({cx:$(E),cy:D(E.value),label:E.label,value:E.value,color:rt}));Ho(b,{width:x,height:A,points:F,tooltip:e.tooltips,crosshair:e.crosshair,crosshairDirection:e.crosshairDirection,crosshairStyle:e.crosshairStyle,crosshairColor:e.crosshairColor,numberFormat:(T=e.verticalAxis)==null?void 0:T.numberFormat,container:t})}if(e.valueLabels&&ot(it).append("g").selectAll(".bc-value-label").data(_,E=>E.label).enter().append("text").attr("class","bc-value-label").attr("x",E=>$(E)).attr("y",E=>D(E.value)-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(E=>String(E.value)),e.lineSymbols){const F=_.map((at,wt)=>({cx:$(at),cy:D(at.value),color:rt,index:wt}));let E;o?(b.appendChild(o),E=ot(o)):E=ot(b).append("g").attr("class","bc-symbols"),Bl(E,F,_.length,e.lineSymbols,r)}bn(t,{chartType:"area",margin:w,plotRect:O}),s&&(en(W.node()),rn(t,s))}function Gl(t){const n=t.series??[];if(n.length===0)return[];const e=n.map(o=>o.name);let r=!1;const a=t.labels.map((o,s)=>{const l={_index:s};return n.forEach(c=>{const f=c.values[s]??0;f<0&&(r=!0),l[c.name]=f}),l});return ju().keys(e).order(vo).offset(r?n2:yo)(a)}function ql(t){const n=t.series??[];if(n.length===0)return[];const e=n.map(o=>o.name),r=t.labels.map((o,s)=>{const l={_index:s};return n.forEach(c=>{l[c.name]=c.values[s]??0}),l}),i=ju().keys(e).order(vo).offset(e2)(r);for(const o of i)for(const s of o)s[0]*=100,s[1]*=100;return i}const jA=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];function KA(t,n,e={},r=!1){var ae,$e,Ze,Le,yn,fe,ie,sn,ft;pn(r),Io(t);let a=n,i=[],o=[],s=null,l,c,f;const h=an.for(t);if(r){const et=mn(t);c=et==null?void 0:et.margin,f=et==null?void 0:et.plotRect,h.detach(),(et==null?void 0:et.chartType)==="area-stacked"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),o=Array.from(t.querySelectorAll(".bc-frame .bc-line"))):et&&(s=nn(t)),l=new Map;for(const gt of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Lt,At]of Xe(gt))l.set(Lt,At);t.replaceChildren()}const{body:d}=dn(t,e.frame),g=Oi(a.labels,(ae=e.horizontalAxis)==null?void 0:ae.range);if(g.length<a.labels.length){const et=g.map(Lt=>a.labels[Lt]),gt=(a.series??[]).map(Lt=>({...Lt,values:g.map(At=>Lt.values[At])}));a={labels:et,values:g.map(Lt=>a.values[Lt]),series:gt}}const v=a.series??[],m=v.filter(et=>!Vr(et.name,e.seriesOverrides)),b=e.colors??jA,x=m.map(et=>et.name),A=e.seriesOverrides,w=Vn(e.colorizes),S=e.directLabelling===!0||e.directLabelling==="auto"&&e.legend!==!0||!!e.directLabelling&&e.directLabelling!=="auto",z=S?"direct":e.legend!==!1?"legend":"none",Y=x.filter(et=>vr(et,z,A)==="direct"),G=e.legend!==!1&&!S,_=qe(d).width,B=350,P=e.legendPosition??"top",$=_>0&&_<B&&(P==="left"||P==="right")?"top":P,N=e.legendAnchor??"start",L=e.stacked!==!1,M=e.stackPercent===!0||e.stackMode===kr.Percent,D=e.areaSortMode??pe.None,q=e.areaLines!==!1,V=[...m];if(D!==pe.None){const et=new Map(V.map(gt=>[gt.name,gt.values.reduce((Lt,At)=>Lt+At,0)]));V.sort((gt,Lt)=>{const At=(et.get(gt.name)??0)-(et.get(Lt.name)??0);return D===pe.Ascending?At:-At})}const C={labels:a.labels,values:a.values,series:V},I=M?ql(C):Gl(C);let W=0;if(L)for(const et of I)for(const gt of et)gt[1]>W&&(W=gt[1]);else for(const et of V)for(const gt of et.values)gt>W&&(W=gt);M&&(W=100);const it=[0,W],rt=(($e=e.verticalAxis)==null?void 0:$e.numberFormat)??(M?"|d|%":void 0),ct=Rr(it,(Ze=e.verticalAxis)==null?void 0:Ze.range,rt,(Le=e.verticalAxis)==null?void 0:Le.scaleType),pt=Cn(_,(yn=e.verticalAxis)==null?void 0:yn.labelPosition,(fe=e.horizontalAxis)==null?void 0:fe.labelPosition,(ie=e.verticalAxis)==null?void 0:ie.direction,ct),xt=Y.length>0?id(Y):0,yt=pt.top!=null,bt=Math.max(0,_-(pt.left??50)-(pt.right??20)-xt),kt=G?yr(x,$,bt):{width:0,height:0},j=G?kt.height+15:0,J={...pt};if(G&&$==="top"){const et=yt?15:0;J.top=j+et}G&&$==="bottom"&&(J.bottom=(J.bottom??24)+j),G&&$==="left"&&(J.left=(J.left??50)+kt.width+10),G&&$==="right"&&(J.right=(J.right??20)+kt.width+10),xt>0&&(J.right=(J.right??20)+xt);const{chartArea:X,width:O,height:ht,margin:mt}=gn(d,J),vt=Ln(c,mt),Tt=so().domain(a.labels).range([0,O]).padding(e.edgePadding?.6:0),Ht=Tt,Ft=et=>Tt(a.labels[et])??0,Yt=Pe().domain([0,W]).nice().range([ht,0]);h.attach(X,vt),h.update({vertical:{scale:Yt,height:ht,options:{...e.verticalAxis,numberFormat:rt,gridWidth:O,topPadding:mt.top}},horizontal:{scale:Ht,height:ht,options:{...e.horizontalAxis,width:O}}});const Ut=X.ownerSVGElement,Gt=Nn(Ut,t,"plot",{x:0,y:0,width:O,height:ht}),dt=ot(X).append("g").attr("clip-path",`url(#${Gt})`),$t=dt.node(),U=Wr(e.interpolation??"monotoneX"),T=I.map(et=>{const gt=v.findIndex(At=>At.name===et.key);let Lt;if(L)Lt=Array.from(et).map(At=>[Yt(At[0]),Yt(At[1])]);else{const At=V.find(Kt=>Kt.name===et.key);Lt=((At==null?void 0:At.values)??[]).map(Kt=>[Yt(0),Yt(Kt)])}return{name:et.key,points:Lt,colorIndex:gt>=0?gt:0}}),F=new Set((e.highlights??[]).map(et=>et.target)),E=F.size>0,at=e.areaFillOpacity!=null?e.areaFillOpacity:.85,wt=et=>w.get(et.name)??re(et.name,et.colorIndex,b,A),Ct=ja().curve(U).x((et,gt)=>Ft(gt)).y0(et=>et[0]).y1(et=>et[1]),st=ot($t).append("g").node(),Et=ot($t).append("g").node();if(r){for(const et of i)st.appendChild(et);for(const et of o)Et.appendChild(et)}const Nt=me(t);ge(Nt,{role:"series-area",parent:st,selector:".bc-area",data:T,key:et=>et.name,insert:et=>et.append("path").attr("class","bc-area"),attrs:et=>({"data-series":et.colorIndex,d:Ct(et.points)??"",fill:wt(et),opacity:E?Ue(F,et.name,at):at})}),ge(Nt,{role:"series-line",parent:Et,selector:".bc-line",data:q?T:[],key:et=>et.name,insert:et=>et.append("path").attr("class","bc-line"),attrs:et=>{const gt=od(et.name,e.interpolation??"monotoneX",A),Lt=Za().curve(Wr(gt)).x((At,Kt)=>Ft(Kt)).y(At=>At[1]);return{"data-series":et.colorIndex,d:Lt(et.points)??"",fill:"none",stroke:wt(et),"stroke-width":1,opacity:E?Ue(F,et.name,1):1}}});const tt={left:mt.left,top:mt.top,width:O,height:ht};if(En(Nt,{svg:Ut,clipId:Gt,group:X,from:f,to:tt,active:r&&(i.length>0||o.length>0)}),(sn=e.annotations)!=null&&sn.length){const et=a.labels.map((gt,Lt)=>{var At;return{label:gt,value:((At=m[0])==null?void 0:At.values[Lt])??0}});Ro(X,e.annotations,{scaleX:Ht,scaleY:Yt,data:et,width:O,height:ht,backgroundColor:Be(t),transition:r,priorAnnotations:l})}if(e.tooltips||e.crosshair){const et=[];I.forEach(gt=>{const Lt=v.findIndex(At=>At.name===gt.key);Array.from(gt).forEach((At,Kt)=>{const He=At[1]-At[0];et.push({cx:Ft(Kt),cy:Yt(At[1]),label:a.labels[Kt],value:Math.round(He*100)/100,series:gt.key,color:re(gt.key,Lt,b,A)})})}),Ho(X,{width:O,height:ht,points:et,tooltip:e.tooltips,crosshair:e.crosshair,crosshairDirection:e.crosshairDirection,crosshairStyle:e.crosshairStyle,crosshairColor:e.crosshairColor,numberFormat:(ft=e.verticalAxis)==null?void 0:ft.numberFormat,container:t})}const St=a.labels.length-1,Dt=Ft(St)+6,Pt=[];if(m.forEach((et,gt)=>{var Ce;if(vr(et.name,z,A)!=="direct")return;const At=I.find(Te=>Te.key===et.name);if(!At)return;const Kt=At[St],He=Yt((Kt[0]+Kt[1])/2),ln=((Ce=A==null?void 0:A.find(Te=>Te.name===et.name))==null?void 0:Ce.labelText)||et.name;Pt.push({name:et.name,index:gt,naturalY:He,text:ln})}),Pt.length>0){Pt.sort((At,Kt)=>At.naturalY-Kt.naturalY);const et=Pt.map(At=>At.naturalY),Lt=Wl(et,0,ht,14);Pt.forEach((At,Kt)=>{ot(X).append("text").attr("class","bc-direct-label").attr("data-series",At.index).attr("x",Dt).attr("y",Lt[Kt]).attr("dy","0.35em").attr("font-size","11px").attr("fill",re(At.name,At.index,b,A)).text(At.text)})}const Zt=x.filter(et=>vr(et,z,A)==="legend");if(G&&Zt.length>0){const et=Zt.map(At=>{const Kt=v.findIndex(He=>He.name===At);return re(At,Kt,b,A)});let gt=0,Lt=0;if($==="top"){const At=yt?15:0;Lt=-(kt.height+10+At)}else $==="bottom"?Lt=ht+25:$==="left"?gt=-(kt.width+10):$==="right"&&(gt=O+10);br(X,Zt,et,Lt,$,N,O,ht,gt,[],{left:mt.left,right:mt.right})}bn(t,{chartType:"area-stacked",margin:mt,plotRect:tt}),s&&(en(dt.node()),rn(t,s))}const JA=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];function QA(t,n,e){const r=[];for(const a of t){const i=a.key,o=e.findIndex(s=>s.name===i);for(let s=0;s<a.length;s++){const l=a[s];r.push({label:n[s],seriesName:i,seriesIndex:o,y0:l[0],y1:l[1],value:l[1]-l[0]})}}return r}function t_(t,n,e={},r=!1){var $t,U,T,F,E,at,wt,Ct;pn(r);let a=[],i=null,o,s,l;const c=an.for(t);if(r){const st=mn(t);s=st==null?void 0:st.margin,l=st==null?void 0:st.plotRect,c.detach(),(st==null?void 0:st.chartType)==="column-stacked"?a=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):st&&(i=nn(t)),o=new Map;for(const Et of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Nt,tt]of Xe(Et))o.set(Nt,tt);t.replaceChildren()}const{body:f}=dn(t,e.frame),h=n.series??[],d=h.filter(st=>!Vr(st.name,e.seriesOverrides)),g=d.map(st=>st.name),v=e.colors??JA,m=e.seriesOverrides,b=e.legend!==!1,x=qe(f).width,A=350,w=e.legendPosition??"top",S=x>0&&x<A&&(w==="left"||w==="right")?"top":w,z=e.legendAnchor??"start",Y={labels:n.labels,values:n.values,series:d},G=e.stackMode===kr.Percent,_=G?ql(Y):Gl(Y),B=QA(_,n.labels,h),P=G?100:Mr(B,st=>st.y1)??0,N=Rr([0,P],($t=e.verticalAxis)==null?void 0:$t.range,(U=e.verticalAxis)==null?void 0:U.numberFormat,(T=e.verticalAxis)==null?void 0:T.scaleType),L=Cn(x,(F=e.verticalAxis)==null?void 0:F.labelPosition,(E=e.horizontalAxis)==null?void 0:E.labelPosition,(at=e.verticalAxis)==null?void 0:at.direction,N),M=Math.max(0,x-(L.left??50)-(L.right??20)),D=Ml(n.labels,M,e.horizontalAxis);D!==void 0&&(L.bottom=D);const q=L.top!=null,V=Math.max(0,x-(L.left??50)-(L.right??20)),C=b?yr(g,S,V):{width:0,height:0},I=b?C.height+15:0,W={...L};if(b&&S==="top"){const st=q?15:0;W.top=I+st}b&&S==="bottom"&&(W.bottom=(W.bottom??24)+I),b&&S==="left"&&(W.left=(W.left??50)+C.width+10),b&&S==="right"&&(W.right=(W.right??20)+C.width+10);const{chartArea:it,width:rt,height:ct,margin:pt}=gn(f,W),xt=Ln(s,pt);let yt=n.labels;if(e.sortMode==="total"){const st=n.labels.map((Et,Nt)=>({label:Et,index:Nt,total:d.reduce((tt,St)=>tt+(St.values[Nt]??0),0)}));st.sort((Et,Nt)=>Nt.total-Et.total),yt=st.map(Et=>Et.label)}const bt=tn().domain(yt).range([0,rt]).padding(Sr(e.barGap)),kt=Pe().domain([0,P]).nice().range([ct,0]);c.attach(it,xt),c.update({vertical:{scale:kt,height:ct,options:{...e.verticalAxis,gridWidth:rt,topPadding:pt.top}},horizontal:{scale:bt,height:ct,options:{...e.horizontalAxis,width:rt}}});const j=it.ownerSVGElement,J=Nn(j,t,"bars",{x:0,y:0,width:rt,height:ct}),X=ot(it).append("g").attr("clip-path",`url(#${J})`),O=yt===n.labels?B:yt.flatMap(st=>B.filter(Et=>Et.label===st)),ht=Vn(e.colorizes),mt=Aa(e.highlights),vt=me(t),Tt=X.append("g").node();if(r)for(const st of a)st.removeAttribute("opacity"),st.removeAttribute("fill-opacity"),Tt.appendChild(st);ge(vt,{role:"mark-per-cell",parent:Tt,selector:".bc-bar-stacked",data:O,key:st=>st.label+"\0"+st.seriesName,insert:st=>st.append("rect").attr("class","bc-bar bc-bar-stacked"),attrs:st=>{const Et=ht.get(st.seriesName)??re(st.seriesName,st.seriesIndex,v,m),Nt=ai(st.seriesName,m),tt={"data-series":st.seriesName,x:bt(st.label)??0,y:kt(st.y1),width:bt.bandwidth(),height:kt(st.y0)-kt(st.y1),fill:Et};return Nt<1&&(tt["fill-opacity"]=Nt),mt.size>0&&(tt.opacity=Ue(mt,st.seriesName)),tt}});const Ht={left:pt.left,top:pt.top,width:rt,height:ct};En(vt,{svg:j,clipId:J,group:it,from:l,to:Ht,active:r&&a.length>0});const Ft=Hr(X);if(e.tooltips&&Ft.use(pr({numberFormat:(wt=e.verticalAxis)==null?void 0:wt.numberFormat})),e.crosshair&&Ft.use(Ir({width:rt,height:ct,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor})),(Ct=e.annotations)!=null&&Ct.length){const st=n.labels.map((Et,Nt)=>({label:Et,value:d.reduce((tt,St)=>tt+(St.values[Nt]??0),0)}));Ft.use(wa(e.annotations,{scaleX:bt,scaleY:kt,data:st,width:rt,height:ct,backgroundColor:Be(t),transition:r,priorAnnotations:o}))}const Yt=()=>Ft.draw(O);vt.state==="committing"?vt.register(Yt):Yt(),bn(t,{chartType:"column-stacked",margin:pt,plotRect:Ht}),i&&(en(X.node()),rn(t,i));const Ut=e.valueLabels??!1,Gt=uf(O,st=>Mr(st,Et=>Et.y1)??0,st=>st.label),dt=ot(it).append("g").attr("class","bc-value-labels");if(O.forEach(st=>{if(!Sa(st.seriesName,Ut,m))return;const Et=(bt(st.label)??0)+bt.bandwidth()/2,Nt=Math.abs(kt(st.y0)-kt(st.y1)),tt=kt(st.y0)-Nt/2,St=G?`${Math.round(st.value)}%`:e.valueLabels==="percent"?xo(st.value,Gt.get(st.label)??0):String(Math.round(st.value*100)/100);Br({text:St,placement:"inside",orientation:"vertical",barWidth:bt.bandwidth(),barHeight:Nt})&&dt.append("text").attr("class","bc-value-label").attr("data-series",st.seriesName).attr("x",Et).attr("y",tt).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(St)}),b&&g.length>0){const st=g.map(tt=>{const St=h.findIndex(Dt=>Dt.name===tt);return re(tt,St,v,m)});let Et=0,Nt=0;if(S==="top"){const tt=q?15:0;Nt=-(C.height+10+tt)}else S==="bottom"?Nt=ct+25:S==="left"?Et=-(C.width+10):S==="right"&&(Et=rt+10);br(it,g,st,Nt,S,z,rt,ct,Et,[],{left:pt.left,right:pt.right})}}const e_=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],gd=13;function n_(t,n,e){const r=[];for(const a of t){const i=a.key,o=e.findIndex(s=>s.name===i);for(let s=0;s<a.length;s++){const l=a[s];r.push({label:n[s],seriesName:i,seriesIndex:o,y0:l[0],y1:l[1],value:l[1]-l[0]})}}return r}function r_(t,n,e={},r=!1){var E,at,wt,Ct,st,Et,Nt;pn(r);let a=[],i=null,o,s,l;const c=an.for(t);if(r){const tt=mn(t);s=tt==null?void 0:tt.margin,l=tt==null?void 0:tt.plotRect,c.detach(),(tt==null?void 0:tt.chartType)==="bar-stacked"?a=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):tt&&(i=nn(t)),o=new Map;for(const St of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Dt,Pt]of Xe(St))o.set(Dt,Pt);t.replaceChildren()}const{body:f}=dn(t,e.frame),h=n.series??[],d=h.filter(tt=>!Vr(tt.name,e.seriesOverrides)),g=d.map(tt=>tt.name),v=e.colors??e_,m=e.seriesOverrides,b=e.legend!==!1,x=qe(f).width,A=350,w=e.legendPosition??"top",S=x>0&&x<A&&(w==="left"||w==="right")?"top":w,z=e.legendAnchor??"start",Y={labels:n.labels,values:n.values,series:d},G=e.stackMode===kr.Percent,_=G?ql(Y):Gl(Y),B=n_(_,n.labels,h),P=G?100:Mr(B,tt=>tt.y1)??0,$=e.categoryLabelLine===!0,N=_o(n.labels),L=$?Jt.Off:(E=e.verticalAxis)==null?void 0:E.labelPosition,M=Cn(x,L,(at=e.horizontalAxis)==null?void 0:at.labelPosition,(wt=e.verticalAxis)==null?void 0:wt.direction,N,(Ct=e.horizontalAxis)==null?void 0:Ct.showAxis),D=M.top!=null,q=Math.max(0,x-(M.left??50)-(M.right??20)),V=b?yr(g,S,q):{width:0,height:0},C=b?V.height+15:0,I={...M};if(b&&S==="top"){const tt=D?15:0;I.top=C+tt}b&&S==="bottom"&&(I.bottom=(I.bottom??24)+C),b&&S==="left"&&(I.left=(I.left??50)+V.width+10),b&&S==="right"&&(I.right=(I.right??20)+V.width+10);const{chartArea:W,width:it,height:rt,margin:ct}=gn(f,I),pt=Ln(s,ct);let xt=n.labels;if(e.sortMode==="total"){const tt=n.labels.map((St,Dt)=>({label:St,index:Dt,total:d.reduce((Pt,Zt)=>Pt+(Zt.values[Dt]??0),0)}));tt.sort((St,Dt)=>Dt.total-St.total),xt=tt.map(St=>St.label)}const yt=Pe().domain([0,P]).nice().range([0,it]),bt=tn().domain(xt).range([0,rt]).padding(Sr(e.barGap));c.attach(W,pt),c.update({horizontal:{scale:yt,height:rt,options:{...e.horizontalAxis,width:it}},vertical:{scale:bt,height:rt,options:{...e.verticalAxis,labelPosition:$?Jt.Off:(st=e.verticalAxis)==null?void 0:st.labelPosition,topPadding:ct.top}},order:"horizontal-first"});const kt=W.ownerSVGElement,j=Nn(kt,t,"bars",{x:0,y:0,width:it,height:rt}),J=ot(W).append("g").attr("clip-path",`url(#${j})`),X=xt===n.labels?B:xt.flatMap(tt=>B.filter(St=>St.label===tt)),O=$?gd:0,ht=Vn(e.colorizes),mt=Aa(e.highlights),vt=me(t),Tt=J.append("g").node();if(r)for(const tt of a)tt.removeAttribute("opacity"),tt.removeAttribute("fill-opacity"),Tt.appendChild(tt);ge(vt,{role:"mark-per-cell",parent:Tt,selector:".bc-bar-stacked",data:X,key:tt=>tt.label+"\0"+tt.seriesName,insert:tt=>tt.append("rect").attr("class","bc-bar bc-bar-stacked"),attrs:tt=>{const St=ht.get(tt.seriesName)??re(tt.seriesName,tt.seriesIndex,v,m),Dt=ai(tt.seriesName,m),Pt={"data-series":tt.seriesName,x:yt(tt.y0),y:(bt(tt.label)??0)+O,width:yt(tt.y1)-yt(tt.y0),height:Math.max(0,bt.bandwidth()-O),fill:St};return Dt<1&&(Pt["fill-opacity"]=Dt),mt.size>0&&(Pt.opacity=Ue(mt,tt.seriesName)),Pt}});const Ht={left:ct.left,top:ct.top,width:it,height:rt};En(vt,{svg:kt,clipId:j,group:W,from:l,to:Ht,active:r&&a.length>0});const Ft=Hr(J);if(e.tooltips&&Ft.use(pr({numberFormat:(Et=e.verticalAxis)==null?void 0:Et.numberFormat})),e.crosshair&&Ft.use(Ir({width:it,height:rt,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor,orientation:Ve.Horizontal})),(Nt=e.annotations)!=null&&Nt.length){const tt=n.labels.map((St,Dt)=>({label:St,value:d.reduce((Pt,Zt)=>Pt+(Zt.values[Dt]??0),0)}));Ft.use(wa(e.annotations,{scaleX:bt,scaleY:yt,data:tt,width:it,height:rt,backgroundColor:Be(t),orientation:Ve.Horizontal,transition:r,priorAnnotations:o}))}const Yt=()=>Ft.draw(X);if(vt.state==="committing"?vt.register(Yt):Yt(),bn(t,{chartType:"bar-stacked",margin:ct,plotRect:Ht}),i&&(en(J.node()),rn(t,i)),$){const tt=ot(W).append("g").attr("class","bc-category-labels");for(const St of xt){const Dt=bt(St)??0;tt.append("text").attr("class","bc-category-label").attr("x",2).attr("y",Dt+gd/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(St)}}const Ut=e.valueLabels??!1,Gt=e.valueLabelPosition??It.Auto,dt=new Set,$t=new Map;for(const tt of xt){const St=X.filter(Dt=>Dt.label===tt).sort((Dt,Pt)=>Dt.y1-Pt.y1);if(St.length>0){const Dt=St[St.length-1];dt.add(Dt.label+"\0"+Dt.seriesName);for(let Pt=0;Pt<St.length-1;Pt++){const Zt=St[Pt].label+"\0"+St[Pt].seriesName;$t.set(Zt,yt(St[Pt+1].y1)-yt(St[Pt].y1))}}}const U=new Map,T=uf(X,tt=>Mr(tt,St=>St.y1)??0,tt=>tt.label),F=ot(W).append("g").attr("class","bc-value-labels");if(X.forEach(tt=>{if(!Sa(tt.seriesName,Ut,m))return;const St=G?`${Math.round(tt.value)}%`:e.valueLabels==="percent"?xo(tt.value,T.get(tt.label)??0):String(Math.round(tt.value*100)/100),Dt=yt(tt.y1)-yt(tt.y0),Pt=St.length*6.5+8,Zt=Dt>=Pt,ae=(bt(tt.label)??0)+O+(bt.bandwidth()-O)/2,$e=re(tt.seriesName,tt.seriesIndex,v,m),Ze=dt.has(tt.label+"\0"+tt.seriesName),Le=Gt===It.Outside||Gt===It.Auto&&!Zt&&Ze,yn=Br({text:St,placement:Le?"outside":"inside",orientation:"horizontal",barWidth:Dt,barHeight:bt.bandwidth()}),fe=()=>{const ie=yt(tt.y0)+Dt/2;F.append("text").attr("class","bc-value-label").attr("data-series",tt.seriesName).attr("opacity",0).attr("x",ie).attr("y",ae).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",hn($e)).text(St)};if(Le)if(Gt===It.Inside)fe();else{const ie=yt(tt.y1)+4,sn=U.get(tt.label)??0,ft=$t.get(tt.label+"\0"+tt.seriesName),et=ie<sn,gt=ft!==void 0&&Pt+4>ft,Lt=it+ct.right-2,At=ie+Pt>Lt;et||gt||At||!yn?fe():(U.set(tt.label,ie+Pt),F.append("text").attr("class","bc-value-label").attr("data-series",tt.seriesName).attr("x",ie).attr("y",ae).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(St))}else if(!Zt||!yn)fe();else{const ie=yt(tt.y0)+Dt/2;F.append("text").attr("class","bc-value-label").attr("data-series",tt.seriesName).attr("x",ie).attr("y",ae).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",hn($e)).text(St)}}),b&&g.length>0){const tt=g.map(Pt=>{const Zt=h.findIndex(ae=>ae.name===Pt);return re(Pt,Zt,v,m)});let St=0,Dt=0;if(S==="top"){const Pt=D?15:0;Dt=-(V.height+10+Pt)}else S==="bottom"?Dt=rt+25:S==="left"?St=-(V.width+10):S==="right"&&(St=it+10);br(W,g,tt,Dt,S,z,it,rt,St,[],{left:ct.left,right:ct.right})}}const a_=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],pd=16,Bo=20,md=13;function i_(t,n,e,r){const a=t.length;if(a===0)return[];const i=Math.max(0,(e-(a-1)*pd)/a),o=r?Mr(t.flatMap(s=>s.values))??0:0;return t.map((s,l)=>{const c=r?o:Mr(s.values)??0,f=Pe().domain([0,c]).nice().range([0,i]);return{seriesName:s.name,seriesIndex:n.findIndex(h=>h.name===s.name),xOffset:l*(i+pd),panelWidth:i,xScale:f}})}function o_(t,n,e,r){const a=[];for(const i of t){const o=r.find(s=>s.name===i.seriesName);if(o)for(const s of n){const l=e.indexOf(s),c=l>=0?o.values[l]??0:0,f=Math.max(0,i.xScale(c)-i.xScale(0));a.push({label:s,seriesName:i.seriesName,seriesIndex:i.seriesIndex,value:c,xPos:i.xOffset,barWidth:f})}}return a}function s_(t,n,e={},r=!1){var Ft,Yt,Ut,Gt,dt,$t;pn(r);let a=[],i=null,o,s;const l=an.for(t);if(r){const U=mn(t);o=U==null?void 0:U.margin,s=U==null?void 0:U.plotRect,l.detach(),(U==null?void 0:U.chartType)==="bar-split"?a=Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")):U&&(i=nn(t)),t.replaceChildren()}const{body:c}=dn(t,e.frame),f=n.series??[],h=f.filter(U=>!Vr(U.name,e.seriesOverrides)),d=h.map(U=>U.name),g=e.colors??a_,v=e.seriesOverrides,m=e.legend!==!1,b=qe(c).width,x=350,A=e.legendPosition??"top",w=b>0&&b<x&&(A==="left"||A==="right")?"top":A,S=e.legendAnchor??"start",z=e.categoryLabelLine===!0,Y=_o(n.labels),G=z?Jt.Off:(Ft=e.verticalAxis)==null?void 0:Ft.labelPosition,_=Cn(b,G,(Yt=e.horizontalAxis)==null?void 0:Yt.labelPosition,(Ut=e.verticalAxis)==null?void 0:Ut.direction,Y,(Gt=e.horizontalAxis)==null?void 0:Gt.showAxis);_.top=(_.top??12)+Bo;const B=Math.max(0,b-(_.left??50)-(_.right??20)),P=m?yr(d,w,B):{width:0,height:0},$=m?P.height+15:0,N={..._};m&&w==="top"&&(N.top=$+Bo),m&&w==="bottom"&&(N.bottom=(N.bottom??24)+$),m&&w==="left"&&(N.left=(N.left??50)+P.width+10),m&&w==="right"&&(N.right=(N.right??20)+P.width+10);const{chartArea:L,width:M,height:D,margin:q}=gn(c,N),V=Ln(o,q);let C=n.labels;if(e.sortMode==="total"){const U=n.labels.map((T,F)=>({label:T,total:h.reduce((E,at)=>E+(at.values[F]??0),0)}));U.sort((T,F)=>F.total-T.total),C=U.map(T=>T.label)}const I=tn().domain(C).range([0,D]).padding(Sr(e.barGap)),W=z?md:0;l.attach(L,V),l.update({vertical:{scale:I,height:D,options:{...e.verticalAxis,labelPosition:z?Jt.Off:(dt=e.verticalAxis)==null?void 0:dt.labelPosition,topPadding:q.top}},order:"horizontal-first"});const it=e.sharedScale===!0,rt=i_(h,f,M,it),ct=L.ownerSVGElement,pt=Nn(ct,t,"bars",{x:0,y:0,width:M,height:D}),xt=ot(L).append("g").attr("clip-path",`url(#${pt})`),yt=ot(L).append("g").attr("class","bc-split-headers");for(const U of rt)yt.append("text").attr("class","bc-split-header").attr("x",U.xOffset+U.panelWidth/2).attr("y",-Bo/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("font-weight","600").attr("fill","currentColor").text(U.seriesName);const bt=o_(rt,C,n.labels,f),kt=Aa(e.highlights),j=Vn(e.colorizes),J=me(t),X=xt.append("g").node();if(r)for(const U of a)U.removeAttribute("opacity"),U.removeAttribute("fill-opacity"),X.appendChild(U);ge(J,{role:"mark-per-cell",parent:X,selector:".bc-bar-split",data:bt,key:U=>U.label+"\0"+U.seriesName,insert:U=>U.append("rect").attr("class","bc-bar bc-bar-split"),attrs:U=>{const T=j.get(U.seriesName)??re(U.seriesName,U.seriesIndex,g,v),F=ai(U.seriesName,v),E={"data-series":U.seriesName,x:U.xPos,y:(I(U.label)??0)+W,width:U.barWidth,height:Math.max(0,I.bandwidth()-W),fill:T};return F<1&&(E["fill-opacity"]=F),kt.size>0&&(E.opacity=Ue(kt,U.seriesName)),E}});const O={left:q.left,top:q.top,width:M,height:D};En(J,{svg:ct,clipId:pt,group:L,from:s,to:O,active:r&&a.length>0});const ht=Hr(xt);e.tooltips&&ht.use(pr({numberFormat:($t=e.verticalAxis)==null?void 0:$t.numberFormat})),e.crosshair&&ht.use(Ir({width:M,height:D,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor,orientation:Ve.Horizontal}));const mt=()=>ht.draw(bt);if(J.state==="committing"?J.register(mt):mt(),bn(t,{chartType:"bar-split",margin:q,plotRect:O}),i&&(en(xt.node()),rn(t,i)),z){const U=ot(L).append("g").attr("class","bc-category-labels");for(const T of C){const F=I(T)??0;U.append("text").attr("class","bc-category-label").attr("x",2).attr("y",F+md/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(T)}}const vt=e.valueLabels??!0,Tt=e.valueLabelPosition??It.Auto,Ht=ot(L).append("g").attr("class","bc-value-labels");if(bt.forEach(U=>{if(!Sa(U.seriesName,vt,v))return;const T=rt.find(tt=>tt.seriesName===U.seriesName);if(!T)return;const F=re(U.seriesName,U.seriesIndex,g,v),E=U.xPos+U.barWidth,at=Math.max(0,I.bandwidth()-W),wt=(I(U.label)??0)+W+at/2,Ct=Tt===It.Inside||Tt===It.Auto&&U.barWidth>30;if(!Br({text:String(U.value),placement:Ct?"inside":"outside",orientation:"horizontal",barWidth:U.barWidth,barHeight:at}))return;let st,Et,Nt;if(Ct)st=E-4,Et="end",Nt=hn(F);else{const tt=E+4,St=T.xOffset+T.panelWidth;tt+20>St?(st=U.xPos-4,Et="end"):(st=tt,Et="start"),Nt="currentColor"}Ht.append("text").attr("class","bc-value-label").attr("data-series",U.seriesName).attr("x",st).attr("y",wt).attr("text-anchor",Et).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Nt).text(String(U.value))}),m&&d.length>0){const U=d.map(E=>{const at=f.findIndex(wt=>wt.name===E);return re(E,at,g,v)});let T=0,F=0;w==="top"?F=-(P.height+10+Bo):w==="bottom"?F=D+25:w==="left"?T=-(P.width+10):w==="right"&&(T=M+10),br(L,d,U,F,w,S,M,D,T,[],{left:q.left,right:q.right})}}const bd=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],yd=13;function l_(t,n,e={},r=!1){var Yt,Ut,Gt,dt,$t,U;pn(r);let a=[],i=null,o,s;const l=an.for(t);if(r){const T=mn(t);o=T==null?void 0:T.margin,s=T==null?void 0:T.plotRect,l.detach(),(T==null?void 0:T.chartType)==="bar-grouped"?a=Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")):T&&(i=nn(t)),t.replaceChildren()}const{body:c}=dn(t,e.frame),f=n.series??[],h=f.filter(T=>!Vr(T.name,e.seriesOverrides)),d=h.map(T=>T.name),g=e.colors??bd,v=e.seriesOverrides,m=e.legend!==!1,b=qe(c).width,x=350,A=e.legendPosition??"top",w=b>0&&b<x&&(A==="left"||A==="right")?"top":A,S=e.legendAnchor??"start",z=e.categoryLabelLine===!0,Y=_o(n.labels),G=z?Jt.Off:(Yt=e.verticalAxis)==null?void 0:Yt.labelPosition,_=Cn(b,G,(Ut=e.horizontalAxis)==null?void 0:Ut.labelPosition,(Gt=e.verticalAxis)==null?void 0:Gt.direction,Y,(dt=e.horizontalAxis)==null?void 0:dt.showAxis),B=Math.max(0,b-(_.left??50)-(_.right??20)),P=m?yr(d,w,B):{width:0,height:0},$=m?P.height+15:0,N={..._};m&&w==="top"&&(N.top=$),m&&w==="bottom"&&(N.bottom=(N.bottom??24)+$),m&&w==="left"&&(N.left=(N.left??50)+P.width+10),m&&w==="right"&&(N.right=(N.right??20)+P.width+10);const{chartArea:L,width:M,height:D,margin:q}=gn(c,N),V=Ln(o,q);let C=n.labels;if(e.sortMode==="total"){const T=n.labels.map((F,E)=>({label:F,total:h.reduce((at,wt)=>at+(wt.values[E]??0),0)}));T.sort((F,E)=>E.total-F.total),C=T.map(F=>F.label)}const I=tn().domain(C).range([0,D]).paddingInner(Sr(e.barGap)).paddingOuter(.05),W=z?yd:0,it=Math.max(0,I.bandwidth()-W),rt=tn().domain(d).range([0,it]).padding(.05),ct=Mr(h.flatMap(T=>T.values))??0,pt=Pe().domain([0,ct]).nice().range([0,M]);l.attach(L,V),l.update({vertical:{scale:I,height:D,options:{...e.verticalAxis,labelPosition:z?Jt.Off:($t=e.verticalAxis)==null?void 0:$t.labelPosition,topPadding:q.top}},horizontal:{scale:pt,height:D,options:{...e.horizontalAxis,width:M}},order:"horizontal-first"});const xt=L.ownerSVGElement,yt=Nn(xt,t,"bars",{x:0,y:0,width:M,height:D}),bt=ot(L).append("g").attr("clip-path",`url(#${yt})`);if(e.barBackground){const T=(e.colors??bd)[0];bt.selectAll(".bc-bar-bg").data(C,F=>F).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",F=>(I(F)??0)+W).attr("width",M).attr("height",I.bandwidth()-W).attr("fill",T).attr("opacity",.18)}if(e.barSeparators&&C.length>1){const T=I.step();for(let F=1;F<C.length;F++){const E=(I(C[F-1])??0)+I.bandwidth()+(T-I.bandwidth())/2;bt.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",M).attr("y1",E).attr("y2",E).attr("stroke","currentColor").attr("opacity",.15)}}const kt=[];for(const T of C){const F=n.labels.indexOf(T);for(const E of h){const at=f.findIndex(wt=>wt.name===E.name);kt.push({label:T,seriesName:E.name,seriesIndex:at,value:F>=0?E.values[F]??0:0})}}const j=Aa(e.highlights),J=Vn(e.colorizes),X=me(t),O=bt.append("g").node();if(r)for(const T of a)T.removeAttribute("opacity"),T.removeAttribute("fill-opacity"),O.appendChild(T);ge(X,{role:"mark-per-cell",parent:O,selector:".bc-bar-grouped",data:kt,key:T=>T.label+"\0"+T.seriesName,insert:T=>T.append("rect").attr("class","bc-bar bc-bar-grouped"),attrs:T=>{const F=J.get(T.seriesName)??re(T.seriesName,T.seriesIndex,g,v),E=ai(T.seriesName,v),at={"data-series":T.seriesName,x:pt(0),y:(I(T.label)??0)+W+(rt(T.seriesName)??0),width:Math.max(0,pt(T.value)-pt(0)),height:rt.bandwidth(),fill:F};return E<1&&(at["fill-opacity"]=E),j.size>0&&(at.opacity=Ue(j,T.seriesName)),at}});const ht={left:q.left,top:q.top,width:M,height:D};En(X,{svg:xt,clipId:yt,group:L,from:s,to:ht,active:r&&a.length>0});const mt=Hr(bt);e.tooltips&&mt.use(pr({numberFormat:(U=e.verticalAxis)==null?void 0:U.numberFormat})),e.crosshair&&mt.use(Ir({width:M,height:D,direction:e.crosshairDirection,style:e.crosshairStyle,color:e.crosshairColor,orientation:Ve.Horizontal}));const vt=()=>mt.draw(kt);if(X.state==="committing"?X.register(vt):vt(),bn(t,{chartType:"bar-grouped",margin:q,plotRect:ht}),i&&(en(bt.node()),rn(t,i)),z){const T=ot(L).append("g").attr("class","bc-category-labels");for(const F of C){const E=I(F)??0;T.append("text").attr("class","bc-category-label").attr("x",2).attr("y",E+yd/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(F)}}const Tt=e.valueLabels??!0,Ht=e.valueLabelPosition??It.Auto,Ft=ot(L).append("g").attr("class","bc-value-labels");if(kt.forEach(T=>{if(!Sa(T.seriesName,Tt,v))return;const F=re(T.seriesName,T.seriesIndex,g,v),E=Math.max(0,pt(T.value)-pt(0)),at=pt(0)+E,wt=(I(T.label)??0)+W+(rt(T.seriesName)??0)+rt.bandwidth()/2,Ct=Ht===It.Inside||Ht===It.Auto&&E>30;if(!Br({text:String(T.value),placement:Ct?"inside":"outside",orientation:"horizontal",barWidth:E,barHeight:rt.bandwidth()}))return;let st,Et,Nt;Ct?(st=at-4,Et="end",Nt=hn(F)):(st=at+4,Et="start",Nt="currentColor"),Ft.append("text").attr("class","bc-value-label").attr("data-series",T.seriesName).attr("x",st).attr("y",wt).attr("text-anchor",Et).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Nt).text(String(T.value))}),m&&d.length>0){const T=d.map(at=>{const wt=f.findIndex(Ct=>Ct.name===at);return re(at,wt,g,v)});let F=0,E=0;w==="top"?E=-(P.height+10):w==="bottom"?E=D+25:w==="left"?F=-(P.width+10):w==="right"&&(F=M+10),br(L,d,T,E,w,S,M,D,F,[],{left:q.left,right:q.right})}}const Xl=new Map;function ze(t,n,e){Xl.set(t,{renderer:n,options:e})}function c_(t){var n;return(n=Xl.get(t))==null?void 0:n.renderer}function vd(t){var n;return((n=Xl.get(t))==null?void 0:n.options)??[]}const xd=[{value:he.Solid,text:"Solid"},{value:he.Dashed,text:"Dashed"},{value:he.Dotted,text:"Dotted"},{value:he.None,text:"None"}],Re={key:"colors",type:_t.Colors,label:"Colors"},Fe={key:"colorPalette",type:_t.Select,label:"Color palette",default:"Blueprint",choices:[{value:"",text:"Custom"},...H0().map(t=>({value:t.name,text:t.label}))]},Ye={key:"autoContrast",type:_t.Boolean,label:"Auto-adjust contrast",default:!1},Ie={key:"allowDarkMode",type:_t.Boolean,label:"Allow dark mode",default:!0},$a={key:"legend",type:_t.Boolean,label:"Show legend",default:!0},er={key:"legendPosition",type:_t.Select,label:"Legend position",default:ia.Top,choices:[{value:ia.Top,text:"Top"},{value:ia.Bottom,text:"Bottom"},{value:ia.Left,text:"Left"},{value:ia.Right,text:"Right"}]},nr={key:"legendAnchor",type:_t.Select,label:"Legend anchor",default:Zn.Start,choices:[{value:Zn.Start,text:"Start"},{value:Zn.Middle,text:"Middle"},{value:Zn.End,text:"End"}]},Vo={key:"directLabelling",type:_t.Select,label:"Direct labelling",default:_e.Off,choices:[{value:_e.Off,text:"Off"},{value:_e.Auto,text:"Auto"},{value:_e.Outside,text:"Outside"},{value:_e.Inside,text:"Inside"}]},Ul={key:"directLabelAnchor",type:_t.Select,label:"Label anchor",default:Zn.Middle,choices:[{value:Zn.Start,text:"Start"},{value:Zn.Middle,text:"Middle"},{value:Zn.End,text:"End"}]},Wo={key:"valueLabels",type:_t.Boolean,label:"Value labels",default:!1},Go={key:"valueLabelPosition",type:_t.Select,label:"Label position",default:It.Auto,choices:[{value:It.Auto,text:"Auto"},{value:It.Outside,text:"Outside"},{value:It.Inside,text:"Inside"}]},rr={key:"tooltips",type:_t.Boolean,label:"Tooltips",default:!1},wd={key:"crosshair",type:_t.Boolean,label:"Crosshair",default:!1},Ad={key:"crosshairDirection",type:_t.Select,label:"Crosshair direction",default:Ae.Both,choices:[{value:Ae.Both,text:"Both"},{value:Ae.Vertical,text:"Vertical"},{value:Ae.Horizontal,text:"Horizontal"}]},_d={key:"crosshairStyle",type:_t.Select,label:"Crosshair style",default:kn.Dashed,choices:[{value:kn.Solid,text:"Solid"},{value:kn.Dashed,text:"Dashed"},{value:kn.Dotted,text:"Dotted"}]},kd={key:"crosshairColor",type:_t.Text,label:"Crosshair color",default:"#999",placeholder:"#999"},Sd={key:"lineSymbols",type:_t.Boolean,label:"Show line symbols",default:!1},Md={key:"lineSymbolShape",type:_t.Select,label:"Symbol",default:Ke.Circle,choices:[{value:Ke.Circle,text:"Circle"},{value:Ke.Square,text:"Square"},{value:Ke.Diamond,text:"Diamond"},{value:Ke.Triangle,text:"Triangle Up"},{value:Ke.TriangleDown,text:"Triangle Down"},{value:Ke.Cross,text:"Cross"},{value:Ke.Star,text:"Star"}]},$d={key:"lineSymbolShowOn",type:_t.Select,label:"Show on",default:Je.FirstLast,choices:[{value:Je.FirstLast,text:"First & Last"},{value:Je.First,text:"First"},{value:Je.Last,text:"Last"},{value:Je.All,text:"All"}]},Ld={key:"lineSymbolStyle",type:_t.Select,label:"Style",default:Ee.Filled,choices:[{value:Ee.Filled,text:"Filled"},{value:Ee.Hollow,text:"Hollow"}]},Cd={key:"lineSymbolSize",type:_t.Text,label:"Size",default:"3.5",placeholder:"3.5"},Td={key:"lineSymbolOpacity",type:_t.Text,label:"Opacity",default:"1",placeholder:"1"},ii={key:"sortMode",type:_t.Select,label:"Sort mode",default:_n.None,choices:[{value:_n.None,text:"None"},{value:_n.Total,text:"By total"},{value:_n.WithinGroups,text:"Within groups"}]},qo={key:"edgePadding",type:_t.Boolean,label:"Edge padding",default:!1},Xo={key:"waterfall",type:_t.Boolean,label:"Waterfall",default:!1},Uo={key:"waterfallTotal",type:_t.Boolean,label:"Waterfall total",default:!1},oi={key:"barBackground",type:_t.Boolean,label:"Bar background",default:!1},Zo={key:"barGap",type:_t.Text,label:"Bar gap",default:String(Rs),placeholder:String(Rs)},si={key:"barSeparators",type:_t.Boolean,label:"Bar separators",default:!1},jo={key:"connectedColumns",type:_t.Boolean,label:"Connected columns",default:!1},Ko={key:"connectionsOpacity",type:_t.Text,label:"Opacity",default:"0.15",placeholder:"0.15"},Jo={key:"swapLabelValue",type:_t.Boolean,label:"Swap labels and values",default:!1},Od={key:"stackMode",type:_t.Select,label:"Stack mode",default:kr.Normal,choices:[{value:kr.Normal,text:"Normal"},{value:kr.Percent,text:"Percentage (100%)"}]},f_={key:"sharedScale",type:_t.Boolean,label:"Shared scale",default:!1},Gr={key:"categoryLabelLine",type:_t.Boolean,label:"Labels on separate line",default:!1},Nd={key:"displayAsPercentage",type:_t.Boolean,label:"Display as percentage",default:!1},Ed={key:"showTotal",type:_t.Boolean,label:"Show total",default:!1},Dd={key:"showLabels",type:_t.Boolean,label:"Show labels",default:!0},Pd={key:"showValues",type:_t.Boolean,label:"Show values",default:!0},zd={key:"sliceMax",type:_t.Text,label:"Max slices",default:"6"},Rd={key:"sliceGroupLabel",type:_t.Text,label:"Group label",default:"Others",placeholder:"Others"},u_={key:"areaFillOpacity",type:_t.Text,label:"Opacity",default:"0.85",placeholder:"0.85"},h_={key:"stacked",type:_t.Boolean,label:"Stack areas",default:!0},d_={key:"stackPercent",type:_t.Boolean,label:"Stack to 100%",default:!1},g_={key:"areaLines",type:_t.Boolean,label:"Separate areas with lines",default:!0},p_={key:"areaSortMode",type:_t.Select,label:"Sort areas",default:pe.None,choices:[{value:pe.None,text:"Keep order"},{value:pe.Ascending,text:"Smallest first"},{value:pe.Descending,text:"Largest first"}]},m_={key:"interpolation",type:_t.Select,label:"Line interpolation",default:Sn.Linear,choices:[{value:Sn.Linear,text:"Linear"},{value:Sn.MonotoneX,text:"Monotone"},{value:Sn.Step,text:"Step"},{value:Sn.StepBefore,text:"Step (before)"},{value:Sn.StepAfter,text:"Step (after)"},{value:Sn.Basis,text:"Basis"},{value:Sn.Cardinal,text:"Cardinal"},{value:Sn.CatmullRom,text:"Catmull-Rom"}]},Fd=[{value:aa.Linear,text:"Linear"},{value:aa.Log,text:"Logarithmic"}],Yd=[{value:Jt.Auto,text:"Auto"},{value:Jt.Inside,text:"Inside"},{value:Jt.Outside,text:"Outside"},{value:Jt.Off,text:"Off"}],b_=[{value:Pa.Auto,text:"Auto"},{value:Pa.Horizontal,text:"Horizontal"},{value:Pa.Vertical,text:"Vertical"}];function li(t){return[{key:"showVerticalAxis",type:_t.Boolean,label:"Show vertical axis",default:t.showVerticalAxis??!0},{key:"verticalAxisDirection",type:_t.Select,label:"Vertical axis side",default:An.Left,choices:[{value:An.Left,text:"Left"},{value:An.Right,text:"Right"}]},{key:"showVerticalTicks",type:_t.Boolean,label:"Show vertical ticks",default:t.showVerticalTicks},{key:"verticalLabelPosition",type:_t.Select,label:"Vertical labels",default:t.valueAxisLabelsOff&&t.valueAxis==="vertical"?Jt.Off:Jt.Auto,choices:Yd},{key:"verticalGridStyle",type:_t.Select,label:"Vertical grid style",default:t.verticalGrid,choices:xd},{key:"verticalNumberFormat",type:_t.NumberFormat,label:"Vertical number format"},...t.valueAxis==="vertical"?[{key:"verticalScaleType",type:_t.Select,label:"Vertical scale",default:aa.Linear,choices:Fd},t.valueAxisZeroBaseline?{key:"verticalRangeMin",type:_t.Text,label:"Vertical min",default:"0",placeholder:"auto"}:{key:"verticalRangeMin",type:_t.Text,label:"Vertical min",placeholder:"auto"},{key:"verticalRangeMax",type:_t.Text,label:"Vertical max",placeholder:"auto"}]:[],{key:"showHorizontalAxis",type:_t.Boolean,label:"Show horizontal axis",default:t.showHorizontalAxis??!0},{key:"showHorizontalTicks",type:_t.Boolean,label:"Show horizontal ticks",default:t.showHorizontalTicks},{key:"horizontalLabelPosition",type:_t.Select,label:"Horizontal labels",default:t.valueAxisLabelsOff&&t.valueAxis==="horizontal"?Jt.Off:Jt.Auto,choices:Yd},{key:"horizontalLabelRotation",type:_t.Select,label:"Horizontal label rotation",default:Pa.Horizontal,choices:b_},{key:"horizontalGridStyle",type:_t.Select,label:"Horizontal grid style",default:t.horizontalGrid,choices:xd},{key:"horizontalNumberFormat",type:_t.NumberFormat,label:"Horizontal number format"},...t.valueAxis==="horizontal"?[{key:"horizontalScaleType",type:_t.Select,label:"Horizontal scale",default:aa.Linear,choices:Fd},t.valueAxisZeroBaseline?{key:"horizontalRangeMin",type:_t.Text,label:"Horizontal min",default:"0",placeholder:"auto"}:{key:"horizontalRangeMin",type:_t.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:_t.Text,label:"Horizontal max",placeholder:"auto"}]:[],...t.horizontalRange?[{key:"horizontalRangeMin",type:_t.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:_t.Text,label:"Horizontal max",placeholder:"auto"}]:[]]}const Qo=li({verticalGrid:he.None,horizontalGrid:he.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",valueAxisZeroBaseline:!0,valueAxisLabelsOff:!0}),ci=li({verticalGrid:he.None,horizontalGrid:he.None,showVerticalTicks:!1,showHorizontalTicks:!1,showHorizontalAxis:!1,valueAxis:"horizontal",valueAxisZeroBaseline:!0,valueAxisLabelsOff:!0}),Id=li({verticalGrid:he.Dashed,horizontalGrid:he.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0}),y_=li({verticalGrid:he.Dashed,horizontalGrid:he.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0}),ts={...m_,default:Sn.MonotoneX},v_={...Ad,default:Ae.Vertical},x_={...wd,default:!0},w_={...Sd,default:!0},Hd={...ii,default:_n.Total},Zl={...Wo,default:!0},A_={...Wo,default:!0},__={...Nd,default:!0},k_={...zd,default:"5"},S_={...Ed,default:!0},es={...Vo,default:_e.Auto},ns={...$a,default:!1},rs=[wd,Ad,_d,kd],jl=[x_,v_,_d,kd],as=[A_,Go,rr,...rs],Kl=[Zl,Go,rr,...rs],M_=[Sd,Md,$d,Ld,Cd,Td],$_=[w_,Md,$d,Ld,Cd,Td],Bd=[Wo,rr,...jl,...M_],L_=[Wo,rr,...jl,...$_],C_=[__,Ed,Dd,Pd,k_,Rd],T_=[Nd,S_,Dd,Pd,zd,Rd];ze(ve.BarVertical,td,[Re,Fe,Ye,Ie,Jo,oi,si,Zo,jo,Ko,Xo,Uo,Gr,...Qo,...as]),ze(ve.BarHorizontal,nd,[Re,Fe,Ye,Ie,Jo,oi,si,Zo,jo,Ko,Xo,Uo,Gr,...ci,...Kl]),ze(ve.BarMulti,CA,[Re,Fe,Ye,Ie,Hd,ns,nr,er,es,Ul,...Qo,...as]),ze(ve.Line,zA,[Re,Fe,Ye,Ie,ts,qo,...Id,...Bd]),ze(ve.LineMulti,IA,[Re,Fe,Ye,Ie,ts,qo,ii,ns,nr,er,es,...Id,...L_]),ze(ve.Donut,qA,[Re,Fe,Ye,Ie,ns,nr,er,es,rr,...T_]),ze(ve.Pie,XA,[Re,Fe,Ye,Ie,ns,nr,er,es,rr,...C_]),ze(ve.Area,ZA,[Re,Fe,Ye,Ie,ts,qo,...y_,...Bd]);const O_=li({verticalGrid:he.Dashed,horizontalGrid:he.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0});ze(ve.AreaStacked,KA,[Re,Fe,Ye,Ie,u_,ts,qo,p_,h_,d_,g_,$a,nr,er,Vo,...O_,rr,...jl]),ze(ve.ColumnStacked,t_,[Re,Fe,Ye,Ie,Od,ii,$a,nr,er,Vo,Ul,...Qo,...as]),ze(ve.BarStacked,r_,[Re,Fe,Ye,Ie,Od,ii,$a,nr,er,Vo,Ul,Gr,...ci,...Kl]),ze(ve.BarSplit,s_,[Re,Fe,Ye,Ie,f_,ii,$a,nr,er,Gr,...ci,Zl,Go,rr,...rs]),ze(ve.BarGrouped,l_,[Re,Fe,Ye,Ie,Hd,$a,nr,er,oi,si,Gr,...ci,Zl,Go,rr,...rs]),ze(ve.VerticalBar,td,[Re,Fe,Ye,Ie,Jo,oi,si,Zo,jo,Ko,Xo,Uo,Gr,...Qo,...as]),ze(ve.HorizontalBar,nd,[Re,Fe,Ye,Ie,Jo,oi,si,Zo,jo,Ko,Xo,Uo,Gr,...ci,...Kl]);function qr(t){return new Map(t.map(n=>[n.key,n.value]))}function Vd(t,n){const e=qr(n),r=vd(t),a=new Set(r.map(o=>o.key)),i={};for(const o of r){const s=e.get(o.key);s!==void 0&&a.has(o.key)&&(o.type===_t.Colors?i[o.key]=String(s).split(",").map(l=>l.trim()).filter(Boolean):o.type===_t.Boolean?o.key==="valueLabels"&&String(s).toLowerCase()==="percent"?i[o.key]="percent":i[o.key]=s==="true"||s===!0:i[o.key]=String(s))}return i}function N_(t){return!(/^-?\d+(\.\d+)?$/.test(t)||/^-?\d+(\.\d+)?%$/.test(t)||/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t))}function Wd(t){return t.entries.map(n=>{if(n.values&&n.values.length>1){if(n.key==="series"&&!n.quotedKey)return`series = ${n.values.map(a=>`"${a}"`).join(",")}`;const r=n.values.join(",");return`"${n.key}" = ${r}`}const e=n.isPercentage?`${n.value}%`:String(n.value);return n.key==="series"&&!n.quotedKey?`series = "${e}"`:typeof n.value=="string"&&N_(e)?`"${n.key}" = "${e}"`:`"${n.key}" = ${e}`}).join(`
|
|
279
|
-
`)}function Gd(t,n){const e=t.find(r=>r.key===n);return e?String(e.value):void 0}function qd(t,n){const e=t.find(r=>r.key===n);if(e)return e.isPercentage,e.value}function Xd(t){const n=t.find(e=>e.key==="maxWidth");if(n)return n.isPercentage?`${n.value}%`:n.value}const xr=t=>t==="true"||t===!0;function Ud(t){return t.map(n=>({target:n.target,color:Gd(n.properties,"color")??"#e15759",label:Gd(n.properties,"label")}))}function Zd(t){return t.map(n=>({target:n.target}))}function jd(t){return t.map(n=>{const e=qr(n.properties);return{from:n.from,to:n.to,color:e.has("color")?String(e.get("color")):void 0,negativeColor:e.has("negativeColor")?String(e.get("negativeColor")):void 0,opacity:e.has("opacity")?Number(e.get("opacity")):void 0,interpolation:e.has("interpolation")?String(e.get("interpolation")):void 0}})}function Jl(t){const n=t.get("repeat");if(n===!0||n==="true")return"always";if(n===void 0||n===!1||n==="false")return;const e=Number(n);return Number.isInteger(e)&&e>=1?e:void 0}function Kd(t){return t.map(n=>{const e=qr(n.properties),r=n.kind??we.Point;if(r===we.Range){const s={kind:we.Range,start:e.has("start")?isNaN(Number(e.get("start")))?String(e.get("start")):Number(e.get("start")):0,end:e.has("end")?isNaN(Number(e.get("end")))?String(e.get("end")):Number(e.get("end")):0};return s.repeat=Jl(e),e.has("orientation")&&(s.orientation=String(e.get("orientation"))),e.has("startAnchor")&&(s.startAnchor=String(e.get("startAnchor"))),e.has("endAnchor")&&(s.endAnchor=String(e.get("endAnchor"))),e.has("bgColor")&&(s.bgColor=String(e.get("bgColor"))),e.has("bgOpacity")&&(s.bgOpacity=Number(e.get("bgOpacity"))),e.has("direction")&&(s.direction=String(e.get("direction"))),e.has("text")&&(s.text=String(e.get("text"))),e.has("textColor")&&(s.textColor=String(e.get("textColor"))),s}if(r===we.Free){const s={kind:we.Free,text:String(e.get("text")??""),x:qd(n.properties,"x")??0,y:qd(n.properties,"y")??0};s.repeat=Jl(e),e.has("textColor")&&(s.textColor=String(e.get("textColor")));const l=Xd(n.properties);return l!==void 0&&(s.maxWidth=l),e.has("textOutline")&&(s.textOutline=xr(e.get("textOutline"))),s}const a="target"in n?n.target:"",i={kind:we.Point,target:a,text:String(e.get("text")??"")};i.repeat=Jl(e),e.has("textColor")&&(i.textColor=String(e.get("textColor")));const o=Xd(n.properties);return o!==void 0&&(i.maxWidth=o),e.has("textOutline")&&(i.textOutline=xr(e.get("textOutline"))),e.has("showLine")&&(i.showLine=xr(e.get("showLine"))),e.has("anchorDirection")&&(i.anchorDirection=String(e.get("anchorDirection"))),e.has("textOffsetX")&&(i.textOffsetX=Number(e.get("textOffsetX"))),e.has("textOffsetY")&&(i.textOffsetY=Number(e.get("textOffsetY"))),e.has("lineStyle")&&(i.lineStyle=String(e.get("lineStyle"))),e.has("lineWeight")&&(i.lineWeight=Number(e.get("lineWeight"))),e.has("showArrow")&&(i.showArrow=xr(e.get("showArrow"))),e.has("lineTargetDistance")&&(i.lineTargetDistance=Number(e.get("lineTargetDistance"))),e.has("showCircle")&&(i.showCircle=xr(e.get("showCircle"))),e.has("circleSize")&&(i.circleSize=Number(e.get("circleSize"))),e.has("circleStyle")&&(i.circleStyle=String(e.get("circleStyle"))),e.has("circleColor")&&(i.circleColor=String(e.get("circleColor"))),i})}function Jd(t){return t.map(n=>{const e=qr(n.properties),r={name:n.name};if(e.has("color")&&(r.color=String(e.get("color"))),e.has("lineWidth")&&(r.lineWidth=Number(e.get("lineWidth"))),e.has("dash")&&(r.dash=String(e.get("dash"))),e.has("interpolation")&&(r.interpolation=String(e.get("interpolation"))),e.has("labelMode")&&(r.labelMode=String(e.get("labelMode"))),e.has("labelText")&&(r.labelText=String(e.get("labelText"))),e.has("valueLabels")){const a=e.get("valueLabels");r.valueLabels=String(a).toLowerCase()==="percent"?"percent":xr(a)}return e.has("lineSymbols")&&(r.lineSymbols=xr(e.get("lineSymbols"))),e.has("hidden")&&(r.hidden=xr(e.get("hidden"))),e.has("symbolShape")&&(r.symbolShape=String(e.get("symbolShape"))),e.has("symbolShowOn")&&(r.symbolShowOn=String(e.get("symbolShowOn"))),e.has("symbolStyle")&&(r.symbolStyle=String(e.get("symbolStyle"))),e.has("symbolSize")&&(r.symbolSize=Number(e.get("symbolSize"))),e.has("symbolOpacity")&&(r.symbolOpacity=Number(e.get("symbolOpacity"))),r})}const Qd=new Set;function E_(t,n,e){let r=n;for(const a of t)a.transformType==="sort"?r=_n.Total:Qd.has(a.transformType)||(Qd.add(a.transformType),console.warn(`[blueprint-chart] Unknown transform "${a.transformType}" in ${e}; ignored.`));return r}function D_(t){const n=i=>{const o=t.get(i);return o==null?void 0:String(o)||void 0},e=t.get("transparentBackground"),r={title:n("title"),description:n("description"),source:n("source"),sourceUrl:n("sourceUrl"),byline:n("byline"),note:n("note"),padding:n("padding"),transparentBackground:e===!0||e==="true"||void 0};return Object.values(r).some(i=>i!==void 0)?r:void 0}function P_(t){const n=qr(t.properties),e=t.data?Wd(t.data):"",r=lf(e),a=n.get("sort"),i=a==null?void 0:String(a),o=i===pe.Ascending||i===pe.Descending?i:void 0,s=n.get("theme"),l=n.get("sortMode");let c;return(l===_n.Total||l===_n.WithinGroups||l===_n.None)&&(c=l),c=E_(t.transforms,c,"chart"),{chartType:t.chartType,data:r,properties:t.properties,frame:D_(n),colorizes:Ud(t.colorizes),highlights:Zd(t.highlights),areaFills:jd(t.areaFills),annotations:Kd(t.annotations),seriesOverrides:Jd(t.series),scenes:t.scenes,sort:o,sortMode:c,theme:s==null?void 0:String(s)||void 0}}const Ql=Object.create(null);function z_(t){if(!Ql[t]){const n={};for(const e of vd(t))e.default!==void 0&&(n[e.key]=e.default);Ql[t]=n}return Ql[t]}function t0(t,n){var a;const e=z_(t);return((a=n.colors)==null?void 0:a.length)?{...e,colorPalette:void 0,...n}:{...e,...n}}const e0=new Set;function R_(t,n,e){let r=n;for(const a of t)a.transformType==="sort"?r=_n.Total:e0.has(a.transformType)||(e0.add(a.transformType),console.warn(`[blueprint-chart] Unknown transform "${a.transformType}" in ${e}; ignored.`));return r}function F_(){return{properties:new Map,chartTypeOptions:{},colorizes:[],highlights:[],areaFills:[],seriesOverrides:[],transforms:[]}}function Y_(t,n,e){const r=F_();for(let a=0;a<=n;a++){const i=t[a],o=qr(i.properties),s=o.get("type");s&&(r.chartType=s);const l=r.chartType??e;i.data&&(r.data=i.data);const c=Vd(l,i.properties);r.chartTypeOptions={...r.chartTypeOptions,...c},i.colorizes.length>0?r.colorizes=i.colorizes:i.data&&(r.colorizes=[]),a===n&&(r.highlights=i.highlights),i.areaFills.length>0&&(r.areaFills=i.areaFills),i.series.length>0&&(r.seriesOverrides=i.series),i.transforms.length>0&&(r.transforms=[...r.transforms,...i.transforms]);for(const[f,h]of o)r.properties.set(f,h)}return r}function I_(t,n,e){return e<t?!1:n==="always"?!0:e<=t+(typeof n=="number"?n:0)}function H_(t,n){const e=t.options??(t.properties?t0(t.chartType,Vd(t.chartType,t.properties)):{}),r={chartType:t.chartType,data:t.data,options:e,frame:t.frame,colorizes:t.colorizes??[],highlights:t.highlights??[],areaFills:t.areaFills??[],annotations:(t.annotations??[]).map((A,w)=>({...A,key:A.key??`base:${w}:${A.kind}`})),seriesOverrides:t.seriesOverrides??[],sort:t.sort,sortMode:t.sortMode,theme:t.theme};if(n==null||!t.scenes||n<0||n>=t.scenes.length)return r;const a=Y_(t.scenes,n,t.chartType),i=a.chartType??t.chartType,o=a.data?lf(Wd(a.data)):r.data,s=Object.keys(a.chartTypeOptions).length>0?t0(i,{...e,...a.chartTypeOptions}):e,l=a.colorizes.length>0?Ud(a.colorizes):a.data?[]:r.colorizes,c=n!=null?Zd(a.highlights):r.highlights,f=a.areaFills.length>0?jd(a.areaFills):r.areaFills,h=(t.annotations??[]).map((A,w)=>({anchor:-1,key:A.key??`base:${w}:${A.kind}`,config:A}));for(let A=0;A<=n;A++)Kd(t.scenes[A].annotations).forEach((w,S)=>{h.push({anchor:A,key:w.key??`s${A}:${S}:${w.kind}`,config:w})});const d=h.filter(({anchor:A,config:w})=>I_(A,w.repeat,n)).map(({key:A,config:w})=>({...w,key:A})),g=a.seriesOverrides.length>0?Jd(a.seriesOverrides):r.seriesOverrides,v=R_(a.transforms,r.sortMode,`scene ${n}`),m=["title","description","source","sourceUrl","byline","note"],b={};for(const A of m){const w=a.properties.get(A);typeof w=="string"&&(b[A]=w)}const x=Object.keys(b).length>0?{...r.frame,...b}:r.frame;return{...r,chartType:i,data:o,options:s,frame:x,colorizes:l,highlights:c,areaFills:f,annotations:d,seriesOverrides:g,sortMode:v}}const tc=new WeakMap;function B_(t){const n=tc.get(t);if(!(!n||n.size===0)){for(const e of n)t.style[e]="";n.clear()}}function La(t,n){let e=tc.get(t);e||(e=new Set,tc.set(t,e)),e.add(n)}function V_(t,n,e){if(B_(t),e.ignoreLayout||!n)return{constrained:!1};const r=qr(n),a=r.get("heightMode"),i=r.get("aspectRatio"),o=r.get("fixedHeight");let s=!1;if(a==="aspect-ratio"&&i){const l=String(i).split(":").map(Number);l.length===2&&l[0]>0&&l[1]>0&&(t.style.aspectRatio=`${l[0]} / ${l[1]}`,t.style.height="auto",La(t,"aspectRatio"),La(t,"height"),s=!0)}else a==="fixed"&&o&&(t.style.height=`${o}px`,La(t,"height"),s=!0);return s&&(t.style.display="flex",t.style.flexDirection="column",t.style.overflow="hidden",La(t,"display"),La(t,"flexDirection"),La(t,"overflow")),{constrained:s}}const ec=new WeakMap;function n0(t){t.querySelectorAll("[data-bc-fade-overlay]").forEach(n=>{typeof n.getAnimations=="function"&&n.getAnimations().forEach(e=>e.cancel()),n.remove()})}function W_(t,n,e){if(!e)return null;const r=ec.get(t);return!r||r===n?null:(n0(t),nn(t))}function G_(t,n,e){if(ec.set(t,n),e){const r=t.querySelector(".bc-frame .bc-frame-body");r&&en(r),rn(t,e)}}function r0(t){ec.delete(t),n0(t)}function q_(t,n,e){const r=t.querySelector(".bc-frame");if(!r)return;const a=[];r.classList.forEach(i=>{i.startsWith("bc-theme-")&&a.push(i)});for(const i of a)r.classList.remove(i);n.theme&&r.classList.add(`bc-theme-${n.theme}`),e.constrained&&r.classList.add("bc-frame--constrained")}function X_(t,n,e={}){var g;if(e.transition||(me(t).interrupt(),t.replaceChildren(),r0(t)),n.data.labels.length===0){e.transition&&(me(t).interrupt(),t.replaceChildren(),r0(t));return}let r=n;if(e.stripColors){const v={...n};if(n.properties&&(v.properties=n.properties.filter(m=>m.key!=="colors"&&m.key!=="colorPalette")),n.options){const{colors:m,colorPalette:b,...x}=n.options;v.options=x}r=v}const a=V_(t,r.properties,e),i=H_(r,e.sceneIndex),o=c_(i.chartType);if(!o)return;const s=W_(t,i.chartType,!!e.transition);s&&t.replaceChildren();const l=Be(t),c=tm(i.options,l);let f;if(e.thumbnail)f=null;else{const v=((g=i.frame)==null?void 0:g.padding)??e.padding??"16px";f={...i.frame??{},padding:v}}const h=me(t);e.transition&&h.beginCommit(),o(t,i.data,{frame:f,sort:i.sort,sortMode:i.sortMode,...c,colorizes:i.colorizes.length>0?i.colorizes:void 0,highlights:i.highlights.length>0?i.highlights:void 0,areaFills:i.areaFills.length>0?i.areaFills:void 0,annotations:i.annotations.length>0?i.annotations:void 0,seriesOverrides:i.seriesOverrides.length>0?i.seriesOverrides:void 0},!!e.transition),e.transition&&h.commit({duration:Ja(),mode:e.transitionMode});const d=e.theme??i.theme;q_(t,{theme:d},a),G_(t,i.chartType,s)}function a0(t,n,e){const r=document.createElement("div");r.style.cssText="color: #888; font-family: monospace; padding: 0.75rem; white-space: pre-wrap;",r.textContent=`Blueprint Chart: ${n}
|
|
280
|
-
${e}`,t.replaceChildren(r)}function U_(t,n,e){if(!n){e!=null&&e.transition||t.replaceChildren();return}let r;try{r=F0(n)}catch(a){const i=a instanceof Error?a.message:String(a);a0(t,"could not parse chart",i);return}try{const a=P_(r);X_(t,a,e)}catch(a){const i=a instanceof Error?a.message:String(a);a0(t,"could not render chart",i)}}function i0(t,n,e){let r=0,a=!1;const i=document.createElement("nav");i.className="blueprint-chart-scenes";const o=document.createElement("button");o.className="blueprint-chart-scenes-prev",o.textContent="Previous";const s=document.createElement("button");s.className="blueprint-chart-scenes-next",s.textContent="Next";const l=document.createElement("span");l.className="blueprint-chart-scenes-counter",i.appendChild(o),i.appendChild(l),i.appendChild(s),n.length>0&&t.appendChild(i);function c(){if(n.length===0){l.textContent="";return}l.textContent=`${r+1} / ${n.length}`}function f(h){if(a||n.length===0||!Number.isFinite(h))return;const g=(Math.floor(h)%n.length+n.length)%n.length;r=g,c(),e(n[g],g)}return o.addEventListener("click",()=>f(r-1)),s.addEventListener("click",()=>f(r+1)),c(),{get currentScene(){return r},get totalScenes(){return n.length},next(){f(r+1)},previous(){f(r-1)},goTo:f,destroy(){a||(a=!0,i.remove())}}}const Z_=i0;return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",hs):hs(),cn.createSceneController=i0,cn.createStepController=Z_,cn.initBlueprint=hs,cn.renderBpc=U_,Object.defineProperty(cn,Symbol.toStringTag,{value:"Module"}),cn})({});
|
|
266
|
+
`,document.head.appendChild(e)}function nb(e){let t=e?eh(e):null,n=e=>t?t(e):String(e);return e=>e.series?`${e.series} – ${e.label}: ${n(e.value)}`:`${e.label}: ${n(e.value)}`}function rb(e,t){let{width:n,height:r,points:i,tooltip:a=!0,crosshair:o=!1,crosshairDirection:s=Jr.Both,crosshairStyle:c=Yr.Dashed,crosshairColor:l=`#999`,format:u=nb(t.numberFormat),container:d}=t;if(i.length===0){let e=()=>{};return d&&$y.set(d,e),e}let f=c===Yr.Solid?`none`:c===Yr.Dotted?`2,2`:`4,3`,p=[...new Set(i.map(e=>e.cx))].sort((e,t)=>e-t),m=$(e),h=null;a&&(tb(),h=document.createElement(`div`),h.className=Qy,document.body.appendChild(h));let g=`.bc-annotations`,_=!m.select(g).empty(),v=e=>_?m.insert(e,g):m.append(e),y=o&&(s===Jr.Both||s===Jr.Vertical),b=o&&(s===Jr.Both||s===Jr.Horizontal),x=null,S=null;y&&(x=v(`line`).attr(`class`,`bc-crosshair bc-crosshair-v`).attr(`y1`,0).attr(`y2`,r).attr(`stroke`,l).attr(`stroke-width`,1).style(`stroke-dasharray`,f).attr(`pointer-events`,`none`).style(`display`,`none`)),b&&(S=v(`line`).attr(`class`,`bc-crosshair bc-crosshair-h`).attr(`x1`,0).attr(`x2`,n).attr(`stroke`,l).attr(`stroke-width`,1).style(`stroke-dasharray`,f).attr(`pointer-events`,`none`).style(`display`,`none`));let C=v(`circle`).attr(`class`,`bc-proximity-dot`).attr(`r`,6).attr(`fill`,`none`).attr(`stroke`,`#333`).attr(`stroke-width`,1).attr(`opacity`,.45).attr(`pointer-events`,`none`).style(`display`,`none`),w=v(`rect`).attr(`class`,`bc-proximity-overlay`).attr(`width`,n).attr(`height`,r).attr(`fill`,`none`).attr(`pointer-events`,`all`);function T(e,t){if(p.length===0)return null;let n=_i(p,e),r=p[n],a=i.filter(e=>e.cx===r);if(a.length===0)return null;let o=a[0],s=Math.abs(a[0].cy-t);for(let e=1;e<a.length;e++){let n=Math.abs(a[e].cy-t);n<s&&(o=a[e],s=n)}return o}let E=t=>{let[n,r]=is(t,e),i=T(n,r);i&&(C.attr(`cx`,i.cx).attr(`cy`,i.cy).attr(`stroke`,i.color).style(`display`,null),h&&(h.textContent=u(i),h.style.display=`block`,M_(C.node(),h,{placement:`top`,middleware:[k_(8),j_(),A_()]}).then(({x:e,y:t})=>{h&&(h.style.left=`${e}px`,h.style.top=`${t}px`)})),x&&x.attr(`x1`,i.cx).attr(`x2`,i.cx).style(`display`,null),S&&S.attr(`y1`,i.cy).attr(`y2`,i.cy).style(`display`,null))},D=()=>{C.style(`display`,`none`),h&&(h.style.display=`none`),x&&x.style(`display`,`none`),S&&S.style(`display`,`none`)},O=w.node();O.addEventListener(`mousemove`,E),O.addEventListener(`mouseleave`,D);let k=()=>{O.removeEventListener(`mousemove`,E),O.removeEventListener(`mouseleave`,D),w.remove(),C.remove(),h&&=(h.remove(),null),x&&x.remove(),S&&S.remove(),d&&$y.get(d)===k&&$y.delete(d)};return d&&$y.set(d,k),k}var ib={circle:zp,square:Wp,diamond:Up,triangle:Zp,triangleDown:$p??Zp,cross:Bp,star:Yp};function ab(e,t,n){switch(n){case Vr.First:return e===0;case Vr.Last:return e===t-1;case Vr.FirstLast:return e===0||e===t-1;case Vr.All:default:return!0}}function ob(e,t,n,r,i=!1){let a=r.symbol??Br.Circle,o=r.showOn??Vr.FirstLast,s=r.style??Hr.Filled,c=r.size??3.5,l=r.opacity??1,u=`var(--bs-body-bg, #fff)`,d=t.filter(e=>ab(e.index,n,o)),f=i?bh():0;if(a===Br.Circle){e.selectAll(`path.bc-symbol`).remove();let t=e.selectAll(`circle.bc-symbol`).data(d).join(e=>e.append(`circle`).attr(`class`,`bc-symbol`).attr(`cx`,e=>e.cx).attr(`cy`,e=>e.cy).attr(`r`,c).attr(`fill`,e=>s===Hr.Filled?e.color:u).attr(`stroke`,e=>e.color).attr(`stroke-width`,s===Hr.Hollow?1.5:0).attr(`opacity`,l),e=>e,e=>e.remove());(i?t.transition().duration(f):t).attr(`cx`,e=>e.cx).attr(`cy`,e=>e.cy).attr(`r`,c).attr(`fill`,e=>s===Hr.Filled?e.color:u).attr(`stroke`,e=>e.color).attr(`stroke-width`,s===Hr.Hollow?1.5:0).attr(`opacity`,l)}else{let t=ib[a]??zp,n=Math.PI*c*c,r=em().type(t).size(n);e.selectAll(`circle.bc-symbol`).remove();let o=e.selectAll(`path.bc-symbol`).data(d).join(e=>e.append(`path`).attr(`class`,`bc-symbol`).attr(`transform`,e=>`translate(${e.cx},${e.cy})`).attr(`d`,r).attr(`fill`,e=>s===Hr.Filled?e.color:u).attr(`stroke`,e=>e.color).attr(`stroke-width`,s===Hr.Hollow?1.5:0).attr(`opacity`,l),e=>e,e=>e.remove());(i?o.transition().duration(f):o).attr(`transform`,e=>`translate(${e.cx},${e.cy})`).attr(`d`,r).attr(`fill`,e=>s===Hr.Filled?e.color:u).attr(`stroke`,e=>e.color).attr(`stroke-width`,s===Hr.Hollow?1.5:0).attr(`opacity`,l)}}function sb(e,t,n={},r=!1){yh(r),eb(e);let i=[],a=[],o=null,s=null,c,l,u,d=Xh.for(e);if(r){let t=Tv(e);l=t?.margin,u=t?.plotRect,d.detach(),t?.chartType===`line`?(i=Array.from(e.querySelectorAll(`.bc-frame .bc-area`)),a=Array.from(e.querySelectorAll(`.bc-frame .bc-line`)),o=e.querySelector(`.bc-frame .bc-symbols`)):t&&(s=Sh(e)),c=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))c.set(e,n);e.replaceChildren()}let{body:f}=Zm(e,n.frame),p=mh(f).width,m=dh(t.values,n.verticalAxis?.range,n.verticalAxis?.numberFormat,n.verticalAxis?.scaleType),{chartArea:h,width:g,height:_,margin:v}=gh(f,ph(p,n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,m)),y=nh(l,v),b=si(t.labels,n.horizontalAxis?.range),x=b.map(e=>t.labels[e]),S=b.map(e=>t.values[e]),C=x.map((e,t)=>({label:e,value:S[t]})),w=Gu().domain(x).range([0,g]).padding(n.edgePadding?.6:0),T=w,E=e=>w(e.label)??0,D=n.verticalAxis?.scaleType===`log`,[O,k]=li(S,n.verticalAxis?.range,n.verticalAxis?.scaleType),A=D?ld().domain([O,k]).nice().range([_,0]):ad().domain([O,k]).nice().range([_,0]),ee=A.domain(),j=ee[0]<0&&ee[1]>0?A(0):void 0;d.attach(h,y),d.update({vertical:{scale:A,height:_,options:{...n.verticalAxis,gridWidth:g,topPadding:v.top}},horizontal:{scale:T,height:_,options:{...n.horizontalAxis,width:g,zeroY:j}}});let M=h.ownerSVGElement,N=kv(M,e,`plot`,{x:-1,y:-1,width:g+2,height:_+2}),P=$(h).append(`g`).attr(`clip-path`,`url(#${N})`),F=P.node(),I=n.colors?.[0]??`#4e79a7`,L=Zy(n.interpolation),R=n.areaFill??!1,z=n.areaFillOpacity??.2,B=Fp().curve(L).x(e=>E(e)).y0(_).y1(e=>A(e.value)),V=Pp().curve(L).x(e=>E(e)).y(e=>A(e.value)),H=$(F).append(`g`).node(),U=$(F).append(`g`).node();if(r){for(let e of i)H.appendChild(e);for(let e of a)U.appendChild(e)}let te=Iv(e),ne=[{name:`line`,points:C}];Jv(te,{role:`series-area`,parent:H,selector:`.bc-area`,data:R?ne:[],key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-area`),attrs:e=>({d:B(e.points)??``,fill:I,opacity:z})}),Jv(te,{role:`series-line`,parent:U,selector:`.bc-line`,data:ne,key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-line`),attrs:e=>({d:V(e.points)??``,fill:`none`,stroke:I})}),$(F).append(`g`).selectAll(`.bc-dot`).data(C,e=>e.label).enter().append(`circle`).attr(`class`,`bc-dot`).attr(`cx`,e=>E(e)).attr(`cy`,e=>A(e.value)).attr(`r`,3).attr(`fill`,I).attr(`fill-opacity`,0).attr(`stroke-opacity`,0).attr(`pointer-events`,`none`);let re={left:v.left,top:v.top,width:g+2,height:_+2};if(ny(te,{svg:M,clipId:N,group:h,from:u,to:re,active:r&&(i.length>0||a.length>0)}),n.annotations?.length&&xv(h,n.annotations,{scaleX:T,scaleY:A,data:C,width:g,height:_,backgroundColor:lr(e),transition:r,priorAnnotations:c}),(n.tooltips||n.crosshair)&&rb(h,{width:g,height:_,points:C.map(e=>({cx:E(e),cy:A(e.value),label:e.label,value:e.value,color:I})),tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:n.verticalAxis?.numberFormat,container:e}),n.valueLabels&&$(F).append(`g`).selectAll(`.bc-value-label`).data(C,e=>e.label).enter().append(`text`).attr(`class`,`bc-value-label`).attr(`x`,e=>E(e)).attr(`y`,e=>A(e.value)-8).attr(`text-anchor`,`middle`).attr(`font-size`,`11px`).attr(`fill`,`currentColor`).text(e=>String(e.value)),n.lineSymbols){let e=C.map((e,t)=>({cx:E(e),cy:A(e.value),color:I,index:t})),t;o?(h.appendChild(o),t=$(o)):t=$(h).append(`g`).attr(`class`,`bc-symbols`),ob(t,e,C.length,n.lineSymbols,r)}Ev(e,{chartType:`line`,margin:v,plotRect:re}),s&&(xh(P.node()),Ch(e,s))}var cb=28,lb=18,ub=20;function db(e,t,n,r=cb){if(e.length===0)return[];if(e.length===1)return[Math.max(t,Math.min(n,e[0]))];let i=e.length,a=n-t,o=(i-1)*r>a?Math.max(0,a/(i-1)):r,s=[...e];for(let e=0;e<10;e++){for(let e=1;e<s.length;e++)s[e]-s[e-1]<o&&(s[e]=s[e-1]+o);s[s.length-1]>n&&(s[s.length-1]=n);for(let e=s.length-2;e>=0;e--)s[e+1]-s[e]<o&&(s[e]=s[e+1]-o);s[0]<t&&(s[0]=t)}return s}function fb(e,t,n){let{outerRadius:r,fontSize:i=12,bgColor:a=`#fff`}=n,o=r+2,s=o+lb,c=cb/s,l=[],u=[];for(let e of t){let t=(e.startAngle+e.endAngle)/2;t<Math.PI?u.push({...e,midAngle:t}):l.push({...e,midAngle:t})}function d(t,n){if(t.length===0)return;t.sort((e,t)=>e.midAngle-t.midAngle);let r=n?.05:Math.PI+.05,l=n?Math.PI-.05:2*Math.PI-.05,u=db(t.map(e=>e.midAngle),r,l,c),d=n?1:-1,f=e.append(`g`).attr(`class`,`bc-arc-labels`);t.forEach((e,t)=>{let r=e.showLabel!==!1,c=e.showValue!==!1;if(!r&&!c)return;let l=u[t]-Math.PI/2,p=Math.cos(l)*o,m=Math.sin(l)*o,h=Math.cos(l)*s,g=Math.sin(l)*s,_=h+d*ub;f.append(`polyline`).attr(`class`,`bc-arc-label-line`).attr(`points`,`${p},${m} ${h},${g} ${_},${g}`).attr(`fill`,`none`).attr(`stroke`,`var(--bc-text-color, #999)`).attr(`stroke-width`,1).attr(`opacity`,.5);let v=_+d*4,y=f.append(`text`).attr(`class`,`bc-arc-direct-label`).attr(`x`,v).attr(`y`,g).attr(`text-anchor`,n?`start`:`end`).attr(`font-size`,`${i}px`);if(r&&y.append(`tspan`).attr(`x`,v).attr(`dy`,c?`-0.1em`:`0.35em`).attr(`font-weight`,`bold`).attr(`fill`,ur(e.color,a)).text(e.label),c){let t=e.displayAsPercentage&&e.percentage!=null?`${Math.round(e.percentage)}%`:String(e.value);y.append(`tspan`).attr(`x`,v).attr(`dy`,r?`1.2em`:`0.35em`).attr(`fill`,`var(--bc-text-color, #666)`).text(t)}})}d(u,!0),d(l,!1)}var pb=.3;function mb(e,t,n){let{outerRadius:r,innerRadius:i=0,fontSize:a=12}=n,o=(i+r)/2,s=e.append(`g`).attr(`class`,`bc-arc-labels-inside`);for(let e of t){if(e.endAngle-e.startAngle<pb)continue;let t=e.showLabel!==!1,n=e.showValue!==!1;if(!t&&!n)continue;let r=(e.startAngle+e.endAngle)/2-Math.PI/2,i=Math.cos(r)*o,c=Math.sin(r)*o,l=s.append(`text`).attr(`class`,`bc-arc-inside-label`).attr(`x`,i).attr(`y`,c).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,`${a}px`),u=sr(e.color);if(t&&l.append(`tspan`).attr(`x`,i).attr(`dy`,n?`-0.5em`:`0em`).attr(`font-weight`,`bold`).attr(`fill`,u).text(e.label),n){let n=e.displayAsPercentage&&e.percentage!=null?`${Math.round(e.percentage)}%`:String(e.value);l.append(`tspan`).attr(`x`,i).attr(`dy`,t?`1.2em`:`0em`).attr(`fill`,u).attr(`opacity`,.85).text(n)}}}function hb(e,t,n){let{outerRadius:r,innerRadius:i=0,fontSize:a=12,bgColor:o}=n,s=(i+r)/2,c=[],l=[];for(let e of t){let t=e.endAngle-e.startAngle;t*s>e.label.length*7*1.2&&t>=pb?c.push(e):l.push(e)}c.length>0&&mb(e,c,{outerRadius:r,innerRadius:i,chartWidth:n.chartWidth,chartHeight:n.chartHeight,fontSize:a}),l.length>0&&fb(e,l,{outerRadius:r,chartWidth:n.chartWidth,chartHeight:n.chartHeight,fontSize:a,bgColor:o})}function gb(e,t){if(e.length===0)return{left:0,right:0,top:0,bottom:0};let n=48+Math.max(...e.map(e=>e.length))*7+6,r=e.length*cb/2,i=Math.max(10,r-t+20);return{left:n,right:n,top:i,bottom:i}}var _b=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`];function vb(e,t,n={},r=!1){yh(r),eb(e);let i=t,a=[],o=[],s=[],c=null,l,u,d,f=Xh.for(e);if(r){let t=Tv(e);u=t?.margin,d=t?.plotRect,f.detach(),t?.chartType===`line-multi`?(a=Array.from(e.querySelectorAll(`.bc-frame .bc-area`)),o=Array.from(e.querySelectorAll(`.bc-frame .bc-line`)),s=Array.from(e.querySelectorAll(`.bc-frame .bc-symbols`))):t&&(c=Sh(e)),l=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))l.set(e,n);e.replaceChildren()}let{body:p}=Zm(e,n.frame),m=i.series??[],h=m.filter(e=>!Uy(e.name,n.seriesOverrides));(n.sortMode===`total`||n.sortMode===`within-groups`)&&(h=[...h].sort((e,t)=>{let n=e.values.reduce((e,t)=>e+t,0);return t.values.reduce((e,t)=>e+t,0)-n}));let g=n.colors??_b,_=h.map(e=>e.name),v=Cv(n.colorizes),y=n.seriesOverrides,b=n.directLabelling===!0||n.directLabelling===`auto`&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!==`auto`,x=b?`direct`:n.legend===!1?`none`:`legend`,S=_.filter(e=>Wy(e,x,y)===`direct`),C=n.legend!==!1&&!b,w=mh(p).width,T=n.legendPosition??`top`,E=w>0&&w<350&&(T===`left`||T===`right`)?`top`:T,D=n.legendAnchor??`start`,O=si(i.labels,n.horizontalAxis?.range),k=O.map(e=>i.labels[e]);h=h.map(e=>({...e,values:O.map(t=>e.values[t])})),i={...i,labels:k,series:h};let A=h.flatMap(e=>e.values),ee=dh(A,n.verticalAxis?.range,n.verticalAxis?.numberFormat,n.verticalAxis?.scaleType),j=ph(w,n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,ee),M=S.length>0?Ly(S):0,N=j.top!=null,P=Math.max(0,w-(j.left??50)-(j.right??20)-M),F=C?Iy(_,E,P):{width:0,height:0},I=C?F.height+15:0,L={...j};C&&E===`top`&&(L.top=I+(N?15:0)),C&&E===`bottom`&&(L.bottom=(L.bottom??24)+I),C&&E===`left`&&(L.left=(L.left??50)+F.width+10),C&&E===`right`&&(L.right=(L.right??20)+F.width+10),M>0&&(L.right=(L.right??20)+M);let{chartArea:R,width:z,height:B,margin:V}=gh(p,L),H=nh(u,V),[U,te]=li(A,n.verticalAxis?.range,n.verticalAxis?.scaleType),ne=Gu().domain(i.labels).range([0,z]).padding(n.edgePadding?.6:0),re=ne,ie=e=>ne(i.labels[e])??0,ae=n.verticalAxis?.scaleType===`log`?ld().domain([U,te]).nice().range([B,0]):ad().domain([U,te]).nice().range([B,0]),oe=ae.domain(),se=oe[0]<0&&oe[1]>0?ae(0):void 0;f.attach(R,H),f.update({vertical:{scale:ae,height:B,options:{...n.verticalAxis,gridWidth:z,topPadding:V.top}},horizontal:{scale:re,height:B,options:{...n.horizontalAxis,width:z,zeroY:se}}});let ce=R.ownerSVGElement,W=kv(ce,e,`plot`,{x:0,y:0,width:z,height:B}),G=$(R).append(`g`).attr(`clip-path`,`url(#${W})`),le=G.node(),K=h.map(e=>({name:e.name,values:e.values,colorIndex:m.findIndex(t=>t.name===e.name)})),ue=Zy(n.interpolation);n.areaFills?.length&&yb(le,n.areaFills,h,ie,i.labels.length,ae,ue);let de=[];h.forEach((e,t)=>{i.labels.forEach((n,r)=>{de.push({label:n,value:e.values[r],series:e.name,colorIndex:t})})});let fe=n.lineSymbols,pe={solid:``,dotted:`2,4`,dashed:`8,4`,"dash-dot":`8,4,2,4`},me=n.valueLabels??!1,he=new Set((n.highlights??[]).map(e=>e.target)),ge=n.areaFill??!1,_e=n.areaFillOpacity??.2,ve=e=>v.get(e.name)??zy(e.name,e.colorIndex,g,y),ye=Fp().curve(ue).x((e,t)=>ie(t)).y0(B).y1(e=>ae(e)),be=Iv(e),xe=$(le).append(`g`).node(),Se=$(le).append(`g`).node(),Ce=new Set(K.map(e=>e.name));if(r){for(let e of a)Ce.has(e.__data__?.name??``)&&xe.appendChild(e);for(let e of o)Ce.has(e.__data__?.name??``)&&Se.appendChild(e)}Jv(be,{role:`series-area`,parent:xe,selector:`.bc-area`,data:ge?K:[],key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-area`),attrs:e=>({"data-series":e.colorIndex,d:ye(e.values)??``,fill:ve(e),opacity:oy(he,e.name,_e)})}),Jv(be,{role:`series-line`,parent:Se,selector:`.bc-line`,data:K,key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-line`),attrs:e=>{let t=Hy(e.name,n.interpolation??`linear`,y),r=Pp().curve(Zy(t)).x((e,t)=>ie(t)).y(e=>ae(e));return{"data-series":e.colorIndex,d:r(e.values)??``,fill:`none`,stroke:ve(e),"stroke-width":Vy(e.name,y),"stroke-dasharray":pe[By(e.name,y)]??``,opacity:oy(he,e.name,1)}}}),$(le).append(`g`).selectAll(`.bc-dot`).data(de,e=>e.label+`\0`+e.series).enter().append(`circle`).attr(`class`,`bc-dot`).attr(`data-series`,e=>e.colorIndex).attr(`cx`,e=>ie(i.labels.indexOf(e.label))).attr(`cy`,e=>ae(e.value)).attr(`r`,3).attr(`fill`,e=>ve({name:e.series,values:[],colorIndex:e.colorIndex})).attr(`fill-opacity`,0).attr(`stroke-opacity`,0).attr(`pointer-events`,`none`);let we={left:V.left,top:V.top,width:z,height:B};if(ny(be,{svg:ce,clipId:W,group:R,from:d,to:we,active:r&&(o.length>0||a.length>0)}),n.annotations?.length){let t=i.labels.map((e,t)=>({label:e,value:h[0]?.values[t]??0}));xv(R,n.annotations,{scaleX:re,scaleY:ae,data:t,width:z,height:B,backgroundColor:lr(e),transition:r,priorAnnotations:l})}let Te=$(le).append(`g`).attr(`class`,`bc-value-labels`);de.forEach(e=>{if(!Gy(e.series,me,y))return;let t=ie(i.labels.indexOf(e.label)),n=ae(e.value);Te.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.colorIndex).attr(`x`,t).attr(`y`,n-8).attr(`text-anchor`,`middle`).attr(`font-size`,`11px`).attr(`fill`,`currentColor`).text(String(e.value))}),(n.tooltips||n.crosshair)&&rb(R,{width:z,height:B,points:de.map(e=>({cx:ie(i.labels.indexOf(e.label)),cy:ae(e.value),label:e.label,value:e.value,series:e.series,color:zy(e.series,e.colorIndex,g,y)})),tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:n.verticalAxis?.numberFormat,container:e});let Ee=fe?{name:``,lineSymbols:!0,symbolShape:fe.symbol,symbolShowOn:fe.showOn,symbolStyle:fe.style,symbolSize:fe.size,symbolOpacity:fe.opacity}:void 0,De=i.labels.length;h.forEach((e,t)=>{let n=qy(e.name,Ee,y);if(!n)return;let a={symbol:n.symbolShape??fe?.symbol??Br.Circle,showOn:n.symbolShowOn??fe?.showOn??Vr.FirstLast,style:n.symbolStyle??fe?.style??Hr.Filled,size:n.symbolSize??fe?.size??3.5,opacity:n.symbolOpacity??fe?.opacity??1},o=i.labels.map((n,r)=>({cx:ie(r),cy:ae(e.values[r]),color:zy(e.name,t,g,y),index:r})),c=s.find(t=>t.getAttribute(`data-series-name`)===e.name),l,u=!1;c?(R.appendChild(c),l=$(c),u=!0):l=$(R).append(`g`).attr(`class`,`bc-symbols`).attr(`data-series`,t).attr(`data-series-name`,e.name),ob(l,o,De,a,r&&u)});let Oe=i.labels.length-1,ke=ie(Oe)+6,Ae=[];if(h.forEach((e,t)=>{if(Wy(e.name,x,y)!==`direct`)return;let n=e.values[Oe],r=y?.find(t=>t.name===e.name)?.labelText||e.name;Ae.push({name:e.name,index:t,naturalY:ae(n),text:r})}),Ae.length>0){Ae.sort((e,t)=>e.naturalY-t.naturalY);let e=db(Ae.map(e=>e.naturalY),0,B,14);Ae.forEach((t,n)=>{$(R).append(`text`).attr(`class`,`bc-direct-label`).attr(`data-series`,t.index).attr(`x`,ke).attr(`y`,e[n]).attr(`dy`,`0.35em`).attr(`font-size`,`11px`).attr(`fill`,zy(t.name,t.index,g,y)).text(t.text)})}let je=_.filter(e=>Wy(e,x,y)===`legend`);if(C&&je.length>0){let e=je.map(e=>zy(e,m.findIndex(t=>t.name===e),g,y)),t=0,n=0;if(E===`top`){let e=N?15:0;n=-(F.height+10+e)}else E===`bottom`?n=B+25:E===`left`?t=-(F.width+10):E===`right`&&(t=z+10);Fy(R,je,e,n,E,D,z,B,t,[],{left:V.left,right:V.right})}Ev(e,{chartType:`line-multi`,margin:V,plotRect:we}),c&&(xh(G.node()),Ch(e,c))}function yb(e,t,n,r,i,a,o){let s=$(e).append(`g`).attr(`class`,`bc-area-fills`);for(let e of t){let t=n.find(t=>t.name===e.from),i=n.find(t=>t.name===e.to);if(!t||!i)continue;let c=e.interpolation?Zy(e.interpolation):o,l=(e.opacity??30)/100,u=e.color??`#ccc`,d=e.negativeColor;if(d)xb(s,t.values,i.values,r,a,c,u,d,l);else{let e=Fp().curve(c).x((e,t)=>r(t)).y0((e,t)=>a(i.values[t])).y1(e=>a(e));s.append(`path`).attr(`class`,`bc-area-fill`).attr(`d`,e(t.values)??``).attr(`fill`,u).attr(`opacity`,l)}}}function bb(e,t,n,r){let i=e-n,a=t-r;if(i===0&&a===0||i>0&&a>0||i<0&&a<0)return null;let o=a-i;if(o===0)return null;let s=-i/o;return s<0||s>1?null:s}function xb(e,t,n,r,i,a,o,s,c){let l=t.length;if(l===0)return;let u=[];for(let e=0;e<l;e++){let a=r(e),o=i(t[e]),s=i(n[e]);if(u.push({x:a,fromY:o,toY:s}),e<l-1){let c=i(t[e+1]),l=i(n[e+1]),d=bb(o,c,s,l);if(d!==null&&d>0&&d<1){let t=a+d*(r(e+1)-a),n=o+d*(c-o),i=s+d*(l-s);u.push({x:t,fromY:n,toY:i})}}}let d=[],f=[],p=null;for(let e of u){let t=e.fromY-e.toY,n=t<0;p===null?(p=t===0?null:n,f.push(e)):t===0?(f.push(e),f.length>=2&&d.push({points:f,positive:p}),f=[e],p=null):p===n?f.push(e):(f.push(e),f.length>=2&&d.push({points:f,positive:p}),f=[e],p=n)}f.length>=2&&p!==null&&d.push({points:f,positive:p});for(let t of d){let n=t.points,r=`M${n[0].x},${n[0].fromY}`;for(let e=1;e<n.length;e++)r+=`L${n[e].x},${n[e].fromY}`;for(let e=n.length-1;e>=0;e--)r+=`L${n[e].x},${n[e].toY}`;r+=`Z`,e.append(`path`).attr(`class`,`bc-area-fill ${t.positive?`bc-area-fill-pos`:`bc-area-fill-neg`}`).attr(`d`,r).attr(`fill`,t.positive?o:s).attr(`opacity`,c)}}var Sb=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`],Cb=class extends Km{initialize(){}};function wb(e,t,n={},r=!1){Tb(e,t,n,.6,r)}function Tb(e,t,n,r,i=!1){yh(i);let a=null,o;if(i){let t=Tv(e),n=r>0?`donut`:`pie`;t&&t.chartType!==n&&(a=Sh(e)),o=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))o.set(e,n);e.replaceChildren()}let{body:s}=Zm(e,n.frame),c=[...t.labels],l=[...t.values];if(n.sort===Ur.Ascending||n.sort===Ur.Descending){let e=c.map((e,t)=>({label:e,value:l[t]}));e.sort((e,t)=>n.sort===Ur.Ascending?e.value-t.value:t.value-e.value),c=e.map(e=>e.label),l=e.map(e=>e.value)}if(n.sliceMax&&n.sliceMax>0&&c.length>n.sliceMax){let e=n.sliceMax-1,t=c.slice(0,e),r=l.slice(0,e),i=l.slice(e).reduce((e,t)=>e+t,0);t.push(n.sliceGroupLabel??`Others`),r.push(i),c=t,l=r}let u=l.reduce((e,t)=>e+t,0),d=l.map(e=>u>0?e/u*100:0),f=n.colors??Sb,p=f.length<c.length&&f.length>=2?ar.scale(f).mode(`lch`).colors(c.length):f,m=typeof n.directLabelling==`string`?n.directLabelling:n.directLabelling?Zr.Auto:Zr.Off,h=!!m&&(m!==Zr.Auto||n.legend!==!0),g=(n.showValues??!0)&&!h?l.map((e,t)=>`(${n.displayAsPercentage?`${Math.round(d[t])}%`:String(e)})`):[],_=n.legend!==!1&&!h,v=mh(s).width,y=n.legendPosition??`top`,b=v>0&&v<350&&(y===`left`||y===`right`)?`top`:y,x=n.legendAnchor??`start`,S=g.length>0?c.map((e,t)=>`${e} ${g[t]}`):c,C=Math.max(0,v-50-20),w=_?Iy(S,b,C):{width:0,height:0},T=_?w.height+15:0,E={};if(_&&b===`top`&&(E.top=T),_&&b===`bottom`&&(E.bottom=24+T),_&&b===`left`&&(E.left=50+w.width+10),_&&b===`right`&&(E.right=20+w.width+10),h){let e=mh(s),t=e.width-40,n=(e.height>0?e.height:400)-40,r=Math.min(t,n)/2,i=gb(c,r);E.left=(E.left??20)+i.left,E.right=(E.right??20)+i.right,E.top=(E.top??20)+i.top,E.bottom=(E.bottom??20)+i.bottom}let{chartArea:D,width:O,height:k,margin:A}=gh(s,E),ee=Math.min(O,k)/2,j=ee*r,M=Hu().domain(c).range(p),N=Rp().sort(null),P=Op().innerRadius(j).outerRadius(ee),F=$(D).append(`g`).attr(`transform`,`translate(${O/2},${k/2})`),I=Cv(n.colorizes),L=N(l),R=L.map((e,t)=>({label:c[t],arc:e,color:I.get(c[t])??M(c[t])})),z=Iv(e),B=ay(n.highlights);Jv(z,{role:`mark-per-category`,parent:F.append(`g`).node(),selector:`.bc-arc`,data:R,key:e=>e.label,insert:e=>e.append(`path`).attr(`class`,`bc-arc`),attrs:e=>{let t={d:P(e.arc)??``,fill:e.color};return B.size>0?{...t,opacity:oy(B,e.label)}:t}});let V=new Cb(F);if(n.tooltips&&V.use(I_()),V.draw(R),n.annotations?.length){let t=n.annotations.filter(e=>e.kind===`free`);t.length&&Sv(t,{scaleX:Uu().domain([]).range([0,O]),scaleY:ad().domain([0,1]).range([k,0]),data:[],width:O,height:k,backgroundColor:lr(e),transition:i,priorAnnotations:o}).postDraw({base:$(D)},void 0)}if(h){let t=L.map((e,t)=>({label:c[t],value:e.data,startAngle:e.startAngle,endAngle:e.endAngle,color:M(c[t]),percentage:d[t],displayAsPercentage:n.displayAsPercentage,showLabel:n.showLabels??!0,showValue:n.showValues??!0})),r=F,i={outerRadius:ee,innerRadius:j,chartWidth:O,chartHeight:k,bgColor:lr(e)};m===Zr.Inside?mb(r,t,i):m===Zr.Auto?hb(r,t,i):fb(r,t,i)}if(n.showTotal&&r>0&&!n.displayAsPercentage){let e=String(u);F.append(`text`).attr(`class`,`bc-arc-total-label`).attr(`text-anchor`,`middle`).attr(`dy`,`-0.3em`).attr(`font-size`,`11px`).attr(`fill`,`var(--bc-text-color, #555)`).attr(`opacity`,.7).text(`Total`),F.append(`text`).attr(`class`,`bc-arc-total-value`).attr(`text-anchor`,`middle`).attr(`dy`,`1em`).attr(`font-size`,`18px`).attr(`font-weight`,`bold`).attr(`fill`,`var(--bc-text-color, #555)`).text(e)}if(_){let e=0,t=0;b===`top`?t=-(w.height+10):b===`bottom`?t=k+25:b===`left`?e=-(w.width+10):b===`right`&&(e=O+10),Fy(D,c,p,t,b,x,O,k,e,g,{left:A.left,right:A.right})}Ev(e,{chartType:r>0?`donut`:`pie`}),a&&(xh(F.node()),Ch(e,a))}function Eb(e,t,n={},r=!1){Tb(e,t,n,0,r)}function Db(e,t,n={},r=!1){yh(r),eb(e);let i=[],a=[],o=null,s=null,c,l,u,d=Xh.for(e);if(r){let t=Tv(e);l=t?.margin,u=t?.plotRect,d.detach(),t?.chartType===`area`?(i=Array.from(e.querySelectorAll(`.bc-frame .bc-area`)),a=Array.from(e.querySelectorAll(`.bc-frame .bc-line`)),o=e.querySelector(`.bc-frame .bc-symbols`)):t&&(s=Sh(e)),c=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))c.set(e,n);e.replaceChildren()}let{body:f}=Zm(e,n.frame),p=mh(f).width,m=dh(t.values,n.verticalAxis?.range,n.verticalAxis?.numberFormat,n.verticalAxis?.scaleType),{chartArea:h,width:g,height:_,margin:v}=gh(f,ph(p,n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,m)),y=nh(l,v),b=si(t.labels,n.horizontalAxis?.range),x=b.map(e=>t.labels[e]),S=b.map(e=>t.values[e]),C=x.map((e,t)=>({label:e,value:S[t]})),w=Gu().domain(x).range([0,g]).padding(n.edgePadding?.6:0),T=w,E=e=>w(e.label)??0,D=n.verticalAxis?.scaleType===`log`,[O,k]=li(S,n.verticalAxis?.range,n.verticalAxis?.scaleType),A=D?ld().domain([O,k]).nice().range([_,0]):ad().domain([O,k]).nice().range([_,0]),ee=A.domain(),j=ee[0]<0&&ee[1]>0?A(0):void 0;d.attach(h,y),d.update({vertical:{scale:A,height:_,options:{...n.verticalAxis,gridWidth:g,topPadding:v.top}},horizontal:{scale:T,height:_,options:{...n.horizontalAxis,width:g,zeroY:j}}});let M=h.ownerSVGElement,N=kv(M,e,`plot`,{x:0,y:0,width:g,height:_}),P=$(h).append(`g`).attr(`clip-path`,`url(#${N})`),F=P.node(),I=n.colors?.[0]??`#4e79a7`,L=Zy(n.interpolation??`monotoneX`),R=n.areaFillOpacity??.25,z=Fp().curve(L).x(e=>E(e)).y0(_).y1(e=>A(e.value)),B=Pp().curve(L).x(e=>E(e)).y(e=>A(e.value)),V=$(F).append(`g`).node(),H=$(F).append(`g`).node();if(r){for(let e of i)V.appendChild(e);for(let e of a)H.appendChild(e)}let U=Iv(e),te=[{name:`area`,points:C}];Jv(U,{role:`series-area`,parent:V,selector:`.bc-area`,data:te,key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-area`),attrs:e=>({d:z(e.points)??``,fill:I,opacity:R})}),Jv(U,{role:`series-line`,parent:H,selector:`.bc-line`,data:te,key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-line`),attrs:e=>({d:B(e.points)??``,fill:`none`,stroke:I,"stroke-width":2})}),$(F).append(`g`).selectAll(`.bc-dot`).data(C,e=>e.label).enter().append(`circle`).attr(`class`,`bc-dot`).attr(`cx`,e=>E(e)).attr(`cy`,e=>A(e.value)).attr(`r`,3).attr(`fill`,I).attr(`fill-opacity`,0).attr(`stroke-opacity`,0).attr(`pointer-events`,`none`);let ne={left:v.left,top:v.top,width:g,height:_};if(ny(U,{svg:M,clipId:N,group:h,from:u,to:ne,active:r&&(i.length>0||a.length>0)}),n.annotations?.length&&xv(h,n.annotations,{scaleX:T,scaleY:A,data:C,width:g,height:_,backgroundColor:lr(e),transition:r,priorAnnotations:c}),(n.tooltips||n.crosshair)&&rb(h,{width:g,height:_,points:C.map(e=>({cx:E(e),cy:A(e.value),label:e.label,value:e.value,color:I})),tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:n.verticalAxis?.numberFormat,container:e}),n.valueLabels&&$(F).append(`g`).selectAll(`.bc-value-label`).data(C,e=>e.label).enter().append(`text`).attr(`class`,`bc-value-label`).attr(`x`,e=>E(e)).attr(`y`,e=>A(e.value)-8).attr(`text-anchor`,`middle`).attr(`font-size`,`11px`).attr(`fill`,`currentColor`).text(e=>String(e.value)),n.lineSymbols){let e=C.map((e,t)=>({cx:E(e),cy:A(e.value),color:I,index:t})),t;o?(h.appendChild(o),t=$(o)):t=$(h).append(`g`).attr(`class`,`bc-symbols`),ob(t,e,C.length,n.lineSymbols,r)}Ev(e,{chartType:`area`,margin:v,plotRect:ne}),s&&(xh(P.node()),Ch(e,s))}function Ob(e){let t=e.series??[];if(t.length===0)return[];let n=t.map(e=>e.name),r=!1,i=e.labels.map((e,n)=>{let i={_index:n};return t.forEach(e=>{let t=e.values[n]??0;t<0&&(r=!0),i[e.name]=t}),i});return wm().keys(n).order(xm).offset(r?Em:bm)(i)}function kb(e){let t=e.series??[];if(t.length===0)return[];let n=t.map(e=>e.name),r=e.labels.map((e,n)=>{let r={_index:n};return t.forEach(e=>{r[e.name]=e.values[n]??0}),r}),i=wm().keys(n).order(xm).offset(Tm)(r);for(let e of i)for(let t of e)t[0]*=100,t[1]*=100;return i}var Ab=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`];function jb(e,t,n={},r=!1){yh(r),eb(e);let i=t,a=[],o=[],s=null,c,l,u,d=Xh.for(e);if(r){let t=Tv(e);l=t?.margin,u=t?.plotRect,d.detach(),t?.chartType===`area-stacked`?(a=Array.from(e.querySelectorAll(`.bc-frame .bc-area`)),o=Array.from(e.querySelectorAll(`.bc-frame .bc-line`))):t&&(s=Sh(e)),c=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))c.set(e,n);e.replaceChildren()}let{body:f}=Zm(e,n.frame),p=si(i.labels,n.horizontalAxis?.range);if(p.length<i.labels.length){let e=p.map(e=>i.labels[e]),t=(i.series??[]).map(e=>({...e,values:p.map(t=>e.values[t])}));i={labels:e,values:p.map(e=>i.values[e]),series:t}}let m=i.series??[],h=m.filter(e=>!Uy(e.name,n.seriesOverrides)),g=n.colors??Ab,_=h.map(e=>e.name),v=n.seriesOverrides,y=Cv(n.colorizes),b=n.directLabelling===!0||n.directLabelling===`auto`&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!==`auto`,x=b?`direct`:n.legend===!1?`none`:`legend`,S=_.filter(e=>Wy(e,x,v)===`direct`),C=n.legend!==!1&&!b,w=mh(f).width,T=n.legendPosition??`top`,E=w>0&&w<350&&(T===`left`||T===`right`)?`top`:T,D=n.legendAnchor??`start`,O=n.stacked!==!1,k=n.stackPercent===!0||n.stackMode===Xr.Percent,A=n.areaSortMode??Ur.None,ee=n.areaLines!==!1,j=[...h];if(A!==Ur.None){let e=new Map(j.map(e=>[e.name,e.values.reduce((e,t)=>e+t,0)]));j.sort((t,n)=>{let r=(e.get(t.name)??0)-(e.get(n.name)??0);return A===Ur.Ascending?r:-r})}let M={labels:i.labels,values:i.values,series:j},N=k?kb(M):Ob(M),P=0;if(O)for(let e of N)for(let t of e)t[1]>P&&(P=t[1]);else for(let e of j)for(let t of e.values)t>P&&(P=t);k&&(P=100);let F=[0,P],I=n.verticalAxis?.numberFormat??(k?`|d|%`:void 0),L=dh(F,n.verticalAxis?.range,I,n.verticalAxis?.scaleType),R=ph(w,n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,L),z=S.length>0?Ly(S):0,B=R.top!=null,V=Math.max(0,w-(R.left??50)-(R.right??20)-z),H=C?Iy(_,E,V):{width:0,height:0},U=C?H.height+15:0,te={...R};C&&E===`top`&&(te.top=U+(B?15:0)),C&&E===`bottom`&&(te.bottom=(te.bottom??24)+U),C&&E===`left`&&(te.left=(te.left??50)+H.width+10),C&&E===`right`&&(te.right=(te.right??20)+H.width+10),z>0&&(te.right=(te.right??20)+z);let{chartArea:ne,width:re,height:ie,margin:ae}=gh(f,te),oe=nh(l,ae),se=Gu().domain(i.labels).range([0,re]).padding(n.edgePadding?.6:0),ce=se,W=e=>se(i.labels[e])??0,G=ad().domain([0,P]).nice().range([ie,0]);d.attach(ne,oe),d.update({vertical:{scale:G,height:ie,options:{...n.verticalAxis,numberFormat:I,gridWidth:re,topPadding:ae.top}},horizontal:{scale:ce,height:ie,options:{...n.horizontalAxis,width:re}}});let le=ne.ownerSVGElement,K=kv(le,e,`plot`,{x:0,y:0,width:re,height:ie}),ue=$(ne).append(`g`).attr(`clip-path`,`url(#${K})`),de=ue.node(),fe=Zy(n.interpolation??`monotoneX`),pe=N.map(e=>{let t=m.findIndex(t=>t.name===e.key),n;return n=O?Array.from(e).map(e=>[G(e[0]),G(e[1])]):(j.find(t=>t.name===e.key)?.values??[]).map(e=>[G(0),G(e)]),{name:e.key,points:n,colorIndex:t>=0?t:0}}),me=new Set((n.highlights??[]).map(e=>e.target)),he=me.size>0,ge=n.areaFillOpacity==null?.85:n.areaFillOpacity,_e=e=>y.get(e.name)??zy(e.name,e.colorIndex,g,v),ve=Fp().curve(fe).x((e,t)=>W(t)).y0(e=>e[0]).y1(e=>e[1]),ye=$(de).append(`g`).node(),be=$(de).append(`g`).node();if(r){for(let e of a)ye.appendChild(e);for(let e of o)be.appendChild(e)}let xe=Iv(e);Jv(xe,{role:`series-area`,parent:ye,selector:`.bc-area`,data:pe,key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-area`),attrs:e=>({"data-series":e.colorIndex,d:ve(e.points)??``,fill:_e(e),opacity:he?oy(me,e.name,ge):ge})}),Jv(xe,{role:`series-line`,parent:be,selector:`.bc-line`,data:ee?pe:[],key:e=>e.name,insert:e=>e.append(`path`).attr(`class`,`bc-line`),attrs:e=>{let t=Hy(e.name,n.interpolation??`monotoneX`,v),r=Pp().curve(Zy(t)).x((e,t)=>W(t)).y(e=>e[1]);return{"data-series":e.colorIndex,d:r(e.points)??``,fill:`none`,stroke:_e(e),"stroke-width":1,opacity:he?oy(me,e.name,1):1}}});let Se={left:ae.left,top:ae.top,width:re,height:ie};if(ny(xe,{svg:le,clipId:K,group:ne,from:u,to:Se,active:r&&(a.length>0||o.length>0)}),n.annotations?.length){let t=i.labels.map((e,t)=>({label:e,value:h[0]?.values[t]??0}));xv(ne,n.annotations,{scaleX:ce,scaleY:G,data:t,width:re,height:ie,backgroundColor:lr(e),transition:r,priorAnnotations:c})}if(n.tooltips||n.crosshair){let t=[];N.forEach(e=>{let n=m.findIndex(t=>t.name===e.key);Array.from(e).forEach((r,a)=>{let o=r[1]-r[0];t.push({cx:W(a),cy:G(r[1]),label:i.labels[a],value:Math.round(o*100)/100,series:e.key,color:zy(e.key,n,g,v)})})}),rb(ne,{width:re,height:ie,points:t,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:n.verticalAxis?.numberFormat,container:e})}let Ce=i.labels.length-1,we=W(Ce)+6,Te=[];if(h.forEach((e,t)=>{if(Wy(e.name,x,v)!==`direct`)return;let n=N.find(t=>t.key===e.name);if(!n)return;let r=n[Ce],i=G((r[0]+r[1])/2),a=v?.find(t=>t.name===e.name)?.labelText||e.name;Te.push({name:e.name,index:t,naturalY:i,text:a})}),Te.length>0){Te.sort((e,t)=>e.naturalY-t.naturalY);let e=db(Te.map(e=>e.naturalY),0,ie,14);Te.forEach((t,n)=>{$(ne).append(`text`).attr(`class`,`bc-direct-label`).attr(`data-series`,t.index).attr(`x`,we).attr(`y`,e[n]).attr(`dy`,`0.35em`).attr(`font-size`,`11px`).attr(`fill`,zy(t.name,t.index,g,v)).text(t.text)})}let Ee=_.filter(e=>Wy(e,x,v)===`legend`);if(C&&Ee.length>0){let e=Ee.map(e=>zy(e,m.findIndex(t=>t.name===e),g,v)),t=0,n=0;if(E===`top`){let e=B?15:0;n=-(H.height+10+e)}else E===`bottom`?n=ie+25:E===`left`?t=-(H.width+10):E===`right`&&(t=re+10);Fy(ne,Ee,e,n,E,D,re,ie,t,[],{left:ae.left,right:ae.right})}Ev(e,{chartType:`area-stacked`,margin:ae,plotRect:Se}),s&&(xh(ue.node()),Ch(e,s))}var Mb=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`];function Nb(e,t,n){let r=[];for(let i of e){let e=i.key,a=n.findIndex(t=>t.name===e);for(let n=0;n<i.length;n++){let o=i[n];r.push({label:t[n],seriesName:e,seriesIndex:a,y0:o[0],y1:o[1],value:o[1]-o[0]})}}return r}function Pb(e,t,n={},r=!1){yh(r);let i=[],a=null,o,s,c,l=Xh.for(e);if(r){let t=Tv(e);s=t?.margin,c=t?.plotRect,l.detach(),t?.chartType===`column-stacked`?i=Array.from(e.querySelectorAll(`.bc-frame .bc-bar-stacked`)):t&&(a=Sh(e)),o=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))o.set(e,n);e.replaceChildren()}let{body:u}=Zm(e,n.frame),d=t.series??[],f=d.filter(e=>!Uy(e.name,n.seriesOverrides)),p=f.map(e=>e.name),m=n.colors??Mb,h=n.seriesOverrides,g=n.legend!==!1,_=mh(u).width,v=n.legendPosition??`top`,y=_>0&&_<350&&(v===`left`||v===`right`)?`top`:v,b=n.legendAnchor??`start`,x={labels:t.labels,values:t.values,series:f},S=n.stackMode===Xr.Percent,C=Nb(S?kb(x):Ob(x),t.labels,d),w=S?100:Ni(C,e=>e.y1)??0,T=dh([0,w],n.verticalAxis?.range,n.verticalAxis?.numberFormat,n.verticalAxis?.scaleType),E=ph(_,n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,T),D=Math.max(0,_-(E.left??50)-(E.right??20)),O=Bh(t.labels,D,n.horizontalAxis);O!==void 0&&(E.bottom=O);let k=E.top!=null,A=Math.max(0,_-(E.left??50)-(E.right??20)),ee=g?Iy(p,y,A):{width:0,height:0},j=g?ee.height+15:0,M={...E};g&&y===`top`&&(M.top=j+(k?15:0)),g&&y===`bottom`&&(M.bottom=(M.bottom??24)+j),g&&y===`left`&&(M.left=(M.left??50)+ee.width+10),g&&y===`right`&&(M.right=(M.right??20)+ee.width+10);let{chartArea:N,width:P,height:F,margin:I}=gh(u,M),L=nh(s,I),R=t.labels;if(n.sortMode===`total`){let e=t.labels.map((e,t)=>({label:e,index:t,total:f.reduce((e,n)=>e+(n.values[t]??0),0)}));e.sort((e,t)=>t.total-e.total),R=e.map(e=>e.label)}let z=Uu().domain(R).range([0,P]).padding(ci(n.barGap)),B=ad().domain([0,w]).nice().range([F,0]);l.attach(N,L),l.update({vertical:{scale:B,height:F,options:{...n.verticalAxis,gridWidth:P,topPadding:I.top}},horizontal:{scale:z,height:F,options:{...n.horizontalAxis,width:P}}});let V=N.ownerSVGElement,H=kv(V,e,`bars`,{x:0,y:0,width:P,height:F}),U=$(N).append(`g`).attr(`clip-path`,`url(#${H})`),te=R===t.labels?C:R.flatMap(e=>C.filter(t=>t.label===e)),ne=Cv(n.colorizes),re=ay(n.highlights),ie=Iv(e),ae=U.append(`g`).node();if(r)for(let e of i)e.removeAttribute(`opacity`),e.removeAttribute(`fill-opacity`),ae.appendChild(e);Jv(ie,{role:`mark-per-cell`,parent:ae,selector:`.bc-bar-stacked`,data:te,key:e=>e.label+`\0`+e.seriesName,insert:e=>e.append(`rect`).attr(`class`,`bc-bar bc-bar-stacked`),attrs:e=>{let t=ne.get(e.seriesName)??zy(e.seriesName,e.seriesIndex,m,h),n=Ky(e.seriesName,h),r={"data-series":e.seriesName,x:z(e.label)??0,y:B(e.y1),width:z.bandwidth(),height:B(e.y0)-B(e.y1),fill:t};return n<1&&(r[`fill-opacity`]=n),re.size>0&&(r.opacity=oy(re,e.seriesName)),r}});let oe={left:I.left,top:I.top,width:P,height:F};ny(ie,{svg:V,clipId:H,group:N,from:c,to:oe,active:r&&i.length>0});let se=jv(U);if(n.tooltips&&se.use(I_({numberFormat:n.verticalAxis?.numberFormat})),n.crosshair&&se.use(R_({width:P,height:F,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),n.annotations?.length){let i=t.labels.map((e,t)=>({label:e,value:f.reduce((e,n)=>e+(n.values[t]??0),0)}));se.use(Sv(n.annotations,{scaleX:z,scaleY:B,data:i,width:P,height:F,backgroundColor:lr(e),transition:r,priorAnnotations:o}))}let ce=()=>se.draw(te);ie.state===`committing`?ie.register(ce):ce(),Ev(e,{chartType:`column-stacked`,margin:I,plotRect:oe}),a&&(xh(U.node()),Ch(e,a));let W=n.valueLabels??!1,G=wi(te,e=>Ni(e,e=>e.y1)??0,e=>e.label),le=$(N).append(`g`).attr(`class`,`bc-value-labels`);if(te.forEach(e=>{if(!Gy(e.seriesName,W,h))return;let t=(z(e.label)??0)+z.bandwidth()/2,r=Math.abs(B(e.y0)-B(e.y1)),i=B(e.y0)-r/2,a=S?`${Math.round(e.value)}%`:n.valueLabels===`percent`?th(e.value,G.get(e.label)??0):String(Math.round(e.value*100)/100);my({text:a,placement:`inside`,orientation:`vertical`,barWidth:z.bandwidth(),barHeight:r})&&le.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`x`,t).attr(`y`,i).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`fill`,`currentColor`).text(a)}),g&&p.length>0){let e=p.map(e=>zy(e,d.findIndex(t=>t.name===e),m,h)),t=0,n=0;if(y===`top`){let e=k?15:0;n=-(ee.height+10+e)}else y===`bottom`?n=F+25:y===`left`?t=-(ee.width+10):y===`right`&&(t=P+10);Fy(N,p,e,n,y,b,P,F,t,[],{left:I.left,right:I.right})}}var Fb=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`],Ib=13;function Lb(e,t,n){let r=[];for(let i of e){let e=i.key,a=n.findIndex(t=>t.name===e);for(let n=0;n<i.length;n++){let o=i[n];r.push({label:t[n],seriesName:e,seriesIndex:a,y0:o[0],y1:o[1],value:o[1]-o[0]})}}return r}function Rb(e,t,n={},r=!1){yh(r);let i=[],a=null,o,s,c,l=Xh.for(e);if(r){let t=Tv(e);s=t?.margin,c=t?.plotRect,l.detach(),t?.chartType===`bar-stacked`?i=Array.from(e.querySelectorAll(`.bc-frame .bc-bar-stacked`)):t&&(a=Sh(e)),o=new Map;for(let t of e.querySelectorAll(`.bc-frame .bc-annotations, .bc-frame .bc-annotations-range`))for(let[e,n]of B_(t))o.set(e,n);e.replaceChildren()}let{body:u}=Zm(e,n.frame),d=t.series??[],f=d.filter(e=>!Uy(e.name,n.seriesOverrides)),p=f.map(e=>e.name),m=n.colors??Fb,h=n.seriesOverrides,g=n.legend!==!1,_=mh(u).width,v=n.legendPosition??`top`,y=_>0&&_<350&&(v===`left`||v===`right`)?`top`:v,b=n.legendAnchor??`start`,x={labels:t.labels,values:t.values,series:f},S=n.stackMode===Xr.Percent,C=Lb(S?kb(x):Ob(x),t.labels,d),w=S?100:Ni(C,e=>e.y1)??0,T=n.categoryLabelLine===!0,E=fh(t.labels),D=ph(_,T?Mr.Off:n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,E,n.horizontalAxis?.showAxis),O=D.top!=null,k=Math.max(0,_-(D.left??50)-(D.right??20)),A=g?Iy(p,y,k):{width:0,height:0},ee=g?A.height+15:0,j={...D};g&&y===`top`&&(j.top=ee+(O?15:0)),g&&y===`bottom`&&(j.bottom=(j.bottom??24)+ee),g&&y===`left`&&(j.left=(j.left??50)+A.width+10),g&&y===`right`&&(j.right=(j.right??20)+A.width+10);let{chartArea:M,width:N,height:P,margin:F}=gh(u,j),I=nh(s,F),L=t.labels;if(n.sortMode===`total`){let e=t.labels.map((e,t)=>({label:e,index:t,total:f.reduce((e,n)=>e+(n.values[t]??0),0)}));e.sort((e,t)=>t.total-e.total),L=e.map(e=>e.label)}let R=ad().domain([0,w]).nice().range([0,N]),z=Uu().domain(L).range([0,P]).padding(ci(n.barGap));l.attach(M,I),l.update({horizontal:{scale:R,height:P,options:{...n.horizontalAxis,width:N}},vertical:{scale:z,height:P,options:{...n.verticalAxis,labelPosition:T?Mr.Off:n.verticalAxis?.labelPosition,topPadding:F.top}},order:`horizontal-first`});let B=M.ownerSVGElement,V=kv(B,e,`bars`,{x:0,y:0,width:N,height:P}),H=$(M).append(`g`).attr(`clip-path`,`url(#${V})`),U=L===t.labels?C:L.flatMap(e=>C.filter(t=>t.label===e)),te=T?Ib:0,ne=Cv(n.colorizes),re=ay(n.highlights),ie=Iv(e),ae=H.append(`g`).node();if(r)for(let e of i)e.removeAttribute(`opacity`),e.removeAttribute(`fill-opacity`),ae.appendChild(e);Jv(ie,{role:`mark-per-cell`,parent:ae,selector:`.bc-bar-stacked`,data:U,key:e=>e.label+`\0`+e.seriesName,insert:e=>e.append(`rect`).attr(`class`,`bc-bar bc-bar-stacked`),attrs:e=>{let t=ne.get(e.seriesName)??zy(e.seriesName,e.seriesIndex,m,h),n=Ky(e.seriesName,h),r={"data-series":e.seriesName,x:R(e.y0),y:(z(e.label)??0)+te,width:R(e.y1)-R(e.y0),height:Math.max(0,z.bandwidth()-te),fill:t};return n<1&&(r[`fill-opacity`]=n),re.size>0&&(r.opacity=oy(re,e.seriesName)),r}});let oe={left:F.left,top:F.top,width:N,height:P};ny(ie,{svg:B,clipId:V,group:M,from:c,to:oe,active:r&&i.length>0});let se=jv(H);if(n.tooltips&&se.use(I_({numberFormat:n.verticalAxis?.numberFormat})),n.crosshair&&se.use(R_({width:N,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:zr.Horizontal})),n.annotations?.length){let i=t.labels.map((e,t)=>({label:e,value:f.reduce((e,n)=>e+(n.values[t]??0),0)}));se.use(Sv(n.annotations,{scaleX:z,scaleY:R,data:i,width:N,height:P,backgroundColor:lr(e),orientation:zr.Horizontal,transition:r,priorAnnotations:o}))}let ce=()=>se.draw(U);if(ie.state===`committing`?ie.register(ce):ce(),Ev(e,{chartType:`bar-stacked`,margin:F,plotRect:oe}),a&&(xh(H.node()),Ch(e,a)),T){let e=$(M).append(`g`).attr(`class`,`bc-category-labels`);for(let t of L){let n=z(t)??0;e.append(`text`).attr(`class`,`bc-category-label`).attr(`x`,2).attr(`y`,n+Ib/2).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`central`).attr(`font-size`,`10px`).attr(`font-weight`,`600`).attr(`fill`,`currentColor`).text(t)}}let W=n.valueLabels??!1,G=n.valueLabelPosition??qr.Auto,le=new Set,K=new Map;for(let e of L){let t=U.filter(t=>t.label===e).sort((e,t)=>e.y1-t.y1);if(t.length>0){let e=t[t.length-1];le.add(e.label+`\0`+e.seriesName);for(let e=0;e<t.length-1;e++){let n=t[e].label+`\0`+t[e].seriesName;K.set(n,R(t[e+1].y1)-R(t[e].y1))}}}let ue=new Map,de=wi(U,e=>Ni(e,e=>e.y1)??0,e=>e.label),fe=$(M).append(`g`).attr(`class`,`bc-value-labels`);if(U.forEach(e=>{if(!Gy(e.seriesName,W,h))return;let t=S?`${Math.round(e.value)}%`:n.valueLabels===`percent`?th(e.value,de.get(e.label)??0):String(Math.round(e.value*100)/100),r=R(e.y1)-R(e.y0),i=t.length*6.5+8,a=r>=i,o=(z(e.label)??0)+te+(z.bandwidth()-te)/2,s=zy(e.seriesName,e.seriesIndex,m,h),c=le.has(e.label+`\0`+e.seriesName),l=G===qr.Outside||G===qr.Auto&&!a&&c,u=my({text:t,placement:l?`outside`:`inside`,orientation:`horizontal`,barWidth:r,barHeight:z.bandwidth()}),d=()=>{let n=R(e.y0)+r/2;fe.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`opacity`,0).attr(`x`,n).attr(`y`,o).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`fill`,sr(s)).text(t)};if(l){if(G===qr.Inside)d();else{let n=R(e.y1)+4,r=ue.get(e.label)??0,a=K.get(e.label+`\0`+e.seriesName),s=n<r,c=a!==void 0&&i+4>a,l=N+F.right-2,f=n+i>l;s||c||f||!u?d():(ue.set(e.label,n+i),fe.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`x`,n).attr(`y`,o).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`fill`,`currentColor`).text(t))}}else if(!a||!u)d();else{let n=R(e.y0)+r/2;fe.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`x`,n).attr(`y`,o).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`fill`,sr(s)).text(t)}}),g&&p.length>0){let e=p.map(e=>zy(e,d.findIndex(t=>t.name===e),m,h)),t=0,n=0;if(y===`top`){let e=O?15:0;n=-(A.height+10+e)}else y===`bottom`?n=P+25:y===`left`?t=-(A.width+10):y===`right`&&(t=N+10);Fy(M,p,e,n,y,b,N,P,t,[],{left:F.left,right:F.right})}}var zb=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`],Bb=16,Vb=20,Hb=13;function Ub(e,t,n,r){let i=e.length;if(i===0)return[];let a=Math.max(0,(n-(i-1)*Bb)/i),o=r?Ni(e.flatMap(e=>e.values))??0:0;return e.map((e,n)=>{let i=r?o:Ni(e.values)??0,s=ad().domain([0,i]).nice().range([0,a]);return{seriesName:e.name,seriesIndex:t.findIndex(t=>t.name===e.name),xOffset:n*(a+Bb),panelWidth:a,xScale:s}})}function Wb(e,t,n,r){let i=[];for(let a of e){let e=r.find(e=>e.name===a.seriesName);if(e)for(let r of t){let t=n.indexOf(r),o=t>=0?e.values[t]??0:0,s=Math.max(0,a.xScale(o)-a.xScale(0));i.push({label:r,seriesName:a.seriesName,seriesIndex:a.seriesIndex,value:o,xPos:a.xOffset,barWidth:s})}}return i}function Gb(e,t,n={},r=!1){yh(r);let i=[],a=null,o,s,c=Xh.for(e);if(r){let t=Tv(e);o=t?.margin,s=t?.plotRect,c.detach(),t?.chartType===`bar-split`?i=Array.from(e.querySelectorAll(`.bc-frame .bc-bar-split`)):t&&(a=Sh(e)),e.replaceChildren()}let{body:l}=Zm(e,n.frame),u=t.series??[],d=u.filter(e=>!Uy(e.name,n.seriesOverrides)),f=d.map(e=>e.name),p=n.colors??zb,m=n.seriesOverrides,h=n.legend!==!1,g=mh(l).width,_=n.legendPosition??`top`,v=g>0&&g<350&&(_===`left`||_===`right`)?`top`:_,y=n.legendAnchor??`start`,b=n.categoryLabelLine===!0,x=fh(t.labels),S=ph(g,b?Mr.Off:n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,x,n.horizontalAxis?.showAxis);S.top=(S.top??12)+Vb;let C=Math.max(0,g-(S.left??50)-(S.right??20)),w=h?Iy(f,v,C):{width:0,height:0},T=h?w.height+15:0,E={...S};h&&v===`top`&&(E.top=T+Vb),h&&v===`bottom`&&(E.bottom=(E.bottom??24)+T),h&&v===`left`&&(E.left=(E.left??50)+w.width+10),h&&v===`right`&&(E.right=(E.right??20)+w.width+10);let{chartArea:D,width:O,height:k,margin:A}=gh(l,E),ee=nh(o,A),j=t.labels;if(n.sortMode===`total`){let e=t.labels.map((e,t)=>({label:e,total:d.reduce((e,n)=>e+(n.values[t]??0),0)}));e.sort((e,t)=>t.total-e.total),j=e.map(e=>e.label)}let M=Uu().domain(j).range([0,k]).padding(ci(n.barGap)),N=b?Hb:0;c.attach(D,ee),c.update({vertical:{scale:M,height:k,options:{...n.verticalAxis,labelPosition:b?Mr.Off:n.verticalAxis?.labelPosition,topPadding:A.top}},order:`horizontal-first`});let P=Ub(d,u,O,n.sharedScale===!0),F=D.ownerSVGElement,I=kv(F,e,`bars`,{x:0,y:0,width:O,height:k}),L=$(D).append(`g`).attr(`clip-path`,`url(#${I})`),R=$(D).append(`g`).attr(`class`,`bc-split-headers`);for(let e of P)R.append(`text`).attr(`class`,`bc-split-header`).attr(`x`,e.xOffset+e.panelWidth/2).attr(`y`,-10).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`font-weight`,`600`).attr(`fill`,`currentColor`).text(e.seriesName);let z=Wb(P,j,t.labels,u),B=ay(n.highlights),V=Cv(n.colorizes),H=Iv(e),U=L.append(`g`).node();if(r)for(let e of i)e.removeAttribute(`opacity`),e.removeAttribute(`fill-opacity`),U.appendChild(e);Jv(H,{role:`mark-per-cell`,parent:U,selector:`.bc-bar-split`,data:z,key:e=>e.label+`\0`+e.seriesName,insert:e=>e.append(`rect`).attr(`class`,`bc-bar bc-bar-split`),attrs:e=>{let t=V.get(e.seriesName)??zy(e.seriesName,e.seriesIndex,p,m),n=Ky(e.seriesName,m),r={"data-series":e.seriesName,x:e.xPos,y:(M(e.label)??0)+N,width:e.barWidth,height:Math.max(0,M.bandwidth()-N),fill:t};return n<1&&(r[`fill-opacity`]=n),B.size>0&&(r.opacity=oy(B,e.seriesName)),r}});let te={left:A.left,top:A.top,width:O,height:k};ny(H,{svg:F,clipId:I,group:D,from:s,to:te,active:r&&i.length>0});let ne=jv(L);n.tooltips&&ne.use(I_({numberFormat:n.verticalAxis?.numberFormat})),n.crosshair&&ne.use(R_({width:O,height:k,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:zr.Horizontal}));let re=()=>ne.draw(z);if(H.state===`committing`?H.register(re):re(),Ev(e,{chartType:`bar-split`,margin:A,plotRect:te}),a&&(xh(L.node()),Ch(e,a)),b){let e=$(D).append(`g`).attr(`class`,`bc-category-labels`);for(let t of j){let n=M(t)??0;e.append(`text`).attr(`class`,`bc-category-label`).attr(`x`,2).attr(`y`,n+Hb/2).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`central`).attr(`font-size`,`10px`).attr(`font-weight`,`600`).attr(`fill`,`currentColor`).text(t)}}let ie=n.valueLabels??!0,ae=n.valueLabelPosition??qr.Auto,oe=$(D).append(`g`).attr(`class`,`bc-value-labels`);if(z.forEach(e=>{if(!Gy(e.seriesName,ie,m))return;let t=P.find(t=>t.seriesName===e.seriesName);if(!t)return;let n=zy(e.seriesName,e.seriesIndex,p,m),r=e.xPos+e.barWidth,i=Math.max(0,M.bandwidth()-N),a=(M(e.label)??0)+N+i/2,o=ae===qr.Inside||ae===qr.Auto&&e.barWidth>30;if(!my({text:String(e.value),placement:o?`inside`:`outside`,orientation:`horizontal`,barWidth:e.barWidth,barHeight:i}))return;let s,c,l;if(o)s=r-4,c=`end`,l=sr(n);else{let n=r+4,i=t.xOffset+t.panelWidth;n+20>i?(s=e.xPos-4,c=`end`):(s=n,c=`start`),l=`currentColor`}oe.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`x`,s).attr(`y`,a).attr(`text-anchor`,c).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`fill`,l).text(String(e.value))}),h&&f.length>0){let e=f.map(e=>zy(e,u.findIndex(t=>t.name===e),p,m)),t=0,n=0;v===`top`?n=-(w.height+10+Vb):v===`bottom`?n=k+25:v===`left`?t=-(w.width+10):v===`right`&&(t=O+10),Fy(D,f,e,n,v,y,O,k,t,[],{left:A.left,right:A.right})}}var Kb=[`#4e79a7`,`#f28e2b`,`#e15759`,`#76b7b2`,`#59a14f`,`#edc948`,`#b07aa1`,`#ff9da7`],qb=13;function Jb(e,t,n={},r=!1){yh(r);let i=[],a=null,o,s,c=Xh.for(e);if(r){let t=Tv(e);o=t?.margin,s=t?.plotRect,c.detach(),t?.chartType===`bar-grouped`?i=Array.from(e.querySelectorAll(`.bc-frame .bc-bar-grouped`)):t&&(a=Sh(e)),e.replaceChildren()}let{body:l}=Zm(e,n.frame),u=t.series??[],d=u.filter(e=>!Uy(e.name,n.seriesOverrides)),f=d.map(e=>e.name),p=n.colors??Kb,m=n.seriesOverrides,h=n.legend!==!1,g=mh(l).width,_=n.legendPosition??`top`,v=g>0&&g<350&&(_===`left`||_===`right`)?`top`:_,y=n.legendAnchor??`start`,b=n.categoryLabelLine===!0,x=fh(t.labels),S=ph(g,b?Mr.Off:n.verticalAxis?.labelPosition,n.horizontalAxis?.labelPosition,n.verticalAxis?.direction,x,n.horizontalAxis?.showAxis),C=Math.max(0,g-(S.left??50)-(S.right??20)),w=h?Iy(f,v,C):{width:0,height:0},T=h?w.height+15:0,E={...S};h&&v===`top`&&(E.top=T),h&&v===`bottom`&&(E.bottom=(E.bottom??24)+T),h&&v===`left`&&(E.left=(E.left??50)+w.width+10),h&&v===`right`&&(E.right=(E.right??20)+w.width+10);let{chartArea:D,width:O,height:k,margin:A}=gh(l,E),ee=nh(o,A),j=t.labels;if(n.sortMode===`total`){let e=t.labels.map((e,t)=>({label:e,total:d.reduce((e,n)=>e+(n.values[t]??0),0)}));e.sort((e,t)=>t.total-e.total),j=e.map(e=>e.label)}let M=Uu().domain(j).range([0,k]).paddingInner(ci(n.barGap)).paddingOuter(.05),N=b?qb:0,P=Math.max(0,M.bandwidth()-N),F=Uu().domain(f).range([0,P]).padding(.05),I=Ni(d.flatMap(e=>e.values))??0,L=ad().domain([0,I]).nice().range([0,O]);c.attach(D,ee),c.update({vertical:{scale:M,height:k,options:{...n.verticalAxis,labelPosition:b?Mr.Off:n.verticalAxis?.labelPosition,topPadding:A.top}},horizontal:{scale:L,height:k,options:{...n.horizontalAxis,width:O}},order:`horizontal-first`});let R=D.ownerSVGElement,z=kv(R,e,`bars`,{x:0,y:0,width:O,height:k}),B=$(D).append(`g`).attr(`clip-path`,`url(#${z})`);if(n.barBackground){let e=(n.colors??Kb)[0];B.selectAll(`.bc-bar-bg`).data(j,e=>e).enter().append(`rect`).attr(`class`,`bc-bar-bg`).attr(`x`,0).attr(`y`,e=>(M(e)??0)+N).attr(`width`,O).attr(`height`,M.bandwidth()-N).attr(`fill`,e).attr(`opacity`,.18)}if(n.barSeparators&&j.length>1){let e=M.step();for(let t=1;t<j.length;t++){let n=(M(j[t-1])??0)+M.bandwidth()+(e-M.bandwidth())/2;B.append(`line`).attr(`class`,`bc-bar-separator`).attr(`x1`,0).attr(`x2`,O).attr(`y1`,n).attr(`y2`,n).attr(`stroke`,`currentColor`).attr(`opacity`,.15)}}let V=[];for(let e of j){let n=t.labels.indexOf(e);for(let t of d){let r=u.findIndex(e=>e.name===t.name);V.push({label:e,seriesName:t.name,seriesIndex:r,value:n>=0?t.values[n]??0:0})}}let H=ay(n.highlights),U=Cv(n.colorizes),te=Iv(e),ne=B.append(`g`).node();if(r)for(let e of i)e.removeAttribute(`opacity`),e.removeAttribute(`fill-opacity`),ne.appendChild(e);Jv(te,{role:`mark-per-cell`,parent:ne,selector:`.bc-bar-grouped`,data:V,key:e=>e.label+`\0`+e.seriesName,insert:e=>e.append(`rect`).attr(`class`,`bc-bar bc-bar-grouped`),attrs:e=>{let t=U.get(e.seriesName)??zy(e.seriesName,e.seriesIndex,p,m),n=Ky(e.seriesName,m),r={"data-series":e.seriesName,x:L(0),y:(M(e.label)??0)+N+(F(e.seriesName)??0),width:Math.max(0,L(e.value)-L(0)),height:F.bandwidth(),fill:t};return n<1&&(r[`fill-opacity`]=n),H.size>0&&(r.opacity=oy(H,e.seriesName)),r}});let re={left:A.left,top:A.top,width:O,height:k};ny(te,{svg:R,clipId:z,group:D,from:s,to:re,active:r&&i.length>0});let ie=jv(B);n.tooltips&&ie.use(I_({numberFormat:n.verticalAxis?.numberFormat})),n.crosshair&&ie.use(R_({width:O,height:k,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:zr.Horizontal}));let ae=()=>ie.draw(V);if(te.state===`committing`?te.register(ae):ae(),Ev(e,{chartType:`bar-grouped`,margin:A,plotRect:re}),a&&(xh(B.node()),Ch(e,a)),b){let e=$(D).append(`g`).attr(`class`,`bc-category-labels`);for(let t of j){let n=M(t)??0;e.append(`text`).attr(`class`,`bc-category-label`).attr(`x`,2).attr(`y`,n+qb/2).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`central`).attr(`font-size`,`10px`).attr(`font-weight`,`600`).attr(`fill`,`currentColor`).text(t)}}let oe=n.valueLabels??!0,se=n.valueLabelPosition??qr.Auto,ce=$(D).append(`g`).attr(`class`,`bc-value-labels`);if(V.forEach(e=>{if(!Gy(e.seriesName,oe,m))return;let t=zy(e.seriesName,e.seriesIndex,p,m),n=Math.max(0,L(e.value)-L(0)),r=L(0)+n,i=(M(e.label)??0)+N+(F(e.seriesName)??0)+F.bandwidth()/2,a=se===qr.Inside||se===qr.Auto&&n>30;if(!my({text:String(e.value),placement:a?`inside`:`outside`,orientation:`horizontal`,barWidth:n,barHeight:F.bandwidth()}))return;let o,s,c;a?(o=r-4,s=`end`,c=sr(t)):(o=r+4,s=`start`,c=`currentColor`),ce.append(`text`).attr(`class`,`bc-value-label`).attr(`data-series`,e.seriesName).attr(`x`,o).attr(`y`,i).attr(`text-anchor`,s).attr(`dominant-baseline`,`central`).attr(`font-size`,`11px`).attr(`fill`,c).text(String(e.value))}),h&&f.length>0){let e=f.map(e=>zy(e,u.findIndex(t=>t.name===e),p,m)),t=0,n=0;v===`top`?n=-(w.height+10):v===`bottom`?n=k+25:v===`left`?t=-(w.width+10):v===`right`&&(t=O+10),Fy(D,f,e,n,v,y,O,k,t,[],{left:A.left,right:A.right})}}var Yb=new Map;function Xb(e,t,n){Yb.set(e,{renderer:t,options:n})}function Zb(e){return Yb.get(e)?.renderer}function Qb(e){return Yb.get(e)?.options??[]}var $b=[{value:jr.Solid,text:`Solid`},{value:jr.Dashed,text:`Dashed`},{value:jr.Dotted,text:`Dotted`},{value:jr.None,text:`None`}],ex={key:`colors`,type:Q.Colors,label:`Colors`},tx={key:`colorPalette`,type:Q.Select,label:`Color palette`,default:`Blueprint`,choices:[{value:``,text:`Custom`},...N().map(e=>({value:e.name,text:e.label}))]},nx={key:`autoContrast`,type:Q.Boolean,label:`Auto-adjust contrast`,default:!1},rx={key:`allowDarkMode`,type:Q.Boolean,label:`Allow dark mode`,default:!0},ix={key:`legend`,type:Q.Boolean,label:`Show legend`,default:!0},ax={key:`legendPosition`,type:Q.Select,label:`Legend position`,default:Gr.Top,choices:[{value:Gr.Top,text:`Top`},{value:Gr.Bottom,text:`Bottom`},{value:Gr.Left,text:`Left`},{value:Gr.Right,text:`Right`}]},ox={key:`legendAnchor`,type:Q.Select,label:`Legend anchor`,default:Kr.Start,choices:[{value:Kr.Start,text:`Start`},{value:Kr.Middle,text:`Middle`},{value:Kr.End,text:`End`}]},sx={key:`directLabelling`,type:Q.Select,label:`Direct labelling`,default:Zr.Off,choices:[{value:Zr.Off,text:`Off`},{value:Zr.Auto,text:`Auto`},{value:Zr.Outside,text:`Outside`},{value:Zr.Inside,text:`Inside`}]},cx={key:`directLabelAnchor`,type:Q.Select,label:`Label anchor`,default:Kr.Middle,choices:[{value:Kr.Start,text:`Start`},{value:Kr.Middle,text:`Middle`},{value:Kr.End,text:`End`}]},lx={key:`valueLabels`,type:Q.Boolean,label:`Value labels`,default:!1},ux={key:`valueLabelPosition`,type:Q.Select,label:`Label position`,default:qr.Auto,choices:[{value:qr.Auto,text:`Auto`},{value:qr.Outside,text:`Outside`},{value:qr.Inside,text:`Inside`}]},dx={key:`tooltips`,type:Q.Boolean,label:`Tooltips`,default:!1},fx={key:`crosshair`,type:Q.Boolean,label:`Crosshair`,default:!1},px={key:`crosshairDirection`,type:Q.Select,label:`Crosshair direction`,default:Jr.Both,choices:[{value:Jr.Both,text:`Both`},{value:Jr.Vertical,text:`Vertical`},{value:Jr.Horizontal,text:`Horizontal`}]},mx={key:`crosshairStyle`,type:Q.Select,label:`Crosshair style`,default:Yr.Dashed,choices:[{value:Yr.Solid,text:`Solid`},{value:Yr.Dashed,text:`Dashed`},{value:Yr.Dotted,text:`Dotted`}]},hx={key:`crosshairColor`,type:Q.Text,label:`Crosshair color`,default:`#999`,placeholder:`#999`},gx={key:`lineSymbols`,type:Q.Boolean,label:`Show line symbols`,default:!1},_x={key:`lineSymbolShape`,type:Q.Select,label:`Symbol`,default:Br.Circle,choices:[{value:Br.Circle,text:`Circle`},{value:Br.Square,text:`Square`},{value:Br.Diamond,text:`Diamond`},{value:Br.Triangle,text:`Triangle Up`},{value:Br.TriangleDown,text:`Triangle Down`},{value:Br.Cross,text:`Cross`},{value:Br.Star,text:`Star`}]},vx={key:`lineSymbolShowOn`,type:Q.Select,label:`Show on`,default:Vr.FirstLast,choices:[{value:Vr.FirstLast,text:`First & Last`},{value:Vr.First,text:`First`},{value:Vr.Last,text:`Last`},{value:Vr.All,text:`All`}]},yx={key:`lineSymbolStyle`,type:Q.Select,label:`Style`,default:Hr.Filled,choices:[{value:Hr.Filled,text:`Filled`},{value:Hr.Hollow,text:`Hollow`}]},bx={key:`lineSymbolSize`,type:Q.Text,label:`Size`,default:`3.5`,placeholder:`3.5`},xx={key:`lineSymbolOpacity`,type:Q.Text,label:`Opacity`,default:`1`,placeholder:`1`},Sx={key:`sortMode`,type:Q.Select,label:`Sort mode`,default:Wr.None,choices:[{value:Wr.None,text:`None`},{value:Wr.Total,text:`By total`},{value:Wr.WithinGroups,text:`Within groups`}]},Cx={key:`edgePadding`,type:Q.Boolean,label:`Edge padding`,default:!1},wx={key:`waterfall`,type:Q.Boolean,label:`Waterfall`,default:!1},Tx={key:`waterfallTotal`,type:Q.Boolean,label:`Waterfall total`,default:!1},Ex={key:`barBackground`,type:Q.Boolean,label:`Bar background`,default:!1},Dx={key:`barGap`,type:Q.Text,label:`Bar gap`,default:`60`,placeholder:`60`},Ox={key:`barSeparators`,type:Q.Boolean,label:`Bar separators`,default:!1},kx={key:`connectedColumns`,type:Q.Boolean,label:`Connected columns`,default:!1},Ax={key:`connectionsOpacity`,type:Q.Text,label:`Opacity`,default:`0.15`,placeholder:`0.15`},jx={key:`swapLabelValue`,type:Q.Boolean,label:`Swap labels and values`,default:!1},Mx={key:`stackMode`,type:Q.Select,label:`Stack mode`,default:Xr.Normal,choices:[{value:Xr.Normal,text:`Normal`},{value:Xr.Percent,text:`Percentage (100%)`}]},Nx={key:`sharedScale`,type:Q.Boolean,label:`Shared scale`,default:!1},Px={key:`categoryLabelLine`,type:Q.Boolean,label:`Labels on separate line`,default:!1},Fx={key:`displayAsPercentage`,type:Q.Boolean,label:`Display as percentage`,default:!1},Ix={key:`showTotal`,type:Q.Boolean,label:`Show total`,default:!1},Lx={key:`showLabels`,type:Q.Boolean,label:`Show labels`,default:!0},Rx={key:`showValues`,type:Q.Boolean,label:`Show values`,default:!0},zx={key:`sliceMax`,type:Q.Text,label:`Max slices`,default:`6`},Bx={key:`sliceGroupLabel`,type:Q.Text,label:`Group label`,default:`Others`,placeholder:`Others`},Vx={key:`areaFillOpacity`,type:Q.Text,label:`Opacity`,default:`0.85`,placeholder:`0.85`},Hx={key:`stacked`,type:Q.Boolean,label:`Stack areas`,default:!0},Ux={key:`stackPercent`,type:Q.Boolean,label:`Stack to 100%`,default:!1},Wx={key:`areaLines`,type:Q.Boolean,label:`Separate areas with lines`,default:!0},Gx={key:`areaSortMode`,type:Q.Select,label:`Sort areas`,default:Ur.None,choices:[{value:Ur.None,text:`Keep order`},{value:Ur.Ascending,text:`Smallest first`},{value:Ur.Descending,text:`Largest first`}]},Kx={key:`interpolation`,type:Q.Select,label:`Line interpolation`,default:Qr.Linear,choices:[{value:Qr.Linear,text:`Linear`},{value:Qr.MonotoneX,text:`Monotone`},{value:Qr.Step,text:`Step`},{value:Qr.StepBefore,text:`Step (before)`},{value:Qr.StepAfter,text:`Step (after)`},{value:Qr.Basis,text:`Basis`},{value:Qr.Cardinal,text:`Cardinal`},{value:Qr.CatmullRom,text:`Catmull-Rom`}]},qx=[{value:Ar.Linear,text:`Linear`},{value:Ar.Log,text:`Logarithmic`}],Jx=[{value:Mr.Auto,text:`Auto`},{value:Mr.Inside,text:`Inside`},{value:Mr.Outside,text:`Outside`},{value:Mr.Off,text:`Off`}],Yx=[{value:Nr.Auto,text:`Auto`},{value:Nr.Horizontal,text:`Horizontal`},{value:Nr.Vertical,text:`Vertical`}];function Xx(e){return[{key:`showVerticalAxis`,type:Q.Boolean,label:`Show vertical axis`,default:e.showVerticalAxis??!0},{key:`verticalAxisDirection`,type:Q.Select,label:`Vertical axis side`,default:kr.Left,choices:[{value:kr.Left,text:`Left`},{value:kr.Right,text:`Right`}]},{key:`showVerticalTicks`,type:Q.Boolean,label:`Show vertical ticks`,default:e.showVerticalTicks},{key:`verticalLabelPosition`,type:Q.Select,label:`Vertical labels`,default:e.valueAxisLabelsOff&&e.valueAxis===`vertical`?Mr.Off:Mr.Auto,choices:Jx},{key:`verticalGridStyle`,type:Q.Select,label:`Vertical grid style`,default:e.verticalGrid,choices:$b},{key:`verticalNumberFormat`,type:Q.NumberFormat,label:`Vertical number format`},...e.valueAxis===`vertical`?[{key:`verticalScaleType`,type:Q.Select,label:`Vertical scale`,default:Ar.Linear,choices:qx},e.valueAxisZeroBaseline?{key:`verticalRangeMin`,type:Q.Text,label:`Vertical min`,default:`0`,placeholder:`auto`}:{key:`verticalRangeMin`,type:Q.Text,label:`Vertical min`,placeholder:`auto`},{key:`verticalRangeMax`,type:Q.Text,label:`Vertical max`,placeholder:`auto`}]:[],{key:`showHorizontalAxis`,type:Q.Boolean,label:`Show horizontal axis`,default:e.showHorizontalAxis??!0},{key:`showHorizontalTicks`,type:Q.Boolean,label:`Show horizontal ticks`,default:e.showHorizontalTicks},{key:`horizontalLabelPosition`,type:Q.Select,label:`Horizontal labels`,default:e.valueAxisLabelsOff&&e.valueAxis===`horizontal`?Mr.Off:Mr.Auto,choices:Jx},{key:`horizontalLabelRotation`,type:Q.Select,label:`Horizontal label rotation`,default:Nr.Horizontal,choices:Yx},{key:`horizontalGridStyle`,type:Q.Select,label:`Horizontal grid style`,default:e.horizontalGrid,choices:$b},{key:`horizontalNumberFormat`,type:Q.NumberFormat,label:`Horizontal number format`},...e.valueAxis===`horizontal`?[{key:`horizontalScaleType`,type:Q.Select,label:`Horizontal scale`,default:Ar.Linear,choices:qx},e.valueAxisZeroBaseline?{key:`horizontalRangeMin`,type:Q.Text,label:`Horizontal min`,default:`0`,placeholder:`auto`}:{key:`horizontalRangeMin`,type:Q.Text,label:`Horizontal min`,placeholder:`auto`},{key:`horizontalRangeMax`,type:Q.Text,label:`Horizontal max`,placeholder:`auto`}]:[],...e.horizontalRange?[{key:`horizontalRangeMin`,type:Q.Text,label:`Horizontal min`,placeholder:`auto`},{key:`horizontalRangeMax`,type:Q.Text,label:`Horizontal max`,placeholder:`auto`}]:[]]}var Zx=Xx({verticalGrid:jr.None,horizontalGrid:jr.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:`vertical`,valueAxisZeroBaseline:!0,valueAxisLabelsOff:!0}),Qx=Xx({verticalGrid:jr.None,horizontalGrid:jr.None,showVerticalTicks:!1,showHorizontalTicks:!1,showHorizontalAxis:!1,valueAxis:`horizontal`,valueAxisZeroBaseline:!0,valueAxisLabelsOff:!0}),$x=Xx({verticalGrid:jr.Dashed,horizontalGrid:jr.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:`vertical`,horizontalRange:!0}),eS=Xx({verticalGrid:jr.Dashed,horizontalGrid:jr.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:`vertical`,horizontalRange:!0,valueAxisZeroBaseline:!0}),tS={...Kx,default:Qr.MonotoneX},nS={...px,default:Jr.Vertical},rS={...fx,default:!0},iS={...gx,default:!0},aS={...Sx,default:Wr.Total},oS={...lx,default:!0},sS={...lx,default:!0},cS={...Fx,default:!0},lS={...zx,default:`5`},uS={...Ix,default:!0},dS={...sx,default:Zr.Auto},fS={...ix,default:!1},pS=[fx,px,mx,hx],mS=[rS,nS,mx,hx],hS=[sS,ux,dx,...pS],gS=[oS,ux,dx,...pS],_S=[gx,_x,vx,yx,bx,xx],vS=[iS,_x,vx,yx,bx,xx],yS=[lx,dx,...mS,..._S],bS=[lx,dx,...mS,...vS],xS=[cS,Ix,Lx,Rx,lS,Bx],SS=[Fx,uS,Lx,Rx,zx,Bx];Xb(Or.BarVertical,_y,[ex,tx,nx,rx,jx,Ex,Ox,Dx,kx,Ax,wx,Tx,Px,...Zx,...hS]),Xb(Or.BarHorizontal,Ey,[ex,tx,nx,rx,jx,Ex,Ox,Dx,kx,Ax,wx,Tx,Px,...Qx,...gS]),Xb(Or.BarMulti,Yy,[ex,tx,nx,rx,aS,fS,ox,ax,dS,cx,...Zx,...hS]),Xb(Or.Line,sb,[ex,tx,nx,rx,tS,Cx,...$x,...yS]),Xb(Or.LineMulti,vb,[ex,tx,nx,rx,tS,Cx,Sx,fS,ox,ax,dS,...$x,...bS]),Xb(Or.Donut,wb,[ex,tx,nx,rx,fS,ox,ax,dS,dx,...SS]),Xb(Or.Pie,Eb,[ex,tx,nx,rx,fS,ox,ax,dS,dx,...xS]),Xb(Or.Area,Db,[ex,tx,nx,rx,tS,Cx,...eS,...yS]);var CS=Xx({verticalGrid:jr.Dashed,horizontalGrid:jr.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:`vertical`,horizontalRange:!0,valueAxisZeroBaseline:!0});Xb(Or.AreaStacked,jb,[ex,tx,nx,rx,Vx,tS,Cx,Gx,Hx,Ux,Wx,ix,ox,ax,sx,...CS,dx,...mS]),Xb(Or.ColumnStacked,Pb,[ex,tx,nx,rx,Mx,Sx,ix,ox,ax,sx,cx,...Zx,...hS]),Xb(Or.BarStacked,Rb,[ex,tx,nx,rx,Mx,Sx,ix,ox,ax,sx,cx,Px,...Qx,...gS]),Xb(Or.BarSplit,Gb,[ex,tx,nx,rx,Nx,Sx,ix,ox,ax,Px,...Qx,oS,ux,dx,...pS]),Xb(Or.BarGrouped,Jb,[ex,tx,nx,rx,aS,ix,ox,ax,Ex,Ox,Px,...Qx,oS,ux,dx,...pS]),Xb(Or.VerticalBar,_y,[ex,tx,nx,rx,jx,Ex,Ox,Dx,kx,Ax,wx,Tx,Px,...Zx,...hS]),Xb(Or.HorizontalBar,Ey,[ex,tx,nx,rx,jx,Ex,Ox,Dx,kx,Ax,wx,Tx,Px,...Qx,...gS]);function wS(e){return new Map(e.map(e=>[e.key,e.value]))}function TS(e,t){let n=wS(t),r=Qb(e),i=new Set(r.map(e=>e.key)),a={};for(let e of r){let t=n.get(e.key);t!==void 0&&i.has(e.key)&&(e.type===Q.Colors?a[e.key]=String(t).split(`,`).map(e=>e.trim()).filter(Boolean):e.type===Q.Boolean?e.key===`valueLabels`&&String(t).toLowerCase()===`percent`?a[e.key]=`percent`:a[e.key]=t===`true`||t===!0:a[e.key]=String(t))}return a}function ES(e){return!(/^-?\d+(\.\d+)?$/.test(e)||/^-?\d+(\.\d+)?%$/.test(e)||/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e))}function DS(e){return e.entries.map(e=>{if(e.values&&e.values.length>1){if(e.key===`series`&&!e.quotedKey)return`series = ${e.values.map(e=>`"${e}"`).join(`,`)}`;let t=e.values.join(`,`);return`"${e.key}" = ${t}`}let t=e.isPercentage?`${e.value}%`:String(e.value);return e.key===`series`&&!e.quotedKey?`series = "${t}"`:typeof e.value==`string`&&ES(t)?`"${e.key}" = "${t}"`:`"${e.key}" = ${t}`}).join(`
|
|
267
|
+
`)}function OS(e,t){let n=e.find(e=>e.key===t);return n?String(n.value):void 0}function kS(e,t){let n=e.find(e=>e.key===t);if(n)return n.isPercentage,n.value}function AS(e){let t=e.find(e=>e.key===`maxWidth`);if(t)return t.isPercentage?`${t.value}%`:t.value}var jS=e=>e===`true`||e===!0;function MS(e){return e.map(e=>({target:e.target,color:OS(e.properties,`color`)??`#e15759`,label:OS(e.properties,`label`)}))}function NS(e){return e.map(e=>({target:e.target}))}function PS(e){return e.map(e=>{let t=wS(e.properties);return{from:e.from,to:e.to,color:t.has(`color`)?String(t.get(`color`)):void 0,negativeColor:t.has(`negativeColor`)?String(t.get(`negativeColor`)):void 0,opacity:t.has(`opacity`)?Number(t.get(`opacity`)):void 0,interpolation:t.has(`interpolation`)?String(t.get(`interpolation`)):void 0}})}function FS(e){let t=e.get(`repeat`);if(t===!0||t===`true`)return`always`;if(t===void 0||t===!1||t===`false`)return;let n=Number(t);return Number.isInteger(n)&&n>=1?n:void 0}function IS(e){return e.map(e=>{let t=wS(e.properties),n=e.kind??Lr.Point;if(n===Lr.Range){let e={kind:Lr.Range,start:t.has(`start`)?isNaN(Number(t.get(`start`)))?String(t.get(`start`)):Number(t.get(`start`)):0,end:t.has(`end`)?isNaN(Number(t.get(`end`)))?String(t.get(`end`)):Number(t.get(`end`)):0};return e.repeat=FS(t),t.has(`orientation`)&&(e.orientation=String(t.get(`orientation`))),t.has(`startAnchor`)&&(e.startAnchor=String(t.get(`startAnchor`))),t.has(`endAnchor`)&&(e.endAnchor=String(t.get(`endAnchor`))),t.has(`bgColor`)&&(e.bgColor=String(t.get(`bgColor`))),t.has(`bgOpacity`)&&(e.bgOpacity=Number(t.get(`bgOpacity`))),t.has(`direction`)&&(e.direction=String(t.get(`direction`))),t.has(`text`)&&(e.text=String(t.get(`text`))),t.has(`textColor`)&&(e.textColor=String(t.get(`textColor`))),e}if(n===Lr.Free){let n={kind:Lr.Free,text:String(t.get(`text`)??``),x:kS(e.properties,`x`)??0,y:kS(e.properties,`y`)??0};n.repeat=FS(t),t.has(`textColor`)&&(n.textColor=String(t.get(`textColor`)));let r=AS(e.properties);return r!==void 0&&(n.maxWidth=r),t.has(`textOutline`)&&(n.textOutline=jS(t.get(`textOutline`))),n}let r=`target`in e?e.target:``,i={kind:Lr.Point,target:r,text:String(t.get(`text`)??``)};i.repeat=FS(t),t.has(`textColor`)&&(i.textColor=String(t.get(`textColor`)));let a=AS(e.properties);return a!==void 0&&(i.maxWidth=a),t.has(`textOutline`)&&(i.textOutline=jS(t.get(`textOutline`))),t.has(`showLine`)&&(i.showLine=jS(t.get(`showLine`))),t.has(`anchorDirection`)&&(i.anchorDirection=String(t.get(`anchorDirection`))),t.has(`textOffsetX`)&&(i.textOffsetX=Number(t.get(`textOffsetX`))),t.has(`textOffsetY`)&&(i.textOffsetY=Number(t.get(`textOffsetY`))),t.has(`lineStyle`)&&(i.lineStyle=String(t.get(`lineStyle`))),t.has(`lineWeight`)&&(i.lineWeight=Number(t.get(`lineWeight`))),t.has(`showArrow`)&&(i.showArrow=jS(t.get(`showArrow`))),t.has(`lineTargetDistance`)&&(i.lineTargetDistance=Number(t.get(`lineTargetDistance`))),t.has(`showCircle`)&&(i.showCircle=jS(t.get(`showCircle`))),t.has(`circleSize`)&&(i.circleSize=Number(t.get(`circleSize`))),t.has(`circleStyle`)&&(i.circleStyle=String(t.get(`circleStyle`))),t.has(`circleColor`)&&(i.circleColor=String(t.get(`circleColor`))),i})}function LS(e){return e.map(e=>{let t=wS(e.properties),n={name:e.name};if(t.has(`color`)&&(n.color=String(t.get(`color`))),t.has(`lineWidth`)&&(n.lineWidth=Number(t.get(`lineWidth`))),t.has(`dash`)&&(n.dash=String(t.get(`dash`))),t.has(`interpolation`)&&(n.interpolation=String(t.get(`interpolation`))),t.has(`labelMode`)&&(n.labelMode=String(t.get(`labelMode`))),t.has(`labelText`)&&(n.labelText=String(t.get(`labelText`))),t.has(`valueLabels`)){let e=t.get(`valueLabels`);n.valueLabels=String(e).toLowerCase()===`percent`?`percent`:jS(e)}return t.has(`lineSymbols`)&&(n.lineSymbols=jS(t.get(`lineSymbols`))),t.has(`hidden`)&&(n.hidden=jS(t.get(`hidden`))),t.has(`symbolShape`)&&(n.symbolShape=String(t.get(`symbolShape`))),t.has(`symbolShowOn`)&&(n.symbolShowOn=String(t.get(`symbolShowOn`))),t.has(`symbolStyle`)&&(n.symbolStyle=String(t.get(`symbolStyle`))),t.has(`symbolSize`)&&(n.symbolSize=Number(t.get(`symbolSize`))),t.has(`symbolOpacity`)&&(n.symbolOpacity=Number(t.get(`symbolOpacity`))),n})}var RS=new Set;function zS(e,t,n){let r=t;for(let t of e)t.transformType===`sort`?r=Wr.Total:RS.has(t.transformType)||(RS.add(t.transformType),console.warn(`[blueprint-chart] Unknown transform "${t.transformType}" in ${n}; ignored.`));return r}function BS(e){let t=t=>{let n=e.get(t);return n==null?void 0:String(n)||void 0},n=e.get(`transparentBackground`),r={title:t(`title`),description:t(`description`),source:t(`source`),sourceUrl:t(`sourceUrl`),byline:t(`byline`),note:t(`note`),padding:t(`padding`),transparentBackground:n===!0||n===`true`||void 0};return Object.values(r).some(e=>e!==void 0)?r:void 0}function VS(e){let t=wS(e.properties),n=ei(e.data?DS(e.data):``),r=t.get(`sort`),i=r==null?void 0:String(r),a=i===Ur.Ascending||i===Ur.Descending?i:void 0,o=t.get(`theme`),s=t.get(`sortMode`),c;return(s===Wr.Total||s===Wr.WithinGroups||s===Wr.None)&&(c=s),c=zS(e.transforms,c,`chart`),{chartType:e.chartType,data:n,properties:e.properties,frame:BS(t),colorizes:MS(e.colorizes),highlights:NS(e.highlights),areaFills:PS(e.areaFills),annotations:IS(e.annotations),seriesOverrides:LS(e.series),scenes:e.scenes,sort:a,sortMode:c,theme:o==null?void 0:String(o)||void 0}}var HS=Object.create(null);function US(e){if(!HS[e]){let t={};for(let n of Qb(e))n.default!==void 0&&(t[n.key]=n.default);HS[e]=t}return HS[e]}function WS(e,t){let n=US(e);return t.colors?.length?{...n,colorPalette:void 0,...t}:{...n,...t}}var GS=new Set;function KS(e,t,n){let r=t;for(let t of e)t.transformType===`sort`?r=Wr.Total:GS.has(t.transformType)||(GS.add(t.transformType),console.warn(`[blueprint-chart] Unknown transform "${t.transformType}" in ${n}; ignored.`));return r}function qS(){return{properties:new Map,chartTypeOptions:{},colorizes:[],highlights:[],areaFills:[],seriesOverrides:[],transforms:[]}}function JS(e,t,n){let r=qS();for(let i=0;i<=t;i++){let a=e[i],o=wS(a.properties),s=o.get(`type`);s&&(r.chartType=s);let c=r.chartType??n;a.data&&(r.data=a.data);let l=TS(c,a.properties);r.chartTypeOptions={...r.chartTypeOptions,...l},a.colorizes.length>0?r.colorizes=a.colorizes:a.data&&(r.colorizes=[]),i===t&&(r.highlights=a.highlights),a.areaFills.length>0&&(r.areaFills=a.areaFills),a.series.length>0&&(r.seriesOverrides=a.series),a.transforms.length>0&&(r.transforms=[...r.transforms,...a.transforms]);for(let[e,t]of o)r.properties.set(e,t)}return r}function YS(e,t,n){return n<e?!1:t===`always`||n<=e+(typeof t==`number`?t:0)}function XS(e,t){let n=e.options??(e.properties?WS(e.chartType,TS(e.chartType,e.properties)):{}),r={chartType:e.chartType,data:e.data,options:n,frame:e.frame,colorizes:e.colorizes??[],highlights:e.highlights??[],areaFills:e.areaFills??[],annotations:(e.annotations??[]).map((e,t)=>({...e,key:e.key??`base:${t}:${e.kind}`})),seriesOverrides:e.seriesOverrides??[],sort:e.sort,sortMode:e.sortMode,theme:e.theme};if(t==null||!e.scenes||t<0||t>=e.scenes.length)return r;let i=JS(e.scenes,t,e.chartType),a=i.chartType??e.chartType,o=i.data?ei(DS(i.data)):r.data,s=Object.keys(i.chartTypeOptions).length>0?WS(a,{...n,...i.chartTypeOptions}):n,c=i.colorizes.length>0?MS(i.colorizes):i.data?[]:r.colorizes,l=t==null?r.highlights:NS(i.highlights),u=i.areaFills.length>0?PS(i.areaFills):r.areaFills,d=(e.annotations??[]).map((e,t)=>({anchor:-1,key:e.key??`base:${t}:${e.kind}`,config:e}));for(let n=0;n<=t;n++)IS(e.scenes[n].annotations).forEach((e,t)=>{d.push({anchor:n,key:e.key??`s${n}:${t}:${e.kind}`,config:e})});let f=d.filter(({anchor:e,config:n})=>YS(e,n.repeat,t)).map(({key:e,config:t})=>({...t,key:e})),p=i.seriesOverrides.length>0?LS(i.seriesOverrides):r.seriesOverrides,m=KS(i.transforms,r.sortMode,`scene ${t}`),h=[`title`,`description`,`source`,`sourceUrl`,`byline`,`note`],g={};for(let e of h){let t=i.properties.get(e);typeof t==`string`&&(g[e]=t)}let _=Object.keys(g).length>0?{...r.frame,...g}:r.frame;return{...r,chartType:a,data:o,options:s,frame:_,colorizes:c,highlights:l,areaFills:u,annotations:f,seriesOverrides:p,sortMode:m}}var ZS=new WeakMap;function QS(e){let t=ZS.get(e);if(!(!t||t.size===0)){for(let n of t)e.style[n]=``;t.clear()}}function $S(e,t){let n=ZS.get(e);n||(n=new Set,ZS.set(e,n)),n.add(t)}function eC(e,t,n){if(QS(e),n.ignoreLayout||!t)return{constrained:!1};let r=wS(t),i=r.get(`heightMode`),a=r.get(`aspectRatio`),o=r.get(`fixedHeight`),s=!1;if(i===`aspect-ratio`&&a){let t=String(a).split(`:`).map(Number);t.length===2&&t[0]>0&&t[1]>0&&(e.style.aspectRatio=`${t[0]} / ${t[1]}`,e.style.height=`auto`,$S(e,`aspectRatio`),$S(e,`height`),s=!0)}else i===`fixed`&&o&&(e.style.height=`${o}px`,$S(e,`height`),s=!0);return s&&(e.style.display=`flex`,e.style.flexDirection=`column`,e.style.overflow=`hidden`,$S(e,`display`),$S(e,`flexDirection`),$S(e,`overflow`)),{constrained:s}}var tC=new WeakMap;function nC(e){e.querySelectorAll(`[data-bc-fade-overlay]`).forEach(e=>{typeof e.getAnimations==`function`&&e.getAnimations().forEach(e=>e.cancel()),e.remove()})}function rC(e,t,n){if(!n)return null;let r=tC.get(e);return!r||r===t?null:(nC(e),Sh(e))}function iC(e,t,n){if(tC.set(e,t),n){let t=e.querySelector(`.bc-frame .bc-frame-body`);t&&xh(t),Ch(e,n)}}function aC(e){tC.delete(e),nC(e)}function oC(e,t,n){let r=e.querySelector(`.bc-frame`);if(!r)return;let i=[];r.classList.forEach(e=>{e.startsWith(`bc-theme-`)&&i.push(e)});for(let e of i)r.classList.remove(e);t.theme&&r.classList.add(`bc-theme-${t.theme}`),n.constrained&&r.classList.add(`bc-frame--constrained`)}function sC(e,t,n={}){if(n.transition||(Iv(e).interrupt(),e.replaceChildren(),aC(e)),t.data.labels.length===0){n.transition&&(Iv(e).interrupt(),e.replaceChildren(),aC(e));return}let r=t;if(n.stripColors){let e={...t};if(t.properties&&(e.properties=t.properties.filter(e=>e.key!==`colors`&&e.key!==`colorPalette`)),t.options){let{colors:n,colorPalette:r,...i}=t.options;e.options=i}r=e}let i=eC(e,r.properties,n),a=XS(r,n.sceneIndex),o=Zb(a.chartType);if(!o)return;let s=rC(e,a.chartType,!!n.transition);s&&e.replaceChildren();let c=lr(e),l=oi(a.options,c),u;if(n.thumbnail)u=null;else{let e=a.frame?.padding??n.padding??`16px`;u={...a.frame??{},padding:e}}let d=Iv(e);n.transition&&d.beginCommit(),o(e,a.data,{frame:u,sort:a.sort,sortMode:a.sortMode,...l,colorizes:a.colorizes.length>0?a.colorizes:void 0,highlights:a.highlights.length>0?a.highlights:void 0,areaFills:a.areaFills.length>0?a.areaFills:void 0,annotations:a.annotations.length>0?a.annotations:void 0,seriesOverrides:a.seriesOverrides.length>0?a.seriesOverrides:void 0},!!n.transition),n.transition&&d.commit({duration:bh(),mode:n.transitionMode}),oC(e,{theme:n.theme??a.theme},i),iC(e,a.chartType,s)}function cC(e,t,n){let r=document.createElement(`div`);r.style.cssText=`color: #888; font-family: monospace; padding: 0.75rem; white-space: pre-wrap;`,r.textContent=`Blueprint Chart: ${t}\n${n}`,e.replaceChildren(r)}function lC(e,t,n){if(!t){n?.transition||e.replaceChildren();return}let r;try{r=A(t)}catch(t){cC(e,`could not parse chart`,t instanceof Error?t.message:String(t));return}try{sC(e,VS(r),n)}catch(t){cC(e,`could not render chart`,t instanceof Error?t.message:String(t))}}function uC(e,t,n){let r=0,i=!1,a=document.createElement(`nav`);a.className=`blueprint-chart-scenes`;let o=document.createElement(`button`);o.className=`blueprint-chart-scenes-prev`,o.textContent=`Previous`;let s=document.createElement(`button`);s.className=`blueprint-chart-scenes-next`,s.textContent=`Next`;let c=document.createElement(`span`);c.className=`blueprint-chart-scenes-counter`,a.appendChild(o),a.appendChild(c),a.appendChild(s),t.length>0&&e.appendChild(a);function l(){if(t.length===0){c.textContent=``;return}c.textContent=`${r+1} / ${t.length}`}function u(e){if(i||t.length===0||!Number.isFinite(e))return;let a=(Math.floor(e)%t.length+t.length)%t.length;r=a,l(),n(t[a],a)}return o.addEventListener(`click`,()=>u(r-1)),s.addEventListener(`click`,()=>u(r+1)),l(),{get currentScene(){return r},get totalScenes(){return t.length},next(){u(r+1)},previous(){u(r-1)},goTo:u,destroy(){i||(i=!0,a.remove())}}}var dC=uC;return document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,b):b(),e.createSceneController=uC,e.createStepController=dC,e.initBlueprint=b,e.renderBpc=lC,e})({});
|