/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/energy-visualization-stacked-area-chart@2.0.0/dist/stacked-area-chart.umd.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).StackedAreaChart={})}(this,(function(t){"use strict";const n={dimensions:{width:800,height:200,margin:{top:10,right:10,bottom:10,left:10}},mode:"fuel",representation:"perCapita",tooltip:{background:"#e8e8e8",color:"black",borderColor:"#cccccc",borderWidth:1,format:"n1",offset:{x:10,y:-10}},animations:{duration:300,easing:"ease-in-out",enabled:!0},colors:{Solar:"#fed530",Nuclear:"#ca0813",Water:"#0b24fb",Wind:"#901d8f",Geothermal:"#905a1c","Natural Gas":"#4cabf2",Coal:"#000000",Biomass:"#46be48",Petroleum:"#095f0b"},cssPrefix:"stacked-area-chart",interactive:!0};function e(t,n){return null==t||null==n?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function i(t,n){return null==t||null==n?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function r(t){let n,r,a;function s(t,e,i=0,o=t.length){if(i<o){if(0!==n(e,e))return o;do{const n=i+o>>>1;r(t[n],e)<0?i=n+1:o=n}while(i<o)}return i}return 2!==t.length?(n=e,r=(n,i)=>e(t(n),i),a=(n,e)=>t(n)-e):(n=t===e||t===i?t:o,r=t,a=t),{left:s,center:function(t,n,e=0,i=t.length){const r=s(t,n,e,i-1);return r>e&&a(t[r-1],n)>-a(t[r],n)?r-1:r},right:function(t,e,i=0,o=t.length){if(i<o){if(0!==n(e,e))return o;do{const n=i+o>>>1;r(t[n],e)<=0?i=n+1:o=n}while(i<o)}return i}}}function o(){return 0}const a=r(e).right;r((function(t){return null===t?NaN:+t})).center;var s=a;const u=Math.sqrt(50),l=Math.sqrt(10),h=Math.sqrt(2);function c(t,n,e){const i=(n-t)/Math.max(0,e),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=u?10:o>=l?5:o>=h?2:1;let s,f,d;return r<0?(d=Math.pow(10,-r)/a,s=Math.round(t*d),f=Math.round(n*d),s/d<t&&++s,f/d>n&&--f,d=-d):(d=Math.pow(10,r)*a,s=Math.round(t/d),f=Math.round(n/d),s*d<t&&++s,f*d>n&&--f),f<s&&.5<=e&&e<2?c(t,n,2*e):[s,f,d]}function f(t,n,e){return c(t=+t,n=+n,e=+e)[2]}var d={value:()=>{}};function p(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new g(i)}function g(t){this._=t}function y(t,n){for(var e,i=0,r=t.length;i<r;++i)if((e=t[i]).name===n)return e.value}function m(t,n,e){for(var i=0,r=t.length;i<r;++i)if(t[i].name===n){t[i]=d,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=e&&t.push({name:n,value:e}),t}g.prototype=p.prototype={constructor:g,on:function(t,n){var e,i,r=this._,o=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a<s;)if(e=(t=o[a]).type)r[e]=m(r[e],t.name,n);else if(null==n)for(e in r)r[e]=m(r[e],t.name,null);return this}for(;++a<s;)if((e=(t=o[a]).type)&&(e=y(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new g(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,i,r=new Array(e),o=0;o<e;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(i=this._[t]).length;o<e;++o)i[o].value.apply(n,r)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(n,e)}};var v="http://www.w3.org/1999/xhtml",_={svg:"http://www.w3.org/2000/svg",xhtml:v,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function w(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),_.hasOwnProperty(n)?{space:_[n],local:t}:t}function x(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===v&&n.documentElement.namespaceURI===v?n.createElement(t):n.createElementNS(e,t)}}function b(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function C(t){var n=w(t);return(n.local?b:x)(n)}function M(){}function $(t){return null==t?M:function(){return this.querySelector(t)}}function S(){return[]}function k(t){return null==t?S:function(){return this.querySelectorAll(t)}}function A(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function E(t){return function(){return this.matches(t)}}function N(t){return function(n){return n.matches(t)}}var D=Array.prototype.find;function I(){return this.firstElementChild}var T=Array.prototype.filter;function P(){return Array.from(this.children)}function F(t){return new Array(t.length)}function q(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function z(t,n,e,i,r,o){for(var a,s=0,u=n.length,l=o.length;s<l;++s)(a=n[s])?(a.__data__=o[s],i[s]=a):e[s]=new q(t,o[s]);for(;s<u;++s)(a=n[s])&&(r[s]=a)}function R(t,n,e,i,r,o,a){var s,u,l,h=new Map,c=n.length,f=o.length,d=new Array(c);for(s=0;s<c;++s)(u=n[s])&&(d[s]=l=a.call(u,u.__data__,s,n)+"",h.has(l)?r[s]=u:h.set(l,u));for(s=0;s<f;++s)l=a.call(t,o[s],s,o)+"",(u=h.get(l))?(i[s]=u,u.__data__=o[s],h.delete(l)):e[s]=new q(t,o[s]);for(s=0;s<c;++s)(u=n[s])&&h.get(d[s])===u&&(r[s]=u)}function W(t){return t.__data__}function B(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function L(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function H(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function X(t,n){return function(){this.setAttribute(t,n)}}function j(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function G(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function V(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function U(t){return function(){this.style.removeProperty(t)}}function K(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Z(t,n,e){return function(){var i=n.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,e)}}function Q(t,n){return t.style.getPropertyValue(n)||V(t).getComputedStyle(t,null).getPropertyValue(n)}function J(t){return function(){delete this[t]}}function tt(t,n){return function(){this[t]=n}}function nt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function et(t){return t.trim().split(/^|\s+/)}function it(t){return t.classList||new rt(t)}function rt(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function ot(t,n){for(var e=it(t),i=-1,r=n.length;++i<r;)e.add(n[i])}function at(t,n){for(var e=it(t),i=-1,r=n.length;++i<r;)e.remove(n[i])}function st(t){return function(){ot(this,t)}}function ut(t){return function(){at(this,t)}}function lt(t,n){return function(){(n.apply(this,arguments)?ot:at)(this,t)}}function ht(){this.textContent=""}function ct(t){return function(){this.textContent=t}}function ft(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function dt(){this.innerHTML=""}function pt(t){return function(){this.innerHTML=t}}function gt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function yt(){this.nextSibling&&this.parentNode.appendChild(this)}function mt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vt(){return null}function _t(){var t=this.parentNode;t&&t.removeChild(this)}function wt(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function xt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function bt(t){return function(){var n=this.__on;if(n){for(var e,i=0,r=-1,o=n.length;i<o;++i)e=n[i],t.type&&e.type!==t.type||e.name!==t.name?n[++r]=e:this.removeEventListener(e.type,e.listener,e.options);++r?n.length=r:delete this.__on}}}function Ct(t,n,e){return function(){var i,r=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(r)for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=e),void(i.value=n);this.addEventListener(t.type,o,e),i={type:t.type,name:t.name,value:n,listener:o,options:e},r?r.push(i):this.__on=[i]}}function Mt(t,n,e){var i=V(t),r=i.CustomEvent;"function"==typeof r?r=new r(n,e):(r=i.document.createEvent("Event"),e?(r.initEvent(n,e.bubbles,e.cancelable),r.detail=e.detail):r.initEvent(n,!1,!1)),t.dispatchEvent(r)}function $t(t,n){return function(){return Mt(this,t,n)}}function St(t,n){return function(){return Mt(this,t,n.apply(this,arguments))}}q.prototype={constructor:q,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)}},rt.prototype={add:function(t){this._names.indexOf(t)<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}};var kt=[null];function At(t,n){this._groups=t,this._parents=n}function Et(){return new At([[document.documentElement]],kt)}function Nt(t){return"string"==typeof t?new At([[document.querySelector(t)]],[document.documentElement]):new At([[t]],kt)}function Dt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function It(t,n){var e=Object.create(t.prototype);for(var i in n)e[i]=n[i];return e}function Tt(){}At.prototype=Et.prototype={constructor:At,select:function(t){"function"!=typeof t&&(t=$(t));for(var n=this._groups,e=n.length,i=new Array(e),r=0;r<e;++r)for(var o,a,s=n[r],u=s.length,l=i[r]=new Array(u),h=0;h<u;++h)(o=s[h])&&(a=t.call(o,o.__data__,h,s))&&("__data__"in o&&(a.__data__=o.__data__),l[h]=a);return new At(i,this._parents)},selectAll:function(t){t="function"==typeof t?A(t):k(t);for(var n=this._groups,e=n.length,i=[],r=[],o=0;o<e;++o)for(var a,s=n[o],u=s.length,l=0;l<u;++l)(a=s[l])&&(i.push(t.call(a,a.__data__,l,s)),r.push(a));return new At(i,r)},selectChild:function(t){return this.select(null==t?I:function(t){return function(){return D.call(this.children,t)}}("function"==typeof t?t:N(t)))},selectChildren:function(t){return this.selectAll(null==t?P:function(t){return function(){return T.call(this.children,t)}}("function"==typeof t?t:N(t)))},filter:function(t){"function"!=typeof t&&(t=E(t));for(var n=this._groups,e=n.length,i=new Array(e),r=0;r<e;++r)for(var o,a=n[r],s=a.length,u=i[r]=[],l=0;l<s;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&u.push(o);return new At(i,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,W);var e=n?R:z,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=r.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var h=i[l],c=r[l],f=c.length,d=B(t.call(h,h&&h.__data__,l,i)),p=d.length,g=s[l]=new Array(p),y=a[l]=new Array(p);e(h,c,g,y,u[l]=new Array(f),d,n);for(var m,v,_=0,w=0;_<p;++_)if(m=g[_]){for(_>=w&&(w=_+1);!(v=y[w])&&++w<p;);m._next=v||null}}return(a=new At(a,i))._enter=s,a._exit=u,a},enter:function(){return new At(this._enter||this._groups.map(F),this._parents)},exit:function(){return new At(this._exit||this._groups.map(F),this._parents)},join:function(t,n,e){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=n&&(r=n(r))&&(r=r.selection()),null==e?o.remove():e(o),i&&r?i.merge(r).order():r},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,i=n._groups,r=e.length,o=i.length,a=Math.min(r,o),s=new Array(r),u=0;u<a;++u)for(var l,h=e[u],c=i[u],f=h.length,d=s[u]=new Array(f),p=0;p<f;++p)(l=h[p]||c[p])&&(d[p]=l);for(;u<r;++u)s[u]=e[u];return new At(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var i,r=t[n],o=r.length-1,a=r[o];--o>=0;)(i=r[o])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=L);for(var e=this._groups,i=e.length,r=new Array(i),o=0;o<i;++o){for(var a,s=e[o],u=s.length,l=r[o]=new Array(u),h=0;h<u;++h)(a=s[h])&&(l[h]=a);l.sort(n)}return new At(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var i=t[n],r=0,o=i.length;r<o;++r){var a=i[r];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,i=n.length;e<i;++e)for(var r,o=n[e],a=0,s=o.length;a<s;++a)(r=o[a])&&t.call(r,r.__data__,a,o);return this},attr:function(t,n){var e=w(t);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((null==n?e.local?O:H:"function"==typeof n?e.local?Y:G:e.local?j:X)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?U:"function"==typeof n?Z:K)(t,n,null==e?"":e)):Q(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?J:"function"==typeof n?nt:tt)(t,n)):this.node()[t]},classed:function(t,n){var e=et(t+"");if(arguments.length<2){for(var i=it(this.node()),r=-1,o=e.length;++r<o;)if(!i.contains(e[r]))return!1;return!0}return this.each(("function"==typeof n?lt:n?st:ut)(e,n))},text:function(t){return arguments.length?this.each(null==t?ht:("function"==typeof t?ft:ct)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?dt:("function"==typeof t?gt:pt)(t)):this.node().innerHTML},raise:function(){return this.each(yt)},lower:function(){return this.each(mt)},append:function(t){var n="function"==typeof t?t:C(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:C(t),i=null==n?vt:"function"==typeof n?n:$(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(_t)},clone:function(t){return this.select(t?xt:wt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var i,r,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=n?Ct:bt,i=0;i<a;++i)this.each(s(o[i],n,e));return this}var s=this.node().__on;if(s)for(var u,l=0,h=s.length;l<h;++l)for(i=0,u=s[l];i<a;++i)if((r=o[i]).type===u.type&&r.name===u.name)return u.value},dispatch:function(t,n){return this.each(("function"==typeof n?St:$t)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var i,r=t[n],o=0,a=r.length;o<a;++o)(i=r[o])&&(yield i)}};var Pt=.7,Ft=1/Pt,qt="\\s*([+-]?\\d+)\\s*",zt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wt=/^#([0-9a-f]{3,8})$/,Bt=new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`),Lt=new RegExp(`^rgb\\(${Rt},${Rt},${Rt}\\)$`),Ht=new RegExp(`^rgba\\(${qt},${qt},${qt},${zt}\\)$`),Ot=new RegExp(`^rgba\\(${Rt},${Rt},${Rt},${zt}\\)$`),Xt=new RegExp(`^hsl\\(${zt},${Rt},${Rt}\\)$`),jt=new RegExp(`^hsla\\(${zt},${Rt},${Rt},${zt}\\)$`),Gt={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};function Yt(){return this.rgb().formatHex()}function Vt(){return this.rgb().formatRgb()}function Ut(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Wt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Kt(n):3===e?new Jt(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Zt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Zt(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Bt.exec(t))?new Jt(n[1],n[2],n[3],1):(n=Lt.exec(t))?new Jt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Ht.exec(t))?Zt(n[1],n[2],n[3],n[4]):(n=Ot.exec(t))?Zt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Xt.exec(t))?an(n[1],n[2]/100,n[3]/100,1):(n=jt.exec(t))?an(n[1],n[2]/100,n[3]/100,n[4]):Gt.hasOwnProperty(t)?Kt(Gt[t]):"transparent"===t?new Jt(NaN,NaN,NaN,0):null}function Kt(t){return new Jt(t>>16&255,t>>8&255,255&t,1)}function Zt(t,n,e,i){return i<=0&&(t=n=e=NaN),new Jt(t,n,e,i)}function Qt(t,n,e,i){return 1===arguments.length?((r=t)instanceof Tt||(r=Ut(r)),r?new Jt((r=r.rgb()).r,r.g,r.b,r.opacity):new Jt):new Jt(t,n,e,null==i?1:i);var r}function Jt(t,n,e,i){this.r=+t,this.g=+n,this.b=+e,this.opacity=+i}function tn(){return`#${on(this.r)}${on(this.g)}${on(this.b)}`}function nn(){const t=en(this.opacity);return`${1===t?"rgb(":"rgba("}${rn(this.r)}, ${rn(this.g)}, ${rn(this.b)}${1===t?")":`, ${t})`}`}function en(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function rn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function on(t){return((t=rn(t))<16?"0":"")+t.toString(16)}function an(t,n,e,i){return i<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new un(t,n,e,i)}function sn(t){if(t instanceof un)return new un(t.h,t.s,t.l,t.opacity);if(t instanceof Tt||(t=Ut(t)),!t)return new un;if(t instanceof un)return t;var n=(t=t.rgb()).r/255,e=t.g/255,i=t.b/255,r=Math.min(n,e,i),o=Math.max(n,e,i),a=NaN,s=o-r,u=(o+r)/2;return s?(a=n===o?(e-i)/s+6*(e<i):e===o?(i-n)/s+2:(n-e)/s+4,s/=u<.5?o+r:2-o-r,a*=60):s=u>0&&u<1?0:a,new un(a,s,u,t.opacity)}function un(t,n,e,i){this.h=+t,this.s=+n,this.l=+e,this.opacity=+i}function ln(t){return(t=(t||0)%360)<0?t+360:t}function hn(t){return Math.max(0,Math.min(1,t||0))}function cn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Dt(Tt,Ut,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Yt,formatHex:Yt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return sn(this).formatHsl()},formatRgb:Vt,toString:Vt}),Dt(Jt,Qt,It(Tt,{brighter(t){return t=null==t?Ft:Math.pow(Ft,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jt(rn(this.r),rn(this.g),rn(this.b),en(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:tn,formatHex:tn,formatHex8:function(){return`#${on(this.r)}${on(this.g)}${on(this.b)}${on(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:nn,toString:nn})),Dt(un,(function(t,n,e,i){return 1===arguments.length?sn(t):new un(t,n,e,null==i?1:i)}),It(Tt,{brighter(t){return t=null==t?Ft:Math.pow(Ft,t),new un(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Pt:Math.pow(Pt,t),new un(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*n,r=2*e-i;return new Jt(cn(t>=240?t-240:t+120,r,i),cn(t,r,i),cn(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new un(ln(this.h),hn(this.s),hn(this.l),en(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=en(this.opacity);return`${1===t?"hsl(":"hsla("}${ln(this.h)}, ${100*hn(this.s)}%, ${100*hn(this.l)}%${1===t?")":`, ${t})`}`}}));var fn=t=>()=>t;function dn(t){return 1==(t=+t)?pn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(i){return Math.pow(t+i*n,e)}}(n,e,t):fn(isNaN(n)?e:n)}}function pn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):fn(isNaN(t)?n:t)}var gn=function t(n){var e=dn(n);function i(t,n){var i=e((t=Qt(t)).r,(n=Qt(n)).r),r=e(t.g,n.g),o=e(t.b,n.b),a=pn(t.opacity,n.opacity);return function(n){return t.r=i(n),t.g=r(n),t.b=o(n),t.opacity=a(n),t+""}}return i.gamma=t,i}(1);function yn(t,n){n||(n=[]);var e,i=t?Math.min(n.length,t.length):0,r=n.slice();return function(o){for(e=0;e<i;++e)r[e]=t[e]*(1-o)+n[e]*o;return r}}function mn(t,n){var e,i=n?n.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),a=new Array(i);for(e=0;e<r;++e)o[e]=Mn(t[e],n[e]);for(;e<i;++e)a[e]=n[e];return function(t){for(e=0;e<r;++e)a[e]=o[e](t);return a}}function vn(t,n){var e=new Date;return t=+t,n=+n,function(i){return e.setTime(t*(1-i)+n*i),e}}function _n(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function wn(t,n){var e,i={},r={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?i[e]=Mn(t[e],n[e]):r[e]=n[e];return function(t){for(e in i)r[e]=i[e](t);return r}}var xn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bn=new RegExp(xn.source,"g");function Cn(t,n){var e,i,r,o=xn.lastIndex=bn.lastIndex=0,a=-1,s=[],u=[];for(t+="",n+="";(e=xn.exec(t))&&(i=bn.exec(n));)(r=i.index)>o&&(r=n.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(e=e[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:_n(e,i)})),o=bn.lastIndex;return o<n.length&&(r=n.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?u[0]?function(t){return function(n){return t(n)+""}}(u[0].x):function(t){return function(){return t}}(n):(n=u.length,function(t){for(var e,i=0;i<n;++i)s[(e=u[i]).i]=e.x(t);return s.join("")})}function Mn(t,n){var e,i=typeof n;return null==n||"boolean"===i?fn(n):("number"===i?_n:"string"===i?(e=Ut(n))?(n=e,gn):Cn:n instanceof Ut?gn:n instanceof Date?vn:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(n)?yn:Array.isArray(n)?mn:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?wn:_n)(t,n)}function $n(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var Sn,kn=180/Math.PI,An={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function En(t,n,e,i,r,o){var a,s,u;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(u=t*e+n*i)&&(e-=t*u,i-=n*u),(s=Math.sqrt(e*e+i*i))&&(e/=s,i/=s,u/=s),t*i<n*e&&(t=-t,n=-n,u=-u,a=-a),{translateX:r,translateY:o,rotate:Math.atan2(n,t)*kn,skewX:Math.atan(u)*kn,scaleX:a,scaleY:s}}function Nn(t,n,e,i){function r(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,i,r,o,a,s){if(t!==r||i!==o){var u=a.push("translate(",null,n,null,e);s.push({i:u-4,x:_n(t,r)},{i:u-2,x:_n(i,o)})}else(r||o)&&a.push("translate("+r+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(r(e)+"rotate(",null,i)-2,x:_n(t,n)})):n&&e.push(r(e)+"rotate("+n+i)}(o.rotate,a.rotate,s,u),function(t,n,e,o){t!==n?o.push({i:e.push(r(e)+"skewX(",null,i)-2,x:_n(t,n)}):n&&e.push(r(e)+"skewX("+n+i)}(o.skewX,a.skewX,s,u),function(t,n,e,i,o,a){if(t!==e||n!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:_n(t,e)},{i:s-2,x:_n(n,i)})}else 1===e&&1===i||o.push(r(o)+"scale("+e+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var n,e=-1,i=u.length;++e<i;)s[(n=u[e]).i]=n.x(t);return s.join("")}}}var Dn,In,Tn=Nn((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?An:En(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),Pn=Nn((function(t){return null==t?An:(Sn||(Sn=document.createElementNS("http://www.w3.org/2000/svg","g")),Sn.setAttribute("transform",t),(t=Sn.transform.baseVal.consolidate())?En((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):An)}),", ",")",")"),Fn=0,qn=0,zn=0,Rn=0,Wn=0,Bn=0,Ln="object"==typeof performance&&performance.now?performance:Date,Hn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function On(){return Wn||(Hn(Xn),Wn=Ln.now()+Bn)}function Xn(){Wn=0}function jn(){this._call=this._time=this._next=null}function Gn(t,n,e){var i=new jn;return i.restart(t,n,e),i}function Yn(){Wn=(Rn=Ln.now())+Bn,Fn=qn=0;try{!function(){On(),++Fn;for(var t,n=Dn;n;)(t=Wn-n._time)>=0&&n._call.call(void 0,t),n=n._next;--Fn}()}finally{Fn=0,function(){var t,n,e=Dn,i=1/0;for(;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Dn=n);In=t,Un(i)}(),Wn=0}}function Vn(){var t=Ln.now(),n=t-Rn;n>1e3&&(Bn-=n,Rn=t)}function Un(t){Fn||(qn&&(qn=clearTimeout(qn)),t-Wn>24?(t<1/0&&(qn=setTimeout(Yn,t-Ln.now()-Bn)),zn&&(zn=clearInterval(zn))):(zn||(Rn=Ln.now(),zn=setInterval(Vn,1e3)),Fn=1,Hn(Yn)))}function Kn(t,n,e){var i=new jn;return n=null==n?0:+n,i.restart((e=>{i.stop(),t(e+n)}),n,e),i}jn.prototype=Gn.prototype={constructor:jn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?On():+e)+(null==n?0:+n),this._next||In===this||(In?In._next=this:Dn=this,In=this),this._call=t,this._time=e,Un()},stop:function(){this._call&&(this._call=null,this._time=1/0,Un())}};var Zn=p("start","end","cancel","interrupt"),Qn=[];function Jn(t,n,e,i,r,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var i,r=t.__transition;function o(t){e.state=1,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var l,h,c,f;if(1!==e.state)return u();for(l in r)if((f=r[l]).name===e.name){if(3===f.state)return Kn(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[l])}if(Kn((function(){3===e.state&&(e.state=4,e.timer.restart(s,e.delay,e.time),s(o))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,i=new Array(c=e.tween.length),l=0,h=-1;l<c;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(i[++h]=f);i.length=h+1}}function s(n){for(var r=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=5,1),o=-1,a=i.length;++o<a;)i[o].call(t,r);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){for(var i in e.state=6,e.timer.stop(),delete r[n],r)return;delete t.__transition}r[n]=e,e.timer=Gn(o,0,e.time)}(t,e,{name:n,index:i,group:r,on:Zn,tween:Qn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function te(t,n){var e=ee(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function ne(t,n){var e=ee(t,n);if(e.state>3)throw new Error("too late; already running");return e}function ee(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function ie(t,n){var e,i;return function(){var r=ne(this,t),o=r.tween;if(o!==e)for(var a=0,s=(i=e=o).length;a<s;++a)if(i[a].name===n){(i=i.slice()).splice(a,1);break}r.tween=i}}function re(t,n,e){var i,r;if("function"!=typeof e)throw new Error;return function(){var o=ne(this,t),a=o.tween;if(a!==i){r=(i=a).slice();for(var s={name:n,value:e},u=0,l=r.length;u<l;++u)if(r[u].name===n){r[u]=s;break}u===l&&r.push(s)}o.tween=r}}function oe(t,n,e){var i=t._id;return t.each((function(){var t=ne(this,i);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return ee(t,i).value[n]}}function ae(t,n){var e;return("number"==typeof n?_n:n instanceof Ut?gn:(e=Ut(n))?(n=e,gn):Cn)(t,n)}function se(t){return function(){this.removeAttribute(t)}}function ue(t){return function(){this.removeAttributeNS(t.space,t.local)}}function le(t,n,e){var i,r,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===i?r:r=n(i=a,e)}}function he(t,n,e){var i,r,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===i?r:r=n(i=a,e)}}function ce(t,n,e){var i,r,o;return function(){var a,s,u=e(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===i&&s===r?o:(r=s,o=n(i=a,u));this.removeAttribute(t)}}function fe(t,n,e){var i,r,o;return function(){var a,s,u=e(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===i&&s===r?o:(r=s,o=n(i=a,u));this.removeAttributeNS(t.space,t.local)}}function de(t,n){var e,i;function r(){var r=n.apply(this,arguments);return r!==i&&(e=(i=r)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,r)),e}return r._value=n,r}function pe(t,n){var e,i;function r(){var r=n.apply(this,arguments);return r!==i&&(e=(i=r)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,r)),e}return r._value=n,r}function ge(t,n){return function(){te(this,t).delay=+n.apply(this,arguments)}}function ye(t,n){return n=+n,function(){te(this,t).delay=n}}function me(t,n){return function(){ne(this,t).duration=+n.apply(this,arguments)}}function ve(t,n){return n=+n,function(){ne(this,t).duration=n}}var _e=Et.prototype.constructor;function we(t){return function(){this.style.removeProperty(t)}}var xe=0;function be(t,n,e,i){this._groups=t,this._parents=n,this._name=e,this._id=i}function Ce(){return++xe}var Me=Et.prototype;be.prototype={constructor:be,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=$(t));for(var i=this._groups,r=i.length,o=new Array(r),a=0;a<r;++a)for(var s,u,l=i[a],h=l.length,c=o[a]=new Array(h),f=0;f<h;++f)(s=l[f])&&(u=t.call(s,s.__data__,f,l))&&("__data__"in s&&(u.__data__=s.__data__),c[f]=u,Jn(c[f],n,e,f,c,ee(s,e)));return new be(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=k(t));for(var i=this._groups,r=i.length,o=[],a=[],s=0;s<r;++s)for(var u,l=i[s],h=l.length,c=0;c<h;++c)if(u=l[c]){for(var f,d=t.call(u,u.__data__,c,l),p=ee(u,e),g=0,y=d.length;g<y;++g)(f=d[g])&&Jn(f,n,e,g,d,p);o.push(d),a.push(u)}return new be(o,a,n,e)},selectChild:Me.selectChild,selectChildren:Me.selectChildren,filter:function(t){"function"!=typeof t&&(t=E(t));for(var n=this._groups,e=n.length,i=new Array(e),r=0;r<e;++r)for(var o,a=n[r],s=a.length,u=i[r]=[],l=0;l<s;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&u.push(o);return new be(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,i=n.length,r=e.length,o=Math.min(i,r),a=new Array(i),s=0;s<o;++s)for(var u,l=n[s],h=e[s],c=l.length,f=a[s]=new Array(c),d=0;d<c;++d)(u=l[d]||h[d])&&(f[d]=u);for(;s<i;++s)a[s]=n[s];return new be(a,this._parents,this._name,this._id)},selection:function(){return new _e(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Ce(),i=this._groups,r=i.length,o=0;o<r;++o)for(var a,s=i[o],u=s.length,l=0;l<u;++l)if(a=s[l]){var h=ee(a,n);Jn(a,t,e,l,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new be(i,this._parents,t,e)},call:Me.call,nodes:Me.nodes,node:Me.node,size:Me.size,empty:Me.empty,each:Me.each,on:function(t,n){var e=this._id;return arguments.length<2?ee(this.node(),e).on.on(t):this.each(function(t,n,e){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?te:ne;return function(){var a=o(this,t),s=a.on;s!==i&&(r=(i=s).copy()).on(n,e),a.on=r}}(e,t,n))},attr:function(t,n){var e=w(t),i="transform"===e?Pn:ae;return this.attrTween(t,"function"==typeof n?(e.local?fe:ce)(e,i,oe(this,"attr."+t,n)):null==n?(e.local?ue:se)(e):(e.local?he:le)(e,i,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var i=w(t);return this.tween(e,(i.local?de:pe)(i,n))},style:function(t,n,e){var i="transform"==(t+="")?Tn:ae;return null==n?this.styleTween(t,function(t,n){var e,i,r;return function(){var o=Q(this,t),a=(this.style.removeProperty(t),Q(this,t));return o===a?null:o===e&&a===i?r:r=n(e=o,i=a)}}(t,i)).on("end.style."+t,we(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var i,r,o;return function(){var a=Q(this,t),s=e(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Q(this,t)),a===u?null:a===i&&u===r?o:(r=u,o=n(i=a,s))}}(t,i,oe(this,"style."+t,n))).each(function(t,n){var e,i,r,o,a="style."+n,s="end."+a;return function(){var u=ne(this,t),l=u.on,h=null==u.value[a]?o||(o=we(n)):void 0;l===e&&r===h||(i=(e=l).copy()).on(s,r=h),u.on=i}}(this._id,t)):this.styleTween(t,function(t,n,e){var i,r,o=e+"";return function(){var a=Q(this,t);return a===o?null:a===i?r:r=n(i=a,e)}}(t,i,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==n)return this.tween(i,null);if("function"!=typeof n)throw new Error;return this.tween(i,function(t,n,e){var i,r;function o(){var o=n.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,n,e){return function(i){this.style.setProperty(t,n.call(this,i),e)}}(t,o,e)),i}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(oe(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function i(){var i=t.apply(this,arguments);return i!==e&&(n=(e=i)&&function(t){return function(n){this.textContent=t.call(this,n)}}(i)),n}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var i,r=ee(this.node(),e).tween,o=0,a=r.length;o<a;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==n?ie:re)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ge:ye)(n,t)):ee(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?me:ve)(n,t)):ee(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){ne(this,t).ease=n}}(n,t)):ee(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;ne(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,i=e._id,r=e.size();return new Promise((function(o,a){var s={value:a},u={value:function(){0==--r&&o()}};e.each((function(){var e=ne(this,i),r=e.on;r!==t&&((n=(t=r).copy())._.cancel.push(s),n._.interrupt.push(s),n._.end.push(u)),e.on=n})),0===r&&o()}))},[Symbol.iterator]:Me[Symbol.iterator]};var $e={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Se(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}Et.prototype.interrupt=function(t){return this.each((function(){!function(t,n){var e,i,r,o=t.__transition,a=!0;if(o){for(r in n=null==n?null:n+"",o)(e=o[r]).name===n?(i=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(i?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[r]):a=!1;a&&delete t.__transition}}(this,t)}))},Et.prototype.transition=function(t){var n,e;t instanceof be?(n=t._id,t=t._name):(n=Ce(),(e=$e).time=On(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var a,s=i[o],u=s.length,l=0;l<u;++l)(a=s[l])&&Jn(a,t,n,l,s,e||Se(a,n));return new be(i,this._parents,t,n)};const ke=Math.PI,Ae=2*ke,Ee=1e-6,Ne=Ae-Ee;function De(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}class Ie{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?De:function(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return De;const e=10**n;return function(t){this._+=t[0];for(let n=1,i=t.length;n<i;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,e,i){this._append`Q${+t},${+n},${this._x1=+e},${this._y1=+i}`}bezierCurveTo(t,n,e,i,r,o){this._append`C${+t},${+n},${+e},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(t,n,e,i,r){if(t=+t,n=+n,e=+e,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,a=this._y1,s=e-t,u=i-n,l=o-t,h=a-n,c=l*l+h*h;if(null===this._x1)this._append`M${this._x1=t},${this._y1=n}`;else if(c>Ee)if(Math.abs(h*s-u*l)>Ee&&r){let f=e-o,d=i-a,p=s*s+u*u,g=f*f+d*d,y=Math.sqrt(p),m=Math.sqrt(c),v=r*Math.tan((ke-Math.acos((p+c-g)/(2*y*m)))/2),_=v/m,w=v/y;Math.abs(_-1)>Ee&&this._append`L${t+_*l},${n+_*h}`,this._append`A${r},${r},0,0,${+(h*f>l*d)},${this._x1=t+w*s},${this._y1=n+w*u}`}else this._append`L${this._x1=t},${this._y1=n}`;else;}arc(t,n,e,i,r,o){if(t=+t,n=+n,o=!!o,(e=+e)<0)throw new Error(`negative radius: ${e}`);let a=e*Math.cos(i),s=e*Math.sin(i),u=t+a,l=n+s,h=1^o,c=o?i-r:r-i;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>Ee||Math.abs(this._y1-l)>Ee)&&this._append`L${u},${l}`,e&&(c<0&&(c=c%Ae+Ae),c>Ne?this._append`A${e},${e},0,1,${h},${t-a},${n-s}A${e},${e},0,1,${h},${this._x1=u},${this._y1=l}`:c>Ee&&this._append`A${e},${e},0,${+(c>=ke)},${h},${this._x1=t+e*Math.cos(r)},${this._y1=n+e*Math.sin(r)}`)}rect(t,n,e,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${e=+e}v${+i}h${-e}Z`}toString(){return this._}}function Te(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,i=t.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+t.slice(e+1)]}function Pe(t){return(t=Te(Math.abs(t)))?t[1]:NaN}var Fe,qe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ze(t){if(!(n=qe.exec(t)))throw new Error("invalid format: "+t);var n;return new Re({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]})}function Re(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function We(t,n){var e=Te(t,n);if(!e)return t+"";var i=e[0],r=e[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}ze.prototype=Re.prototype,Re.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Be={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},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)=>We(100*t,n),r:We,s:function(t,n){var e=Te(t,n);if(!e)return t+"";var i=e[0],r=e[1],o=r-(Fe=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Te(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Le(t){return t}var He,Oe,Xe,je=Array.prototype.map,Ge=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ye(t){var n,e,i=void 0===t.grouping||void 0===t.thousands?Le:(n=je.call(t.grouping,Number),e=t.thousands+"",function(t,i){for(var r=t.length,o=[],a=0,s=n[0],u=0;r>0&&s>0&&(u+s+1>i&&(s=Math.max(1,i-u)),o.push(t.substring(r-=s,r+s)),!((u+=s+1)>i));)s=n[a=(a+1)%n.length];return o.reverse().join(e)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Le:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(je.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function c(t){var n=(t=ze(t)).fill,e=t.align,c=t.sign,f=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,m=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Be[v]||(void 0===y&&(y=12),m=!0,v="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var _="$"===f?r:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",w="$"===f?o:/[%p]/.test(v)?u:"",x=Be[v],b=/[defgprs%]/.test(v);function C(t){var r,o,u,f=_,C=w;if("c"===v)C=x(t)+C,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),y),m&&(t=function(t){t:for(var n,e=t.length,i=1,r=-1;i<e;++i)switch(t[i]){case".":r=n=i;break;case"0":0===r&&(r=i),n=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(n+1):t}(t)),M&&0==+t&&"+"!==c&&(M=!1),f=(M?"("===c?c:l:"-"===c||"("===c?"":c)+f,C=("s"===v?Ge[8+Fe/3]:"")+C+(M&&"("===c?")":""),b)for(r=-1,o=t.length;++r<o;)if(48>(u=t.charCodeAt(r))||u>57){C=(46===u?a+t.slice(r+1):t.slice(r))+C,t=t.slice(0,r);break}}g&&!d&&(t=i(t,1/0));var $=f.length+t.length+C.length,S=$<p?new Array(p-$+1).join(n):"";switch(g&&d&&(t=i(S+t,S.length?p-C.length:1/0),S=""),e){case"<":t=f+t+C+S;break;case"=":t=f+S+t+C;break;case"^":t=S.slice(0,$=S.length>>1)+f+t+C+S.slice($);break;default:t=S+f+t+C}return s(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),C.toString=function(){return t+""},C}return{format:c,formatPrefix:function(t,n){var e=c(((t=ze(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Pe(n)/3))),r=Math.pow(10,-i),o=Ge[8+i/3];return function(t){return e(r*t)+o}}}}function Ve(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function Ue(t){return+t}He=Ye({thousands:",",grouping:[3],currency:["$",""]}),Oe=He.format,Xe=He.formatPrefix;var Ke=[0,1];function Ze(t){return t}function Qe(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:function(t){return function(){return t}}(isNaN(n)?NaN:.5)}function Je(t,n,e){var i=t[0],r=t[1],o=n[0],a=n[1];return r<i?(i=Qe(r,i),o=e(a,o)):(i=Qe(i,r),o=e(o,a)),function(t){return o(i(t))}}function ti(t,n,e){var i=Math.min(t.length,n.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<i;)r[a]=Qe(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(n){var e=s(t,n,1,i)-1;return o[e](r[e](n))}}function ni(){var t,n,e,i,r,o,a=Ke,s=Ke,u=Mn,l=Ze;function h(){var t,n,e,u=Math.min(a.length,s.length);return l!==Ze&&(t=a[0],n=a[u-1],t>n&&(e=t,t=n,n=e),l=function(e){return Math.max(t,Math.min(n,e))}),i=u>2?ti:Je,r=o=null,c}function c(n){return null==n||isNaN(n=+n)?e:(r||(r=i(a.map(t),s,u)))(t(l(n)))}return c.invert=function(e){return l(n((o||(o=i(s,a.map(t),_n)))(e)))},c.domain=function(t){return arguments.length?(a=Array.from(t,Ue),h()):a.slice()},c.range=function(t){return arguments.length?(s=Array.from(t),h()):s.slice()},c.rangeRound=function(t){return s=Array.from(t),u=$n,h()},c.clamp=function(t){return arguments.length?(l=!!t||Ze,h()):l!==Ze},c.interpolate=function(t){return arguments.length?(u=t,h()):u},c.unknown=function(t){return arguments.length?(e=t,c):e},function(e,i){return t=e,n=i,h()}}function ei(t,n,e,i){var r,o=function(t,n,e){e=+e;const i=(n=+n)<(t=+t),r=i?f(n,t,e):f(t,n,e);return(i?-1:1)*(r<0?1/-r:r)}(t,n,e);switch((i=ze(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null!=i.precision||isNaN(r=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Pe(n)/3)))-Pe(Math.abs(t)))}(o,a))||(i.precision=r),Xe(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Pe(n)-Pe(t))+1}(o,Math.max(Math.abs(t),Math.abs(n))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Pe(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return Oe(i)}function ii(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){if(!((e=+e)>0))return[];if((t=+t)==(n=+n))return[t];const i=n<t,[r,o,a]=i?c(n,t,e):c(t,n,e);if(!(o>=r))return[];const s=o-r+1,u=new Array(s);if(i)if(a<0)for(let t=0;t<s;++t)u[t]=(o-t)/-a;else for(let t=0;t<s;++t)u[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)u[t]=(r+t)/-a;else for(let t=0;t<s;++t)u[t]=(r+t)*a;return u}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var i=n();return ei(i[0],i[i.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var i,r,o=n(),a=0,s=o.length-1,u=o[a],l=o[s],h=10;for(l<u&&(r=u,u=l,l=r,r=a,a=s,s=r);h-- >0;){if((r=f(u,l,e))===i)return o[a]=u,o[s]=l,n(o);if(r>0)u=Math.floor(u/r)*r,l=Math.ceil(l/r)*r;else{if(!(r<0))break;u=Math.ceil(u*r)/r,l=Math.floor(l*r)/r}i=r}return t},t}function ri(){var t=ni()(Ze,Ze);return t.copy=function(){return n=t,ri().domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());var n},Ve.apply(t,arguments),ii(t)}function oi(t){return function(){return t}}function ai(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(null==e)n=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);n=t}return t},()=>new Ie(n)}function si(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ui(t){this._context=t}function li(t){return new ui(t)}function hi(t){return t[0]}function ci(t){return t[1]}function fi(t,n,e){var i=null,r=oi(!0),o=null,a=li,s=null,u=ai(l);function l(l){var h,c,f,d,p,g=(l=si(l)).length,y=!1,m=new Array(g),v=new Array(g);for(null==o&&(s=a(p=u())),h=0;h<=g;++h){if(!(h<g&&r(d=l[h],h,l))===y)if(y=!y)c=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=h-1;f>=c;--f)s.point(m[f],v[f]);s.lineEnd(),s.areaEnd()}y&&(m[h]=+t(d,h,l),v[h]=+n(d,h,l),s.point(i?+i(d,h,l):m[h],e?+e(d,h,l):v[h]))}if(p)return s=null,p+""||null}function h(){return function(t,n){var e=oi(!0),i=null,r=li,o=null,a=ai(s);function s(s){var u,l,h,c=(s=si(s)).length,f=!1;for(null==i&&(o=r(h=a())),u=0;u<=c;++u)!(u<c&&e(l=s[u],u,s))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+t(l,u,s),+n(l,u,s));if(h)return o=null,h+""||null}return t="function"==typeof t?t:void 0===t?hi:oi(t),n="function"==typeof n?n:void 0===n?ci:oi(n),s.x=function(n){return arguments.length?(t="function"==typeof n?n:oi(+n),s):t},s.y=function(t){return arguments.length?(n="function"==typeof t?t:oi(+t),s):n},s.defined=function(t){return arguments.length?(e="function"==typeof t?t:oi(!!t),s):e},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s}().defined(r).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?hi:oi(+t),n="function"==typeof n?n:oi(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?ci:oi(+e),l.x=function(n){return arguments.length?(t="function"==typeof n?n:oi(+n),i=null,l):t},l.x0=function(n){return arguments.length?(t="function"==typeof n?n:oi(+n),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:oi(+t),l):i},l.y=function(t){return arguments.length?(n="function"==typeof t?t:oi(+t),e=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:oi(+t),l):n},l.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:oi(+t),l):e},l.lineX0=l.lineY0=function(){return h().x(t).y(n)},l.lineY1=function(){return h().x(t).y(e)},l.lineX1=function(){return h().x(i).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:oi(!!t),l):r},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}function di(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 pi(t,n){this._context=t,this._k=(1-n)/6}ui.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&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)}}},pi.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:di(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&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:di(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var gi=function t(n){function e(t){return new pi(t,n)}return e.tension=function(n){return t(+n)},e}(0);function yi(t,n){if((r=t.length)>1)for(var e,i,r,o=1,a=t[n[0]],s=a.length;o<r;++o)for(i=a,a=t[n[o]],e=0;e<s;++e)a[e][1]+=a[e][0]=isNaN(i[e][1])?i[e][0]:i[e][1]}function mi(t){for(var n=t.length,e=new Array(n);--n>=0;)e[n]=n;return e}function vi(t,n){return t[n]}function _i(t){const n=[];return n.key=t,n}function wi(t,n,e){this.k=t,this.x=n,this.y=e}wi.prototype={constructor:wi,scale:function(t){return 1===t?this:new wi(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new wi(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+")"}},wi.prototype;const xi="stacked-area-chart",bi="area-path",Ci="tooltip",Mi={fuel:{fractional:"fuel-fractional",perCapita:"fuel-perCapita",total:"fuel-total"},sector:{fractional:"sectoral-fractional",perCapita:"sectoral-perCapita",total:"sectoral-total"}};class $i{static extractDatasetFromMulti(t,n,e){const i=Mi[n][e],r=t[i];if(!r||!Array.isArray(r))throw new Error(`Dataset '${i}' not found or invalid in multi-dataset format`);return r}static transformKendoToD3(t){if(!t||0===t.length)throw new Error("Raw data is empty or invalid");const n=t[0];if(!n||!n.year||!Array.isArray(n.year))throw new Error("First object must contain years array");const e=n.year,i=t.slice(1),r=i.map((t=>t.name));i.forEach((t=>{if(!t.data||t.data.length!==e.length)throw new Error(`Data length mismatch for source: ${t.name}`)}));return{data:e.map(((t,n)=>{const e={year:t};return i.forEach((t=>{e[t.name]=t.data[n]||0})),e})),energySources:r,years:e}}static createStackedData(t,n){const e=function(){var t=oi([]),n=mi,e=yi,i=vi;function r(r){var o,a,s=Array.from(t.apply(this,arguments),_i),u=s.length,l=-1;for(const t of r)for(o=0,++l;o<u;++o)(s[o][l]=[0,+i(t,s[o].key,l,r)]).data=t;for(o=0,a=si(n(s));o<u;++o)s[a[o]].index=o;return e(s,a),s}return r.keys=function(n){return arguments.length?(t="function"==typeof n?n:oi(Array.from(n)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:oi(+t),r):i},r.order=function(t){return arguments.length?(n=null==t?mi:"function"==typeof t?t:oi(Array.from(t)),r):n},r.offset=function(t){return arguments.length?(e=null==t?yi:t,r):e},r}().keys(n).order(mi).offset(yi);return e(t)}static calculateDomains(t,n){const e=function(t,n){let e,i;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=i=n):(e>n&&(e=n),i<n&&(i=n)));else{let r=-1;for(let o of t)null!=(o=n(o,++r,t))&&(void 0===e?o>=o&&(e=i=o):(e>o&&(e=o),i<o&&(i=o)))}return[e,i]}(t,(t=>t.year)),i=function(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e<r||void 0===e&&r>=r)&&(e=r)}return e}(t,(t=>n.reduce(((n,e)=>n+(t[e]||0)),0)))||0;return{xDomain:e,yDomain:[0,i]}}static calculateBounds(t,n,e){return{width:t,height:n,innerWidth:Math.max(0,t-e.left-e.right),innerHeight:Math.max(0,n-e.top-e.bottom)}}static getDataAtPoint(t,n,e){const i=t.find((t=>t.year===n));return(null==i?void 0:i[e])||0}static findClosestDataPoint(t,n){return 0===t.length?null:t.reduce(((t,e)=>Math.abs(e.year-n)<Math.abs(t.year-n)?e:t))}static extractColors(t){const n={};return t.slice(1).forEach((t=>{t.name&&t.color&&(n[t.name]=t.color)})),n}static validateProcessedData(t,n){return!(!t||0===t.length)&&(!(!n||0===n.length)&&t.every((t=>n.every((n=>"number"==typeof t[n]&&!isNaN(t[n]))))))}}function Si(t,n,e,i=!1){const r=function(t,n=1,e=!1){const i=[{value:1,symbol:" W"},{value:1e3,symbol:" kW"},{value:1e6,symbol:" MW"},{value:1e9,symbol:" GW"},{value:1e12,symbol:" TW"},{value:1e15,symbol:" PW"},{value:1e18,symbol:" EW"}],r=/\.0+$|(\.[0-9]*[1-9])0+$/;let o;for(o=i.length-1;o>0;o--){const n=i[o];if(n&&t>=n.value)break}const a=i[o];return a?e?(t/a.value).toFixed(n):(t/a.value).toFixed(n).replace(r,"$1")+a.symbol:t.toString()}(e,1,i);return`${t} - ${n}<br/>${r}`}function ki(t){return"fractional"===t}class Ai{constructor(t,n,e){this.config=e,this.representation="perCapita",this.chartContainer=n;const i="string"==typeof t?document.querySelector(t):t;if(i){"static"===window.getComputedStyle(i).position&&(i.style.position="relative")}const r=Nt(t);this.element=r.append("div").attr("class",Ci),this.element.style("position","absolute").style("visibility","hidden").style("background-color",e.background).style("color",e.color).style("border",`${e.borderWidth}px solid ${e.borderColor}`).style("border-radius","3px").style("padding","8px").style("font-size","12px").style("font-family","Arial, sans-serif").style("pointer-events","none").style("z-index","9999").style("box-shadow","0 2px 4px rgba(0,0,0,0.1)")}show(t,n){const{year:e,energySource:i,value:r}=t,o=Si(e,i,r,ki(this.representation));this.element.html(o).style("visibility","visible"),this.updatePosition(n)}showAtPosition(t,n,e){const{year:i,energySource:r,value:o}=t,a=Si(i,r,o,ki(this.representation));this.element.html(a).style("visibility","visible");const s=this.convertToContainerCoordinates(n,e);this.updatePositionFromCoords(s.x,s.y)}showCenteredWithCircle(t,n,e){const{year:i,energySource:r,value:o}=t,a=Si(i,r,o,ki(this.representation));this.element.html(a).style("visibility","visible"),this.updatePositionWithCenterAlignedToCircle(n,e)}showCenteredWithChartCoordinates(t,n,e){const{year:i,energySource:r,value:o}=t,a=Si(i,r,o,ki(this.representation));this.element.html(a).style("visibility","visible"),this.updatePositionUsingActualCirclePosition()}updatePositionUsingActualCirclePosition(){const t=this.element.node();if(!t)return;const n=this.chartContainer.querySelector("svg"),e=null==n?void 0:n.querySelector("circle.hover-circle");if(!e)return;const i=e.getBoundingClientRect(),r=this.chartContainer.getBoundingClientRect(),o=t.getBoundingClientRect(),a=i.left+i.width/2,s=i.top+i.height/2,u=a-r.left;let l=u+15,h=s-r.top-o.height/2;const c=this.getContainerBounds();l+o.width>c.width&&(l=u-o.width-15),h<0?h=10:h+o.height>c.height&&(h=c.height-o.height-10),l=Math.max(0,Math.min(l,c.width-o.width)),h=Math.max(0,Math.min(h,c.height-o.height)),this.element.style("left",`${l}px`).style("top",`${h}px`)}showAtCirclePosition(t,n,e){const{year:i,energySource:r,value:o}=t,a=Si(i,r,o,ki(this.representation));this.element.html(a).style("visibility","visible");const s=this.convertToContainerCoordinates(n,e);this.updatePositionCenteredWithCircle(s.x,s.y)}hide(){this.element.style("visibility","hidden")}updatePosition(t){const n=this.convertToContainerCoordinates(t.pageX,t.pageY);this.updatePositionFromCoords(n.x,n.y)}convertToContainerCoordinates(t,n){const e=this.chartContainer.getBoundingClientRect(),i=t-window.pageXOffset,r=n-window.pageYOffset;let o=i-e.left,a=r-e.top;const s=window.getComputedStyle(this.chartContainer).transform;if(s&&"none"!==s){const t=this.parseTransformMatrix(s);if(t){const n=this.applyInverseTransform(o,a,t);o=n.x,a=n.y}}return{x:o,y:a}}parseTransformMatrix(t){if(t.startsWith("matrix(")){const n=t.slice(7,-1).split(",").map((t=>parseFloat(t.trim())));if(6===n.length)return{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}}else if(t.startsWith("matrix3d(")){const n=t.slice(9,-1).split(",").map((t=>parseFloat(t.trim())));if(16===n.length)return{a:n[0],b:n[1],c:n[4],d:n[5],e:n[12],f:n[13]}}return null}applyInverseTransform(t,n,e){const i=e.a*e.d-e.b*e.c;if(Math.abs(i)<1e-10)return{x:t,y:n};const r=e.d/i,o=-e.b/i,a=-e.c/i,s=e.a/i;return{x:r*t+a*n+(e.c*e.f-e.d*e.e)/i,y:o*t+s*n+(e.b*e.e-e.a*e.f)/i}}updatePositionFromCoords(t,n){const e=this.element.node();if(!e)return;const i=e.getBoundingClientRect();let r=t+this.config.offset.x,o=n+this.config.offset.y;const a=this.getContainerBounds();r+i.width>a.width&&(r=t-i.width-Math.abs(this.config.offset.x)),o+i.height>a.height&&(o=n-i.height-Math.abs(this.config.offset.y)),r=Math.max(0,Math.min(r,a.width-i.width)),o=Math.max(0,Math.min(o,a.height-i.height)),this.element.style("left",`${r}px`).style("top",`${o}px`)}getContainerBounds(){const t=this.chartContainer.getBoundingClientRect(),n=window.getComputedStyle(this.chartContainer),e=parseFloat(n.paddingLeft)||0,i=parseFloat(n.paddingRight)||0,r=parseFloat(n.paddingTop)||0,o=parseFloat(n.paddingBottom)||0;return{width:t.width-e-i,height:t.height-r-o}}updatePositionWithCenterAlignedToCircle(t,n){const e=this.convertToContainerCoordinates(t,n);this.updatePositionCenteredWithCircle(e.x,e.y)}updatePositionCenteredWithCircle(t,n){const e=this.element.node();if(!e)return;const i=e.getBoundingClientRect(),r=this.chartContainer.querySelector("svg"),o=null==r?void 0:r.querySelector("g[transform]");let a=0,s=0;if(o){const t=o.getAttribute("transform");if(t){const n=t.match(/translate\(([^,]+),\s*([^)]+)\)/);n&&n[1]&&n[2]&&(a=parseFloat(n[1])||0,s=parseFloat(n[2])||0)}}const u=t+a;let l=u+15,h=n+s-i.height/2;const c=this.getContainerBounds();l+i.width>c.width&&(l=u-i.width-15),h<0?h=10:h+i.height>c.height&&(h=c.height-i.height-10),l=Math.max(0,Math.min(l,c.width-i.width)),h=Math.max(0,Math.min(h,c.height-i.height)),this.element.style("left",`${l}px`).style("top",`${h}px`)}setRepresentation(t){this.representation=t}updateConfig(t){this.config={...this.config,...t},this.element.style("background-color",this.config.background).style("color",this.config.color).style("border",`${this.config.borderWidth}px solid ${this.config.borderColor}`)}isVisible(){return"visible"===this.element.style("visibility")}destroy(){this.element.remove()}getElement(){return this.element.node()}}const Ei={Solar:"#fed530",Nuclear:"#ca0813",Water:"#0b24fb",Wind:"#901d8f",Geothermal:"#905a1c","Natural Gas":"#4cabf2",Coal:"#000000",Biomass:"#46be48",Petroleum:"#095f0b"};class Ni{constructor(t,n){this.tooltip=null,this.currentData=[],this.currentEnergySources=[],this.currentColors={},this.hoverIndicator=null,this.hoverCircle=null,this.config=n,this.bounds=$i.calculateBounds(n.dimensions.width,n.dimensions.height,n.dimensions.margin),this.chartContainer="string"==typeof t?document.getElementById(t)||document.body:t,this.initializeSVG(t),this.initializeScales(),this.initializeAreaGenerator(),n.interactive&&this.initializeTooltip(t)}initializeSVG(t){const n=Nt(t);n.selectAll("*").remove(),this.svg=n.append("svg").attr("class",xi),this.svg.attr("width",this.config.dimensions.width).attr("height",this.config.dimensions.height).style("display","block"),this.chartGroup=this.svg.append("g").attr("transform",`translate(${this.config.dimensions.margin.left}, ${this.config.dimensions.margin.top})`)}initializeScales(){this.xScale=ri().range([0,this.bounds.innerWidth]),this.yScale=ri().range([this.bounds.innerHeight,0])}initializeAreaGenerator(){this.area=fi().x((t=>this.xScale(t.data.year))).y0((t=>this.yScale(t[0]))).y1((t=>this.yScale(t[1]))).curve(gi.tension(.1))}initializeTooltip(t){if(!this.config.interactive)return;const n="string"==typeof t?document.querySelector(t):t;n&&(this.tooltip=new Ai(n,this.chartContainer,this.config.tooltip),this.tooltip.setRepresentation(this.config.representation))}initializeHoverIndicator(){this.config.interactive&&(this.hoverIndicator&&this.hoverIndicator.remove(),this.hoverIndicator=this.chartGroup.append("g").attr("class","hover-indicator").style("opacity",0).style("pointer-events","none"),this.hoverCircle=this.hoverIndicator.append("circle").attr("class","hover-circle").attr("r",4).attr("fill","white").attr("stroke","white").attr("stroke-width",2).style("filter","drop-shadow(0px 1px 2px rgba(0,0,0,0.5))"))}render(t,n,e){if(this.currentData=t,this.currentEnergySources=n,e&&(this.currentColors=e),0===t.length||0===n.length)return void this.clearChart();this.updateScales(t,n);const i=$i.createStackedData(t,n);this.renderAreas(i),this.initializeHoverIndicator()}update(t,n,e){if(this.currentData=t,this.currentEnergySources=n,e&&(this.currentColors=e),0===t.length||0===n.length)return void this.clearChart();this.updateScales(t,n);const i=$i.createStackedData(t,n);this.updateAreas(i),this.hoverIndicator&&this.hoverIndicator.raise()}updateScales(t,n){const e=$i.calculateDomains(t,n);this.xScale.domain(e.xDomain),this.yScale.domain(e.yDomain),this.area.x((t=>this.xScale(t.data.year))).y0((t=>this.yScale(t[0]))).y1((t=>this.yScale(t[1])))}renderAreas(t){const n=this.chartGroup.selectAll("."+bi).data(t,(t=>t.key)),e=n.enter().append("path").attr("class",bi).attr("fill",(t=>this.getColorForSource(t.key))).attr("opacity",1).attr("d",this.area).style("cursor",this.config.interactive?"pointer":"default");n.attr("fill",(t=>this.getColorForSource(t.key))).transition().duration(this.config.animations.enabled?this.config.animations.duration:0).attr("d",this.area),n.exit().transition().duration(this.config.animations.enabled?this.config.animations.duration:0).attr("opacity",0).remove(),this.config.interactive&&(this.addInteractions(e),this.addInteractions(n))}updateAreas(t){const n=this.chartGroup.selectAll("."+bi).data(t,(t=>t.key)),e=n.enter().append("path").attr("class",bi).attr("fill",(t=>this.getColorForSource(t.key))).attr("opacity",0).attr("d",this.area).style("cursor",this.config.interactive?"pointer":"default");e.transition().duration(this.config.animations.enabled?this.config.animations.duration:0).attr("opacity",1),n.attr("fill",(t=>this.getColorForSource(t.key))).transition().duration(this.config.animations.enabled?this.config.animations.duration:0).attr("d",this.area),n.exit().transition().duration(this.config.animations.enabled?this.config.animations.duration:0).attr("opacity",0).remove(),this.config.interactive&&(this.addInteractions(e),this.addInteractions(n))}addInteractions(t){this.tooltip&&this.config.interactive&&(t.on("mouseover",null).on("mousemove",null).on("mouseout",null),t.on("mouseover",(t=>{Nt(t.target).transition().duration(100).attr("opacity",1.1),this.showHoverIndicator()})).on("mousemove",((t,n)=>{if(!this.tooltip)return;const[e]=function(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var i=e.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(n.getScreenCTM().inverse())).x,i.y]}if(n.getBoundingClientRect){var r=n.getBoundingClientRect();return[t.clientX-r.left-n.clientLeft,t.clientY-r.top-n.clientTop]}}return[t.pageX,t.pageY]}(t,this.chartGroup.node()),i=Math.round(this.xScale.invert(e)),r=this.getColorForSource(n.key),o=this.updateHoverIndicatorForLayer(e,n,r),a=this.currentData.find((t=>t.year===i));if(a&&n.key&&o){const t=a[n.key]||0;this.tooltip.showCenteredWithChartCoordinates({year:i,energySource:n.key,value:t},o.x,o.y)}})).on("mouseout",(t=>{Nt(t.target).transition().duration(100).attr("opacity",1),this.tooltip&&this.tooltip.hide(),this.hideHoverIndicator(),this.hoverCircle&&this.hoverCircle.attr("fill","white")})))}clearChart(){this.chartGroup.selectAll("*").remove()}resize(t,n){this.config.dimensions.width=t,this.config.dimensions.height=n,this.bounds=$i.calculateBounds(t,n,this.config.dimensions.margin),this.svg.attr("width",t).attr("height",n),this.xScale.range([0,this.bounds.innerWidth]),this.yScale.range([this.bounds.innerHeight,0]),this.currentData.length>0&&this.render(this.currentData,this.currentEnergySources)}updateConfig(t){this.config={...this.config,...t},this.tooltip&&(this.tooltip.setRepresentation(this.config.representation),t.tooltip&&this.tooltip.updateConfig(t.tooltip))}destroy(){this.svg.remove(),this.tooltip&&this.tooltip.destroy()}showHoverIndicator(){this.hoverIndicator&&this.config.interactive&&this.hoverIndicator.transition().duration(100).style("opacity",1)}hideHoverIndicator(){this.hoverIndicator&&this.config.interactive&&this.hoverIndicator.transition().duration(100).style("opacity",0)}updateHoverIndicatorForLayer(t,n,e){if(!this.hoverIndicator||!this.hoverCircle||!this.config.interactive)return null;const i=Math.max(0,Math.min(this.bounds.innerWidth,t)),r=Math.round(this.xScale.invert(i)),o=n.find((t=>t.data.year===r));if(o){const t=this.yScale(o[1]);return this.hoverCircle.attr("cx",i).attr("cy",t).attr("fill",e),{x:i,y:t}}return null}getColorForSource(t){return this.currentColors[t]||function(t){return Ei[t]||"#cccccc"}(t)}getSVG(){return this.svg.node()}}class Di{constructor(t,e){var i,r;this.currentData=[],this.currentEnergySources=[],this.currentColors={},this.multiDataset=null;const o=document.getElementById(t);if(!o)throw new Error(`Container element with ID '${t}' not found`);this.containerId=t,this.containerElement=o,this.config=this.mergeConfig(n,e),(null===(i=null==e?void 0:e.dimensions)||void 0===i?void 0:i.width)||(this.config.dimensions.width=this.calculateContainerWidth()),(null===(r=null==e?void 0:e.dimensions)||void 0===r?void 0:r.height)||(this.config.dimensions.height=this.calculateOptimalHeight()),this.setupChartStructure(),this.renderer=new Ni(this.getChartContainer(),this.config),this.setupEmbeddedControls(),this.setupResponsiveBehavior(),(null==e?void 0:e.data)&&(this.multiDataset=e.data,this.loadDataForCurrentSettings(),this.render())}setupChartStructure(){this.containerElement.innerHTML="";const t=document.createElement("div");t.className="stacked-chart-wrapper",t.setAttribute("data-stacked-area-chart",""),t.style.width="100%",t.style.fontFamily="Arial, sans-serif";const n=document.createElement("div");n.id=`${this.containerId}-chart`,n.className="stacked-chart-svg-container",n.style.width="100%",n.style.height=`${this.config.dimensions.height}px`,n.style.overflow="hidden";const e=document.createElement("div");e.className="stacked-chart-controls",e.style.display="flex",e.style.justifyContent="space-between",e.style.alignItems="center",e.style.padding="15px",e.style.fontSize="14px",t.appendChild(n),t.appendChild(e),this.containerElement.appendChild(t)}getChartContainer(){const t=document.getElementById(`${this.containerId}-chart`);if(!t)throw new Error("Chart container not found");return t}setupEmbeddedControls(){const t=this.containerElement.querySelector(".stacked-chart-controls");if(!t)return;const n=`mode-${this.containerId}`,e=`repr-${this.containerId}`,i=document.createElement("div");i.className="control-group view-type-group",i.style.display="flex",i.style.gap="15px",i.innerHTML=`\n            <label style="cursor: pointer;">\n                <input type="radio" name="${n}" value="fuel" ${"fuel"===this.config.mode?"checked":""} style="margin-right: 5px;"> By Fuel\n            </label>\n            <label style="cursor: pointer;">\n                <input type="radio" name="${n}" value="sector" ${"sector"===this.config.mode?"checked":""} style="margin-right: 5px;"> By Sector\n            </label>\n        `;const r=document.createElement("div");r.className="control-group representation-group",r.style.display="flex",r.style.gap="15px",r.innerHTML=`\n            <label style="cursor: pointer;">\n                <input type="radio" name="${e}" value="fractional" ${"fractional"===this.config.representation?"checked":""} style="margin-right: 5px;"> Fractional\n            </label>\n            <label style="cursor: pointer;">\n                <input type="radio" name="${e}" value="perCapita" ${"perCapita"===this.config.representation?"checked":""} style="margin-right: 5px;"> Per Capita\n            </label>\n            <label style="cursor: pointer;">\n                <input type="radio" name="${e}" value="total" ${"total"===this.config.representation?"checked":""} style="margin-right: 5px;"> Total\n            </label>\n        `,t.appendChild(i),t.appendChild(r),this.attachControlEventListeners(n,e)}attachControlEventListeners(t,n){document.querySelectorAll(`input[name="${t}"]`).forEach((t=>{t.addEventListener("change",(()=>{this.handleControlChange()}))}));document.querySelectorAll(`input[name="${n}"]`).forEach((t=>{t.addEventListener("change",(()=>{this.handleControlChange()}))}))}handleControlChange(){const t=`mode-${this.containerId}`,n=`repr-${this.containerId}`,e=document.querySelector(`input[name="${t}"]:checked`),i=document.querySelector(`input[name="${n}"]:checked`);if(e&&i){const t=e.value,n=i.value;this.config.mode=t,this.config.representation=n,this.renderer.updateConfig({mode:t,representation:n}),this.loadDataForCurrentSettings(),this.update()}}loadDataForCurrentSettings(){if(!this.multiDataset)throw new Error("No data available. Provide data via data() method or config.");const t=$i.extractDatasetFromMulti(this.multiDataset,this.config.mode,this.config.representation);this.processAndStoreData(t)}calculateContainerWidth(){const t=window.getComputedStyle(this.containerElement),n=parseInt(t.width,10)-(parseInt(t.paddingLeft,10)||0)-(parseInt(t.paddingRight,10)||0)-(parseInt(t.borderLeftWidth,10)||0)-(parseInt(t.borderRightWidth,10)||0);return Math.max(n||800,200)}calculateOptimalHeight(){const t=this.config.dimensions.width,n=Math.round(.25*t);return Math.max(150,Math.min(n,400))}setupResponsiveBehavior(){if("undefined"!=typeof ResizeObserver){new ResizeObserver((t=>{for(const n of t){const t=n.contentRect.width;t>0&&Math.abs(t-this.config.dimensions.width)>10&&(this.config.dimensions.width=Math.max(t,200),this.renderer.resize(this.config.dimensions.width,this.config.dimensions.height),this.updateChartContainerWidth())}})).observe(this.containerElement)}else window.addEventListener("resize",(()=>{setTimeout((()=>{const t=this.calculateContainerWidth();Math.abs(t-this.config.dimensions.width)>10&&(this.config.dimensions.width=t,this.renderer.resize(this.config.dimensions.width,this.config.dimensions.height),this.updateChartContainerWidth())}),100)}))}updateChartContainerWidth(){this.getChartContainer().style.width="100%"}width(t){return this.config.dimensions.width=t,this.renderer.resize(t,this.config.dimensions.height),this}height(t){return this.config.dimensions.height=t,this.renderer.resize(this.config.dimensions.width,t),this}data(t){return this.isMultiDatasetFormat(t)?(this.multiDataset=t,this.loadDataForCurrentSettings()):this.processAndStoreData(t),this}isMultiDatasetFormat(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"fuel-fractional"in t&&"fuel-perCapita"in t&&"fuel-total"in t}mode(t){return this.config.mode=t,this.renderer.updateConfig({mode:t}),this}representation(t){return this.config.representation=t,this.renderer.updateConfig({representation:t}),this}configure(t){return this.config=this.mergeConfig(this.config,t),this.renderer.updateConfig(this.config),this}render(){return this.currentData.length>0&&this.currentEnergySources.length>0&&this.renderer.render(this.currentData,this.currentEnergySources,this.currentColors),this}update(){return this.currentData.length>0&&this.currentEnergySources.length>0&&this.renderer.update(this.currentData,this.currentEnergySources,this.currentColors),this}updateData(t){return this.data(t),this.update(),this}switchDataSource(t,n){return this.config.mode=t,this.config.representation=n,this.renderer.updateConfig({mode:t,representation:n}),this.loadDataForCurrentSettings(),this.update(),this}resize(t,n){const e=null!=t?t:this.config.dimensions.width,i=null!=n?n:this.config.dimensions.height;return this.config.dimensions.width=e,this.config.dimensions.height=i,this.renderer.resize(e,i),this}destroy(){this.renderer.destroy()}getConfig(){return{...this.config}}getData(){return[...this.currentData]}getEnergySources(){return[...this.currentEnergySources]}getSVG(){return this.renderer.getSVG()}hasData(){return this.currentData.length>0&&this.currentEnergySources.length>0}processAndStoreData(t){const n=$i.transformKendoToD3(t);this.currentData=n.data,this.currentEnergySources=n.energySources,this.currentColors=$i.extractColors(t),Object.keys(this.currentColors).length>0&&(this.config.colors={...this.config.colors,...this.currentColors},this.renderer.updateConfig({colors:this.config.colors}))}mergeConfig(t,n){if(!n)return{...t};const e={...t};return n.dimensions&&(e.dimensions={...t.dimensions,...n.dimensions},n.dimensions.margin&&(e.dimensions.margin={...t.dimensions.margin,...n.dimensions.margin})),n.tooltip&&(e.tooltip={...t.tooltip,...n.tooltip},n.tooltip.offset&&(e.tooltip.offset={...t.tooltip.offset,...n.tooltip.offset})),n.animations&&(e.animations={...t.animations,...n.animations}),n.colors&&(e.colors={...t.colors,...n.colors}),Object.keys(n).forEach((t=>{"dimensions"!==t&&"tooltip"!==t&&"animations"!==t&&"colors"!==t&&(e[t]=n[t])})),e}}t.DEFAULT_CONFIG=n,t.StackedAreaChart=Di,t.default=Di,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=/sm/5704ff5dba004f88589c24965d8c4dbfaabc773d0de6c128baa920d9a6bf28e4.map