@antv/g2 5.4.5 → 5.4.6

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.
@@ -6,9 +6,9 @@
6
6
  * @date 5/9/2025, 8:18:51 AM
7
7
  * @author AntVis
8
8
  * @docs https://g.antv.antgroup.com/
9
- */function Pc(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function Cc(t,e){var n=Math.min.apply(Math,bc(t)),r=Math.min.apply(Math,bc(e));return{x:n,y:r,width:Math.max.apply(Math,bc(t))-n,height:Math.max.apply(Math,bc(e))-r}}function Lc(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function jc(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Rc(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),l=1/0,c=-1/0,u=[a,o],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var d=s+f;a<o?a<d&&d<o&&u.push(d):o<d&&d<a&&u.push(d)}for(var h=0;h<u.length;h++){var p=Lc(t,0,n,r,i,u[h]);p<l&&(l=p),p>c&&(c=p)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,m=-1/0,y=[a,o],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;a<o?a<x&&x<o&&y.push(x):o<x&&x<a&&y.push(x)}for(var w=0;w<y.length;w++){var k=jc(0,e,n,r,i,y[w]);k<v&&(v=k),k>m&&(m=k)}return{x:l,y:v,width:c-l,height:m-v}}function Ic(t,e,n,r,i,a){var o=-1,s=1/0,l=[n,r],c=20;a&&a>200&&(c=a/10);for(var u=1/c,f=u/10,d=0;d<=c;d++){var h=d*u,p=[i.apply(void 0,bc(t.concat([h]))),i.apply(void 0,bc(e.concat([h])))],g=Pc(l[0],l[1],p[0],p[1]);g<s&&(o=h,s=g)}if(0===o)return{x:t[0],y:e[0]};if(1===o){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var m=0;m<32&&!(f<1e-4);m++){var y=o-f,b=o+f,x=[i.apply(void 0,bc(t.concat([y]))),i.apply(void 0,bc(e.concat([y])))],w=Pc(l[0],l[1],x[0],x[1]);if(y>=0&&w<s)o=y,s=w;else{var k=[i.apply(void 0,bc(t.concat([b]))),i.apply(void 0,bc(e.concat([b])))],M=Pc(l[0],l[1],k[0],k[1]);b<=1&&M<s?(o=b,s=M):f*=.5}}return{x:i.apply(void 0,bc(t.concat([o]))),y:i.apply(void 0,bc(e.concat([o])))}}function Dc(t,e,n,r){return Pc(t,e,n,r)}function Bc(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Fc(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var l=[i-t,a-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))}function zc(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Wc(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,l=6*t-12*e+6*n,c=3*e-3*t,u=[];if(D(s,0))D(l,0)||(i=-c/l)>=0&&i<=1&&u.push(i);else{var f=l*l-4*s*c;D(f,0)?u.push(-l/(2*s)):f>0&&(a=(-l-(o=Math.sqrt(f)))/(2*s),(i=(-l+o)/(2*s))>=0&&i<=1&&u.push(i),a>=0&&a<=1&&u.push(a))}return u}function $c(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Wc(t,n,i,o),f=Wc(e,r,a,s),d=0;d<u.length;d++)l.push(zc(t,n,i,o,u[d]));for(var h=0;h<f.length;h++)c.push(zc(e,r,a,s,f[h]));return Cc(l,c)}function Gc(t,e,n,r,i,a,o,s,l,c,u){var f=function(t,e,n,r,i,a,o,s,l,c,u){return Ic([t,n,i,o],[e,r,a,s],l,c,zc,u)}(t,e,n,r,i,a,o,s,l,c,u);return Pc(f.x,f.y,l,c)}function Yc(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=Pc(r[0],r[1],i[0],i[1])}return e}(t)}function Hc(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Vc(t,e,n){var r=t+n-2*e;if(D(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function qc(t,e,n,r,i,a){var o=Vc(t,n,i)[0],s=Vc(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(Hc(t,n,i,o)),void 0!==s&&c.push(Hc(e,r,a,s)),Cc(l,c)}function Xc(t,e,n,r,i,a,o,s){var l=function(t,e,n,r,i,a,o,s){return Ic([t,n,i],[e,r,a],o,s,Hc)}(t,e,n,r,i,a,o,s);return Pc(l.x,l.y,o,s)}function Uc(t,e){this.v=t,this.k=e}function Kc(t,e,n,r){var i=Object.defineProperty;Kc=function(t,e,n,r){function a(e,n){Kc(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},Kc(t,e,n,r)}function Zc(){
9
+ */function Pc(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function Cc(t,e){var n=Math.min.apply(Math,bc(t)),r=Math.min.apply(Math,bc(e));return{x:n,y:r,width:Math.max.apply(Math,bc(t))-n,height:Math.max.apply(Math,bc(e))-r}}function Lc(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function jc(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Rc(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),l=1/0,c=-1/0,u=[a,o],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var d=s+f;a<o?a<d&&d<o&&u.push(d):o<d&&d<a&&u.push(d)}for(var h=0;h<u.length;h++){var p=Lc(t,0,n,r,i,u[h]);p<l&&(l=p),p>c&&(c=p)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,m=-1/0,y=[a,o],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;a<o?a<x&&x<o&&y.push(x):o<x&&x<a&&y.push(x)}for(var w=0;w<y.length;w++){var k=jc(0,e,n,r,i,y[w]);k<v&&(v=k),k>m&&(m=k)}return{x:l,y:v,width:c-l,height:m-v}}function Ic(t,e,n,r){return Pc(t,e,n,r)}function Dc(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Bc(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Fc(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,l=6*t-12*e+6*n,c=3*e-3*t,u=[];if(D(s,0))D(l,0)||(i=-c/l)>=0&&i<=1&&u.push(i);else{var f=l*l-4*s*c;D(f,0)?u.push(-l/(2*s)):f>0&&(a=(-l-(o=Math.sqrt(f)))/(2*s),(i=(-l+o)/(2*s))>=0&&i<=1&&u.push(i),a>=0&&a<=1&&u.push(a))}return u}function zc(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Fc(t,n,i,o),f=Fc(e,r,a,s),d=0;d<u.length;d++)l.push(Bc(t,n,i,o,u[d]));for(var h=0;h<f.length;h++)c.push(Bc(e,r,a,s,f[h]));return Cc(l,c)}function Wc(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=Pc(r[0],r[1],i[0],i[1])}return e}(t)}function $c(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Gc(t,e,n){var r=t+n-2*e;if(D(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Yc(t,e,n,r,i,a){var o=Gc(t,n,i)[0],s=Gc(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push($c(t,n,i,o)),void 0!==s&&c.push($c(e,r,a,s)),Cc(l,c)}function Hc(t,e){this.v=t,this.k=e}function Vc(t,e,n,r){var i=Object.defineProperty;Vc=function(t,e,n,r){function a(e,n){Vc(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},Vc(t,e,n,r)}function qc(){
10
10
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
11
- var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Kc(c,"_invoke",function(n,r,i){var a,s,l,c=0,u=i||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return a=e,s=0,l=t,d.n=n,o}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!i&&e<u.length;e++){var i,a=u[e],h=d.p,p=a[2];n>3?(i=p===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):a[0]<=h&&((i=n<2&&h<a[1])?(s=0,d.v=r,d.n=a[1]):h<p&&(i=n<3||a[0]>r||r>p)&&(a[4]=n,a[5]=r,d.n=p,s=0))}if(i||n>1)return o;throw f=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){a||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==o)break}catch(e){a=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,i,a),!0),c}var o={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(Kc(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Kc(t,i,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Kc(f,"constructor",c),Kc(c,"constructor",l),l.displayName="GeneratorFunction",Kc(c,i,"GeneratorFunction"),Kc(f),Kc(f,i,"Generator"),Kc(f,r,function(){return this}),Kc(f,"toString",function(){return"[object Generator]"}),(Zc=function(){return{w:a,m:d}})()}function Qc(t,e){function n(r,i,a,o){try{var s=t[r](i),l=s.value;return l instanceof Uc?e.resolve(l.v).then(function(t){n("next",t,a,o)},function(t){n("throw",t,a,o)}):e.resolve(l).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,o)})}catch(t){o(t)}}var r;this.next||(Kc(Qc.prototype),Kc(Qc.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Kc(this,"_invoke",function(t,i,a){function o(){return new e(function(e,r){n(t,a,e,r)})}return r=r?r.then(o,o):o()},!0)}function Jc(t,e,n,r,i){return new Qc(Zc().w(t,e,n,r),i||Promise)}function tu(t,e,n,r,i){var a=Jc(t,e,n,r,i);return a.next().then(function(t){return t.done?t.value:a.next()})}function eu(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}function nu(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(cc(t)+" is not iterable")}function ru(){var t=Zc(),e=t.m(ru),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function r(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===n||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function a(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,i[t],e)},delegateYield:function(t,i,a){return e.resultName=i,n(r.d,nu(t),a)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(ru=function(){return{wrap:function(e,n,r,i){return t.w(a(e),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:t.m,awrap:function(t,e){return new Uc(t,e)},AsyncIterator:Qc,async:function(t,e,n,i,o){return(r(e)?Jc:tu)(a(t),e,n,i,o)},keys:eu,values:nu}})()}function iu(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function au(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function o(t){iu(a,r,i,o,s,"next",t)}function s(t){iu(a,r,i,o,s,"throw",t)}o(void 0)})}}function ou(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=yc(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function su(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==lc||"undefined"!=typeof self&&self;var lu={exports:{}};!function(t){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-l*u/s+f)),Math.min(a,Math.floor(r+(s-l)*u/s+f)),o)}var d=t[r],h=i,p=a;for(n(t,i,r),o(t[a],d)>0&&n(t,i,a);h<p;){for(n(t,h,p),h++,p--;o(t[h],d)<0;)h++;for(;o(t[p],d)>0;)p--}0===o(t[i],d)?n(t,i,p):n(t,++p,a),p<=r&&(i=p+1),r<=p&&(a=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];l(i,t.leaf?r(o):o)}return i}function l(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;v(t,s)&&(e.leaf?n.push(o):g(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(v(t,a)){if(e.leaf||g(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),l=[],c=[];o||l.length;){if(o||(o=l.pop(),r=l[l.length-1],n=c.pop(),i=!0),o.leaf){var u=a(t,o.children,e);if(-1!==u)return o.children.splice(u,1),l.push(o),this._condense(l),this}i||o.leaf||!g(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(l.push(o),c.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=m([])).leaf=!1,i.height=r;var l=Math.ceil(a/s),c=l*Math.ceil(Math.sqrt(s));y(t,e,n,c,this.compareMinX);for(var u=e;u<=n;u+=c){var f=Math.min(u+c-1,n);y(t,u,f,l,this.compareMinY);for(var d=u;d<=f;d+=l){var h=Math.min(d+l-1,f);i.children.push(this._build(t,d,h,r-1))}}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=f(l),u=h(t,l)-c;u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),l(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;o<=n-e;o++){var l=s(t,0,o,this.toBBox),c=s(t,o,n,this.toBBox),u=p(l,c),d=f(l)+f(c);u<i?(i=u,r=o,a=d<a?d:a):u===i&&d<a&&(a=d,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),c=d(a)+d(o),u=e;u<n-e;u++){var f=t.children[u];l(a,t.leaf?i(f):f),c+=d(a)}for(var h=n-e-1;h>=e;h--){var p=t.children[h];l(o,t.leaf?i(p):p),c+=d(o)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)l(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}(lu);var cu=lu.exports,uu=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),fu=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),du=function(){return vc(function t(){pc(this,t),this.plugins=[]},[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)})}}])}(),hu=function(){return vc(function t(e){pc(this,t),this.clipSpaceNearZ=fu.NEGATIVE_ONE,this.plugins=[],this.config=hc({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)},[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),pu=se,gu=ae,vu=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},mu=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},yu=ce,bu=me,xu=function(){function t(){pc(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return vc(t,[{key:"update",value:function(t,e){gu(this.center,t),gu(this.halfExtents,e),bu(this.min,this.center,this.halfExtents),pu(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){pu(this.center,e,t),yu(this.center,this.center,.5),bu(this.halfExtents,e,t),yu(this.halfExtents,this.halfExtents,.5),gu(this.min,t),gu(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],l=o[1],c=o[2],u=r-s,f=r+s,d=i-l,h=i+l,p=a-c,g=a+c,v=e.center,m=v[0],y=v[1],b=v[2],x=e.halfExtents,w=x[0],k=x[1],M=x[2],O=m-w,E=m+w,S=y-k,A=y+k,_=b-M,T=b+M;O<u&&(u=O),E>f&&(f=E),S<d&&(d=S),A>h&&(h=A),_<p&&(p=_),T>g&&(g=T),n[0]=.5*(u+f),n[1]=.5*(d+h),n[2]=.5*(p+g),o[0]=.5*(f-u),o[1]=.5*(h-d),o[2]=.5*(g-p),this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],l=e[8],c=e[1],u=e[5],f=e[9],d=e[2],h=e[6],p=e[10],g=Math.abs(o),v=Math.abs(s),m=Math.abs(l),y=Math.abs(c),b=Math.abs(u),x=Math.abs(f),w=Math.abs(d),k=Math.abs(h),M=Math.abs(p);n[0]=e[12]+o*i[0]+s*i[1]+l*i[2],n[1]=e[13]+c*i[0]+u*i[1]+f*i[2],n[2]=e[14]+d*i[0]+h*i[1]+p*i[2],r[0]=g*a[0]+v*a[1]+m*a[2],r[1]=y*a[0]+b*a[1]+x*a[2],r[2]=w*a[0]+k*a[1]+M*a[2],bu(this.min,n,r),pu(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=vu([0,0,0],this.getMin(),e.getMin()),i=mu([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?gu([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?gu([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),wu=function(){return vc(function t(e,n){pc(this,t),this.distance=e||0,this.normal=n||ie(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return fe(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/be(this.normal);ce(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&i<=1;return a&&n&&he(n,t,e,i),a}}])}(),ku=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Mu=function(){return vc(function t(e){if(pc(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new wu)},[{key:"extractFromVPMatrix",value:function(t){var e=Sc(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15];oe(this.planes[0].normal,a-n,c-o,h-u),this.planes[0].distance=m-p,oe(this.planes[1].normal,a+n,c+o,h+u),this.planes[1].distance=m+p,oe(this.planes[2].normal,a+r,c+s,h+f),this.planes[2].distance=m+g,oe(this.planes[3].normal,a-r,c-s,h-f),this.planes[3].distance=m-g,oe(this.planes[4].normal,a-i,c-l,h-d),this.planes[4].distance=m-v,oe(this.planes[5].normal,a+i,c+l,h+d),this.planes[5].distance=m+v,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})}}])}(),Ou=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;pc(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return vc(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Eu=function(){function t(e,n,r,i){pc(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return vc(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=we(e.x,e.y,0,1),i=we(e.x+e.width,e.y,0,1),a=we(e.x,e.y+e.height,0,1),o=we(e.x+e.width,e.y+e.height,0,1),s=xe(),l=xe(),c=xe(),u=xe();ke(s,r,n),ke(l,i,n),ke(c,a,n),ke(u,o,n);var f=Math.min(s[0],l[0],c[0],u[0]),d=Math.min(s[1],l[1],c[1],u[1]),h=Math.max(s[0],l[0],c[0],u[0]),p=Math.max(s[1],l[1],c[1],u[1]);return t.fromRect({x:f,y:d,width:h-f,height:p-d})}}])}(),Su="Method not implemented.",Au="Use document.documentElement instead.";function _u(t){return void 0===t?0:t>360||t<-360?t%360:t}var Tu=ee();function Nu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?ne(t):ae(Tu,t):I(t)?r?ie(t,e,n):oe(Tu,t,e,n):r?ie(t[0],t[1]||e,t[2]||n):oe(Tu,t[0],t[1]||e,t[2]||n)}var Pu=Math.PI/180;function Cu(t){return t*Pu}var Lu=180/Math.PI;function ju(t){return t*Lu}var Ru=Math.PI/2;function Iu(t,e){return 16===e.length?function(t,e){var n,r,i=Sc(zt(ee(),e),3),a=i[0],o=i[1],s=i[2],l=Math.asin(-e[2]/a);return l<Ru?l>-Ru?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,l=a*a,c=n*n+o+s+l,u=n*a-r*i;return u>.499995*c?(t[0]=Ru,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*c?(t[0]=-Ru,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+l)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function Du(t,e,n,r,i){var a,o,s,l,c,u,f,d,h,p,g=Math.cos(t),v=Math.sin(t);return a=r*g,o=i*v,s=0,l=-r*v,c=i*g,u=0,f=e,d=n,h=1,(p=new gt(9))[0]=a,p[1]=o,p[2]=s,p[3]=l,p[4]=c,p[5]=u,p[6]=f,p[7]=d,p[8]=h,p}function Bu(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(e*i-n*r<0&&(e<i?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var l=1/o;r*=l,i*=l}var c=ju(Math.atan2(n,e));return[t[6],t[7],a,o,c]}var Fu=yt(),zu=yt(),Wu=xe(),$u=[ee(),ee(),ee()],Gu=ee();function Yu(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Hu=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),Vu=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),qu=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Xu="updated",Uu=2e-4,Ku=function(){return vc(function t(){pc(this,t),this.clipSpaceNearZ=fu.NEGATIVE_ONE,this.eventEmitter=new _c,this.matrix=yt(),this.right=ie(1,0,0),this.up=ie(0,1,0),this.forward=ie(0,0,1),this.position=ie(0,0,1),this.focalPoint=ie(0,0,0),this.distanceVector=ie(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=yt(),this.projectionMatrixInverse=yt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Hu.EXPLORING,this.trackingMode=Vu.DEFAULT,this.projectionMode=qu.PERSPECTIVE,this.frustum=new Mu,this.orthoMatrix=yt()},[{key:"isOrtho",value:function(){return this.projectionMode===qu.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===Hu.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Hu.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Hu.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return Et(yt(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=Ct(yt(),[t,e,0]);this.jitteredProjectionMatrix=At(yt(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===qu.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===qu.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===qu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===qu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===qu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===qu.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=ie(o.x-r,o.y-i,0),l=fe(s,this.right)/re(this.right),c=fe(s,this.up)/re(this.up),u=Sc(this.getPosition(),2),f=u[0],d=u[1],h=Sc(this.getFocalPoint(),2),p=h[0],g=h[1];return this.setPosition(f-l,d-c),this.setFocalPoint(p-l,g-c),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=qu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(Cu(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,l=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var c=this.view.fullWidth,u=this.view.fullHeight;l+=this.view.offsetX*s/c,a-=this.view.offsetY*o/u,s*=this.view.width/c,o*=this.view.height/u}return function(t,e,n,r,i,a,o){var s,l,c=2*a,u=n-e,f=r-i,d=c/u,h=c/f,p=(n+e)/u,g=(r+i)/f,v=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/v,l=-m/v):(s=-(o+a)/v,l=-2*m/v),t[0]=d,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=p,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,l,l+s,a-o,a,t,this.far,this.clipSpaceNearZ===fu.ZERO),Et(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=qu.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=c-s,d=c+s,h=u+l,p=u-l;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=g*this.view.offsetX)+g*this.view.width,p=(h-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===fu.NEGATIVE_ONE?qt(this.projectionMatrix,f,d,h,p,i,a):Xt(this.projectionMatrix,f,d,h,p,i,a),Et(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=Nu(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=ie(0,1,0);if(this.focalPoint=Nu(t,e,n),this.trackingMode===Vu.CINEMATIC){var i=le(ee(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=re(i),o=ju(Math.asin(e/a)),s=90+ju(Math.atan2(n,t)),l=yt();Pt(l,l,Cu(s)),Nt(l,l,Cu(o)),r=pe(ee(),[0,1,0],l)}return Et(this.matrix,Ut(yt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Uu&&(this.distance=Uu),this.dollyingStep=this.distance/100;var e=ee();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=_u(t),this.computeMatrix(),this._getAxes(),this.type===Hu.ORBITING||this.type===Hu.EXPLORING?this._getPosition():this.type===Hu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=_u(t),this.computeMatrix(),this._getAxes(),this.type===Hu.ORBITING||this.type===Hu.EXPLORING?this._getPosition():this.type===Hu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=_u(t),this.computeMatrix(),this._getAxes(),this.type===Hu.ORBITING||this.type===Hu.EXPLORING?this._getPosition():this.type===Hu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Oe(Me(),[0,0,1],Cu(this.roll));Mt(this.matrix);var e=Oe(Me(),[1,0,0],Cu((this.rotateWorld&&this.type!==Hu.TRACKING||this.type===Hu.TRACKING?1:-1)*this.elevation)),n=Oe(Me(),[0,1,0],Cu((this.rotateWorld&&this.type!==Hu.TRACKING||this.type===Hu.TRACKING?1:-1)*this.azimuth)),r=Ee(Me(),n,e);r=Ee(Me(),r,t);var i=Gt(yt(),r);this.type===Hu.ORBITING||this.type===Hu.EXPLORING?(_t(this.matrix,this.matrix,this.focalPoint),At(this.matrix,this.matrix,i),_t(this.matrix,this.matrix,[0,0,this.distance])):this.type===Hu.TRACKING&&(_t(this.matrix,this.matrix,this.position),At(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=Nu(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ae(this.right,Nu(ke(xe(),[1,0,0,0],this.matrix))),ae(this.up,Nu(ke(xe(),[0,1,0,0],this.matrix))),ae(this.forward,Nu(ke(xe(),[0,0,1,0],this.matrix))),ue(this.right,this.right),ue(this.up,this.up),ue(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=re(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Hu.TRACKING||this.rotateWorld?(this.elevation=ju(Math.asin(e/r)),this.azimuth=ju(Math.atan2(-t,-n))):(this.elevation=-ju(Math.asin(e/r)),this.azimuth=-ju(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ae(this.position,Nu(ke(xe(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){ge(this.distanceVector,[0,0,-this.distance],function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}(vt(),this.matrix)),se(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=le(ee(),this.focalPoint,this.position),this.distance=re(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===qu.ORTHOGRAPHIC){var t=this.position,e=Oe(Me(),[0,0,1],-this.roll*Math.PI/180);$t(this.orthoMatrix,e,ie((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),ie(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=At(yt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Xu)}}},{key:"rotate",value:function(t,e,n){throw new Error(Su)}},{key:"pan",value:function(t,e){throw new Error(Su)}},{key:"dolly",value:function(t){throw new Error(Su)}},{key:"createLandmark",value:function(t,e){throw new Error(Su)}},{key:"gotoLandmark",value:function(t,e){throw new Error(Su)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Su)}}])}(),Zu=function(t){return t[t.Standard=0]="Standard",t}({}),Qu=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Ju=ee(),tf=yt(),ef=Me();function nf(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){$t(t.localTransform,t.localRotation,t.localPosition,ie(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(Mt(tf),tf[4]=Math.tan(t.localSkew[0]),tf[1]=Math.tan(t.localSkew[1]),At(t.localTransform,t.localTransform,tf));var e=$t(tf,Ne(ef,0,0,0,1),oe(Ju,1,1,1),t.localScale,t.origin);At(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],l=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],c=1!==a[0]||1!==a[1]||1!==a[2],u=0!==o[0]||0!==o[1]||0!==o[2];l||c||u?$t(n,i,r,a,o):s?Ct(n,r):Mt(n)}t.localDirtyFlag=!1}}var rf={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Eu(0,0,0,0)},af=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function of(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function lf(){}var cf=.7,uf=1/cf,ff="\\s*([+-]?\\d+)\\s*",df="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",hf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pf=/^#([0-9a-f]{3,8})$/,gf=new RegExp(`^rgb\\(${ff},${ff},${ff}\\)$`),vf=new RegExp(`^rgb\\(${hf},${hf},${hf}\\)$`),mf=new RegExp(`^rgba\\(${ff},${ff},${ff},${df}\\)$`),yf=new RegExp(`^rgba\\(${hf},${hf},${hf},${df}\\)$`),bf=new RegExp(`^hsl\\(${df},${hf},${hf}\\)$`),xf=new RegExp(`^hsla\\(${df},${hf},${hf},${df}\\)$`),wf={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 kf(){return this.rgb().formatHex()}function Mf(){return this.rgb().formatRgb()}function Of(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=pf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ef(e):3===n?new Af(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Sf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Sf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=gf.exec(t))?new Af(e[1],e[2],e[3],1):(e=vf.exec(t))?new Af(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=mf.exec(t))?Sf(e[1],e[2],e[3],e[4]):(e=yf.exec(t))?Sf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bf.exec(t))?Lf(e[1],e[2]/100,e[3]/100,1):(e=xf.exec(t))?Lf(e[1],e[2]/100,e[3]/100,e[4]):wf.hasOwnProperty(t)?Ef(wf[t]):"transparent"===t?new Af(NaN,NaN,NaN,0):null}function Ef(t){return new Af(t>>16&255,t>>8&255,255&t,1)}function Sf(t,e,n,r){return r<=0&&(t=e=n=NaN),new Af(t,e,n,r)}function Af(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _f(){return`#${Cf(this.r)}${Cf(this.g)}${Cf(this.b)}`}function Tf(){const t=Nf(this.opacity);return`${1===t?"rgb(":"rgba("}${Pf(this.r)}, ${Pf(this.g)}, ${Pf(this.b)}${1===t?")":`, ${t})`}`}function Nf(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Cf(t){return((t=Pf(t))<16?"0":"")+t.toString(16)}function Lf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Rf(t,e,n,r)}function jf(t){if(t instanceof Rf)return new Rf(t.h,t.s,t.l,t.opacity);if(t instanceof lf||(t=Of(t)),!t)return new Rf;if(t instanceof Rf)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Rf(o,s,l,t.opacity)}function Rf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function If(t){return(t=(t||0)%360)<0?t+360:t}function Df(t){return Math.max(0,Math.min(1,t||0))}function Bf(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Ff(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var l=t.apply(this,i);return n.cache=s.set(o,l)||s,l};return n.cache=new(Ff.Cache||Map),Ff.cacheList.push(n.cache),n}of(lf,Of,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:kf,formatHex:kf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jf(this).formatHsl()},formatRgb:Mf,toString:Mf}),of(Af,function(t,e,n,r){return 1===arguments.length?function(t){return t instanceof lf||(t=Of(t)),t?new Af((t=t.rgb()).r,t.g,t.b,t.opacity):new Af}(t):new Af(t,e,n,null==r?1:r)},sf(lf,{brighter(t){return t=null==t?uf:Math.pow(uf,t),new Af(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?cf:Math.pow(cf,t),new Af(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Af(Pf(this.r),Pf(this.g),Pf(this.b),Nf(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:_f,formatHex:_f,formatHex8:function(){return`#${Cf(this.r)}${Cf(this.g)}${Cf(this.b)}${Cf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Tf,toString:Tf})),of(Rf,function(t,e,n,r){return 1===arguments.length?jf(t):new Rf(t,e,n,null==r?1:r)},sf(lf,{brighter(t){return t=null==t?uf:Math.pow(uf,t),new Rf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?cf:Math.pow(cf,t),new Rf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Af(Bf(t>=240?t-240:t+120,i,r),Bf(t,i,r),Bf(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Rf(If(this.h),Df(this.s),Df(this.l),Nf(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=Nf(this.opacity);return`${1===t?"hsl(":"hsla("}${If(this.h)}, ${100*Df(this.s)}%, ${100*Df(this.l)}%${1===t?")":`, ${t})`}`}})),Ff.Cache=Map,Ff.cacheList=[],Ff.clearCache=function(){Ff.cacheList.forEach(function(t){return t.clear()})};var zf=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Wf=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),$f=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Gf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Yf=[{name:"em",unit_type:zf.kEms},{name:"px",unit_type:zf.kPixels},{name:"deg",unit_type:zf.kDegrees},{name:"rad",unit_type:zf.kRadians},{name:"grad",unit_type:zf.kGradians},{name:"ms",unit_type:zf.kMilliseconds},{name:"s",unit_type:zf.kSeconds},{name:"rem",unit_type:zf.kRems},{name:"turn",unit_type:zf.kTurns}],Hf=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),Vf=function(t){return t?"number"===t?zf.kNumber:"percent"===t||"%"===t?zf.kPercentage:function(t){return Yf.find(function(e){return e.name===t}).unit_type}(t):zf.kUnknown},qf=function(t){var e=1;switch(t){case zf.kPixels:case zf.kDegrees:case zf.kSeconds:break;case zf.kMilliseconds:e=.001;break;case zf.kRadians:e=180/Math.PI;break;case zf.kGradians:e=.9;break;case zf.kTurns:e=360}return e},Xf=function(t){switch(t){case zf.kNumber:case zf.kInteger:return"";case zf.kPercentage:return"%";case zf.kEms:return"em";case zf.kRems:return"rem";case zf.kPixels:return"px";case zf.kDegrees:return"deg";case zf.kRadians:return"rad";case zf.kGradians:return"grad";case zf.kMilliseconds:return"ms";case zf.kSeconds:return"s";case zf.kTurns:return"turn"}return""},Uf=function(){return vc(function t(){pc(this,t)},[{key:"toString",value:function(){return this.buildCSSText($f.kNo,Gf.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Hf.kUnitType&&this.getType()<=Hf.kClampType}}],[{key:"isAngle",value:function(t){return t===zf.kDegrees||t===zf.kRadians||t===zf.kGradians||t===zf.kTurns}},{key:"isLength",value:function(t){return t>=zf.kEms&&t<zf.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===zf.kPercentage||t===zf.kEms||t===zf.kRems}},{key:"isTime",value:function(t){return t===zf.kSeconds||t===zf.kMilliseconds}}])}(),Kf=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e)).colorSpace=t,n}return Ec(e,t),vc(e,[{key:"getType",value:function(){return Hf.kColorType}},{key:"to",value:function(t){return this}}])}(Uf),Zf=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Qf=function(t){function e(t,n){var r;return pc(this,e),(r=Mc(this,e)).type=t,r.value=n,r}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Hf.kColorType}}])}(Uf),Jf=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e)).value=t,n}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Hf.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Uf),td=function(t){return function(t){switch(t){case Wf.kUNumber:return zf.kNumber;case Wf.kULength:return zf.kPixels;case Wf.kUPercent:return zf.kPercentage;case Wf.kUTime:return zf.kSeconds;case Wf.kUAngle:return zf.kDegrees;default:return zf.kUnknown}}(function(t){switch(t){case zf.kNumber:case zf.kInteger:return Wf.kUNumber;case zf.kPercentage:return Wf.kUPercent;case zf.kPixels:return Wf.kULength;case zf.kMilliseconds:case zf.kSeconds:return Wf.kUTime;case zf.kDegrees:case zf.kRadians:case zf.kGradians:case zf.kTurns:return Wf.kUAngle;default:return Wf.kUOther}}(t))},ed=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zf.kNumber;return pc(this,e),n=Mc(this,e),r="string"==typeof i?Vf(i):i,n.unit=r,n.value=t,n}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return Hf.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=td(this.unit);if(n!==td(t)||n===zf.kUnknown)return null;var r=qf(this.unit)/qf(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case zf.kUnknown:break;case zf.kInteger:r=Number(this.value).toFixed(0);break;case zf.kNumber:case zf.kPercentage:case zf.kEms:case zf.kRems:case zf.kPixels:case zf.kDegrees:case zf.kRadians:case zf.kGradians:case zf.kMilliseconds:case zf.kSeconds:case zf.kTurns:var i=this.value,a=Xf(this.unit);if(i<-999999||i>999999){var o=Xf(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Uf),nd=new ed(0,"px");new ed(1,"px");var rd=new ed(0,"deg"),id=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return pc(this,e),(i=Mc(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=o,i}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Kf),ad=new Jf("unset"),od={"":ad,unset:ad,initial:new Jf("initial"),inherit:new Jf("inherit")},sd=new id(0,0,0,0,!0),ld=new id(0,0,0,0),cd=Ff(function(t,e,n,r){return new id(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),ud=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zf.kNumber;return new ed(t,e)};function fd(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new ed(50,"%");var dd=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,h=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,m=/^rgb/i,y=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function w(t){throw new Error("".concat(x,": ").concat(t))}function k(){var t=C(M);return x.length>0&&w("Invalid input not EOF"),t}function M(){return O("linear-gradient",t,S)||O("repeating-linear-gradient",e,S)||O("radial-gradient",n,A)||O("repeating-radial-gradient",r,A)||O("conic-gradient",i,A)}function O(t,e,n){return E(e,function(e){var r=n();return r&&(B(p)||w("Missing comma before color stops")),{type:t,orientation:r,colorStops:C(L)}})}function E(t,e){var n=B(t);if(n){B(d)||w("Missing (");var r=e(n);return B(h)||w("Missing )"),r}}function S(){return D("directional",a,1)||D("angular",f,1)}function A(){var t,e,n=_();return n&&((t=[]).push(n),e=x,B(p)&&((n=_())?t.push(n):x=e)),t}function _(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||T());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=R()||T());return t}();if(t)t.at=N();else{var e=T();if(e){t=e;var n=N();n&&(t.at=n)}else{var r=P();r&&(t={type:"default-radial",at:r})}}return t}function T(){return D("extent-keyword",o,1)}function N(){if(D("position",/^at/,0)){var t=P();return t||w("Missing positioning value"),t}}function P(){var t={x:R(),y:R()};if(t.x||t.y)return{type:"position",value:t}}function C(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):w("One extra comma");return n}function L(){var t=D("hex",g,1)||E(y,function(){return{type:"rgba",value:C(j)}})||E(m,function(){return{type:"rgb",value:C(j)}})||D("literal",v,0);return t||w("Expected color definition"),t.length=R(),t}function j(){return B(b)[1]}function R(){return D("%",c,1)||D("position-keyword",s,1)||I()}function I(){return D("px",l,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,k()}}();var hd=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,pd=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,gd=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,vd=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var md={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},yd=Ff(function(t){var e;return e="angular"===t.type?Number(t.value):md[t.value]||0,ud(e,"deg")}),bd=Ff(function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:ud(e,r),cy:ud(n,i)}}),xd=Ff(function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return dd(t).map(function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;o<r;o++){var s,l=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!b(l)&&!b(a)){for(var c=1;c<o-i;c++)t[i+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(o-i))};i=o,a=Number(l)}}}(r);var i=r.map(function(t){return{offset:ud(Number(t.length.value),"%"),color:fd(t)}});if("linear-gradient"===e)return new Qf(Zf.LinearGradient,{angle:n?yd(n):rd,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var a,o=bd(n[0].at),s=o.cx,l=o.cy;if(n[0].style){var c=n[0].style,u=c.type,f=c.value;a="extent-keyword"===u?function(t){return od[t]||(od[t]=new Jf(t)),od[t]}(f):ud(f,u)}return new Qf(Zf.RadialGradient,{cx:s,cy:l,size:a,steps:i})}});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=hd.exec(t);if(n){var r,i=(null===(r=n[2].match(vd))||void 0===r?void 0:r.map(function(t){return t.split(":")}))||[];return[new Qf(Zf.LinearGradient,{angle:ud(parseFloat(n[1]),"deg"),steps:i.map(function(t){var e=Sc(t,2),n=e[0],r=e[1];return{offset:ud(100*Number(n),"%"),color:r}})})]}}else if("r"===e){var a=function(t){var e=pd.exec(t);if(e){var n,r=(null===(n=e[4].match(vd))||void 0===n?void 0:n.map(function(t){return t.split(":")}))||[];return{cx:ud(50,"%"),cy:ud(50,"%"),steps:r.map(function(t){var e=Sc(t,2),n=e[0],r=e[1];return{offset:ud(100*Number(n),"%"),color:r}})}}return null}(t);if(a){if(!L(a))return[new Qf(Zf.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=gd.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)});function wd(t){return t&&!!t.image}function kd(t){return t&&!b(t.r)&&!b(t.g)&&!b(t.b)}var Md=Ff(function(t){if(wd(t))return hc({repetition:"repeat"},t);if(b(t)&&(t=""),"transparent"===t)return ld;if("currentColor"===t)t="black";else if("none"===t)return sd;var e=xd(t);if(e)return e;var n=Of(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),cd.apply(void 0,r)});function Od(t,e){if(kd(t)&&kd(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(R(e[n],0,255));return e[3]=R(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Ed(t,e){if(b(e))return ud(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return ud(Number(e),"px");if("deg".search(t)>=0)return ud(Number(e),"deg")}var n=[];e=e.replace(t,function(t){return n.push(t),"U".concat(t)});var r="U(".concat(t.source,")");return n.map(function(t){return ud(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var Sd=function(t){return Ed(new RegExp("px","g"),t)},Ad=Ff(Sd);Ff(function(t){return Ed(new RegExp("%","g"),t)});var _d=function(t){return I(t)||isFinite(Number(t))?ud(Number(t)||0,"px"):Ed(new RegExp("px|%|em|rem","g"),t)},Td=Ff(_d),Nd=function(t){return Ed(new RegExp("deg|rad|grad|turn","g"),t)},Pd=Ff(Nd);function Cd(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,l=td(t.unit),c=t.convertTo(l),u=e.convertTo(l);return c&&u?(o=c.value,s=u.value,a=Xf(t.unit)):(ed.isLength(t.unit)||ed.isLength(e.unit))&&(o=Rd(t,i,n),s=Rd(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Ld(t){var e=0;return t.unit===zf.kDegrees?e=t.value:t.unit===zf.kRadians?e=ju(Number(t.value)):t.unit===zf.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function jd(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):L(t)?n=t.split(" ").map(function(t){return Number(t)}):I(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat(bc(n),bc(n)):n}function Rd(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===zf.kPixels)return Number(t.value);if(t.unit===zf.kPercentage&&n){var i=n.nodeName===uu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Id=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Dd(t){return t.toString()}var Bd=function(t){return"number"==typeof t?ud(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ud(Number(t)):ud(0)},Fd=Ff(Bd);function zd(t,e){return[t,e,Dd]}function Wd(t,e){return function(n,r){return[n,r,function(n){return Dd(R(n,t,e))}]}}function $d(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Gd(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=En(t.parsedStyle.d.absolutePath,void 0,Ie(Ie({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Yd(t,e){return t[0]===e[0]&&t[1]===e[1]}function Hd(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||0===Math.sin(l)||D(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(l/2-c)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(u-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0}}function Vd(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Ff(function(t){return L(t)?t.split(" ").map(Fd):t.map(Fd)});var qd=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Xd=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var l=Cu(r=z(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-o.x)/2,u=(t.y-o.y)/2,f={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var h=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));h=h<0?0:h;var p=(i!==a?1:-1)*Math.sqrt(h),g=p*(e*f.y/n),v=p*(-n*f.x/e),m={x:Math.cos(l)*g-Math.sin(l)*v+(t.x+o.x)/2,y:Math.sin(l)*g+Math.cos(l)*v+(t.y+o.y)/2},y={x:(f.x-g)/e,y:(f.y-v)/n},b=qd({x:1,y:0},y),x=qd(y,{x:(-f.x-g)/e,y:(-f.y-v)/n});!a&&x>0?x-=2*Math.PI:a&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,k=e*Math.cos(w),M=n*Math.sin(w);return{x:Math.cos(l)*k-Math.sin(l)*M+m.x,y:Math.sin(l)*k+Math.cos(l)*M+m.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Ud(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,f=Xd({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=Xd({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),h=d.x-f.x,p=d.y-f.y,g=Math.sqrt(h*h+p*p);return{x:-h/g,y:-p/g}}function Kd(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Zd(t,e){return Kd(t)*Kd(e)?(t[0]*e[0]+t[1]*e[1])/(Kd(t)*Kd(e)):1}function Qd(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Zd(t,e))}function Jd(t,e){var n=e[1],r=e[2],i=z(Cu(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],u=e[7],f=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*d/r:0,m=n?g*-r*f/n:0,y=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,b=(l+u)/2+Math.sin(i)*v+Math.cos(i)*m,x=[(f-v)/n,(d-m)/r],w=[(-1*f-v)/n,(-1*d-m)/r],k=Qd([1,0],x),M=Qd(x,w);return Zd(x,w)<=-1&&(M=Math.PI),Zd(x,w)>=1&&(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&M<0&&(M+=2*Math.PI),{cx:y,cy:b,rx:Yd(t,[c,u])?0:n,ry:Yd(t,[c,u])?0:r,startAngle:k,endAngle:k+M,xRotation:i,arcFlag:a,sweepFlag:o}}function th(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,o=e*i,s=n-t,l=n+t,c=r-e,u=r+e;return[["M",s,r],["C",s,r-o,n-a,c,n,c],["C",n+a,c,l,r-o,l,r],["C",l,r+o,n+a,u,n,u],["C",n-a,u,s,r+o,s,r],["Z"]]}function eh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case uu.LINE:var r=t.parsedStyle,i=r.x1,a=void 0===i?0:i,o=r.y1,s=void 0===o?0:o,l=r.x2,c=void 0===l?0:l,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(a,s,c,void 0===u?0:u);break;case uu.CIRCLE:var f=t.parsedStyle,d=f.r,h=void 0===d?0:d,p=f.cx,g=void 0===p?0:p,v=f.cy;n=th(h,h,g,void 0===v?0:v);break;case uu.ELLIPSE:var m=t.parsedStyle,y=m.rx,b=void 0===y?0:y,x=m.ry,w=void 0===x?0:x,k=m.cx,M=void 0===k?0:k,O=m.cy;n=th(b,w,M,void 0===O?0:O);break;case uu.POLYLINE:case uu.POLYGON:n=function(t,e){var n=t.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]});return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===uu.POLYGON);break;case uu.RECT:var E=t.parsedStyle,S=E.width,A=void 0===S?0:S,_=E.height,T=void 0===_?0:_,N=E.x,P=void 0===N?0:N,C=E.y,L=void 0===C?0:C,j=E.radius,I=j&&j.some(function(t){return 0!==t});n=function(t,e,n,r,i){if(i){var a=Sc(i,4),o=a[0],s=a[1],l=a[2],c=a[3],u=t>0?1:-1,f=e>0?1:-1,d=u+f!==0?1:0;return[["M",u*o+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,d,t+n,f*s+r]:null,["L",t+n,e-f*l+r],l?["A",l,l,0,0,d,t+n-u*l,e+r]:null,["L",n+u*c,e+r],c?["A",c,c,0,0,d,n,e+r-f*c]:null,["L",n,f*o+r],o?["A",o,o,0,0,d,u*o+n,r]:null,["Z"]].filter(function(t){return t})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(A,T,P,L,I&&j.map(function(t){return R(t,0,Math.min(Math.abs(A)/2,Math.abs(T)/2))}));break;case uu.PATH:n=bc(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce(function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=ie(e[1],e[2],0);n&&pe(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=ie(e[1],e[2],0),o=ie(e[3],e[4],0),s=ie(e[5],e[6],0);n&&(pe(a,a,n),pe(o,o,n),pe(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var l=ie(e[6],e[7],0);n&&pe(l,l,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(l[0],",").concat(l[1])}else if("Q"===e[0]){var c=ie(e[1],e[2],0),u=ie(e[3],e[4],0);n&&(pe(c,c,n),pe(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r},"")}(n,0,e)}var nh=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=cn(t)}catch(n){e=cn(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=[r[1],r[2]],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&Yd(a,o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s];r=t[s+1];var c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var f=Jd(n,l);u.arcParams=f}if("Z"===c)n=i,r=t[a+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),u.currentPoint=n,e[a]&&Yd(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var g=[l[1],l[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===c){var v=e[s-1],m=Vd(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var y=[l[1],l[2]],b=[l[3],l[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[y[0]-b[0],y[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-y[0],b[1]-y[1]])}else if("S"===c){var x=e[s-1],w=Vd(x.currentPoint,p),k=[l[1],l[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]]):(u.command="SQ",u.startTangent=[p[0]-k[0],p[1]-k[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]])}else if("A"===c){var M=Ud(u,0),O=M.x,E=M.y,S=Ud(u,1,!1),A=S.x,_=S.y;u.startTangent=[O,E],u.endTangent=[A,_]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,l=o.params,c=o.prePoint,u=void 0;switch(o.command){case"Q":u=qc(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=$c(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=o.arcParams;u=Rc(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var d=P(n),h=P(r),p=N(n),g=N(r);if(0===i.length)return{x:d,y:h,width:p-d,height:g-h};for(var v=0;v<i.length;v++){var m=i[v],y=m.currentPoint;y[0]===d?d-=Hd(m,e).xExtra:y[0]===p&&(p+=Hd(m,e).xExtra),y[1]===h?h-=Hd(m,e).yExtra:y[1]===g&&(g+=Hd(m,e).yExtra)}return{x:d,y:h,width:p-d,height:g-h}}(o,0),l=s.x,c=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},rh=Ff(nh);function ih(t){return L(t)?rh(t):nh(t)}function ah(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=gn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=gn(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Tn(r,i));var o,s,l=An(a[0])!==An(a[1])?(o=a[0],s=o.slice(1).map(function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))}).map(function(t){return t.map(function(e,n){return t[t.length-n-2*(1-n%2)]})}).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map(function(t){return["C"].concat(t.slice(2))}))):function(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}(a[0]);return[l,Sn(a[1],l),function(t){return t}]}function oh(t,e){return[t.points,e.points,function(t){return t}]}var sh=null,lh=/\s*(\w+)\(([^)]*)\)/g;function ch(t){return function(e){var n=0;return t.map(function(t){return t===sh?e[n++]:t})}}function uh(t){return t}var fh={matrix:["NNNNNN",[sh,sh,0,0,sh,sh,0,0,0,0,1,0,sh,sh,0,1],uh],matrix3d:["NNNNNNNNNNNNNNNN",uh],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ch([sh,sh,new ed(1)]),uh],scaleX:["N",ch([sh,new ed(1),new ed(1)]),ch([sh,new ed(1)])],scaleY:["N",ch([new ed(1),sh,new ed(1)]),ch([new ed(1),sh])],scaleZ:["N",ch([new ed(1),new ed(1),sh])],scale3d:["NNN",uh],skew:["Aa",null,uh],skewX:["A",null,ch([sh,rd])],skewY:["A",null,ch([rd,sh])],translate:["Tt",ch([sh,sh,nd]),uh],translateX:["T",ch([sh,nd,nd]),ch([sh,nd])],translateY:["T",ch([nd,sh,nd]),ch([nd,sh])],translateZ:["L",ch([nd,nd,sh])],translate3d:["TTL",uh]};function dh(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!fh[a])return[];var s=o.map(function(t){return ud(t)});e.push({t:a,d:s})}return e}function hh(t){if(Array.isArray(t))return dh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(lh.lastIndex=0;e=lh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=fh[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var l=[],c=0;c<s.length;c++){var u=o[c],f=s[c],d=void 0;if(d=u?{A:function(t){return"0"===t.trim()?rd:Pd(t)},N:Fd,T:Td,L:Ad}[f.toUpperCase()](u):{a:rd,n:l[0],t:nd}[f],void 0===d)return[];l.push(d)}if(n.push({t:i,d:l}),lh.lastIndex===t.length)return n}return[]}function ph(t){if(Array.isArray(t))return dh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(lh.lastIndex=0;e=lh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=fh[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var l=[],c=0;c<s.length;c++){var u=o[c],f=s[c],d=void 0;if(d=u?{A:function(t){return"0"===t.trim()?rd:Nd(t)},N:Bd,T:_d,L:Sd}[f.toUpperCase()](u):{a:rd,n:l[0],t:nd}[f],void 0===d)return[];l.push(d)}if(n.push({t:i,d:l}),lh.lastIndex===t.length)return n}return[]}function gh(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Cu(Ld(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Cu(Ld(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Cu(Ld(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Cu(Ld(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*l),2*(e*r*c-n*l),0,2*(e*n*c-r*l),1-2*(e*e+r*r)*c,2*(n*r*c+e*l),0,2*(e*r*c+n*l),2*(n*r*c-e*l),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=Cu(Ld(t.d[0])),f=Cu(Ld(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Cu(Ld(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Cu(Ld(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Rd(t.d[0],0,null)||0,n=Rd(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Rd(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Rd(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Rd(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Rd(t.d[0],0,null)||0,n=Rd(t.d[1],0,null)||0,r=Rd(t.d[2],0,null)||0,1];case"perspective":var d=Rd(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function vh(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function mh(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(Fu,t))return!1;if(xt(zu,Fu),zu[3]=0,zu[7]=0,zu[11]=0,zu[15]=1,Math.abs(St(zu))<1e-8)return!1;var o,s,l=Fu[3],c=Fu[7],u=Fu[11],f=Fu[12],d=Fu[13],h=Fu[14],p=Fu[15];if(0!==l||0!==c||0!==u){if(Wu[0]=l,Wu[1]=c,Wu[2]=u,Wu[3]=p,!Et(zu,zu))return!1;Ot(zu,zu),ke(i,Wu,zu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=d,e[2]=h,s=Fu,(o=$u)[0][0]=s[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=re($u[0]),ue($u[0],$u[0]),r[0]=fe($u[0],$u[1]),Yu($u[1],$u[1],$u[0],1,-r[0]),n[1]=re($u[1]),ue($u[1],$u[1]),r[0]/=n[1],r[1]=fe($u[0],$u[2]),Yu($u[2],$u[2],$u[0],1,-r[1]),r[2]=fe($u[1],$u[2]),Yu($u[2],$u[2],$u[1],1,-r[2]),n[2]=re($u[2]),ue($u[2],$u[2]),r[1]/=n[2],r[2]/=n[2],de(Gu,$u[1],$u[2]),fe($u[0],Gu)<0)for(var g=0;g<3;g++)n[g]*=-1,$u[g][0]*=-1,$u[g][1]*=-1,$u[g][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+$u[0][0]-$u[1][1]-$u[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-$u[0][0]+$u[1][1]-$u[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-$u[0][0]-$u[1][1]+$u[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+$u[0][0]+$u[1][1]+$u[2][2],0)),$u[2][1]>$u[1][2]&&(a[0]=-a[0]),$u[0][2]>$u[2][0]&&(a[1]=-a[1]),$u[1][0]>$u[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(gh).reduce(vh)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var yh=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(var l=0;l<3;l++)for(var c=0;c<3;c++)o[3][l]+=e[c]*o[c][l];var u=i[0],f=i[1],d=i[2],h=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+d*d),p[0][1]=2*(u*f-d*h),p[0][2]=2*(u*d+f*h),p[1][0]=2*(u*f+d*h),p[1][1]=1-2*(u*u+d*d),p[1][2]=2*(f*d-u*h),p[2][0]=2*(u*d-f*h),p[2][1]=2*(f*d+u*h),p[2][2]=1-2*(u*u+f*f),o=t(o,p);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(g[2][1]=r[2],o=t(o,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],o=t(o,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],o=t(o,g));for(var v=0;v<3;v++)for(var m=0;m<3;m++)o[v][m]*=n[v];return function(t){return 0===t[0][2]&&0===t[0][3]&&0===t[1][2]&&0===t[1][3]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]&&0===t[2][3]&&0===t[3][2]&&1===t[3][3]}(o)?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function bh(t){return t.toFixed(6).replace(".000000","")}function xh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=mh(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=mh(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=R(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return yh(t[0],t[1],t[2],e,t[4]).map(bh).join(",")}])}function wh(t){return t.replace(/[XY]/,"")}function kh(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}var Mh=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function Oh(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map(function(t){return"number"==typeof t?ud(o):ud(o,t.unit)})})},a=0;a<t.length;a++)i()}var o=[],s=[],l=[];if(t.length!==e.length){var c=xh(t,e);o=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]]}else for(var u=0;u<t.length;u++){var f=t[u].t,d=e[u].t,h=t[u].d,p=e[u].d,g=fh[f],v=fh[d],m=void 0;if(Mh(f,d)){var y=xh([t[u]],[e[u]]);o.push(y[0]),s.push(y[1]),l.push(["matrix",[y[2]]])}else{if(f===d)m=f;else if(g[2]&&v[2]&&wh(f)===wh(d))m=wh(f),h=g[2](h),p=v[2](p);else{if(!g[1]||!v[1]||kh(f)!==kh(d)){var b=xh(t,e);o=[b[0]],s=[b[1]],l=[["matrix",[b[2]]]];break}m=kh(f),h=g[1](h),p=v[1](p)}for(var x=[],w=[],k=[],M=0;M<h.length;M++){var O=Cd(h[M],p[M],n,!1,M);x[M]=O[0],w[M]=O[1],k.push(O[2])}o.push(x),s.push(w),l.push([m,k])}}if(r){var E=o;o=s,s=E}return[o,s,function(t){return t.map(function(t,e){var n=t.map(function(t,n){return l[e][1][n](t)}).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),"".concat(l[e][0],"(").concat(n,")")}).join(" ")}]}var Eh=Ff(function(t){if(L(t)){if("text-anchor"===t)return[ud(0,"px"),ud(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Td(Sh(e[0])),Td(Sh(e[1]))]}return[ud(t[0]||0,"px"),ud(t[1]||0,"px")]});function Sh(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Ah=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:af.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:af.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:af.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:af.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:af.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:af.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:af.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:af.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:af.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:af.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:af.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:af.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:af.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:af.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:af.FILTER},{n:"clipPath",syntax:af.DEFINED_PATH},{n:"textPath",syntax:af.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:af.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:af.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:af.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:af.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:af.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:af.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:af.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:af.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:af.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:af.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:af.COORDINATE},{n:"y1",int:!0,l:!0,syntax:af.COORDINATE},{n:"z1",int:!0,l:!0,syntax:af.COORDINATE},{n:"x2",int:!0,l:!0,syntax:af.COORDINATE},{n:"y2",int:!0,l:!0,syntax:af.COORDINATE},{n:"z2",int:!0,l:!0,syntax:af.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:af.PATH,p:50},{n:"points",int:!0,l:!0,syntax:af.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:af.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:af.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:af.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:af.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:af.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:af.NUMBER,d:function(t){return t===uu.PATH||t===uu.POLYGON||t===uu.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:af.MARKER},{n:"markerEnd",syntax:af.MARKER},{n:"markerMid",syntax:af.MARKER},{n:"markerStartOffset",syntax:af.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:af.LENGTH,l:!0,int:!0,d:"0"}],_h=new Set(Ah.filter(function(t){return!!t.l}).map(function(t){return t.n})),Th={},Nh=function(){return vc(function t(e){var n=this;pc(this,t),this.runtime=e,Ah.forEach(function(t){n.registerMetadata(t)})},[{key:"registerMetadata",value:function(t){[t.n].concat(bc(t.a||[])).forEach(function(e){Th[e]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=Ph(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var o in e)if(_h.has(o)){a=!0;break}var s,l,c=Ph(t);c.has("fill")&&e.fill&&(t.parsedStyle.fill=Md(e.fill)),c.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=Md(e.stroke)),c.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=Md(e.shadowColor)),c.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Id.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return Ed(/deg|rad|grad|turn|px|%/g,t)||Md(t)})}),n.lastIndex===t.length)return r}return[]}(e.filter)),c.has("radius")&&!b(e.radius)&&(t.parsedStyle.radius=jd(e.radius,4)),c.has("lineDash")&&!b(e.lineDash)&&(t.parsedStyle.lineDash=jd(e.lineDash,"even")),c.has("points")&&e.points&&(t.parsedStyle.points=(s=e.points,l=L(s)?s.split(" ").map(function(t){var e=Sc(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]}):s,{points:l,totalLength:0,segments:[]})),c.has("d")&&""===e.d&&(t.parsedStyle.d=hc({},rf)),c.has("d")&&e.d&&(t.parsedStyle.d=ih(e.d)),c.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[af.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),c.has("clipPath")&&!V(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[af.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),c.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[af.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),c.has("transform")&&e.transform&&(t.parsedStyle.transform=hh(e.transform)),c.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=Eh(e.transformOrigin)),c.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[af.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),c.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[af.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),c.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[af.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),c.has("zIndex")&&!b(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[af.Z_INDEX].postProcessor(t),c.has("offsetDistance")&&!b(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[af.OFFSET_DISTANCE].postProcessor(t),c.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[af.TRANSFORM].postProcessor(t),c.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[af.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.dirty(!0,!0),n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new xu),r.renderBounds||(r.renderBounds=new xu);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,l=a.cy,c=void 0===l?0:l,u=a.cz,f=void 0===u?0:u,d=a.hwidth,h=void 0===d?0:d,p=a.hheight,g=void 0===p?0:p,v=a.hdepth,m=void 0===v?0:v,y=[Math.abs(h),Math.abs(g),m],b=i.stroke,x=i.lineWidth,w=void 0===x?1:x,k=i.increasedLineWidthForHitTesting,M=void 0===k?0:k,O=i.shadowType,E=void 0===O?"outer":O,S=i.shadowColor,A=i.filter,_=void 0===A?[]:A,T=i.transformOrigin,N=[s,c,f];r.contentBounds.update(N,y);var P=e===uu.POLYLINE||e===uu.POLYGON||e===uu.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var C=((w||0)+(M||0))*P;y[0]+=C,y[1]+=C}if(r.renderBounds.update(N,y),S&&E&&"inner"!==E){var L=r.renderBounds,j=L.min,R=L.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=j[0]-I+D,z=R[0]+I+D,W=j[1]-I+B,$=R[1]+I+B;j[0]=Math.min(j[0],F),R[0]=Math.max(R[0],z),j[1]=Math.min(j[1],W),R[1]=Math.max(R[1],$),r.renderBounds.setMinMax(j,R)}_.forEach(function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,se(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,l=r.renderBounds,c=l.min,u=l.max,f=c[0]-s+a,d=u[0]+s+a,h=c[1]-s+o,p=u[1]+s+o;c[0]=Math.min(c[0],f),u[0]=Math.max(u[0],d),c[1]=Math.min(c[1],h),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(c,u)}}),t.geometry.dirty=!1;var G=g<0,Y=(h<0?-1:1)*(T?Rd(T[0],0,t,!0):0),H=(G?-1:1)*(T?Rd(T[1],1,t,!0):0);(Y||H)&&t.setOrigin(Y,H)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===uu.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===uu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function Ph(t){return t.constructor.PARSED_STYLE_LIST}var Ch=function(){return vc(function t(){pc(this,t),this.mixer=zd},[{key:"calculator",value:function(t,e,n,r){return Ld(n)}}])}(),Lh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Jf&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtyToRoot(t)}),n}}])}(),jh=function(){return vc(function t(){pc(this,t),this.parser=Md,this.mixer=Od},[{key:"calculator",value:function(t,e,n,r){return n instanceof Jf?"none"===n.value?sd:ld:n}}])}(),Rh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n){return n instanceof Jf?[]:n}}])}();function Ih(t){var e=t.parsedStyle.fontSize;return b(e)?null:e}var Dh=function(){return vc(function t(){pc(this,t),this.mixer=zd},[{key:"calculator",value:function(t,e,n,r,i){if(I(n))return n;if(!ed.isRelativeUnit(n.unit))return n.value;if(n.unit===zf.kPercentage)return 0;if(n.unit===zf.kEms){if(r.parentNode){var a=Ih(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===zf.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=Ih(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Bh=function(){return vc(function t(){pc(this,t),this.mixer=$d},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),Fh=function(){return vc(function t(){pc(this,t),this.mixer=$d},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),zh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Jf&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Wh=function(){return vc(function t(){pc(this,t),this.mixer=zd},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),$h=function(){return vc(function t(){pc(this,t),this.mixer=Wd(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===uu.LINE||i===uu.PATH||i===uu.POLYLINE){var a=n.getPoint(r);a&&t.setLocalPosition(a.x,a.y)}}}}])}(),Gh=function(){return vc(function t(){pc(this,t),this.mixer=Wd(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Yh=function(){return vc(function t(){pc(this,t),this.parser=ih,this.mixer=ah},[{key:"calculator",value:function(t,e,n){return n instanceof Jf&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Eu(0,0,0,0)}:n}}])}(),Hh=vc(function t(){pc(this,t),this.mixer=oh}),Vh=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).mixer=Wd(0,1/0),t}return Ec(e,t),vc(e)}(Dh),qh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){return n instanceof Jf?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Xh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Uh=new WeakMap;var Kh="undefined"!=typeof window&&void 0!==window.document;function Zh(t){return!!t.getAttribute}function Qh(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Jh(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function tp(t,e){if(Kh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ep={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},np="object"==typeof performance&&performance.now?performance:Date;function rp(t){return t.nodeName===uu.FRAGMENT||t.getRootNode().nodeName===uu.FRAGMENT}function ip(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=a,i=o):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var ap=1,op="object"==typeof self&&self.self===self?self:"object"==typeof lc&&lc.global===lc?lc:{},sp=Date.now(),lp={},cp=Date.now(),up=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-cp,r=n>16?0:16-n,i=ap++;return lp[i]=t,Object.keys(lp).length>1||setTimeout(function(){cp=e;var t=lp;lp={},Object.keys(t).forEach(function(e){return t[e](op.performance&&"function"==typeof op.performance.now?op.performance.now():Date.now()-sp)})},r),i},fp=function(t){delete lp[t]},dp=function(t){return"string"!=typeof t?up:""===t?op.requestAnimationFrame:op["".concat(t,"RequestAnimationFrame")]},hp=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],function(t){return!!dp(t)}),pp=dp(hp),gp=function(t){return"string"!=typeof t?fp:""===t?op.cancelAnimationFrame:op["".concat(t,"CancelAnimationFrame")]||op["".concat(t,"CancelRequestAnimationFrame")]}(hp);op.requestAnimationFrame=pp,op.cancelAnimationFrame=gp;var vp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,e)}))}}])}(),mp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=au(ru().mark(function t(){var e,n,r,i,a=arguments;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=6;break}return t.next=1,(e=this.callbacks)[0].apply(e,a);case 1:n=t.sent,r=0;case 2:if(!(r<this.callbacks.length-1)){t.next=5;break}return i=this.callbacks[r],t.next=3,i(n);case 3:n=t.sent;case 4:r++,t.next=2;break;case 5:return t.abrupt("return",n);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),yp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach(function(t){t.apply(void 0,r)})}}])}(),bp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),a=0;a<this.callbacks.length-1;a++){i=(0,this.callbacks[a])(i)}return i}return null}}])}(),xp=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],wp=/([\"\'])[^\'\"]+\1/;function kp(t){var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,l=void 0===s?"normal":s,c=t.fontWeight;return{fontSize:n,fontFamily:i,fontStyle:o,fontVariant:l,fontWeight:void 0===c?"normal":c}}var Mp=Ff(function(t){for(var e=kp(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight,s=I(n)&&"".concat(n,"px")||"16px",l=r.split(","),c=l.length-1;c>=0;c--){var u=l[c].trim();!wp.test(u)&&xp.indexOf(u)<0&&(u='"'.concat(u,'"')),l[c]=u}return"".concat(i," ").concat(a," ").concat(o," ").concat(s," ").concat(l.join(","))},function(t){var e=kp(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight;return"".concat(i,"_").concat(a,"_").concat(o,"_").concat(n,"_").concat(r)}),Op=function(t){return Math.max(t,1e-6)};function Ep(t,e,n){return Mt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Sp=yt(),Ap=yt(),_p={scale:function(t){Lt(Sp,[t[0].value,t[1].value,1].map(function(t){return Op(t)}))},scaleX:function(t){Lt(Sp,[t[0].value,1,1].map(function(t){return Op(t)}))},scaleY:function(t){Lt(Sp,[1,t[0].value,1].map(function(t){return Op(t)}))},scaleZ:function(t){Lt(Sp,[1,1,t[0].value].map(function(t){return Op(t)}))},scale3d:function(t){Lt(Sp,[t[0].value,t[1].value,t[2].value].map(function(t){return Op(t)}))},translate:function(t){Ct(Sp,[t[0].value,t[1].value,0])},translateX:function(t){Ct(Sp,[t[0].value,0,0])},translateY:function(t){Ct(Sp,[0,t[0].value,0])},translateZ:function(t){Ct(Sp,[0,0,t[0].value])},translate3d:function(t){Ct(Sp,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Dt(Sp,Cu(Ld(t[0])))},rotateX:function(t){Rt(Sp,Cu(Ld(t[0])))},rotateY:function(t){It(Sp,Cu(Ld(t[0])))},rotateZ:function(t){Dt(Sp,Cu(Ld(t[0])))},rotate3d:function(t){jt(Sp,Cu(Ld(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Ep(Sp,Cu(t[0].value),Cu(t[1].value))},skewX:function(t){Ep(Sp,Cu(t[0].value),0)},skewY:function(t){Ep(Sp,0,Cu(t[0].value))},matrix:function(t){kt(Sp,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){kt.apply(te,[Sp].concat(bc(t.map(function(t){return t.value}))))}},Tp=ie(1,1,1),Np=ee(),Pp={translate:function(t,e){Rg.sceneGraphService.setLocalScale(t,Tp,!1),Rg.sceneGraphService.setLocalEulerAngles(t,Np,void 0,void 0,!1),Rg.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Rg.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Cp(t,e){if(t.length){if(1===t.length&&Pp[t[0].t])return void Pp[t[0].t](e,t[0].d);for(var n=Mt(Ap),r=0;r<t.length;r++){var i=t[r],a=i.t,o=i.d,s=_p[a];s&&(s(o),Qt(n,n,Sp))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Lp=function(){return vc(function t(){pc(this,t),this.parser=ph,this.mixer=Oh},[{key:"calculator",value:function(t,e,n,r){return n instanceof Jf?[]:n}},{key:"postProcessor",value:function(t){Cp(t.parsedStyle.transform,t)}}])}(),jp=function(){return vc(function t(){pc(this,t)},[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===zf.kPixels&&e[1].unit===zf.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),Rp=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&e.dirty(),r&&(r.dirty=!0,r.dirtyReason=Qu.Z_INDEX_CHANGED)}}}])}(),Ip=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.r,s=void 0===o?0:o;return{cx:r,cy:a,hwidth:s,hheight:s}}}])}(),Dp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.rx,s=void 0===o?0:o,l=t.ry;return{cx:r,cy:a,hwidth:s,hheight:void 0===l?0:l}}}])}(),Bp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),l=(o-a)/2,c=(Math.max(n,i)-s)/2;return{cx:a+l,cy:s+c,hwidth:l,hheight:c}}}])}(),Fp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,a=e.height/2;return{cx:n+i,cy:r+a,hwidth:i,hheight:a}}}])}(),zp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,bc(e.map(function(t){return t[0]}))),r=Math.max.apply(Math,bc(e.map(function(t){return t[0]}))),i=Math.min.apply(Math,bc(e.map(function(t){return t[1]}))),a=Math.max.apply(Math,bc(e.map(function(t){return t[1]}))),o=(r-n)/2,s=(a-i)/2;return{cx:n+o,cy:i+s,hwidth:o,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Wp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,l=void 0===s?0:s,c=t.height,u=l,f=void 0===c?0:c;return o&&!L(o)&&(u||(u=o.width,t.width=u),f||(f=o.height,t.height=f)),{cx:r+u/2,cy:a+f/2,hwidth:u/2,hheight:f/2}}}])}(),$p=function(){return vc(function t(e){pc(this,t),this.globalRuntime=e},[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,l=t.textBaseline,c=void 0===l?"alphabetic":l,u=t.dx,f=void 0===u?0:u,d=t.dy,h=void 0===d?0:d,p=t.x,g=void 0===p?0:p,v=t.y,m=void 0===v?0:v;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,y);t.metrics=b;var x=b.width/2,w=b.height/2,k=g+x;"center"===a||"middle"===a?k+=s/2-x:"right"!==a&&"end"!==a||(k+=s-2*x);var M=m-w;return"middle"===c?M+=w:"top"===c||"hanging"===c?M+=2*w:"alphabetic"===c||"bottom"!==c&&"ideographic"!==c||(M+=0),f&&(k+=f),h&&(M+=h),{cx:k,cy:M,hwidth:x,hheight:w}}}])}(),Gp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Yp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.width,s=void 0===o?0:o,l=t.height,c=void 0===l?0:l;return{cx:r+s/2,cy:a+c/2,hwidth:s/2,hheight:c/2}}}])}(),Hp=function(){return vc(function t(e){pc(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ou,this.page=new Ou,this.canvas=new Ou,this.viewport=new Ou,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(Su)}}])}(),Vp=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).client=new Ou,t.movement=new Ou,t.offset=new Ou,t.global=new Ou,t.screen=new Ou,t}return Ec(e,t),vc(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(Su)}}])}(Hp),qp=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return Ec(e,t),vc(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Vp),Xp=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Vp),Up=function(t){function e(t,n){var r;return pc(this,e),(r=Mc(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return Ec(e,t),vc(e)}(Hp),Kp=function(){return vc(function t(){pc(this,t),this.emitter=new _c},[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(Y(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=y(e)?e:e.handleEvent;var s=y(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(Y(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=y(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=y(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Up(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(t),!0;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(e){if(t.manager=e.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])}(),Zp=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t.destroyed=!1,t}return Ec(e,t),vc(e,[{key:"textContent",get:function(){var t="";this.nodeName===uu.TEXT&&(t+=this.style.text);var e,n=ou(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===uu.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===uu.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Su)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Su)}},{key:"lookupPrefix",value:function(t){throw new Error(Su)}},{key:"normalize",value:function(){throw new Error(Su)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,l=s===i?a:i;if(s[s.length-l.length]===l[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-l.length,u=l.length-1;u>=0;u--){var f=l[u],d=s[c+u];if(d!==f){var h=f.parentNode.childNodes;return h.indexOf(f)<h.indexOf(d)?l===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Kp);Zp.DOCUMENT_POSITION_DISCONNECTED=1,Zp.DOCUMENT_POSITION_PRECEDING=2,Zp.DOCUMENT_POSITION_FOLLOWING=4,Zp.DOCUMENT_POSITION_CONTAINS=8,Zp.DOCUMENT_POSITION_CONTAINED_BY=16,Zp.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Qp=function(){return vc(function t(e,n){var r=this;pc(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=yt(),this.tmpVec3=ee(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=np.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var a=r.trackingData(t.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[t.button]),s=o;if(o&&!n.composedPath().includes(o)){for(var l=o;l&&!n.composedPath().includes(l);){if(n.currentTarget=l,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var c=2===n.button;r.notifyTarget(n,c?"rightupoutside":"mouseupoutside")}Zp.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],s=l}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var d=r.context.renderingContext.root.ownerDocument.defaultView,h=a.clicksByButton[t.button];h.target===f.target&&e-h.timeStamp<d.getConfig().dblClickSpeed?++h.clickCount:h.clickCount=1,h.target=f.target,h.timeStamp=e,f.detail=h.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==f.pointerType&&"touch"!==f.pointerType||r.dispatchEvent(f,"click"),r.dispatchEvent(f,"pointertap")),r.freeEvent(f)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,o,a||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(a)){var l=r.createPointerEvent(t,"pointerleave",a||void 0);for(l.eventPhase=l.AT_TARGET;l.target&&!e.composedPath().includes(l.target);)l.currentTarget=l.target,r.notifyTarget(l),n&&r.notifyTarget(l,"mouseleave"),Zp.isNode(l.target)&&(l.target=l.target.parentNode);r.freeEvent(l)}r.freeEvent(s)}if(a!==e.target){var c="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,c);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var f=a&&Zp.isNode(a)&&a.parentNode;f&&f!==(Zp.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Zp.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var d=r.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==a&&d.target!==(Zp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)d.currentTarget=d.target,r.notifyTarget(d),n&&r.notifyTarget(d,"mouseenter"),Zp.isNode(d.target)&&(d.target=d.target.parentNode);r.freeEvent(d)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Zp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Zp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Zp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Zp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Zp.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Ou((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Ou((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),l=r.getWorldTransform(),c=At(this.tmpMatrix,l,s),u=oe(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return pe(u,u,c),new Ou(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=At(this.tmpMatrix,n,r),a=oe(this.tmpVec3,t.x,t.y,0);pe(this.tmpVec3,this.tmpVec3,i);var o=this.context.config,s=o.width,l=o.height;return new Ou((a[0]+1)/2*s,(1-(a[1]+1)/2)*l)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)Zp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,a=r.height,o=r.disableHitTesting;return e<0||n<0||e>i||n>a?null:!o&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(qp);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Xp);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Xp);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(qp);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=np.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Zp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Zh(e)&&e.getAttribute("cursor");if(n)return n;e=Zp.isNode(e)&&e.parentNode}}}])}(),Jp=function(){return vc(function t(){pc(this,t)},[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Rg.offscreenCanvas)this.canvas=t||Rg.offscreenCanvas,this.context=this.canvas.getContext("2d",hc({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",hc({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",hc({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),tg=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),eg=function(){return vc(function t(e,n){pc(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new yp,initAsync:new vp,dirtycheck:new bp,cull:new bp,beginFrame:new yp,beforeRender:new yp,render:new yp,afterRender:new yp,endFrame:new yp,destroy:new yp,pick:new mp,pickSync:new bp,pointerDown:new yp,pointerUp:new yp,pointerMove:new yp,pointerOut:new yp,pointerOver:new yp,pointerWheel:new yp,pointerCancel:new yp,click:new yp},this.globalRuntime=e,this.context=n},[{key:"init",value:function(t){var e=this,n=hc(hc({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,e.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()}).catch(function(t){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(tg.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(tg.CAMERA_CHANGED),o=!t.disableRenderHooks||!a;o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach(function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)}),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t,l=null;s&&(l=o?r.hooks.cull.call(s,r.context.camera):s)&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(l)),t.dirty(!1),i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var l=[t];l.length>0;){var c,u=l.pop();s(u);for(var f=(null===(c=u.sortable)||void 0===c||null===(c=c.sorted)||void 0===c?void 0:c.length)>0?u.sortable.sorted:u.childNodes,d=f.length-1;d>=0;d--)l.push(f[d])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==Qu.Z_INDEX_CHANGED?e.dirtyChildren.forEach(function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Qh(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}}):e.sorted=t.childNodes.slice().sort(Qh),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter(function(t){return t.parsedStyle.zIndex}).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(tg.DISPLAY_OBJECT_CHANGED)}}])}(),ng=/\[\s*(.*)=(.*)\s*\]/,rg=function(){return vc(function t(){pc(this,t)},[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find(function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.find(function(e){return e.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):null}return e.find(function(n){return e!==n&&n.nodeName===t})}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll(function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(r){return e!==r&&r.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):[]}return e.findAll(function(n){return e!==n&&n.nodeName===t})}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(ng),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return b(n)?"":n.toString?n.toString():""}}])}(),ig=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),ag=function(t){function e(t,n,r,i,a,o,s,l){var c;return pc(this,e),(c=Mc(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=l,c.type=t,c}return Ec(e,t),vc(e)}(Hp);ag.ADDITION=2,ag.MODIFICATION=1,ag.REMOVAL=3;var og,sg,lg,cg=new ag(ig.REPARENT,null,"","","",0,"",""),ug=Le(),fg=ee(),dg=ie(1,1,1),hg=yt(),pg=Le(),gg=ee(),vg=yt(),mg=Me(),yg=ee(),bg=Me(),xg=ee(),wg=ee(),kg=ee(),Mg=yt(),Og=Me(),Eg=Me(),Sg=Me(),Ag={affectChildren:!0},_g=function(){return vc(function t(e){pc(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Up(ig.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e},[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===uu.FRAGMENT,o=rp(e);t.parentNode=e;var s=a?t.childNodes:[t];I(n)?s.forEach(function(t){e.childNodes.splice(n,0,t),t.parentNode=e}):s.forEach(function(t){e.childNodes.push(t),t.parentNode=e});var l=e.sortable;if((null!=l&&null!==(r=l.sorted)&&void 0!==r&&r.length||l.dirty||t.parsedStyle.zIndex)&&(-1===l.dirtyChildren.indexOf(t)&&l.dirtyChildren.push(t),l.dirty=!0,l.dirtyReason=Qu.ADDED),!o){if(a)this.dirtifyFragment(t);else{var c=t.transformable;c&&this.dirtyWorldTransform(t,c)}if(i){var u,f=!0===(null===(u=e.ownerDocument)||void 0===u||null===(u=u.defaultView)||void 0===u||null===(u=u.getConfig())||void 0===u||null===(u=u.future)||void 0===u?void 0:u.experimentalCancelEventPropagation);t.dispatchEvent(cg,f,f)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Qu.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtyWorldTransform(t,r),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return nf(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;wg[0]=e[0],wg[1]=e[1],wg[2]=null!==(n=e[2])&&void 0!==n?n:0,ve(i.localPosition,wg)||(ae(i.localPosition,wg),r&&this.dirtyLocalTransform(t,i))}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;ve(e,fg)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=e[0],l=e[1],c=e[2],u=i*c-a*l,f=a*s-r*c,d=r*l-i*s;u+=u,f+=f,d+=d,t[0]=s+o*u+i*d-a*f,t[1]=l+o*f+a*u-r*d,t[2]=c+o*d+r*f-i*u}(e,e,n.localRotation),se(n.localPosition,n.localPosition,e),this.dirtyLocalTransform(t,n))}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=Ne(mg,e,n,r,i));var o=t.transformable;Te(o.localRotation,e),a&&this.dirtyLocalTransform(t,o)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Ae(Eg,e[0],e[1],e[2]),Pe(n.localRotation,n.localRotation,Eg),this.dirtyLocalTransform(t,n)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;oe(gg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),ve(gg,i.localScale)||(ae(i.localScale,gg),r&&this.dirtyLocalTransform(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r=t.transformable;!function(t,e,n){t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2]}(r.localScale,r.localScale,oe(gg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtyLocalTransform(t,r)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(pg,e,n));var i=t.transformable;!function(t,e){t[0]=e[0],t[1]=e[1]}(i.localSkew,e),r&&this.dirtyLocalTransform(t,i)}},{key:"setLocalEulerAngles",value:function(t,e){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Ae(r.localRotation,e[0],e[1],e[2]),n&&this.dirtyLocalTransform(t,r)}},{key:"setLocalTransform",value:function(t,e){var n=Ft(yg,e),r=Wt(bg,e),i=zt(xg,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,dg,!1),this.setLocalPosition(t,fg,!1),this.setLocalEulerAngles(t,fg,void 0,void 0,!1),this.setLocalSkew(t,ug,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return Ft(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Wt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return zt(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t),e.worldTransform):e.worldTransform}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(kg[0]=e[0],kg[1]=e[1],kg[2]=null!==(n=e[2])&&void 0!==n?n:0,!ve(this.getPosition(t),kg)){if(ae(r.position,kg),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;xt(Mg,i.worldTransform),Et(Mg,Mg),pe(r.localPosition,kg,Mg)}else ae(r.localPosition,kg);this.dirtyLocalTransform(t,r)}}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=oe(gg,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),ve(e,fg)||(se(gg,this.getPosition(t),e),this.setPosition(t,gg))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=_e(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Te(mg,o),Se(mg,mg),Ee(a.localRotation,mg,e),Ce(a.localRotation,a.localRotation),this.dirtyLocalTransform(t,a)}else this.setLocalRotation(t,e)}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=mg;Ae(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);Te(Sg,a),Se(Sg,Sg),Ee(r,Sg,r),Ee(n.localRotation,r,i),Ce(n.localRotation,n.localRotation),this.dirtyLocalTransform(t,n)}else this.rotateLocal(t,e)}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtyLocalTransform(t,n)}}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Ae(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Te(Og,Se(mg,r)),Pe(n.localRotation,n.localRotation,Og),this.dirtyLocalTransform(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!xu.isEmpty(r)){var i=n||new xu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Rg.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new xu}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach(function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new xu).update(r.center,r.halfExtents))}),a||(a=new xu),n){var o=Jh(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=hg;t.parentNode.transformable&&(e=Et(vg,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!xu.isEmpty(n)){var r=new xu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);xu.isEmpty(r)||(n=new xu).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=Sc(n.getMin(),2),o=a[0],s=a[1],l=Sc(n.getMax(),2),c=l[0],u=l[1];return new Eu(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),c-o,u-s)}return new Eu((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;nf(t.transformable),function(t,e){t.dirtyFlag&&(e?At(t.worldTransform,e.worldTransform,t.localTransform):xt(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,r,i,a,o,s,l=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization),c=e[e.length-1],u=(null==c?void 0:c.transformDirty)||(null===(r=t.transformable)||void 0===r?void 0:r.localDirtyFlag);t.transformable&&((o=t.transformable).dirtyFlag||(o.dirtyFlag=u));(this.internalUpdateTransform(t),u)&&(null===(s=t.dirty)||void 0===s||s.call(t,!0,!0));var f=(null===(i=t.renderable)||void 0===i?void 0:i.boundsDirty)||(null===(a=t.renderable)||void 0===a?void 0:a.renderBoundsDirty);if((u||f)&&!1===(null==c?void 0:c.shapeUpdated)&&l)for(var d=e.length-1;d>=0;){var h,p,g=e[d];if(g.shapeUpdated)break;null===(h=(p=g.node).dirty)||void 0===h||h.call(p,!0,!0),g.shapeUpdated=!0,d-=1}return u}},{key:"syncHierarchy",value:function(t){for(var e,n,r=[t],i=t.parentNode?[{node:t.parentNode,transformDirty:(null===(e=t.parentNode.transformable)||void 0===e?void 0:e.localDirtyFlag)||(null===(n=t.parentNode.transformable)||void 0===n?void 0:n.dirtyFlag),shapeUpdated:!1}]:[];r.length>0;){for(var a=r.pop(),o=i[i.length-1];i.length>0&&a.parentNode!==o.node;)o=i.pop();var s=this.internalUpdateElement(a,i);if(a.childNodes.length>0){for(var l=a.childNodes.length-1;l>=0;l--)r.push(a.childNodes[l]);i.push({node:a,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){rp(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtifyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n,r=this,i=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization);e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),i||t.childNodes.forEach(function(t){var e=t.transformable;r.dirtifyWorldInternal(t,e)}))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=!0===(null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);r;){var a,o;if(null===(a=(o=r).dirty)||void 0===a||a.call(o,!0,!0),i)break;r=r.parentNode}n&&t.forEach(function(t){var e;null===(e=t.dirty)||void 0===e||e.call(t,!0,!0)}),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,n)}},{key:"dirtifyFragment",value:function(t){var e,n,r=t.transformable;r&&(r.dirtyFlag=!0,r.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var i=t.childNodes.length,a=0;a<i;a++)this.dirtifyFragment(t.childNodes[a]);t.nodeName===uu.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t,e,n=this,r=new Set,i=function(e,i){if(e.isConnected&&!r.has(e)&&e.nodeName!==uu.FRAGMENT){if(n.boundsChangedEvent.detail=i,n.boundsChangedEvent.target=e,e.isMutationObserved)e.dispatchEvent(n.boundsChangedEvent);else{var a;if(void 0===t)t=!0===(null===(a=e.ownerDocument.defaultView)||void 0===a||null===(a=a.getConfig())||void 0===a||null===(a=a.future)||void 0===a?void 0:a.experimentalCancelEventPropagation);e.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0,t)}r.add(e)}};this.pendingEvents.forEach(function(t,n){if(n.nodeName!==uu.FRAGMENT){var r;if(void 0===e)e=!0===(null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r||null===(r=r.getConfig())||void 0===r||null===(r=r.future)||void 0===r?void 0:r.experimentalAttributeUpdateOptimization);Ag.affectChildren=t,e?i(n,Ag):t?n.forEach(function(t){i(t,Ag)}):i(n,Ag)}}),r.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,r=this.displayObjectDependencyMap.get(t);if(r){var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalCancelEventPropagation;Object.keys(r).forEach(function(t){r[t].forEach(function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new ag(ig.ATTR_MODIFIED,e,n,n,t,ag.MODIFICATION,n,n),i,i),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)})})}}}])}(),Tg=function(){return vc(function t(e){if(pc(this,t),e<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map},[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var n=this.cache.keys().next().value;this.cache.delete(n)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Ng={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Pg=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Cg=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Lg=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),jg=function(){return vc(function t(e){var n=this;pc(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Lg.exec(e)&&!Cg.exec(t))},this.trimByKinsokuShorui=function(t){var e=bc(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e,this.charWidthCache=new Tg(100)},[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=Ng.MetricsString+Ng.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(Ng.BaselineSymbol).width),l=Ng.HeightMultiplier*s;s=s*Ng.BaselineMultiplier|0,r.width=o,r.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var c=i.getImageData(0,0,o||1,l||1).data,u=c.length,f=4*o,d=0,h=0,p=!1;for(d=0;d<s;++d){for(var g=0;g<f;g+=4)if(255!==c[h+g]){p=!0;break}if(p)break;h+=f}for(n.ascent=s-d,h=u-f,p=!1,d=l;d>s;--d){for(var v=0;v<f;v+=4)if(255!==c[h+v]){p=!0;break}if(p)break;h-=f}return n.descent=d-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,l=e.lineWidth,c=void 0===l?1:l,u=e.textBaseline,f=void 0===u?"alphabetic":u,d=e.textAlign,h=void 0===d?"start":d,p=e.letterSpacing,g=void 0===p?0:p,v=e.textPath,m=e.leading,y=void 0===m?0:m,b=Mp(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var w=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);w.font=b,e.isOverflowing=!1;var k=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(k.length),O=0;if(!v){for(var E=0;E<k.length;E++){var S=w.measureText(k[E]).width+(k[E].length-1)*g;M[E]=S,O=Math.max(O,S)}var A=O+c,_=s||x.fontSize+c,T=Math.max(_,x.fontSize+c)+(k.length-1)*(_+y),N=0;return"middle"===f?N=-T/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?N=-T:"top"!==f&&"hanging"!==f||(N=0),{font:b,width:A,height:T,lines:k,lineWidths:M,lineHeight:_+=y,maxLineWidth:O,fontProperties:x,lineMetrics:M.map(function(t,e){var n=0;return"center"===h||"middle"===h?n-=t/2:"right"!==h&&"end"!==h||(n-=t),new Eu(n-c/2,N+e*_,t+c,_)})}}v.getTotalLength();for(var P=0;P<k.length;P++)w.measureText(k[P]).width,k[P].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=Array.from(t);if(0===i.length)return"";var a=this,o=e.wordWrapWidth,s=void 0===o?0:o,l=e.letterSpacing,c=void 0===l?0:l,u=e.maxLines,f=void 0===u?1/0:u,d=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=s+c,g="";"ellipsis"===d?g="...":d&&"clip"!==d&&(g=d);var v=[""],m=0,y=0,b=-1,x=Mp(e),w=this.charWidthCache.get(x);w||(w=new Tg(500),this.charWidthCache.put(x,w));var k=function(t){return r.getFromCache(t,c,w,h)},M=k(g);function O(t,e,n,r){for(;k(t)<r&&e<i.length-1&&!a.isNewline(i[e+1]);)t+=i[e+=1];for(;k(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function E(t,e){if(!(M<=0||M>p))if(v[t]){var n=O(v[t],e,b+1,p-M);v[t]=n.lineTxt+g}else v[t]=g}for(var S=0;S<i.length;S++){var A=i[S],_=i[S-1],T=i[S+1],N=k(A);if(this.isNewline(A)){if(m+1>=f){S<i.length-1&&E(m,S-1),e.isOverflowing=!0;break}b=S-1,y=0,v[m+=1]=""}else{if(N>p){E(m,S-1),e.isOverflowing=!0;break}if(y>0&&y+N>p){var P=O(v[m],S-1,b+1,p);if(P.txtLastCharIndex!==S-1){if(v[m]=P.lineTxt,P.txtLastCharIndex===i.length-1)break;S=P.txtLastCharIndex+1,A=i[S],_=i[S-1],T=i[S+1],N=k(A)}if(m+1>=f){E(m,S-1),e.isOverflowing=!0;break}if(b=S-1,y=0,v[m+=1]="",this.isBreakingSpace(A))continue;this.canBreakInLastChar(A)||(v=this.trimToBreakable(v),y=this.sumTextWidthByCache(v[m]||"",k)),this.shouldBreakByKinsokuShorui(A,T)&&(v=this.trimByKinsokuShorui(v),y+=k(_||""))}y+=N,v[m]+=A}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Ng.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Ng.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=bc(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+1,o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(a,n.length),e[e.length-2]=n.slice(0,o),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Pg.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce(function(t,n){return t+e(n)},0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!Pg.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n.get(t);if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n.put(t,i)}return i}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Rg={},Ig=(sg=new Wp,lg=new zp,fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(og={},uu.FRAGMENT,null),uu.CIRCLE,new Ip),uu.ELLIPSE,new Dp),uu.RECT,sg),uu.IMAGE,sg),uu.GROUP,new Gp),uu.LINE,new Bp),uu.TEXT,new $p(Rg)),uu.POLYLINE,lg),uu.POLYGON,lg),fc(fc(fc(og,uu.PATH,new Fp),uu.HTML,new Yp),uu.MESH,null)),Dg=function(t){var e=new jh,n=new Dh;return fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},af.PERCENTAGE,null),af.NUMBER,new Wh),af.ANGLE,new Ch),af.DEFINED_PATH,new Lh),af.PAINT,e),af.COLOR,e),af.FILTER,new Rh),af.LENGTH,n),af.LENGTH_PERCENTAGE,n),af.LENGTH_PERCENTAGE_12,new Bh),fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t,af.LENGTH_PERCENTAGE_14,new Fh),af.COORDINATE,new Dh),af.OFFSET_DISTANCE,new $h),af.OPACITY_VALUE,new Gh),af.PATH,new Yh),af.LIST_OF_POINTS,new Hh),af.SHADOW_BLUR,new Vh),af.TEXT,new qh),af.TEXT_TRANSFORM,new Xh),af.TRANSFORM,new Lp),fc(fc(fc(t,af.TRANSFORM_ORIGIN,new jp),af.Z_INDEX,new Rp),af.MARKER,new zh)}();Rg.CameraContribution=Ku,Rg.AnimationTimeline=null,Rg.EasingFunction=null,Rg.offscreenCanvasCreator=new Jp,Rg.sceneGraphSelector=new rg,Rg.sceneGraphService=new _g(Rg),Rg.textService=new jg(Rg),Rg.geometryUpdaterFactory=Ig,Rg.CSSPropertySyntaxFactory=Dg,Rg.styleValueRegistry=new Nh(Rg),Rg.layoutRegistry=null,Rg.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==lc?lc:{},Rg.enableStyleSyntax=!0,Rg.enableSizeAttenuation=!1;var Bg=0,Fg=new ag(ig.INSERTED,null,"","","",0,"",""),zg=new ag(ig.REMOVED,null,"","","",0,"",""),Wg=new Up(ig.DESTROY),$g=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).entity=Bg++,t.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:Zu.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return Ec(e,t),vc(e,[{key:"dirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.renderable.dirty=t,e&&(this.renderable.boundsDirty=t,this.renderable.renderBoundsDirty=t)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(Su)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return Rg.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(rp(this)||t.nodeName!==uu.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Fg.relatedNode=this,t.dispatchEvent(Fg)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e,n,r=!0===(null===(e=this.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return zg.relatedNode=this,t.dispatchEvent(zg,r,r),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Rg.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Rg.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Rg.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Rg.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Rg.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Rg.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Rg.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Rg.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Rg.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach(function(r){return r===e||!t(r)||(n=r,!1)}),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach(function(r){r!==e&&t(r)&&n.push(r)}),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach(function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,bc(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(e){return t.appendChild(e)})}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(e,n){return t.appendChild(e,n)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var t,e=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(Wg,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Rg.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Rg.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Rg.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Rg.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Rg.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(Su)}},{key:"getAttributeNode",value:function(t){throw new Error(Su)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(Su)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(Su)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(Su)}},{key:"removeAttributeNode",value:function(t){throw new Error(Su)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(Su)}},{key:"setAttributeNode",value:function(t){throw new Error(Su)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(Su)}},{key:"toggleAttribute",value:function(t,e){throw new Error(Su)}}])}(Zp);function Gg(t){return!(null==t||!t.nodeName)}var Yg=Rg.globalThis.Proxy?Rg.globalThis.Proxy:function(){},Hg=new ag(ig.ATTR_MODIFIED,null,null,null,null,ag.MODIFICATION,null,null),Vg=ee(),qg=Me(),Xg=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||uu.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Rg.enableStyleSyntax&&(n.style=new Yg({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return Ec(e,t),vc(e,[{key:"destroy",value:function(){Nc(e,"destroy",this,3)([]),this.getAnimations().forEach(function(t){t.cancel()})}},{key:"cloneNode",value:function(t,e){var n=hc({},this.attributes);for(var r in n){var i=n[r];Gg(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor(hc(hc({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach(function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}}),a}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Rg.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];V(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),Nc(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.attributes[t],i=this.parsedStyle[t];Rg.styleValueRegistry.processProperties(this,fc({},t,e),n),this.dirty();var a,o=this.parsedStyle[t];if(this.isConnected)if(Hg.relatedNode=this,Hg.prevValue=r,Hg.newValue=e,Hg.attrName=t,Hg.prevParsedValue=i,Hg.newParsedValue=o,this.isMutationObserved)this.dispatchEvent(Hg);else{var s,l=!0===(null===(s=this.ownerDocument.defaultView.getConfig().future)||void 0===s?void 0:s.experimentalCancelEventPropagation);Hg.target=this,this.ownerDocument.defaultView.dispatchEvent(Hg,!0,l)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(a=this.attributeChangedCallback)||void 0===a||a.call(this,t,r,e,i,o))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=Sc(t.getMin(),2),n=e[0],r=e[1],i=Sc(t.getMax(),2),a=i[0],o=i[1];return new Eu(n,r,a-n,o-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Rg.sceneGraphService.setOrigin(this,Nu(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return Rg.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Rg.sceneGraphService.setPosition(this,Nu(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Rg.sceneGraphService.setLocalPosition(this,Nu(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Rg.sceneGraphService.translate(this,Nu(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Rg.sceneGraphService.translateLocal(this,Nu(t,e,n,!1)),this}},{key:"getPosition",value:function(){return Rg.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Rg.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Nu(t,e=e||t,n=n||t,!1)),Rg.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Nu(t,e=e||t,n=n||t,!1)),Rg.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Rg.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Rg.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return ju(Sc(Iu(Vg,Rg.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return ju(Sc(Iu(Vg,Rg.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Rg.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Rg.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return b(e)&&b(n)?Rg.sceneGraphService.rotateLocal(this,0,0,t):Rg.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return b(e)&&b(n)?Rg.sceneGraphService.rotate(this,0,0,t):Rg.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Rg.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Rg.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Rg.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Rg.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Rg.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Rg.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Rg.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Rg.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Rg.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Rg.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,bc(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,bc(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?w(i)?(Object.keys(i).forEach(function(e){t.setAttribute(e,i[e])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=Sc(Ft(Vg,e),2),r=n[0],i=n[1],a=Sc(zt(Vg,e),2),o=a[0],s=a[1],l=Wt(qg,e),c=Sc(Iu(Vg,l),3),u=c[0],f=c[2];return Du(u||f,r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=Sc(Bu(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setEulerAngles(o).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=Sc(Bu(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setLocalEulerAngles(o).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach(function(t){t.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(t){t.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}($g);Xg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ug=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:uu.CIRCLE},t)])}return Ec(e,t),vc(e)}(Xg);Ug.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Kg=["style"],Zg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=su(n,Kg);return pc(this,e),(t=Mc(this,e,[hc({style:r},i)])).isCustomElement=!0,t}return Ec(e,t),vc(e)}(Xg);Zg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Qg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:uu.ELLIPSE},t)])}return Ec(e,t),vc(e)}(Xg);Qg.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return pc(this,e),Mc(this,e,[{type:uu.FRAGMENT}])}return Ec(e,t),vc(e)}(Xg)).PARSED_STYLE_LIST=new Set(["class","className"]);var Jg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:uu.GROUP},t)])}return Ec(e,t),vc(e)}(Xg);Jg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var tv=["style"],ev=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=su(n,tv);return pc(this,e),(t=Mc(this,e,[hc({type:uu.HTML,style:r},i)])).cullable.enable=!1,t}return Ec(e,t),vc(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=Et(yt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!xu.isEmpty(e)){var n=new xu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Xg);ev.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var nv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:uu.IMAGE},t)])}return Ec(e,t),vc(e)}(Xg);nv.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var rv=["style"],iv=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=su(n,rv);pc(this,e),(t=Mc(this,e,[hc({type:uu.LINE,style:hc({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd;return o&&Gg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),s&&Gg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ec(e,t),vc(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Gg(r)&&(this.markerStartAngle=0,r.remove()),i&&Gg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Gg(r)&&(this.markerEndAngle=0,r.remove()),i&&Gg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=e.x1,s=e.x2,l=e.y1,c=e.y2,u=t?n:r;if(u&&Gg(u)){var f,d,h,p,g,v,m;t?(p=o,g=l,d=s-o,h=c-l,v=i||0,m=this.markerStartAngle):(p=s,g=c,d=o-s,h=l-c,v=a||0,m=this.markerEndAngle),f=Math.atan2(h,d),u.setLocalEulerAngles(180*f/Math.PI+m),u.setLocalPosition(p+Math.cos(f)*v,g+Math.sin(f)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=Bc(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=pe(ee(),ie(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Ou(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return Dc(t.x1,t.y1,t.x2,t.y2)}}])}(Xg);iv.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var av=["style"],ov=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=su(n,av);pc(this,e),(t=Mc(this,e,[hc({type:uu.PATH,style:r,initialParsedStyle:{miterLimit:4,d:hc({},rf)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,l=a.markerMid;return o&&Gg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&Gg(l)&&t.placeMarkerMid(l),s&&Gg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ec(e,t),vc(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Gg(r)&&(this.markerStartAngle=0,r.remove()),i&&Gg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Gg(r)&&(this.markerEndAngle=0,r.remove()),i&&Gg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=t?n:r;if(o&&Gg(o)){var s,l,c,u,f,d,h;if(t){var p=Sc(this.getStartTangent(),2),g=p[0],v=p[1];u=v[0],f=v[1],l=g[0]-v[0],c=g[1]-v[1],d=i||0,h=this.markerStartAngle}else{var m=Sc(this.getEndTangent(),2),y=m[0],b=m[1];u=b[0],f=b[1],l=y[0]-b[0],c=y[1]-b[1],d=a||0,h=this.markerEndAngle}s=Math.atan2(c,l),o.setLocalEulerAngles(180*s/Math.PI+h),o.setLocalPosition(u+Math.cos(s)*d,f+Math.sin(s)*d)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Gg(t))for(var n=1;n<e.length-1;n++){var r=Sc(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Gd(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return En(t,e,Ie(Ie({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=pe(ee(),ie(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ou(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Gd(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Xg);ov.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var sv=["style"],lv=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=su(n,sv);pc(this,e),(t=Mc(this,e,[hc({type:uu.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,l=a.markerMid;return o&&Gg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&Gg(l)&&t.placeMarkerMid(l),s&&Gg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ec(e,t),vc(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Gg(r)&&(this.markerStartAngle=0,r.remove()),i&&Gg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Gg(r)&&(this.markerEndAngle=0,r.remove()),i&&Gg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=(e.points||{}).points,s=t?n:r;if(s&&Gg(s)&&o){var l,c,u,f,d,h,p;if(f=o[0][0],d=o[0][1],t)c=o[1][0]-o[0][0],u=o[1][1]-o[0][1],h=i||0,p=this.markerStartAngle;else{var g=o.length;this.parsedStyle.isClosed?(c=o[g-1][0]-o[0][0],u=o[g-1][1]-o[0][1]):(f=o[g-1][0],d=o[g-1][1],c=o[g-2][0]-o[g-1][0],u=o[g-2][1]-o[g-1][1]),h=a||0,p=this.markerEndAngle}l=Math.atan2(u,c),s.setLocalEulerAngles(180*l/Math.PI+p),s.setLocalPosition(f+Math.cos(l)*h,d+Math.sin(l)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Gg(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Xg);lv.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var cv=["style"],uv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=su(t,cv);return pc(this,e),Mc(this,e,[hc({type:uu.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return Ec(e,t),vc(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Yc(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach(function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=Dc(t[0],t[1],n[e+1][0],n[e+1][1]),o+=i,r[1]=o/s,a.push(r))}),this.parsedStyle.points.segments=a}var l=0,c=0;this.parsedStyle.points.segments.forEach(function(e,n){t>=e[0]&&t<=e[1]&&(l=(t-e[0])/(e[1]-e[0]),c=n)});var u=Bc(n[c][0],n[c][1],n[c+1][0],n[c+1][1],l),f=u.x,d=u.y,h=pe(ee(),ie(f,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Ou(h[0],h[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(lv);uv.PARSED_STYLE_LIST=new Set([].concat(bc(lv.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var fv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:uu.RECT},t)])}return Ec(e,t),vc(e)}(Xg);fv.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var dv=["style"],hv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=su(t,dv);return pc(this,e),Mc(this,e,[hc({type:uu.TEXT,style:hc({fill:"black"},n)},r)])}return Ec(e,t),vc(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Xg);hv.PARSED_STYLE_LIST=new Set([].concat(bc(Xg.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var pv=function(){return vc(function t(){pc(this,t),this.registry={},this.define(uu.CIRCLE,Ug),this.define(uu.ELLIPSE,Qg),this.define(uu.RECT,fv),this.define(uu.IMAGE,nv),this.define(uu.LINE,iv),this.define(uu.GROUP,Jg),this.define(uu.PATH,ov),this.define(uu.POLYGON,lv),this.define(uu.POLYLINE,uv),this.define(uu.TEXT,hv),this.define(uu.HTML,ev)},[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),gv=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,a=t.syntax;Rg.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:a})},vv=function(t){function e(){var t;pc(this,e),(t=Mc(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Rg.AnimationTimeline(t)}catch(t){}var n={};return Ah.forEach(function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=y(i)?i(uu.GROUP):i)}),t.documentElement=new Jg({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return Ec(e,t),vc(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?hv:Jg);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Su)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach(function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)}),a.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return null;var l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,u=l.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement}},{key:"elementFromPoint",value:(r=au(ru().mark(function t(e,n){var r,i,a,o,s,l,c,u,f,d,h;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(i<0||a<0||i>s||a>l)){t.next=1;break}return t.abrupt("return",null);case 1:return c=this.defaultView.viewport2Client({x:i,y:a}),u=c.x,f=c.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 2:return d=t.sent,h=d.picked,t.abrupt("return",h&&h[0]||this.documentElement);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return[];var l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,u=l.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f}},{key:"elementsFromPoint",value:(n=au(ru().mark(function t(e,n){var r,i,a,o,s,l,c,u,f,d,h;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(i<0||a<0||i>s||a>l)){t.next=1;break}return t.abrupt("return",[]);case 1:return c=this.defaultView.viewport2Client({x:i,y:a}),u=c.x,f=c.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 2:return d=t.sent,(h=d.picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),t.abrupt("return",h);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Au)}},{key:"insertBefore",value:function(t,e){throw new Error(Au)}},{key:"removeChild",value:function(t,e){throw new Error(Au)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Au)}},{key:"append",value:function(){throw new Error(Au)}},{key:"prepend",value:function(){throw new Error(Au)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Zp),mv=function(){function t(e){pc(this,t),this.strategies=e}return vc(t,[{key:"apply",value:function(e){var n=e.config,r=e.camera,i=e.renderingService,a=e.renderingContext,o=this.strategies;i.hooks.cull.tap(t.tag,function(t){if(t){var e,i=t.cullable;if(0===o.length?i.visible=a.unculledEntities.indexOf(t.entity)>-1:i.visible=o.every(function(e){return e.isVisible(r,t)}),!t.isCulled()&&t.isVisible())return t;var s=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return t.dispatchEvent(new Up(ig.CULLED),s,s),null}return t}),i.hooks.afterRender.tap(t.tag,function(t){t.cullable.visibilityPlaneMask=-1})}}])}();mv.tag="Culling";var yv=function(){function t(){var e=this;pc(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new qp(null),this.rootWheelEvent=new Xp(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=ou(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.bootstrapEvent(e.rootPointerEvent,o,r,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=ou(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.bootstrapEvent(e.rootPointerEvent,o,i,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return vc(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)}),r.hooks.pointerDown.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=ou(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=n.bootstrapEvent(n.rootPointerEvent,o,i,t);n.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=ou(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=e.value,l=n.bootstrapEvent(n.rootPointerEvent,s,i,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,function(t){var e,r=ou(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=e.value,o=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(o)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,o=i.y;t.viewport.x=a,t.viewport.y=o;var s=this.context.eventService.viewport2Canvas(t.viewport),l=s.x,c=s.y;return t.canvas.x=l,t.canvas.y=c,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ep[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var a=this.context.eventService.viewport2Canvas(e.viewport),o=a.x,s=a.y;return e.canvas.x=o,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=np.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];V(i.button)&&(i.button=0),V(i.buttons)&&(i.buttons=1),V(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),V(i.width)&&(i.width=i.radiusX||1),V(i.height)&&(i.height=i.radiusY||1),V(i.tiltX)&&(i.tiltX=0),V(i.tiltY)&&(i.tiltY=0),V(i.pointerType)&&(i.pointerType="touch"),V(i.pointerId)&&(i.pointerId=i.identifier||0),V(i.pressure)&&(i.pressure=i.force||.5),V(i.twist)&&(i.twist=0),V(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;V(a.isPrimary)&&(a.isPrimary=!0),V(a.width)&&(a.width=1),V(a.height)&&(a.height=1),V(a.tiltX)&&(a.tiltX=0),V(a.tiltY)&&(a.tiltY=0),V(a.pointerType)&&(a.pointerType="mouse"),V(a.pointerId)&&(a.pointerId=1),V(a.pressure)&&(a.pressure=.5),V(a.twist)&&(a.twist=0),V(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();yv.tag="Event";var bv=[uu.CIRCLE,uu.ELLIPSE,uu.IMAGE,uu.RECT,uu.LINE,uu.POLYLINE,uu.POLYGON,uu.TEXT,uu.PATH,uu.HTML],xv=function(){return vc(function t(){pc(this,t)},[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(xu.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||ku.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==ku.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===ku.OUTSIDE||n===ku.INSIDE)return n;for(var i=ku.INSIDE,a=bv.indexOf(t.nodeName)>-1,o=0,s=r.length;o<s;++o){var l=1<<o;if(0!==(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,f=c.distance;if(fe(u,e.getPositiveFarPoint(r[o]))+f<0)return ku.OUTSIDE;fe(u,e.getNegativeFarPoint(r[o]))+f<0&&(i|=l)}}return i}}])}(),wv=function(){function t(){pc(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return vc(t,[{key:"apply",value:function(e){var n,r,i=this,a=e.config,o=e.renderingService,s=e.renderingContext,l=e.rBushRoot,c=s.root.ownerDocument.defaultView;this.rBush=l;var u=function(t){o.dirtify()},f=function(t){i.syncTasks.set(t.target,t.detail.affectChildren),o.dirtify()},d=function(t){var e=t.target;Rg.enableSizeAttenuation&&Rg.styleValueRegistry.updateSizeAttenuation(e,c.getCamera().getZoom())},h=function(t){var e=t.target,n=e.rBushNode;null!=n&&n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),Rg.sceneGraphService.dirtyToRoot(e),o.dirtify()};o.hooks.init.tap(t.tag,function(){c.addEventListener(ig.MOUNTED,d),c.addEventListener(ig.UNMOUNTED,h),c.addEventListener(ig.ATTR_MODIFIED,u),c.addEventListener(ig.BOUNDS_CHANGED,f)}),o.hooks.destroy.tap(t.tag,function(){c.removeEventListener(ig.MOUNTED,d),c.removeEventListener(ig.UNMOUNTED,h),c.removeEventListener(ig.ATTR_MODIFIED,u),c.removeEventListener(ig.BOUNDS_CHANGED,f),i.syncTasks.clear()});var p=null!==(n=Rg.globalThis.requestIdleCallback)&&void 0!==n?n:pp.bind(Rg.globalThis),g=!0===(null===(r=a.future)||void 0===r?void 0:r.experimentalRICSyncRTree);o.hooks.endFrame.tap(t.tag,function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,p(function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0})):g&&Rg.globalThis.requestIdleCallback&&Rg.globalThis.cancelIdleCallback?(Rg.globalThis.cancelIdleCallback(i.ricSyncRTreeId),i.ricSyncRTreeId=Rg.globalThis.requestIdleCallback(function(){return i.syncRTree()})):i.syncRTree()})}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new xu),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=Sc(r.getMin(),2),o=a[0],s=a[1],l=Sc(r.getMax(),2),c=l[0],u=l[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=c,n.aabb.maxY=u}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach(function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement}),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();wv.tag="Prepare";var kv=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Mv=new Up(ig.MOUNTED),Ov=new Up(ig.UNMOUNTED),Ev=new Up(kv.BEFORE_RENDER),Sv=new Up(kv.RERENDER),Av=new Up(kv.AFTER_RENDER),_v=function(t){function e(t){var n;pc(this,e),(n=Mc(this,e)).Element=Xg,n.inited=!1,n.context={};var r=t.container,i=t.canvas,a=t.renderer,o=t.width,s=t.height,l=t.background,c=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,f=t.cleanUpOnDestroy,d=void 0===f||f,h=t.offscreenCanvas,p=t.devicePixelRatio,g=t.requestAnimationFrame,v=t.cancelAnimationFrame,m=t.createImage,y=t.supportsTouchEvents,b=t.supportsPointerEvents,x=t.isTouchEvent,w=t.isMouseEvent,k=t.dblClickSpeed,M=o,O=s,E=p||Kh&&window.devicePixelRatio||1;return E=E>=1?Math.ceil(E):1,i&&(M=o||function(t){var e=tp(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/E,O=s||function(t){var e=tp(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/E),n.customElements=new pv,n.devicePixelRatio=E,n.requestAnimationFrame=null!=g?g:pp.bind(Rg.globalThis),n.cancelAnimationFrame=null!=v?v:gp.bind(Rg.globalThis),n.createImage=null!=m?m:function(){return new window.Image},n.supportsTouchEvents=null!=y?y:"ontouchstart"in Rg.globalThis,n.supportsPointerEvents=null!=b?b:!!Rg.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof Rg.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!Rg.globalThis.MouseEvent||t instanceof Rg.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Rg.globalThis.PointerEvent))},h&&(Rg.offscreenCanvas=h),n.document=new vv,n.document.defaultView=n,u||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Uh.has(r)&&Uh.get(r).destroy(n),Uh.set(r,e)}}(r,n,d),n.initRenderingContext(hc(hc({},t),{},{width:M,height:O,background:null!=l?l:"transparent",cursor:null!=c?c:"default",cleanUpOnDestroy:d,devicePixelRatio:E,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=k?k:200})),n.initDefaultCamera(M,O,a.clipSpaceNearZ),n.initRenderer(a,!0),n}return Ec(e,t),vc(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Rg.CameraContribution;i.clipSpaceNearZ=n,i.setType(Hu.EXPLORING,Vu.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Xu,function(){r.context.renderingContext.renderReasons.add(tg.CAMERA_CHANGED),Rg.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()}),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach(function(e){Rg.styleValueRegistry.updateSizeAttenuation(e,t)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise(function(e){t.resolveReadyPromise=function(){e(t)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0;Ff.clearCache();var r=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);n||this.dispatchEvent(new Up(kv.BEFORE_DESTROY),r,r),this.frameId&&this.cancelAnimationFrame(this.frameId);var i=this.getRoot();e&&(this.unmountChildren(i),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),n||this.dispatchEvent(new Up(kv.AFTER_DESTROY),r,r);var a=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};a(Mv),a(Ov),a(Ev),a(Sv),a(Av),a(Hg),a(Fg),a(zg),a(Wg),Rg.textService.clearCache()}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n,r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),a===qu.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e);var o=!0===(null===(n=r.future)||void 0===n?void 0:n.experimentalCancelEventPropagation);this.dispatchEvent(new Up(kv.RESIZE,{width:t,height:e}),o,o)}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e,n=this;t&&(Ev.detail=t,Av.detail=t);var r=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(Ev,r,r),this.getRenderingService().render(this.getConfig(),t,function(){n.dispatchEvent(Sv,r,r)}),this.dispatchEvent(Av,r,r)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new cu,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new yv,new wv,new mv([new xv])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(hc(hc({},Rg),this.context)),this.context.renderingService=new eg(Rg,this.context),this.context.eventService=new Qp(Rg,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then(function(){e.initRenderingService(t,n)}).catch(function(t){console.error(t)})}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var i;e.inited=!0;var a=!0===(null===(i=e.getConfig().future)||void 0===i?void 0:i.experimentalCancelEventPropagation);n?r?e.requestAnimationFrame(function(){e.dispatchEvent(new Up(kv.READY),a,a)}):e.dispatchEvent(new Up(kv.READY),a,a):e.dispatchEvent(new Up(kv.RENDERER_CHANGED),a,a),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach(function(t){var e,n;null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0)}),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()})}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(Rg)})}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),bc((null==n?void 0:n.getPlugins())||[]).reverse().forEach(function(t){t.destroy(Rg)}),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;if(t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited){if(t.isMutationObserved)t.dispatchEvent(Ov);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);Ov.target=t,this.dispatchEvent(Ov,!0,r)}t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rp(t);if(this.inited){if(!t.isConnected&&(t.ownerDocument=this.document,t.isConnected=!0,!n))if(t.isMutationObserved)t.dispatchEvent(Mv);else{var r,i=!0===(null===(r=this.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);Mv.target=t,this.dispatchEvent(Mv,!0,i)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName);t.childNodes.forEach(function(t){e.mountChildren(t,n)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Kp),Tv=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).landmarks=[],t}return Ec(e,t),vc(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=_u(e),this.relAzimuth=_u(t),this.relRoll=_u(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Hu.EXPLORING){var r=Oe(Me(),[1,0,0],Cu((this.rotateWorld?1:-1)*this.relElevation)),i=Oe(Me(),[0,1,0],Cu((this.rotateWorld?1:-1)*this.relAzimuth)),a=Oe(Me(),[0,0,1],Cu(this.relRoll)),o=Ee(Me(),i,r);o=Ee(Me(),o,a);var s=Gt(yt(),o);_t(this.matrix,this.matrix,[0,0,-this.distance]),At(this.matrix,this.matrix,s),_t(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Hu.ORBITING||this.type===Hu.EXPLORING?this._getPosition():this.type===Hu.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Nu(t,e,0),r=ne(this.position);return se(r,r,ce(ee(),this.right,n[0])),se(r,r,ce(ee(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=ne(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Hu.ORBITING||this.type===Hu.EXPLORING?this._getDistance():this.type===Hu.TRACKING&&se(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,l=a.focalPoint,c=void 0===l?this.focalPoint:l,u=a.roll,f=a.zoom,d=new Rg.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),d.setFocalPoint(c[0],null!==(r=c[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=c[2])&&void 0!==i?i:this.focalPoint[2]),d.setRoll(null!=u?u:this.roll),d.setZoom(null!=f?f:this.zoom);var h={name:t,matrix:bt(d.getWorldTransform()),right:ne(d.right),up:ne(d.up),forward:ne(d.forward),position:ne(d.getPosition()),focalPoint:ne(d.getFocalPoint()),distanceVector:ne(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(h),h}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=L(t)?this.landmarks.find(function(e){return e.name===t}):t;if(r){var i=I(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,l=void 0===s?100:s,c=i.easingFunction,u=void 0===c?void 0:c,f=i.onfinish,d=void 0===f?void 0:f,h=i.onframe,p=void 0===h?void 0:h;this.cancelLandmarkAnimation();var g,v=r.position,m=r.focalPoint,y=r.zoom,b=r.roll,x=u||Rg.EasingFunction(o),w=function(){e.setFocalPoint(m),e.setPosition(v),e.setRoll(b),e.setZoom(y),e.computeMatrix(),e.triggerUpdate(),null==d||d()};if(0===l)return w();var k=function(t){void 0===g&&(g=t);var n=t-g;if(n>=l)w();else{var r,i,a=x(n/l),o=ee(),s=ee();if(he(o,e.focalPoint,m,a),he(s,e.position,v,a),i=e.roll*(1-a)+b*a,r=e.zoom*(1-a)+y*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),ye(o,m)+ye(s,v)<=.01&&void 0===y&&void 0===b)return w();e.computeMatrix(),e.triggerUpdate(),n<l&&(null==p||p(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(k))}};this.canvas.requestAnimationFrame(k)}}}])}(Ku);Rg.CameraContribution=Tv;
11
+ var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Vc(c,"_invoke",function(n,r,i){var a,s,l,c=0,u=i||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return a=e,s=0,l=t,d.n=n,o}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!i&&e<u.length;e++){var i,a=u[e],h=d.p,p=a[2];n>3?(i=p===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):a[0]<=h&&((i=n<2&&h<a[1])?(s=0,d.v=r,d.n=a[1]):h<p&&(i=n<3||a[0]>r||r>p)&&(a[4]=n,a[5]=r,d.n=p,s=0))}if(i||n>1)return o;throw f=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){a||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==o)break}catch(e){a=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,i,a),!0),c}var o={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(Vc(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Vc(t,i,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Vc(f,"constructor",c),Vc(c,"constructor",l),l.displayName="GeneratorFunction",Vc(c,i,"GeneratorFunction"),Vc(f),Vc(f,i,"Generator"),Vc(f,r,function(){return this}),Vc(f,"toString",function(){return"[object Generator]"}),(qc=function(){return{w:a,m:d}})()}function Xc(t,e){function n(r,i,a,o){try{var s=t[r](i),l=s.value;return l instanceof Hc?e.resolve(l.v).then(function(t){n("next",t,a,o)},function(t){n("throw",t,a,o)}):e.resolve(l).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,o)})}catch(t){o(t)}}var r;this.next||(Vc(Xc.prototype),Vc(Xc.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Vc(this,"_invoke",function(t,i,a){function o(){return new e(function(e,r){n(t,a,e,r)})}return r=r?r.then(o,o):o()},!0)}function Uc(t,e,n,r,i){return new Xc(qc().w(t,e,n,r),i||Promise)}function Kc(t,e,n,r,i){var a=Uc(t,e,n,r,i);return a.next().then(function(t){return t.done?t.value:a.next()})}function Zc(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}function Qc(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(cc(t)+" is not iterable")}function Jc(){var t=qc(),e=t.m(Jc),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function r(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===n||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function a(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,i[t],e)},delegateYield:function(t,i,a){return e.resultName=i,n(r.d,Qc(t),a)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(Jc=function(){return{wrap:function(e,n,r,i){return t.w(a(e),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:t.m,awrap:function(t,e){return new Hc(t,e)},AsyncIterator:Xc,async:function(t,e,n,i,o){return(r(e)?Uc:Kc)(a(t),e,n,i,o)},keys:Zc,values:Qc}})()}function tu(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function eu(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function o(t){tu(a,r,i,o,s,"next",t)}function s(t){tu(a,r,i,o,s,"throw",t)}o(void 0)})}}function nu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=yc(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ru(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==lc||"undefined"!=typeof self&&self;var iu={exports:{}};!function(t){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-l*u/s+f)),Math.min(a,Math.floor(r+(s-l)*u/s+f)),o)}var d=t[r],h=i,p=a;for(n(t,i,r),o(t[a],d)>0&&n(t,i,a);h<p;){for(n(t,h,p),h++,p--;o(t[h],d)<0;)h++;for(;o(t[p],d)>0;)p--}0===o(t[i],d)?n(t,i,p):n(t,++p,a),p<=r&&(i=p+1),r<=p&&(a=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];l(i,t.leaf?r(o):o)}return i}function l(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;v(t,s)&&(e.leaf?n.push(o):g(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(v(t,a)){if(e.leaf||g(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),l=[],c=[];o||l.length;){if(o||(o=l.pop(),r=l[l.length-1],n=c.pop(),i=!0),o.leaf){var u=a(t,o.children,e);if(-1!==u)return o.children.splice(u,1),l.push(o),this._condense(l),this}i||o.leaf||!g(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(l.push(o),c.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=m([])).leaf=!1,i.height=r;var l=Math.ceil(a/s),c=l*Math.ceil(Math.sqrt(s));y(t,e,n,c,this.compareMinX);for(var u=e;u<=n;u+=c){var f=Math.min(u+c-1,n);y(t,u,f,l,this.compareMinY);for(var d=u;d<=f;d+=l){var h=Math.min(d+l-1,f);i.children.push(this._build(t,d,h,r-1))}}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=f(l),u=h(t,l)-c;u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),l(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;o<=n-e;o++){var l=s(t,0,o,this.toBBox),c=s(t,o,n,this.toBBox),u=p(l,c),d=f(l)+f(c);u<i?(i=u,r=o,a=d<a?d:a):u===i&&d<a&&(a=d,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),c=d(a)+d(o),u=e;u<n-e;u++){var f=t.children[u];l(a,t.leaf?i(f):f),c+=d(a)}for(var h=n-e-1;h>=e;h--){var p=t.children[h];l(o,t.leaf?i(p):p),c+=d(o)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)l(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}(iu);var au=iu.exports,ou=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),su=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),lu=function(){return vc(function t(){pc(this,t),this.plugins=[]},[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)})}}])}(),cu=function(){return vc(function t(e){pc(this,t),this.clipSpaceNearZ=su.NEGATIVE_ONE,this.plugins=[],this.config=hc({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)},[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),uu=se,fu=ae,du=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},hu=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},pu=ce,gu=me,vu=function(){function t(){pc(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return vc(t,[{key:"update",value:function(t,e){fu(this.center,t),fu(this.halfExtents,e),gu(this.min,this.center,this.halfExtents),uu(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){uu(this.center,e,t),pu(this.center,this.center,.5),gu(this.halfExtents,e,t),pu(this.halfExtents,this.halfExtents,.5),fu(this.min,t),fu(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],l=o[1],c=o[2],u=r-s,f=r+s,d=i-l,h=i+l,p=a-c,g=a+c,v=e.center,m=v[0],y=v[1],b=v[2],x=e.halfExtents,w=x[0],k=x[1],M=x[2],O=m-w,E=m+w,S=y-k,A=y+k,_=b-M,T=b+M;O<u&&(u=O),E>f&&(f=E),S<d&&(d=S),A>h&&(h=A),_<p&&(p=_),T>g&&(g=T),n[0]=.5*(u+f),n[1]=.5*(d+h),n[2]=.5*(p+g),o[0]=.5*(f-u),o[1]=.5*(h-d),o[2]=.5*(g-p),this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],l=e[8],c=e[1],u=e[5],f=e[9],d=e[2],h=e[6],p=e[10],g=Math.abs(o),v=Math.abs(s),m=Math.abs(l),y=Math.abs(c),b=Math.abs(u),x=Math.abs(f),w=Math.abs(d),k=Math.abs(h),M=Math.abs(p);n[0]=e[12]+o*i[0]+s*i[1]+l*i[2],n[1]=e[13]+c*i[0]+u*i[1]+f*i[2],n[2]=e[14]+d*i[0]+h*i[1]+p*i[2],r[0]=g*a[0]+v*a[1]+m*a[2],r[1]=y*a[0]+b*a[1]+x*a[2],r[2]=w*a[0]+k*a[1]+M*a[2],gu(this.min,n,r),uu(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=du([0,0,0],this.getMin(),e.getMin()),i=hu([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?fu([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?fu([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),mu=function(){return vc(function t(e,n){pc(this,t),this.distance=e||0,this.normal=n||ie(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return fe(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/be(this.normal);ce(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&i<=1;return a&&n&&he(n,t,e,i),a}}])}(),yu=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),bu=function(){return vc(function t(e){if(pc(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new mu)},[{key:"extractFromVPMatrix",value:function(t){var e=Sc(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15];oe(this.planes[0].normal,a-n,c-o,h-u),this.planes[0].distance=m-p,oe(this.planes[1].normal,a+n,c+o,h+u),this.planes[1].distance=m+p,oe(this.planes[2].normal,a+r,c+s,h+f),this.planes[2].distance=m+g,oe(this.planes[3].normal,a-r,c-s,h-f),this.planes[3].distance=m-g,oe(this.planes[4].normal,a-i,c-l,h-d),this.planes[4].distance=m-v,oe(this.planes[5].normal,a+i,c+l,h+d),this.planes[5].distance=m+v,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})}}])}(),xu=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;pc(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return vc(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),wu=function(){function t(e,n,r,i){pc(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return vc(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=we(e.x,e.y,0,1),i=we(e.x+e.width,e.y,0,1),a=we(e.x,e.y+e.height,0,1),o=we(e.x+e.width,e.y+e.height,0,1),s=xe(),l=xe(),c=xe(),u=xe();ke(s,r,n),ke(l,i,n),ke(c,a,n),ke(u,o,n);var f=Math.min(s[0],l[0],c[0],u[0]),d=Math.min(s[1],l[1],c[1],u[1]),h=Math.max(s[0],l[0],c[0],u[0]),p=Math.max(s[1],l[1],c[1],u[1]);return t.fromRect({x:f,y:d,width:h-f,height:p-d})}}])}(),ku="Method not implemented.",Mu="Use document.documentElement instead.";function Ou(t){return void 0===t?0:t>360||t<-360?t%360:t}var Eu=ee();function Su(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?ne(t):ae(Eu,t):I(t)?r?ie(t,e,n):oe(Eu,t,e,n):r?ie(t[0],t[1]||e,t[2]||n):oe(Eu,t[0],t[1]||e,t[2]||n)}var Au=Math.PI/180;function _u(t){return t*Au}var Tu=180/Math.PI;function Nu(t){return t*Tu}var Pu=Math.PI/2;function Cu(t,e){return 16===e.length?function(t,e){var n,r,i=Sc(zt(ee(),e),3),a=i[0],o=i[1],s=i[2],l=Math.asin(-e[2]/a);return l<Pu?l>-Pu?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,l=a*a,c=n*n+o+s+l,u=n*a-r*i;return u>.499995*c?(t[0]=Pu,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*c?(t[0]=-Pu,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+l)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function Lu(t,e,n,r,i){var a,o,s,l,c,u,f,d,h,p,g=Math.cos(t),v=Math.sin(t);return a=r*g,o=i*v,s=0,l=-r*v,c=i*g,u=0,f=e,d=n,h=1,(p=new gt(9))[0]=a,p[1]=o,p[2]=s,p[3]=l,p[4]=c,p[5]=u,p[6]=f,p[7]=d,p[8]=h,p}function ju(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(e*i-n*r<0&&(e<i?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var l=1/o;r*=l,i*=l}var c=Nu(Math.atan2(n,e));return[t[6],t[7],a,o,c]}var Ru=yt(),Iu=yt(),Du=xe(),Bu=[ee(),ee(),ee()],Fu=ee();function zu(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Wu=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),$u=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Gu=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Yu="updated",Hu=2e-4,Vu=function(){return vc(function t(){pc(this,t),this.clipSpaceNearZ=su.NEGATIVE_ONE,this.eventEmitter=new _c,this.matrix=yt(),this.right=ie(1,0,0),this.up=ie(0,1,0),this.forward=ie(0,0,1),this.position=ie(0,0,1),this.focalPoint=ie(0,0,0),this.distanceVector=ie(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=yt(),this.projectionMatrixInverse=yt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Wu.EXPLORING,this.trackingMode=$u.DEFAULT,this.projectionMode=Gu.PERSPECTIVE,this.frustum=new bu,this.orthoMatrix=yt()},[{key:"isOrtho",value:function(){return this.projectionMode===Gu.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===Wu.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Wu.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Wu.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return Et(yt(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=Ct(yt(),[t,e,0]);this.jitteredProjectionMatrix=At(yt(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Gu.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Gu.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Gu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Gu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Gu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Gu.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=ie(o.x-r,o.y-i,0),l=fe(s,this.right)/re(this.right),c=fe(s,this.up)/re(this.up),u=Sc(this.getPosition(),2),f=u[0],d=u[1],h=Sc(this.getFocalPoint(),2),p=h[0],g=h[1];return this.setPosition(f-l,d-c),this.setFocalPoint(p-l,g-c),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=Gu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(_u(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,l=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var c=this.view.fullWidth,u=this.view.fullHeight;l+=this.view.offsetX*s/c,a-=this.view.offsetY*o/u,s*=this.view.width/c,o*=this.view.height/u}return function(t,e,n,r,i,a,o){var s,l,c=2*a,u=n-e,f=r-i,d=c/u,h=c/f,p=(n+e)/u,g=(r+i)/f,v=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/v,l=-m/v):(s=-(o+a)/v,l=-2*m/v),t[0]=d,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=p,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,l,l+s,a-o,a,t,this.far,this.clipSpaceNearZ===su.ZERO),Et(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=Gu.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=c-s,d=c+s,h=u+l,p=u-l;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=g*this.view.offsetX)+g*this.view.width,p=(h-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===su.NEGATIVE_ONE?qt(this.projectionMatrix,f,d,h,p,i,a):Xt(this.projectionMatrix,f,d,h,p,i,a),Et(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=Su(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=ie(0,1,0);if(this.focalPoint=Su(t,e,n),this.trackingMode===$u.CINEMATIC){var i=le(ee(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=re(i),o=Nu(Math.asin(e/a)),s=90+Nu(Math.atan2(n,t)),l=yt();Pt(l,l,_u(s)),Nt(l,l,_u(o)),r=pe(ee(),[0,1,0],l)}return Et(this.matrix,Ut(yt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Hu&&(this.distance=Hu),this.dollyingStep=this.distance/100;var e=ee();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Ou(t),this.computeMatrix(),this._getAxes(),this.type===Wu.ORBITING||this.type===Wu.EXPLORING?this._getPosition():this.type===Wu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Ou(t),this.computeMatrix(),this._getAxes(),this.type===Wu.ORBITING||this.type===Wu.EXPLORING?this._getPosition():this.type===Wu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Ou(t),this.computeMatrix(),this._getAxes(),this.type===Wu.ORBITING||this.type===Wu.EXPLORING?this._getPosition():this.type===Wu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Oe(Me(),[0,0,1],_u(this.roll));Mt(this.matrix);var e=Oe(Me(),[1,0,0],_u((this.rotateWorld&&this.type!==Wu.TRACKING||this.type===Wu.TRACKING?1:-1)*this.elevation)),n=Oe(Me(),[0,1,0],_u((this.rotateWorld&&this.type!==Wu.TRACKING||this.type===Wu.TRACKING?1:-1)*this.azimuth)),r=Ee(Me(),n,e);r=Ee(Me(),r,t);var i=Gt(yt(),r);this.type===Wu.ORBITING||this.type===Wu.EXPLORING?(_t(this.matrix,this.matrix,this.focalPoint),At(this.matrix,this.matrix,i),_t(this.matrix,this.matrix,[0,0,this.distance])):this.type===Wu.TRACKING&&(_t(this.matrix,this.matrix,this.position),At(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=Su(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ae(this.right,Su(ke(xe(),[1,0,0,0],this.matrix))),ae(this.up,Su(ke(xe(),[0,1,0,0],this.matrix))),ae(this.forward,Su(ke(xe(),[0,0,1,0],this.matrix))),ue(this.right,this.right),ue(this.up,this.up),ue(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=re(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Wu.TRACKING||this.rotateWorld?(this.elevation=Nu(Math.asin(e/r)),this.azimuth=Nu(Math.atan2(-t,-n))):(this.elevation=-Nu(Math.asin(e/r)),this.azimuth=-Nu(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ae(this.position,Su(ke(xe(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){ge(this.distanceVector,[0,0,-this.distance],function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}(vt(),this.matrix)),se(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=le(ee(),this.focalPoint,this.position),this.distance=re(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Gu.ORTHOGRAPHIC){var t=this.position,e=Oe(Me(),[0,0,1],-this.roll*Math.PI/180);$t(this.orthoMatrix,e,ie((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),ie(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=At(yt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Yu)}}},{key:"rotate",value:function(t,e,n){throw new Error(ku)}},{key:"pan",value:function(t,e){throw new Error(ku)}},{key:"dolly",value:function(t){throw new Error(ku)}},{key:"createLandmark",value:function(t,e){throw new Error(ku)}},{key:"gotoLandmark",value:function(t,e){throw new Error(ku)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(ku)}}])}(),qu=function(t){return t[t.Standard=0]="Standard",t}({}),Xu=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Uu=ee(),Ku=yt(),Zu=Me();function Qu(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){$t(t.localTransform,t.localRotation,t.localPosition,ie(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(Mt(Ku),Ku[4]=Math.tan(t.localSkew[0]),Ku[1]=Math.tan(t.localSkew[1]),At(t.localTransform,t.localTransform,Ku));var e=$t(Ku,Ne(Zu,0,0,0,1),oe(Uu,1,1,1),t.localScale,t.origin);At(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],l=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],c=1!==a[0]||1!==a[1]||1!==a[2],u=0!==o[0]||0!==o[1]||0!==o[2];l||c||u?$t(n,i,r,a,o):s?Ct(n,r):Mt(n)}t.localDirtyFlag=!1}}var Ju={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new wu(0,0,0,0)},tf=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function ef(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function nf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function rf(){}var af=.7,of=1/af,sf="\\s*([+-]?\\d+)\\s*",lf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uf=/^#([0-9a-f]{3,8})$/,ff=new RegExp(`^rgb\\(${sf},${sf},${sf}\\)$`),df=new RegExp(`^rgb\\(${cf},${cf},${cf}\\)$`),hf=new RegExp(`^rgba\\(${sf},${sf},${sf},${lf}\\)$`),pf=new RegExp(`^rgba\\(${cf},${cf},${cf},${lf}\\)$`),gf=new RegExp(`^hsl\\(${lf},${cf},${cf}\\)$`),vf=new RegExp(`^hsla\\(${lf},${cf},${cf},${lf}\\)$`),mf={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 yf(){return this.rgb().formatHex()}function bf(){return this.rgb().formatRgb()}function xf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=uf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?wf(e):3===n?new Mf(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?kf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?kf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ff.exec(t))?new Mf(e[1],e[2],e[3],1):(e=df.exec(t))?new Mf(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=hf.exec(t))?kf(e[1],e[2],e[3],e[4]):(e=pf.exec(t))?kf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=gf.exec(t))?Tf(e[1],e[2]/100,e[3]/100,1):(e=vf.exec(t))?Tf(e[1],e[2]/100,e[3]/100,e[4]):mf.hasOwnProperty(t)?wf(mf[t]):"transparent"===t?new Mf(NaN,NaN,NaN,0):null}function wf(t){return new Mf(t>>16&255,t>>8&255,255&t,1)}function kf(t,e,n,r){return r<=0&&(t=e=n=NaN),new Mf(t,e,n,r)}function Mf(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Of(){return`#${_f(this.r)}${_f(this.g)}${_f(this.b)}`}function Ef(){const t=Sf(this.opacity);return`${1===t?"rgb(":"rgba("}${Af(this.r)}, ${Af(this.g)}, ${Af(this.b)}${1===t?")":`, ${t})`}`}function Sf(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Af(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _f(t){return((t=Af(t))<16?"0":"")+t.toString(16)}function Tf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pf(t,e,n,r)}function Nf(t){if(t instanceof Pf)return new Pf(t.h,t.s,t.l,t.opacity);if(t instanceof rf||(t=xf(t)),!t)return new Pf;if(t instanceof Pf)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Pf(o,s,l,t.opacity)}function Pf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Cf(t){return(t=(t||0)%360)<0?t+360:t}function Lf(t){return Math.max(0,Math.min(1,t||0))}function jf(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Rf(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var l=t.apply(this,i);return n.cache=s.set(o,l)||s,l};return n.cache=new(Rf.Cache||Map),Rf.cacheList.push(n.cache),n}ef(rf,xf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yf,formatHex:yf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Nf(this).formatHsl()},formatRgb:bf,toString:bf}),ef(Mf,function(t,e,n,r){return 1===arguments.length?function(t){return t instanceof rf||(t=xf(t)),t?new Mf((t=t.rgb()).r,t.g,t.b,t.opacity):new Mf}(t):new Mf(t,e,n,null==r?1:r)},nf(rf,{brighter(t){return t=null==t?of:Math.pow(of,t),new Mf(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?af:Math.pow(af,t),new Mf(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Mf(Af(this.r),Af(this.g),Af(this.b),Sf(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:Of,formatHex:Of,formatHex8:function(){return`#${_f(this.r)}${_f(this.g)}${_f(this.b)}${_f(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ef,toString:Ef})),ef(Pf,function(t,e,n,r){return 1===arguments.length?Nf(t):new Pf(t,e,n,null==r?1:r)},nf(rf,{brighter(t){return t=null==t?of:Math.pow(of,t),new Pf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?af:Math.pow(af,t),new Pf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Mf(jf(t>=240?t-240:t+120,i,r),jf(t,i,r),jf(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Pf(Cf(this.h),Lf(this.s),Lf(this.l),Sf(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=Sf(this.opacity);return`${1===t?"hsl(":"hsla("}${Cf(this.h)}, ${100*Lf(this.s)}%, ${100*Lf(this.l)}%${1===t?")":`, ${t})`}`}})),Rf.Cache=Map,Rf.cacheList=[],Rf.clearCache=function(){Rf.cacheList.forEach(function(t){return t.clear()})};var If=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Df=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Bf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Ff=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),zf=[{name:"em",unit_type:If.kEms},{name:"px",unit_type:If.kPixels},{name:"deg",unit_type:If.kDegrees},{name:"rad",unit_type:If.kRadians},{name:"grad",unit_type:If.kGradians},{name:"ms",unit_type:If.kMilliseconds},{name:"s",unit_type:If.kSeconds},{name:"rem",unit_type:If.kRems},{name:"turn",unit_type:If.kTurns}],Wf=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),$f=function(t){return t?"number"===t?If.kNumber:"percent"===t||"%"===t?If.kPercentage:function(t){return zf.find(function(e){return e.name===t}).unit_type}(t):If.kUnknown},Gf=function(t){var e=1;switch(t){case If.kPixels:case If.kDegrees:case If.kSeconds:break;case If.kMilliseconds:e=.001;break;case If.kRadians:e=180/Math.PI;break;case If.kGradians:e=.9;break;case If.kTurns:e=360}return e},Yf=function(t){switch(t){case If.kNumber:case If.kInteger:return"";case If.kPercentage:return"%";case If.kEms:return"em";case If.kRems:return"rem";case If.kPixels:return"px";case If.kDegrees:return"deg";case If.kRadians:return"rad";case If.kGradians:return"grad";case If.kMilliseconds:return"ms";case If.kSeconds:return"s";case If.kTurns:return"turn"}return""},Hf=function(){return vc(function t(){pc(this,t)},[{key:"toString",value:function(){return this.buildCSSText(Bf.kNo,Ff.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Wf.kUnitType&&this.getType()<=Wf.kClampType}}],[{key:"isAngle",value:function(t){return t===If.kDegrees||t===If.kRadians||t===If.kGradians||t===If.kTurns}},{key:"isLength",value:function(t){return t>=If.kEms&&t<If.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===If.kPercentage||t===If.kEms||t===If.kRems}},{key:"isTime",value:function(t){return t===If.kSeconds||t===If.kMilliseconds}}])}(),Vf=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e)).colorSpace=t,n}return Ec(e,t),vc(e,[{key:"getType",value:function(){return Wf.kColorType}},{key:"to",value:function(t){return this}}])}(Hf),qf=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Xf=function(t){function e(t,n){var r;return pc(this,e),(r=Mc(this,e)).type=t,r.value=n,r}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Wf.kColorType}}])}(Hf),Uf=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e)).value=t,n}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Wf.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Hf),Kf=function(t){return function(t){switch(t){case Df.kUNumber:return If.kNumber;case Df.kULength:return If.kPixels;case Df.kUPercent:return If.kPercentage;case Df.kUTime:return If.kSeconds;case Df.kUAngle:return If.kDegrees;default:return If.kUnknown}}(function(t){switch(t){case If.kNumber:case If.kInteger:return Df.kUNumber;case If.kPercentage:return Df.kUPercent;case If.kPixels:return Df.kULength;case If.kMilliseconds:case If.kSeconds:return Df.kUTime;case If.kDegrees:case If.kRadians:case If.kGradians:case If.kTurns:return Df.kUAngle;default:return Df.kUOther}}(t))},Zf=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:If.kNumber;return pc(this,e),n=Mc(this,e),r="string"==typeof i?$f(i):i,n.unit=r,n.value=t,n}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return Wf.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Kf(this.unit);if(n!==Kf(t)||n===If.kUnknown)return null;var r=Gf(this.unit)/Gf(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case If.kUnknown:break;case If.kInteger:r=Number(this.value).toFixed(0);break;case If.kNumber:case If.kPercentage:case If.kEms:case If.kRems:case If.kPixels:case If.kDegrees:case If.kRadians:case If.kGradians:case If.kMilliseconds:case If.kSeconds:case If.kTurns:var i=this.value,a=Yf(this.unit);if(i<-999999||i>999999){var o=Yf(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Hf),Qf=new Zf(0,"px");new Zf(1,"px");var Jf=new Zf(0,"deg"),td=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return pc(this,e),(i=Mc(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=o,i}return Ec(e,t),vc(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Vf),ed=new Uf("unset"),nd={"":ed,unset:ed,initial:new Uf("initial"),inherit:new Uf("inherit")},rd=new td(0,0,0,0,!0),id=new td(0,0,0,0),ad=Rf(function(t,e,n,r){return new td(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),od=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:If.kNumber;return new Zf(t,e)};function sd(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new Zf(50,"%");var ld=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,h=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,m=/^rgb/i,y=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function w(t){throw new Error("".concat(x,": ").concat(t))}function k(){var t=C(M);return x.length>0&&w("Invalid input not EOF"),t}function M(){return O("linear-gradient",t,S)||O("repeating-linear-gradient",e,S)||O("radial-gradient",n,A)||O("repeating-radial-gradient",r,A)||O("conic-gradient",i,A)}function O(t,e,n){return E(e,function(e){var r=n();return r&&(B(p)||w("Missing comma before color stops")),{type:t,orientation:r,colorStops:C(L)}})}function E(t,e){var n=B(t);if(n){B(d)||w("Missing (");var r=e(n);return B(h)||w("Missing )"),r}}function S(){return D("directional",a,1)||D("angular",f,1)}function A(){var t,e,n=_();return n&&((t=[]).push(n),e=x,B(p)&&((n=_())?t.push(n):x=e)),t}function _(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||T());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=R()||T());return t}();if(t)t.at=N();else{var e=T();if(e){t=e;var n=N();n&&(t.at=n)}else{var r=P();r&&(t={type:"default-radial",at:r})}}return t}function T(){return D("extent-keyword",o,1)}function N(){if(D("position",/^at/,0)){var t=P();return t||w("Missing positioning value"),t}}function P(){var t={x:R(),y:R()};if(t.x||t.y)return{type:"position",value:t}}function C(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):w("One extra comma");return n}function L(){var t=D("hex",g,1)||E(y,function(){return{type:"rgba",value:C(j)}})||E(m,function(){return{type:"rgb",value:C(j)}})||D("literal",v,0);return t||w("Expected color definition"),t.length=R(),t}function j(){return B(b)[1]}function R(){return D("%",c,1)||D("position-keyword",s,1)||I()}function I(){return D("px",l,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,k()}}();var cd=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ud=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,fd=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,dd=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var hd={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},pd=Rf(function(t){var e;return e="angular"===t.type?Number(t.value):hd[t.value]||0,od(e,"deg")}),gd=Rf(function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:od(e,r),cy:od(n,i)}}),vd=Rf(function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return ld(t).map(function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;o<r;o++){var s,l=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!b(l)&&!b(a)){for(var c=1;c<o-i;c++)t[i+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(o-i))};i=o,a=Number(l)}}}(r);var i=r.map(function(t){return{offset:od(Number(t.length.value),"%"),color:sd(t)}});if("linear-gradient"===e)return new Xf(qf.LinearGradient,{angle:n?pd(n):Jf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var a,o=gd(n[0].at),s=o.cx,l=o.cy;if(n[0].style){var c=n[0].style,u=c.type,f=c.value;a="extent-keyword"===u?function(t){return nd[t]||(nd[t]=new Uf(t)),nd[t]}(f):od(f,u)}return new Xf(qf.RadialGradient,{cx:s,cy:l,size:a,steps:i})}});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=cd.exec(t);if(n){var r,i=(null===(r=n[2].match(dd))||void 0===r?void 0:r.map(function(t){return t.split(":")}))||[];return[new Xf(qf.LinearGradient,{angle:od(parseFloat(n[1]),"deg"),steps:i.map(function(t){var e=Sc(t,2),n=e[0],r=e[1];return{offset:od(100*Number(n),"%"),color:r}})})]}}else if("r"===e){var a=function(t){var e=ud.exec(t);if(e){var n,r=(null===(n=e[4].match(dd))||void 0===n?void 0:n.map(function(t){return t.split(":")}))||[];return{cx:od(50,"%"),cy:od(50,"%"),steps:r.map(function(t){var e=Sc(t,2),n=e[0],r=e[1];return{offset:od(100*Number(n),"%"),color:r}})}}return null}(t);if(a){if(!L(a))return[new Xf(qf.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=fd.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)});function md(t){return t&&!!t.image}function yd(t){return t&&!b(t.r)&&!b(t.g)&&!b(t.b)}var bd=Rf(function(t){if(md(t))return hc({repetition:"repeat"},t);if(b(t)&&(t=""),"transparent"===t)return id;if("currentColor"===t)t="black";else if("none"===t)return rd;var e=vd(t);if(e)return e;var n=xf(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),ad.apply(void 0,r)});function xd(t,e){if(yd(t)&&yd(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(R(e[n],0,255));return e[3]=R(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function wd(t,e){if(b(e))return od(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return od(Number(e),"px");if("deg".search(t)>=0)return od(Number(e),"deg")}var n=[];e=e.replace(t,function(t){return n.push(t),"U".concat(t)});var r="U(".concat(t.source,")");return n.map(function(t){return od(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var kd=function(t){return wd(new RegExp("px","g"),t)},Md=Rf(kd);Rf(function(t){return wd(new RegExp("%","g"),t)});var Od=function(t){return I(t)||isFinite(Number(t))?od(Number(t)||0,"px"):wd(new RegExp("px|%|em|rem","g"),t)},Ed=Rf(Od),Sd=function(t){return wd(new RegExp("deg|rad|grad|turn","g"),t)},Ad=Rf(Sd);function _d(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,l=Kf(t.unit),c=t.convertTo(l),u=e.convertTo(l);return c&&u?(o=c.value,s=u.value,a=Yf(t.unit)):(Zf.isLength(t.unit)||Zf.isLength(e.unit))&&(o=Pd(t,i,n),s=Pd(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Td(t){var e=0;return t.unit===If.kDegrees?e=t.value:t.unit===If.kRadians?e=Nu(Number(t.value)):t.unit===If.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function Nd(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):L(t)?n=t.split(" ").map(function(t){return Number(t)}):I(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat(bc(n),bc(n)):n}function Pd(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===If.kPixels)return Number(t.value);if(t.unit===If.kPercentage&&n){var i=n.nodeName===ou.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Cd=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ld(t){return t.toString()}var jd=function(t){return"number"==typeof t?od(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?od(Number(t)):od(0)},Rd=Rf(jd);function Id(t,e){return[t,e,Ld]}function Dd(t,e){return function(n,r){return[n,r,function(n){return Ld(R(n,t,e))}]}}function Bd(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Fd(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=En(t.parsedStyle.d.absolutePath,void 0,Ie(Ie({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function zd(t,e){return t[0]===e[0]&&t[1]===e[1]}function Wd(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||0===Math.sin(l)||D(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(l/2-c)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(u-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0}}function $d(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Rf(function(t){return L(t)?t.split(" ").map(Rd):t.map(Rd)});var Gd=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Yd=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var l=_u(r=z(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-o.x)/2,u=(t.y-o.y)/2,f={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var h=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));h=h<0?0:h;var p=(i!==a?1:-1)*Math.sqrt(h),g=p*(e*f.y/n),v=p*(-n*f.x/e),m={x:Math.cos(l)*g-Math.sin(l)*v+(t.x+o.x)/2,y:Math.sin(l)*g+Math.cos(l)*v+(t.y+o.y)/2},y={x:(f.x-g)/e,y:(f.y-v)/n},b=Gd({x:1,y:0},y),x=Gd(y,{x:(-f.x-g)/e,y:(-f.y-v)/n});!a&&x>0?x-=2*Math.PI:a&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,k=e*Math.cos(w),M=n*Math.sin(w);return{x:Math.cos(l)*k-Math.sin(l)*M+m.x,y:Math.sin(l)*k+Math.cos(l)*M+m.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Hd(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,f=Yd({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=Yd({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),h=d.x-f.x,p=d.y-f.y,g=Math.sqrt(h*h+p*p);return{x:-h/g,y:-p/g}}function Vd(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qd(t,e){return Vd(t)*Vd(e)?(t[0]*e[0]+t[1]*e[1])/(Vd(t)*Vd(e)):1}function Xd(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(qd(t,e))}function Ud(t,e){var n=e[1],r=e[2],i=z(_u(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],u=e[7],f=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*d/r:0,m=n?g*-r*f/n:0,y=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,b=(l+u)/2+Math.sin(i)*v+Math.cos(i)*m,x=[(f-v)/n,(d-m)/r],w=[(-1*f-v)/n,(-1*d-m)/r],k=Xd([1,0],x),M=Xd(x,w);return qd(x,w)<=-1&&(M=Math.PI),qd(x,w)>=1&&(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&M<0&&(M+=2*Math.PI),{cx:y,cy:b,rx:zd(t,[c,u])?0:n,ry:zd(t,[c,u])?0:r,startAngle:k,endAngle:k+M,xRotation:i,arcFlag:a,sweepFlag:o}}function Kd(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,o=e*i,s=n-t,l=n+t,c=r-e,u=r+e;return[["M",s,r],["C",s,r-o,n-a,c,n,c],["C",n+a,c,l,r-o,l,r],["C",l,r+o,n+a,u,n,u],["C",n-a,u,s,r+o,s,r],["Z"]]}function Zd(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case ou.LINE:var r=t.parsedStyle,i=r.x1,a=void 0===i?0:i,o=r.y1,s=void 0===o?0:o,l=r.x2,c=void 0===l?0:l,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(a,s,c,void 0===u?0:u);break;case ou.CIRCLE:var f=t.parsedStyle,d=f.r,h=void 0===d?0:d,p=f.cx,g=void 0===p?0:p,v=f.cy;n=Kd(h,h,g,void 0===v?0:v);break;case ou.ELLIPSE:var m=t.parsedStyle,y=m.rx,b=void 0===y?0:y,x=m.ry,w=void 0===x?0:x,k=m.cx,M=void 0===k?0:k,O=m.cy;n=Kd(b,w,M,void 0===O?0:O);break;case ou.POLYLINE:case ou.POLYGON:n=function(t,e){var n=t.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]});return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===ou.POLYGON);break;case ou.RECT:var E=t.parsedStyle,S=E.width,A=void 0===S?0:S,_=E.height,T=void 0===_?0:_,N=E.x,P=void 0===N?0:N,C=E.y,L=void 0===C?0:C,j=E.radius,I=j&&j.some(function(t){return 0!==t});n=function(t,e,n,r,i){if(i){var a=Sc(i,4),o=a[0],s=a[1],l=a[2],c=a[3],u=t>0?1:-1,f=e>0?1:-1,d=u+f!==0?1:0;return[["M",u*o+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,d,t+n,f*s+r]:null,["L",t+n,e-f*l+r],l?["A",l,l,0,0,d,t+n-u*l,e+r]:null,["L",n+u*c,e+r],c?["A",c,c,0,0,d,n,e+r-f*c]:null,["L",n,f*o+r],o?["A",o,o,0,0,d,u*o+n,r]:null,["Z"]].filter(function(t){return t})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(A,T,P,L,I&&j.map(function(t){return R(t,0,Math.min(Math.abs(A)/2,Math.abs(T)/2))}));break;case ou.PATH:n=bc(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce(function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=ie(e[1],e[2],0);n&&pe(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=ie(e[1],e[2],0),o=ie(e[3],e[4],0),s=ie(e[5],e[6],0);n&&(pe(a,a,n),pe(o,o,n),pe(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var l=ie(e[6],e[7],0);n&&pe(l,l,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(l[0],",").concat(l[1])}else if("Q"===e[0]){var c=ie(e[1],e[2],0),u=ie(e[3],e[4],0);n&&(pe(c,c,n),pe(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r},"")}(n,0,e)}var Qd=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=cn(t)}catch(n){e=cn(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=[r[1],r[2]],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&zd(a,o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s];r=t[s+1];var c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var f=Ud(n,l);u.arcParams=f}if("Z"===c)n=i,r=t[a+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),u.currentPoint=n,e[a]&&zd(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var g=[l[1],l[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===c){var v=e[s-1],m=$d(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var y=[l[1],l[2]],b=[l[3],l[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[y[0]-b[0],y[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-y[0],b[1]-y[1]])}else if("S"===c){var x=e[s-1],w=$d(x.currentPoint,p),k=[l[1],l[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]]):(u.command="SQ",u.startTangent=[p[0]-k[0],p[1]-k[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]])}else if("A"===c){var M=Hd(u,0),O=M.x,E=M.y,S=Hd(u,1,!1),A=S.x,_=S.y;u.startTangent=[O,E],u.endTangent=[A,_]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,l=o.params,c=o.prePoint,u=void 0;switch(o.command){case"Q":u=Yc(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=zc(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=o.arcParams;u=Rc(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var d=P(n),h=P(r),p=N(n),g=N(r);if(0===i.length)return{x:d,y:h,width:p-d,height:g-h};for(var v=0;v<i.length;v++){var m=i[v],y=m.currentPoint;y[0]===d?d-=Wd(m,e).xExtra:y[0]===p&&(p+=Wd(m,e).xExtra),y[1]===h?h-=Wd(m,e).yExtra:y[1]===g&&(g+=Wd(m,e).yExtra)}return{x:d,y:h,width:p-d,height:g-h}}(o,0),l=s.x,c=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},Jd=Rf(Qd);function th(t){return L(t)?Jd(t):Qd(t)}function eh(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=gn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=gn(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Tn(r,i));var o,s,l=An(a[0])!==An(a[1])?(o=a[0],s=o.slice(1).map(function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))}).map(function(t){return t.map(function(e,n){return t[t.length-n-2*(1-n%2)]})}).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map(function(t){return["C"].concat(t.slice(2))}))):function(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}(a[0]);return[l,Sn(a[1],l),function(t){return t}]}function nh(t,e){return[t.points,e.points,function(t){return t}]}var rh=null,ih=/\s*(\w+)\(([^)]*)\)/g;function ah(t){return function(e){var n=0;return t.map(function(t){return t===rh?e[n++]:t})}}function oh(t){return t}var sh={matrix:["NNNNNN",[rh,rh,0,0,rh,rh,0,0,0,0,1,0,rh,rh,0,1],oh],matrix3d:["NNNNNNNNNNNNNNNN",oh],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ah([rh,rh,new Zf(1)]),oh],scaleX:["N",ah([rh,new Zf(1),new Zf(1)]),ah([rh,new Zf(1)])],scaleY:["N",ah([new Zf(1),rh,new Zf(1)]),ah([new Zf(1),rh])],scaleZ:["N",ah([new Zf(1),new Zf(1),rh])],scale3d:["NNN",oh],skew:["Aa",null,oh],skewX:["A",null,ah([rh,Jf])],skewY:["A",null,ah([Jf,rh])],translate:["Tt",ah([rh,rh,Qf]),oh],translateX:["T",ah([rh,Qf,Qf]),ah([rh,Qf])],translateY:["T",ah([Qf,rh,Qf]),ah([Qf,rh])],translateZ:["L",ah([Qf,Qf,rh])],translate3d:["TTL",oh]};function lh(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!sh[a])return[];var s=o.map(function(t){return od(t)});e.push({t:a,d:s})}return e}function ch(t){if(Array.isArray(t))return lh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(ih.lastIndex=0;e=ih.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=sh[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var l=[],c=0;c<s.length;c++){var u=o[c],f=s[c],d=void 0;if(d=u?{A:function(t){return"0"===t.trim()?Jf:Ad(t)},N:Rd,T:Ed,L:Md}[f.toUpperCase()](u):{a:Jf,n:l[0],t:Qf}[f],void 0===d)return[];l.push(d)}if(n.push({t:i,d:l}),ih.lastIndex===t.length)return n}return[]}function uh(t){if(Array.isArray(t))return lh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(ih.lastIndex=0;e=ih.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=sh[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var l=[],c=0;c<s.length;c++){var u=o[c],f=s[c],d=void 0;if(d=u?{A:function(t){return"0"===t.trim()?Jf:Sd(t)},N:jd,T:Od,L:kd}[f.toUpperCase()](u):{a:Jf,n:l[0],t:Qf}[f],void 0===d)return[];l.push(d)}if(n.push({t:i,d:l}),ih.lastIndex===t.length)return n}return[]}function fh(t){var e,n,r,i;switch(t.t){case"rotateX":return i=_u(Td(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=_u(Td(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=_u(Td(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=_u(Td(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*l),2*(e*r*c-n*l),0,2*(e*n*c-r*l),1-2*(e*e+r*r)*c,2*(n*r*c+e*l),0,2*(e*r*c+n*l),2*(n*r*c-e*l),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=_u(Td(t.d[0])),f=_u(Td(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=_u(Td(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=_u(Td(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Pd(t.d[0],0,null)||0,n=Pd(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Pd(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Pd(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Pd(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Pd(t.d[0],0,null)||0,n=Pd(t.d[1],0,null)||0,r=Pd(t.d[2],0,null)||0,1];case"perspective":var d=Pd(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function dh(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function hh(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(Ru,t))return!1;if(xt(Iu,Ru),Iu[3]=0,Iu[7]=0,Iu[11]=0,Iu[15]=1,Math.abs(St(Iu))<1e-8)return!1;var o,s,l=Ru[3],c=Ru[7],u=Ru[11],f=Ru[12],d=Ru[13],h=Ru[14],p=Ru[15];if(0!==l||0!==c||0!==u){if(Du[0]=l,Du[1]=c,Du[2]=u,Du[3]=p,!Et(Iu,Iu))return!1;Ot(Iu,Iu),ke(i,Du,Iu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=d,e[2]=h,s=Ru,(o=Bu)[0][0]=s[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=re(Bu[0]),ue(Bu[0],Bu[0]),r[0]=fe(Bu[0],Bu[1]),zu(Bu[1],Bu[1],Bu[0],1,-r[0]),n[1]=re(Bu[1]),ue(Bu[1],Bu[1]),r[0]/=n[1],r[1]=fe(Bu[0],Bu[2]),zu(Bu[2],Bu[2],Bu[0],1,-r[1]),r[2]=fe(Bu[1],Bu[2]),zu(Bu[2],Bu[2],Bu[1],1,-r[2]),n[2]=re(Bu[2]),ue(Bu[2],Bu[2]),r[1]/=n[2],r[2]/=n[2],de(Fu,Bu[1],Bu[2]),fe(Bu[0],Fu)<0)for(var g=0;g<3;g++)n[g]*=-1,Bu[g][0]*=-1,Bu[g][1]*=-1,Bu[g][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Bu[0][0]-Bu[1][1]-Bu[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Bu[0][0]+Bu[1][1]-Bu[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Bu[0][0]-Bu[1][1]+Bu[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Bu[0][0]+Bu[1][1]+Bu[2][2],0)),Bu[2][1]>Bu[1][2]&&(a[0]=-a[0]),Bu[0][2]>Bu[2][0]&&(a[1]=-a[1]),Bu[1][0]>Bu[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(fh).reduce(dh)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var ph=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(var l=0;l<3;l++)for(var c=0;c<3;c++)o[3][l]+=e[c]*o[c][l];var u=i[0],f=i[1],d=i[2],h=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+d*d),p[0][1]=2*(u*f-d*h),p[0][2]=2*(u*d+f*h),p[1][0]=2*(u*f+d*h),p[1][1]=1-2*(u*u+d*d),p[1][2]=2*(f*d-u*h),p[2][0]=2*(u*d-f*h),p[2][1]=2*(f*d+u*h),p[2][2]=1-2*(u*u+f*f),o=t(o,p);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(g[2][1]=r[2],o=t(o,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],o=t(o,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],o=t(o,g));for(var v=0;v<3;v++)for(var m=0;m<3;m++)o[v][m]*=n[v];return function(t){return 0===t[0][2]&&0===t[0][3]&&0===t[1][2]&&0===t[1][3]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]&&0===t[2][3]&&0===t[3][2]&&1===t[3][3]}(o)?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function gh(t){return t.toFixed(6).replace(".000000","")}function vh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=hh(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=hh(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=R(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return ph(t[0],t[1],t[2],e,t[4]).map(gh).join(",")}])}function mh(t){return t.replace(/[XY]/,"")}function yh(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}var bh=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function xh(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map(function(t){return"number"==typeof t?od(o):od(o,t.unit)})})},a=0;a<t.length;a++)i()}var o=[],s=[],l=[];if(t.length!==e.length){var c=vh(t,e);o=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]]}else for(var u=0;u<t.length;u++){var f=t[u].t,d=e[u].t,h=t[u].d,p=e[u].d,g=sh[f],v=sh[d],m=void 0;if(bh(f,d)){var y=vh([t[u]],[e[u]]);o.push(y[0]),s.push(y[1]),l.push(["matrix",[y[2]]])}else{if(f===d)m=f;else if(g[2]&&v[2]&&mh(f)===mh(d))m=mh(f),h=g[2](h),p=v[2](p);else{if(!g[1]||!v[1]||yh(f)!==yh(d)){var b=vh(t,e);o=[b[0]],s=[b[1]],l=[["matrix",[b[2]]]];break}m=yh(f),h=g[1](h),p=v[1](p)}for(var x=[],w=[],k=[],M=0;M<h.length;M++){var O=_d(h[M],p[M],n,!1,M);x[M]=O[0],w[M]=O[1],k.push(O[2])}o.push(x),s.push(w),l.push([m,k])}}if(r){var E=o;o=s,s=E}return[o,s,function(t){return t.map(function(t,e){var n=t.map(function(t,n){return l[e][1][n](t)}).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),"".concat(l[e][0],"(").concat(n,")")}).join(" ")}]}var wh=Rf(function(t){if(L(t)){if("text-anchor"===t)return[od(0,"px"),od(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Ed(kh(e[0])),Ed(kh(e[1]))]}return[od(t[0]||0,"px"),od(t[1]||0,"px")]});function kh(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Mh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:tf.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:tf.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:tf.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:tf.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:tf.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:tf.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:tf.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:tf.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:tf.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:tf.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:tf.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:tf.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:tf.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:tf.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:tf.FILTER},{n:"clipPath",syntax:tf.DEFINED_PATH},{n:"textPath",syntax:tf.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:tf.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:tf.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:tf.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:tf.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:tf.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:tf.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:tf.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:tf.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:tf.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:tf.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:tf.COORDINATE},{n:"y1",int:!0,l:!0,syntax:tf.COORDINATE},{n:"z1",int:!0,l:!0,syntax:tf.COORDINATE},{n:"x2",int:!0,l:!0,syntax:tf.COORDINATE},{n:"y2",int:!0,l:!0,syntax:tf.COORDINATE},{n:"z2",int:!0,l:!0,syntax:tf.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:tf.PATH,p:50},{n:"points",int:!0,l:!0,syntax:tf.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:tf.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:tf.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:tf.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:tf.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:tf.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:tf.NUMBER,d:function(t){return t===ou.PATH||t===ou.POLYGON||t===ou.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:tf.MARKER},{n:"markerEnd",syntax:tf.MARKER},{n:"markerMid",syntax:tf.MARKER},{n:"markerStartOffset",syntax:tf.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:tf.LENGTH,l:!0,int:!0,d:"0"}],Oh=new Set(Mh.filter(function(t){return!!t.l}).map(function(t){return t.n})),Eh={},Sh=function(){return vc(function t(e){var n=this;pc(this,t),this.runtime=e,Mh.forEach(function(t){n.registerMetadata(t)})},[{key:"registerMetadata",value:function(t){[t.n].concat(bc(t.a||[])).forEach(function(e){Eh[e]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=Ah(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var o in e)if(Oh.has(o)){a=!0;break}var s,l,c=Ah(t);c.has("fill")&&e.fill&&(t.parsedStyle.fill=bd(e.fill)),c.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=bd(e.stroke)),c.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=bd(e.shadowColor)),c.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Cd.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return wd(/deg|rad|grad|turn|px|%/g,t)||bd(t)})}),n.lastIndex===t.length)return r}return[]}(e.filter)),c.has("radius")&&!b(e.radius)&&(t.parsedStyle.radius=Nd(e.radius,4)),c.has("lineDash")&&!b(e.lineDash)&&(t.parsedStyle.lineDash=Nd(e.lineDash,"even")),c.has("points")&&e.points&&(t.parsedStyle.points=(s=e.points,l=L(s)?s.split(" ").map(function(t){var e=Sc(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]}):s,{points:l,totalLength:0,segments:[]})),c.has("d")&&""===e.d&&(t.parsedStyle.d=hc({},Ju)),c.has("d")&&e.d&&(t.parsedStyle.d=th(e.d)),c.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[tf.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),c.has("clipPath")&&!V(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[tf.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),c.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[tf.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),c.has("transform")&&e.transform&&(t.parsedStyle.transform=ch(e.transform)),c.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=wh(e.transformOrigin)),c.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[tf.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),c.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[tf.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),c.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[tf.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),c.has("zIndex")&&!b(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[tf.Z_INDEX].postProcessor(t),c.has("offsetDistance")&&!b(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[tf.OFFSET_DISTANCE].postProcessor(t),c.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[tf.TRANSFORM].postProcessor(t),c.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[tf.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.dirty(!0,!0),n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new vu),r.renderBounds||(r.renderBounds=new vu);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,l=a.cy,c=void 0===l?0:l,u=a.cz,f=void 0===u?0:u,d=a.hwidth,h=void 0===d?0:d,p=a.hheight,g=void 0===p?0:p,v=a.hdepth,m=void 0===v?0:v,y=[Math.abs(h),Math.abs(g),m],b=i.stroke,x=i.lineWidth,w=void 0===x?1:x,k=i.increasedLineWidthForHitTesting,M=void 0===k?0:k,O=i.shadowType,E=void 0===O?"outer":O,S=i.shadowColor,A=i.filter,_=void 0===A?[]:A,T=i.transformOrigin,N=[s,c,f];r.contentBounds.update(N,y);var P=e===ou.POLYLINE||e===ou.POLYGON||e===ou.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var C=((w||0)+(M||0))*P;y[0]+=C,y[1]+=C}if(r.renderBounds.update(N,y),S&&E&&"inner"!==E){var L=r.renderBounds,j=L.min,R=L.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=j[0]-I+D,z=R[0]+I+D,W=j[1]-I+B,$=R[1]+I+B;j[0]=Math.min(j[0],F),R[0]=Math.max(R[0],z),j[1]=Math.min(j[1],W),R[1]=Math.max(R[1],$),r.renderBounds.setMinMax(j,R)}_.forEach(function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,se(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,l=r.renderBounds,c=l.min,u=l.max,f=c[0]-s+a,d=u[0]+s+a,h=c[1]-s+o,p=u[1]+s+o;c[0]=Math.min(c[0],f),u[0]=Math.max(u[0],d),c[1]=Math.min(c[1],h),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(c,u)}}),t.geometry.dirty=!1;var G=g<0,Y=(h<0?-1:1)*(T?Pd(T[0],0,t,!0):0),H=(G?-1:1)*(T?Pd(T[1],1,t,!0):0);(Y||H)&&t.setOrigin(Y,H)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===ou.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===ou.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function Ah(t){return t.constructor.PARSED_STYLE_LIST}var _h=function(){return vc(function t(){pc(this,t),this.mixer=Id},[{key:"calculator",value:function(t,e,n,r){return Td(n)}}])}(),Th=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Uf&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtyToRoot(t)}),n}}])}(),Nh=function(){return vc(function t(){pc(this,t),this.parser=bd,this.mixer=xd},[{key:"calculator",value:function(t,e,n,r){return n instanceof Uf?"none"===n.value?rd:id:n}}])}(),Ph=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n){return n instanceof Uf?[]:n}}])}();function Ch(t){var e=t.parsedStyle.fontSize;return b(e)?null:e}var Lh=function(){return vc(function t(){pc(this,t),this.mixer=Id},[{key:"calculator",value:function(t,e,n,r,i){if(I(n))return n;if(!Zf.isRelativeUnit(n.unit))return n.value;if(n.unit===If.kPercentage)return 0;if(n.unit===If.kEms){if(r.parentNode){var a=Ch(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===If.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=Ch(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),jh=function(){return vc(function t(){pc(this,t),this.mixer=Bd},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),Rh=function(){return vc(function t(){pc(this,t),this.mixer=Bd},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),Ih=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Uf&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Dh=function(){return vc(function t(){pc(this,t),this.mixer=Id},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Bh=function(){return vc(function t(){pc(this,t),this.mixer=Dd(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===ou.LINE||i===ou.PATH||i===ou.POLYLINE){var a=n.getPoint(r);a&&t.setLocalPosition(a.x,a.y)}}}}])}(),Fh=function(){return vc(function t(){pc(this,t),this.mixer=Dd(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),zh=function(){return vc(function t(){pc(this,t),this.parser=th,this.mixer=eh},[{key:"calculator",value:function(t,e,n){return n instanceof Uf&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new wu(0,0,0,0)}:n}}])}(),Wh=vc(function t(){pc(this,t),this.mixer=nh}),$h=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).mixer=Dd(0,1/0),t}return Ec(e,t),vc(e)}(Lh),Gh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){return n instanceof Uf?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Yh=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Hh=new WeakMap;var Vh="undefined"!=typeof window&&void 0!==window.document;function qh(t){return!!t.getAttribute}function Xh(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Uh(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Kh(t,e){if(Vh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Zh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Qh="object"==typeof performance&&performance.now?performance:Date;function Jh(t){return t.nodeName===ou.FRAGMENT||t.getRootNode().nodeName===ou.FRAGMENT}function tp(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=a,i=o):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var ep=1,np="object"==typeof self&&self.self===self?self:"object"==typeof lc&&lc.global===lc?lc:{},rp=Date.now(),ip={},ap=Date.now(),op=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-ap,r=n>16?0:16-n,i=ep++;return ip[i]=t,Object.keys(ip).length>1||setTimeout(function(){ap=e;var t=ip;ip={},Object.keys(t).forEach(function(e){return t[e](np.performance&&"function"==typeof np.performance.now?np.performance.now():Date.now()-rp)})},r),i},sp=function(t){delete ip[t]},lp=function(t){return"string"!=typeof t?op:""===t?np.requestAnimationFrame:np["".concat(t,"RequestAnimationFrame")]},cp=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],function(t){return!!lp(t)}),up=lp(cp),fp=function(t){return"string"!=typeof t?sp:""===t?np.cancelAnimationFrame:np["".concat(t,"CancelAnimationFrame")]||np["".concat(t,"CancelRequestAnimationFrame")]}(cp);np.requestAnimationFrame=up,np.cancelAnimationFrame=fp;var dp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,e)}))}}])}(),hp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=eu(Jc().mark(function t(){var e,n,r,i,a=arguments;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=6;break}return t.next=1,(e=this.callbacks)[0].apply(e,a);case 1:n=t.sent,r=0;case 2:if(!(r<this.callbacks.length-1)){t.next=5;break}return i=this.callbacks[r],t.next=3,i(n);case 3:n=t.sent;case 4:r++,t.next=2;break;case 5:return t.abrupt("return",n);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),pp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach(function(t){t.apply(void 0,r)})}}])}(),gp=function(){return vc(function t(){pc(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),a=0;a<this.callbacks.length-1;a++){i=(0,this.callbacks[a])(i)}return i}return null}}])}(),vp=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],mp=/([\"\'])[^\'\"]+\1/;function yp(t){var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,l=void 0===s?"normal":s,c=t.fontWeight;return{fontSize:n,fontFamily:i,fontStyle:o,fontVariant:l,fontWeight:void 0===c?"normal":c}}var bp=Rf(function(t){for(var e=yp(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight,s=I(n)&&"".concat(n,"px")||"16px",l=r.split(","),c=l.length-1;c>=0;c--){var u=l[c].trim();!mp.test(u)&&vp.indexOf(u)<0&&(u='"'.concat(u,'"')),l[c]=u}return"".concat(i," ").concat(a," ").concat(o," ").concat(s," ").concat(l.join(","))},function(t){var e=yp(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight;return"".concat(i,"_").concat(a,"_").concat(o,"_").concat(n,"_").concat(r)}),xp=function(t){return Math.max(t,1e-6)};function wp(t,e,n){return Mt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var kp=yt(),Mp=yt(),Op={scale:function(t){Lt(kp,[t[0].value,t[1].value,1].map(function(t){return xp(t)}))},scaleX:function(t){Lt(kp,[t[0].value,1,1].map(function(t){return xp(t)}))},scaleY:function(t){Lt(kp,[1,t[0].value,1].map(function(t){return xp(t)}))},scaleZ:function(t){Lt(kp,[1,1,t[0].value].map(function(t){return xp(t)}))},scale3d:function(t){Lt(kp,[t[0].value,t[1].value,t[2].value].map(function(t){return xp(t)}))},translate:function(t){Ct(kp,[t[0].value,t[1].value,0])},translateX:function(t){Ct(kp,[t[0].value,0,0])},translateY:function(t){Ct(kp,[0,t[0].value,0])},translateZ:function(t){Ct(kp,[0,0,t[0].value])},translate3d:function(t){Ct(kp,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Dt(kp,_u(Td(t[0])))},rotateX:function(t){Rt(kp,_u(Td(t[0])))},rotateY:function(t){It(kp,_u(Td(t[0])))},rotateZ:function(t){Dt(kp,_u(Td(t[0])))},rotate3d:function(t){jt(kp,_u(Td(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){wp(kp,_u(t[0].value),_u(t[1].value))},skewX:function(t){wp(kp,_u(t[0].value),0)},skewY:function(t){wp(kp,0,_u(t[0].value))},matrix:function(t){kt(kp,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){kt.apply(te,[kp].concat(bc(t.map(function(t){return t.value}))))}},Ep=ie(1,1,1),Sp=ee(),Ap={translate:function(t,e){Pg.sceneGraphService.setLocalScale(t,Ep,!1),Pg.sceneGraphService.setLocalEulerAngles(t,Sp,void 0,void 0,!1),Pg.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Pg.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function _p(t,e){if(t.length){if(1===t.length&&Ap[t[0].t])return void Ap[t[0].t](e,t[0].d);for(var n=Mt(Mp),r=0;r<t.length;r++){var i=t[r],a=i.t,o=i.d,s=Op[a];s&&(s(o),Qt(n,n,kp))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Tp=function(){return vc(function t(){pc(this,t),this.parser=uh,this.mixer=xh},[{key:"calculator",value:function(t,e,n,r){return n instanceof Uf?[]:n}},{key:"postProcessor",value:function(t){_p(t.parsedStyle.transform,t)}}])}(),Np=function(){return vc(function t(){pc(this,t)},[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===If.kPixels&&e[1].unit===If.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),Pp=function(){return vc(function t(){pc(this,t)},[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&e.dirty(),r&&(r.dirty=!0,r.dirtyReason=Xu.Z_INDEX_CHANGED)}}}])}(),Cp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.r,s=void 0===o?0:o;return{cx:r,cy:a,hwidth:s,hheight:s}}}])}(),Lp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.rx,s=void 0===o?0:o,l=t.ry;return{cx:r,cy:a,hwidth:s,hheight:void 0===l?0:l}}}])}(),jp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),l=(o-a)/2,c=(Math.max(n,i)-s)/2;return{cx:a+l,cy:s+c,hwidth:l,hheight:c}}}])}(),Rp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,a=e.height/2;return{cx:n+i,cy:r+a,hwidth:i,hheight:a}}}])}(),Ip=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,bc(e.map(function(t){return t[0]}))),r=Math.max.apply(Math,bc(e.map(function(t){return t[0]}))),i=Math.min.apply(Math,bc(e.map(function(t){return t[1]}))),a=Math.max.apply(Math,bc(e.map(function(t){return t[1]}))),o=(r-n)/2,s=(a-i)/2;return{cx:n+o,cy:i+s,hwidth:o,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Dp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,l=void 0===s?0:s,c=t.height,u=l,f=void 0===c?0:c;return o&&!L(o)&&(u||(u=o.width,t.width=u),f||(f=o.height,t.height=f)),{cx:r+u/2,cy:a+f/2,hwidth:u/2,hheight:f/2}}}])}(),Bp=function(){return vc(function t(e){pc(this,t),this.globalRuntime=e},[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,l=t.textBaseline,c=void 0===l?"alphabetic":l,u=t.dx,f=void 0===u?0:u,d=t.dy,h=void 0===d?0:d,p=t.x,g=void 0===p?0:p,v=t.y,m=void 0===v?0:v;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,y);t.metrics=b;var x=b.width/2,w=b.height/2,k=g+x;"center"===a||"middle"===a?k+=s/2-x:"right"!==a&&"end"!==a||(k+=s-2*x);var M=m-w;return"middle"===c?M+=w:"top"===c||"hanging"===c?M+=2*w:"alphabetic"===c||"bottom"!==c&&"ideographic"!==c||(M+=0),f&&(k+=f),h&&(M+=h),{cx:k,cy:M,hwidth:x,hheight:w}}}])}(),Fp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),zp=function(){return vc(function t(){pc(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.width,s=void 0===o?0:o,l=t.height,c=void 0===l?0:l;return{cx:r+s/2,cy:a+c/2,hwidth:s/2,hheight:c/2}}}])}(),Wp=function(){return vc(function t(e){pc(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new xu,this.page=new xu,this.canvas=new xu,this.viewport=new xu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(ku)}}])}(),$p=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).client=new xu,t.movement=new xu,t.offset=new xu,t.global=new xu,t.screen=new xu,t}return Ec(e,t),vc(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(ku)}}])}(Wp),Gp=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return Ec(e,t),vc(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}($p),Yp=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}($p),Hp=function(t){function e(t,n){var r;return pc(this,e),(r=Mc(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return Ec(e,t),vc(e)}(Wp),Vp=function(){return vc(function t(){pc(this,t),this.emitter=new _c},[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(Y(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=y(e)?e:e.handleEvent;var s=y(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(Y(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=y(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=y(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Hp(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(t),!0;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(e){if(t.manager=e.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])}(),qp=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t.destroyed=!1,t}return Ec(e,t),vc(e,[{key:"textContent",get:function(){var t="";this.nodeName===ou.TEXT&&(t+=this.style.text);var e,n=nu(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===ou.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===ou.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(ku)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(ku)}},{key:"lookupPrefix",value:function(t){throw new Error(ku)}},{key:"normalize",value:function(){throw new Error(ku)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,l=s===i?a:i;if(s[s.length-l.length]===l[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-l.length,u=l.length-1;u>=0;u--){var f=l[u],d=s[c+u];if(d!==f){var h=f.parentNode.childNodes;return h.indexOf(f)<h.indexOf(d)?l===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Vp);qp.DOCUMENT_POSITION_DISCONNECTED=1,qp.DOCUMENT_POSITION_PRECEDING=2,qp.DOCUMENT_POSITION_FOLLOWING=4,qp.DOCUMENT_POSITION_CONTAINS=8,qp.DOCUMENT_POSITION_CONTAINED_BY=16,qp.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Xp=function(){return vc(function t(e,n){var r=this;pc(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=yt(),this.tmpVec3=ee(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=Qh.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var a=r.trackingData(t.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[t.button]),s=o;if(o&&!n.composedPath().includes(o)){for(var l=o;l&&!n.composedPath().includes(l);){if(n.currentTarget=l,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var c=2===n.button;r.notifyTarget(n,c?"rightupoutside":"mouseupoutside")}qp.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],s=l}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var d=r.context.renderingContext.root.ownerDocument.defaultView,h=a.clicksByButton[t.button];h.target===f.target&&e-h.timeStamp<d.getConfig().dblClickSpeed?++h.clickCount:h.clickCount=1,h.target=f.target,h.timeStamp=e,f.detail=h.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==f.pointerType&&"touch"!==f.pointerType||r.dispatchEvent(f,"click"),r.dispatchEvent(f,"pointertap")),r.freeEvent(f)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,o,a||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(a)){var l=r.createPointerEvent(t,"pointerleave",a||void 0);for(l.eventPhase=l.AT_TARGET;l.target&&!e.composedPath().includes(l.target);)l.currentTarget=l.target,r.notifyTarget(l),n&&r.notifyTarget(l,"mouseleave"),qp.isNode(l.target)&&(l.target=l.target.parentNode);r.freeEvent(l)}r.freeEvent(s)}if(a!==e.target){var c="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,c);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var f=a&&qp.isNode(a)&&a.parentNode;f&&f!==(qp.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(qp.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var d=r.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==a&&d.target!==(qp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)d.currentTarget=d.target,r.notifyTarget(d),n&&r.notifyTarget(d,"mouseenter"),qp.isNode(d.target)&&(d.target=d.target.parentNode);r.freeEvent(d)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(qp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),qp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(qp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),qp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),qp.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new xu((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new xu((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),l=r.getWorldTransform(),c=At(this.tmpMatrix,l,s),u=oe(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return pe(u,u,c),new xu(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=At(this.tmpMatrix,n,r),a=oe(this.tmpVec3,t.x,t.y,0);pe(this.tmpVec3,this.tmpVec3,i);var o=this.context.config,s=o.width,l=o.height;return new xu((a[0]+1)/2*s,(1-(a[1]+1)/2)*l)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)qp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,a=r.height,o=r.disableHitTesting;return e<0||n<0||e>i||n>a?null:!o&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Gp);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Yp);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Yp);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Gp);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Qh.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||qp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=qh(e)&&e.getAttribute("cursor");if(n)return n;e=qp.isNode(e)&&e.parentNode}}}])}(),Up=function(){return vc(function t(){pc(this,t)},[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Pg.offscreenCanvas)this.canvas=t||Pg.offscreenCanvas,this.context=this.canvas.getContext("2d",hc({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",hc({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",hc({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Kp=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Zp=function(){return vc(function t(e,n){pc(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new pp,initAsync:new dp,dirtycheck:new gp,cull:new gp,beginFrame:new pp,beforeRender:new pp,render:new pp,afterRender:new pp,endFrame:new pp,destroy:new pp,pick:new hp,pickSync:new gp,pointerDown:new pp,pointerUp:new pp,pointerMove:new pp,pointerOut:new pp,pointerOver:new pp,pointerWheel:new pp,pointerCancel:new pp,click:new pp},this.globalRuntime=e,this.context=n},[{key:"init",value:function(t){var e=this,n=hc(hc({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,e.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()}).catch(function(t){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Kp.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Kp.CAMERA_CHANGED),o=!t.disableRenderHooks||!a;o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach(function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)}),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t,l=null;s&&(l=o?r.hooks.cull.call(s,r.context.camera):s)&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(l)),t.dirty(!1),i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var l=[t];l.length>0;){var c,u=l.pop();s(u);for(var f=(null===(c=u.sortable)||void 0===c||null===(c=c.sorted)||void 0===c?void 0:c.length)>0?u.sortable.sorted:u.childNodes,d=f.length-1;d>=0;d--)l.push(f[d])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==Xu.Z_INDEX_CHANGED?e.dirtyChildren.forEach(function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Xh(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}}):e.sorted=t.childNodes.slice().sort(Xh),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter(function(t){return t.parsedStyle.zIndex}).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Kp.DISPLAY_OBJECT_CHANGED)}}])}(),Qp=/\[\s*(.*)=(.*)\s*\]/,Jp=function(){return vc(function t(){pc(this,t)},[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find(function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.find(function(e){return e.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):null}return e.find(function(n){return e!==n&&n.nodeName===t})}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll(function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(r){return e!==r&&r.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):[]}return e.findAll(function(n){return e!==n&&n.nodeName===t})}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Qp),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return b(n)?"":n.toString?n.toString():""}}])}(),tg=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),eg=function(t){function e(t,n,r,i,a,o,s,l){var c;return pc(this,e),(c=Mc(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=l,c.type=t,c}return Ec(e,t),vc(e)}(Wp);eg.ADDITION=2,eg.MODIFICATION=1,eg.REMOVAL=3;var ng,rg,ig,ag=new eg(tg.REPARENT,null,"","","",0,"",""),og=Le(),sg=ee(),lg=ie(1,1,1),cg=yt(),ug=Le(),fg=ee(),dg=yt(),hg=Me(),pg=ee(),gg=Me(),vg=ee(),mg=ee(),yg=ee(),bg=yt(),xg=Me(),wg=Me(),kg=Me(),Mg={affectChildren:!0},Og=function(){return vc(function t(e){pc(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Hp(tg.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e},[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===ou.FRAGMENT,o=Jh(e);t.parentNode=e;var s=a?t.childNodes:[t];I(n)?s.forEach(function(t){e.childNodes.splice(n,0,t),t.parentNode=e}):s.forEach(function(t){e.childNodes.push(t),t.parentNode=e});var l=e.sortable;if((null!=l&&null!==(r=l.sorted)&&void 0!==r&&r.length||l.dirty||t.parsedStyle.zIndex)&&(-1===l.dirtyChildren.indexOf(t)&&l.dirtyChildren.push(t),l.dirty=!0,l.dirtyReason=Xu.ADDED),!o){if(a)this.dirtifyFragment(t);else{var c=t.transformable;c&&this.dirtyWorldTransform(t,c)}if(i){var u,f=!0===(null===(u=e.ownerDocument)||void 0===u||null===(u=u.defaultView)||void 0===u||null===(u=u.getConfig())||void 0===u||null===(u=u.future)||void 0===u?void 0:u.experimentalCancelEventPropagation);t.dispatchEvent(ag,f,f)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Xu.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtyWorldTransform(t,r),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return Qu(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;mg[0]=e[0],mg[1]=e[1],mg[2]=null!==(n=e[2])&&void 0!==n?n:0,ve(i.localPosition,mg)||(ae(i.localPosition,mg),r&&this.dirtyLocalTransform(t,i))}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;ve(e,sg)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=e[0],l=e[1],c=e[2],u=i*c-a*l,f=a*s-r*c,d=r*l-i*s;u+=u,f+=f,d+=d,t[0]=s+o*u+i*d-a*f,t[1]=l+o*f+a*u-r*d,t[2]=c+o*d+r*f-i*u}(e,e,n.localRotation),se(n.localPosition,n.localPosition,e),this.dirtyLocalTransform(t,n))}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=Ne(hg,e,n,r,i));var o=t.transformable;Te(o.localRotation,e),a&&this.dirtyLocalTransform(t,o)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Ae(wg,e[0],e[1],e[2]),Pe(n.localRotation,n.localRotation,wg),this.dirtyLocalTransform(t,n)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;oe(fg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),ve(fg,i.localScale)||(ae(i.localScale,fg),r&&this.dirtyLocalTransform(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r=t.transformable;!function(t,e,n){t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2]}(r.localScale,r.localScale,oe(fg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtyLocalTransform(t,r)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(ug,e,n));var i=t.transformable;!function(t,e){t[0]=e[0],t[1]=e[1]}(i.localSkew,e),r&&this.dirtyLocalTransform(t,i)}},{key:"setLocalEulerAngles",value:function(t,e){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Ae(r.localRotation,e[0],e[1],e[2]),n&&this.dirtyLocalTransform(t,r)}},{key:"setLocalTransform",value:function(t,e){var n=Ft(pg,e),r=Wt(gg,e),i=zt(vg,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,lg,!1),this.setLocalPosition(t,sg,!1),this.setLocalEulerAngles(t,sg,void 0,void 0,!1),this.setLocalSkew(t,og,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return Ft(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Wt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return zt(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t),e.worldTransform):e.worldTransform}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(yg[0]=e[0],yg[1]=e[1],yg[2]=null!==(n=e[2])&&void 0!==n?n:0,!ve(this.getPosition(t),yg)){if(ae(r.position,yg),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;xt(bg,i.worldTransform),Et(bg,bg),pe(r.localPosition,yg,bg)}else ae(r.localPosition,yg);this.dirtyLocalTransform(t,r)}}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=oe(fg,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),ve(e,sg)||(se(fg,this.getPosition(t),e),this.setPosition(t,fg))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=_e(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Te(hg,o),Se(hg,hg),Ee(a.localRotation,hg,e),Ce(a.localRotation,a.localRotation),this.dirtyLocalTransform(t,a)}else this.setLocalRotation(t,e)}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=hg;Ae(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);Te(kg,a),Se(kg,kg),Ee(r,kg,r),Ee(n.localRotation,r,i),Ce(n.localRotation,n.localRotation),this.dirtyLocalTransform(t,n)}else this.rotateLocal(t,e)}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtyLocalTransform(t,n)}}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=ie(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Ae(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Te(xg,Se(hg,r)),Pe(n.localRotation,n.localRotation,xg),this.dirtyLocalTransform(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!vu.isEmpty(r)){var i=n||new vu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Pg.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new vu}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach(function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new vu).update(r.center,r.halfExtents))}),a||(a=new vu),n){var o=Uh(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=cg;t.parentNode.transformable&&(e=Et(dg,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!vu.isEmpty(n)){var r=new vu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);vu.isEmpty(r)||(n=new vu).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=Sc(n.getMin(),2),o=a[0],s=a[1],l=Sc(n.getMax(),2),c=l[0],u=l[1];return new wu(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),c-o,u-s)}return new wu((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;Qu(t.transformable),function(t,e){t.dirtyFlag&&(e?At(t.worldTransform,e.worldTransform,t.localTransform):xt(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,r,i,a,o,s,l=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization),c=e[e.length-1],u=(null==c?void 0:c.transformDirty)||(null===(r=t.transformable)||void 0===r?void 0:r.localDirtyFlag);t.transformable&&((o=t.transformable).dirtyFlag||(o.dirtyFlag=u));(this.internalUpdateTransform(t),u)&&(null===(s=t.dirty)||void 0===s||s.call(t,!0,!0));var f=(null===(i=t.renderable)||void 0===i?void 0:i.boundsDirty)||(null===(a=t.renderable)||void 0===a?void 0:a.renderBoundsDirty);if((u||f)&&!1===(null==c?void 0:c.shapeUpdated)&&l)for(var d=e.length-1;d>=0;){var h,p,g=e[d];if(g.shapeUpdated)break;null===(h=(p=g.node).dirty)||void 0===h||h.call(p,!0,!0),g.shapeUpdated=!0,d-=1}return u}},{key:"syncHierarchy",value:function(t){for(var e,n,r=[t],i=t.parentNode?[{node:t.parentNode,transformDirty:(null===(e=t.parentNode.transformable)||void 0===e?void 0:e.localDirtyFlag)||(null===(n=t.parentNode.transformable)||void 0===n?void 0:n.dirtyFlag),shapeUpdated:!1}]:[];r.length>0;){for(var a=r.pop(),o=i[i.length-1];i.length>0&&a.parentNode!==o.node;)o=i.pop();var s=this.internalUpdateElement(a,i);if(a.childNodes.length>0){for(var l=a.childNodes.length-1;l>=0;l--)r.push(a.childNodes[l]);i.push({node:a,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){Jh(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtifyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n,r=this,i=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization);e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),i||t.childNodes.forEach(function(t){var e=t.transformable;r.dirtifyWorldInternal(t,e)}))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=!0===(null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);r;){var a,o;if(null===(a=(o=r).dirty)||void 0===a||a.call(o,!0,!0),i)break;r=r.parentNode}n&&t.forEach(function(t){var e;null===(e=t.dirty)||void 0===e||e.call(t,!0,!0)}),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,n)}},{key:"dirtifyFragment",value:function(t){var e,n,r=t.transformable;r&&(r.dirtyFlag=!0,r.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var i=t.childNodes.length,a=0;a<i;a++)this.dirtifyFragment(t.childNodes[a]);t.nodeName===ou.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t,e,n=this,r=new Set,i=function(e,i){if(e.isConnected&&!r.has(e)&&e.nodeName!==ou.FRAGMENT){if(n.boundsChangedEvent.detail=i,n.boundsChangedEvent.target=e,e.isMutationObserved)e.dispatchEvent(n.boundsChangedEvent);else{var a;if(void 0===t)t=!0===(null===(a=e.ownerDocument.defaultView)||void 0===a||null===(a=a.getConfig())||void 0===a||null===(a=a.future)||void 0===a?void 0:a.experimentalCancelEventPropagation);e.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0,t)}r.add(e)}};this.pendingEvents.forEach(function(t,n){if(n.nodeName!==ou.FRAGMENT){var r;if(void 0===e)e=!0===(null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r||null===(r=r.getConfig())||void 0===r||null===(r=r.future)||void 0===r?void 0:r.experimentalAttributeUpdateOptimization);Mg.affectChildren=t,e?i(n,Mg):t?n.forEach(function(t){i(t,Mg)}):i(n,Mg)}}),r.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,r=this.displayObjectDependencyMap.get(t);if(r){var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalCancelEventPropagation;Object.keys(r).forEach(function(t){r[t].forEach(function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new eg(tg.ATTR_MODIFIED,e,n,n,t,eg.MODIFICATION,n,n),i,i),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)})})}}}])}(),Eg=function(){return vc(function t(e){if(pc(this,t),e<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map},[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var n=this.cache.keys().next().value;this.cache.delete(n)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Sg={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Ag=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,_g=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Tg=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ng=function(){return vc(function t(e){var n=this;pc(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Tg.exec(e)&&!_g.exec(t))},this.trimByKinsokuShorui=function(t){var e=bc(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e,this.charWidthCache=new Eg(100)},[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=Sg.MetricsString+Sg.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(Sg.BaselineSymbol).width),l=Sg.HeightMultiplier*s;s=s*Sg.BaselineMultiplier|0,r.width=o,r.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var c=i.getImageData(0,0,o||1,l||1).data,u=c.length,f=4*o,d=0,h=0,p=!1;for(d=0;d<s;++d){for(var g=0;g<f;g+=4)if(255!==c[h+g]){p=!0;break}if(p)break;h+=f}for(n.ascent=s-d,h=u-f,p=!1,d=l;d>s;--d){for(var v=0;v<f;v+=4)if(255!==c[h+v]){p=!0;break}if(p)break;h-=f}return n.descent=d-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,l=e.lineWidth,c=void 0===l?1:l,u=e.textBaseline,f=void 0===u?"alphabetic":u,d=e.textAlign,h=void 0===d?"start":d,p=e.letterSpacing,g=void 0===p?0:p,v=e.textPath,m=e.leading,y=void 0===m?0:m,b=bp(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var w=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);w.font=b,e.isOverflowing=!1;var k=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(k.length),O=0;if(!v){for(var E=0;E<k.length;E++){var S=w.measureText(k[E]).width+(k[E].length-1)*g;M[E]=S,O=Math.max(O,S)}var A=O+c,_=s||x.fontSize+c,T=Math.max(_,x.fontSize+c)+(k.length-1)*(_+y),N=0;return"middle"===f?N=-T/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?N=-T:"top"!==f&&"hanging"!==f||(N=0),{font:b,width:A,height:T,lines:k,lineWidths:M,lineHeight:_+=y,maxLineWidth:O,fontProperties:x,lineMetrics:M.map(function(t,e){var n=0;return"center"===h||"middle"===h?n-=t/2:"right"!==h&&"end"!==h||(n-=t),new wu(n-c/2,N+e*_,t+c,_)})}}v.getTotalLength();for(var P=0;P<k.length;P++)w.measureText(k[P]).width,k[P].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=Array.from(t);if(0===i.length)return"";var a=this,o=e.wordWrapWidth,s=void 0===o?0:o,l=e.letterSpacing,c=void 0===l?0:l,u=e.maxLines,f=void 0===u?1/0:u,d=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=s+c,g="";"ellipsis"===d?g="...":d&&"clip"!==d&&(g=d);var v=[""],m=0,y=0,b=-1,x=bp(e),w=this.charWidthCache.get(x);w||(w=new Eg(500),this.charWidthCache.put(x,w));var k=function(t){return r.getFromCache(t,c,w,h)},M=k(g);function O(t,e,n,r){for(;k(t)<r&&e<i.length-1&&!a.isNewline(i[e+1]);)t+=i[e+=1];for(;k(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function E(t,e){if(!(M<=0||M>p))if(v[t]){var n=O(v[t],e,b+1,p-M);v[t]=n.lineTxt+g}else v[t]=g}for(var S=0;S<i.length;S++){var A=i[S],_=i[S-1],T=i[S+1],N=k(A);if(this.isNewline(A)){if(m+1>=f){S<i.length-1&&E(m,S-1),e.isOverflowing=!0;break}b=S-1,y=0,v[m+=1]=""}else{if(N>p){E(m,S-1),e.isOverflowing=!0;break}if(y>0&&y+N>p){var P=O(v[m],S-1,b+1,p);if(P.txtLastCharIndex!==S-1){if(v[m]=P.lineTxt,P.txtLastCharIndex===i.length-1)break;S=P.txtLastCharIndex+1,A=i[S],_=i[S-1],T=i[S+1],N=k(A)}if(m+1>=f){E(m,S-1),e.isOverflowing=!0;break}if(b=S-1,y=0,v[m+=1]="",this.isBreakingSpace(A))continue;this.canBreakInLastChar(A)||(v=this.trimToBreakable(v),y=this.sumTextWidthByCache(v[m]||"",k)),this.shouldBreakByKinsokuShorui(A,T)&&(v=this.trimByKinsokuShorui(v),y+=k(_||""))}y+=N,v[m]+=A}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Sg.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Sg.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=bc(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+1,o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(a,n.length),e[e.length-2]=n.slice(0,o),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Ag.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce(function(t,n){return t+e(n)},0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!Ag.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n.get(t);if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n.put(t,i)}return i}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Pg={},Cg=(rg=new Dp,ig=new Ip,fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(ng={},ou.FRAGMENT,null),ou.CIRCLE,new Cp),ou.ELLIPSE,new Lp),ou.RECT,rg),ou.IMAGE,rg),ou.GROUP,new Fp),ou.LINE,new jp),ou.TEXT,new Bp(Pg)),ou.POLYLINE,ig),ou.POLYGON,ig),fc(fc(fc(ng,ou.PATH,new Rp),ou.HTML,new zp),ou.MESH,null)),Lg=function(t){var e=new Nh,n=new Lh;return fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},tf.PERCENTAGE,null),tf.NUMBER,new Dh),tf.ANGLE,new _h),tf.DEFINED_PATH,new Th),tf.PAINT,e),tf.COLOR,e),tf.FILTER,new Ph),tf.LENGTH,n),tf.LENGTH_PERCENTAGE,n),tf.LENGTH_PERCENTAGE_12,new jh),fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t,tf.LENGTH_PERCENTAGE_14,new Rh),tf.COORDINATE,new Lh),tf.OFFSET_DISTANCE,new Bh),tf.OPACITY_VALUE,new Fh),tf.PATH,new zh),tf.LIST_OF_POINTS,new Wh),tf.SHADOW_BLUR,new $h),tf.TEXT,new Gh),tf.TEXT_TRANSFORM,new Yh),tf.TRANSFORM,new Tp),fc(fc(fc(t,tf.TRANSFORM_ORIGIN,new Np),tf.Z_INDEX,new Pp),tf.MARKER,new Ih)}();Pg.CameraContribution=Vu,Pg.AnimationTimeline=null,Pg.EasingFunction=null,Pg.offscreenCanvasCreator=new Up,Pg.sceneGraphSelector=new Jp,Pg.sceneGraphService=new Og(Pg),Pg.textService=new Ng(Pg),Pg.geometryUpdaterFactory=Cg,Pg.CSSPropertySyntaxFactory=Lg,Pg.styleValueRegistry=new Sh(Pg),Pg.layoutRegistry=null,Pg.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==lc?lc:{},Pg.enableStyleSyntax=!0,Pg.enableSizeAttenuation=!1;var jg=0,Rg=new eg(tg.INSERTED,null,"","","",0,"",""),Ig=new eg(tg.REMOVED,null,"","","",0,"",""),Dg=new Hp(tg.DESTROY),Bg=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).entity=jg++,t.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:qu.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return Ec(e,t),vc(e,[{key:"dirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.renderable.dirty=t,e&&(this.renderable.boundsDirty=t,this.renderable.renderBoundsDirty=t)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(ku)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return Pg.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Jh(this)||t.nodeName!==ou.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Rg.relatedNode=this,t.dispatchEvent(Rg)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e,n,r=!0===(null===(e=this.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return Ig.relatedNode=this,t.dispatchEvent(Ig,r,r),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Pg.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Pg.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Pg.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Pg.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Pg.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Pg.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Pg.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Pg.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Pg.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach(function(r){return r===e||!t(r)||(n=r,!1)}),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach(function(r){r!==e&&t(r)&&n.push(r)}),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach(function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,bc(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(e){return t.appendChild(e)})}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(e,n){return t.appendChild(e,n)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var t,e=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(Dg,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Pg.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Pg.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Pg.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Pg.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Pg.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(ku)}},{key:"getAttributeNode",value:function(t){throw new Error(ku)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(ku)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(ku)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(ku)}},{key:"removeAttributeNode",value:function(t){throw new Error(ku)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(ku)}},{key:"setAttributeNode",value:function(t){throw new Error(ku)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(ku)}},{key:"toggleAttribute",value:function(t,e){throw new Error(ku)}}])}(qp);function Fg(t){return!(null==t||!t.nodeName)}var zg=Pg.globalThis.Proxy?Pg.globalThis.Proxy:function(){},Wg=new eg(tg.ATTR_MODIFIED,null,null,null,null,eg.MODIFICATION,null,null),$g=ee(),Gg=Me(),Yg=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||ou.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Pg.enableStyleSyntax&&(n.style=new zg({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return Ec(e,t),vc(e,[{key:"destroy",value:function(){Nc(e,"destroy",this,3)([]),this.getAnimations().forEach(function(t){t.cancel()})}},{key:"cloneNode",value:function(t,e){var n=hc({},this.attributes);for(var r in n){var i=n[r];Fg(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor(hc(hc({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach(function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}}),a}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Pg.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];V(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),Nc(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.attributes[t],i=this.parsedStyle[t];Pg.styleValueRegistry.processProperties(this,fc({},t,e),n),this.dirty();var a,o=this.parsedStyle[t];if(this.isConnected)if(Wg.relatedNode=this,Wg.prevValue=r,Wg.newValue=e,Wg.attrName=t,Wg.prevParsedValue=i,Wg.newParsedValue=o,this.isMutationObserved)this.dispatchEvent(Wg);else{var s,l=!0===(null===(s=this.ownerDocument.defaultView.getConfig().future)||void 0===s?void 0:s.experimentalCancelEventPropagation);Wg.target=this,this.ownerDocument.defaultView.dispatchEvent(Wg,!0,l)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(a=this.attributeChangedCallback)||void 0===a||a.call(this,t,r,e,i,o))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=Sc(t.getMin(),2),n=e[0],r=e[1],i=Sc(t.getMax(),2),a=i[0],o=i[1];return new wu(n,r,a-n,o-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Pg.sceneGraphService.setOrigin(this,Su(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return Pg.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Pg.sceneGraphService.setPosition(this,Su(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Pg.sceneGraphService.setLocalPosition(this,Su(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Pg.sceneGraphService.translate(this,Su(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Pg.sceneGraphService.translateLocal(this,Su(t,e,n,!1)),this}},{key:"getPosition",value:function(){return Pg.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Pg.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Su(t,e=e||t,n=n||t,!1)),Pg.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Su(t,e=e||t,n=n||t,!1)),Pg.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Pg.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Pg.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Nu(Sc(Cu($g,Pg.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Nu(Sc(Cu($g,Pg.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Pg.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Pg.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return b(e)&&b(n)?Pg.sceneGraphService.rotateLocal(this,0,0,t):Pg.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return b(e)&&b(n)?Pg.sceneGraphService.rotate(this,0,0,t):Pg.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Pg.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Pg.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Pg.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Pg.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Pg.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Pg.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Pg.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Pg.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Pg.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Pg.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,bc(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,bc(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?w(i)?(Object.keys(i).forEach(function(e){t.setAttribute(e,i[e])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=Sc(Ft($g,e),2),r=n[0],i=n[1],a=Sc(zt($g,e),2),o=a[0],s=a[1],l=Wt(Gg,e),c=Sc(Cu($g,l),3),u=c[0],f=c[2];return Lu(u||f,r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=Sc(ju(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setEulerAngles(o).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=Sc(ju(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setLocalEulerAngles(o).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach(function(t){t.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(t){t.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Bg);Yg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Hg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:ou.CIRCLE},t)])}return Ec(e,t),vc(e)}(Yg);Hg.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Vg=["style"],qg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ru(n,Vg);return pc(this,e),(t=Mc(this,e,[hc({style:r},i)])).isCustomElement=!0,t}return Ec(e,t),vc(e)}(Yg);qg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Xg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:ou.ELLIPSE},t)])}return Ec(e,t),vc(e)}(Yg);Xg.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return pc(this,e),Mc(this,e,[{type:ou.FRAGMENT}])}return Ec(e,t),vc(e)}(Yg)).PARSED_STYLE_LIST=new Set(["class","className"]);var Ug=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:ou.GROUP},t)])}return Ec(e,t),vc(e)}(Yg);Ug.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Kg=["style"],Zg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ru(n,Kg);return pc(this,e),(t=Mc(this,e,[hc({type:ou.HTML,style:r},i)])).cullable.enable=!1,t}return Ec(e,t),vc(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=Et(yt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!vu.isEmpty(e)){var n=new vu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Yg);Zg.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Qg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:ou.IMAGE},t)])}return Ec(e,t),vc(e)}(Yg);Qg.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Jg=["style"],tv=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ru(n,Jg);pc(this,e),(t=Mc(this,e,[hc({type:ou.LINE,style:hc({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd;return o&&Fg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),s&&Fg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ec(e,t),vc(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Fg(r)&&(this.markerStartAngle=0,r.remove()),i&&Fg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Fg(r)&&(this.markerEndAngle=0,r.remove()),i&&Fg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=e.x1,s=e.x2,l=e.y1,c=e.y2,u=t?n:r;if(u&&Fg(u)){var f,d,h,p,g,v,m;t?(p=o,g=l,d=s-o,h=c-l,v=i||0,m=this.markerStartAngle):(p=s,g=c,d=o-s,h=l-c,v=a||0,m=this.markerEndAngle),f=Math.atan2(h,d),u.setLocalEulerAngles(180*f/Math.PI+m),u.setLocalPosition(p+Math.cos(f)*v,g+Math.sin(f)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=Dc(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=pe(ee(),ie(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new xu(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return Ic(t.x1,t.y1,t.x2,t.y2)}}])}(Yg);tv.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var ev=["style"],nv=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ru(n,ev);pc(this,e),(t=Mc(this,e,[hc({type:ou.PATH,style:r,initialParsedStyle:{miterLimit:4,d:hc({},Ju)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,l=a.markerMid;return o&&Fg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&Fg(l)&&t.placeMarkerMid(l),s&&Fg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ec(e,t),vc(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Fg(r)&&(this.markerStartAngle=0,r.remove()),i&&Fg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fg(r)&&(this.markerEndAngle=0,r.remove()),i&&Fg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=t?n:r;if(o&&Fg(o)){var s,l,c,u,f,d,h;if(t){var p=Sc(this.getStartTangent(),2),g=p[0],v=p[1];u=v[0],f=v[1],l=g[0]-v[0],c=g[1]-v[1],d=i||0,h=this.markerStartAngle}else{var m=Sc(this.getEndTangent(),2),y=m[0],b=m[1];u=b[0],f=b[1],l=y[0]-b[0],c=y[1]-b[1],d=a||0,h=this.markerEndAngle}s=Math.atan2(c,l),o.setLocalEulerAngles(180*s/Math.PI+h),o.setLocalPosition(u+Math.cos(s)*d,f+Math.sin(s)*d)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Fg(t))for(var n=1;n<e.length-1;n++){var r=Sc(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Fd(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return En(t,e,Ie(Ie({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=pe(ee(),ie(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new xu(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Fd(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Yg);nv.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var rv=["style"],iv=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ru(n,rv);pc(this,e),(t=Mc(this,e,[hc({type:ou.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,l=a.markerMid;return o&&Fg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&Fg(l)&&t.placeMarkerMid(l),s&&Fg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ec(e,t),vc(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Fg(r)&&(this.markerStartAngle=0,r.remove()),i&&Fg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fg(r)&&(this.markerEndAngle=0,r.remove()),i&&Fg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=(e.points||{}).points,s=t?n:r;if(s&&Fg(s)&&o){var l,c,u,f,d,h,p;if(f=o[0][0],d=o[0][1],t)c=o[1][0]-o[0][0],u=o[1][1]-o[0][1],h=i||0,p=this.markerStartAngle;else{var g=o.length;this.parsedStyle.isClosed?(c=o[g-1][0]-o[0][0],u=o[g-1][1]-o[0][1]):(f=o[g-1][0],d=o[g-1][1],c=o[g-2][0]-o[g-1][0],u=o[g-2][1]-o[g-1][1]),h=a||0,p=this.markerEndAngle}l=Math.atan2(u,c),s.setLocalEulerAngles(180*l/Math.PI+p),s.setLocalPosition(f+Math.cos(l)*h,d+Math.sin(l)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Fg(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Yg);iv.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var av=["style"],ov=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=ru(t,av);return pc(this,e),Mc(this,e,[hc({type:ou.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return Ec(e,t),vc(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Wc(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach(function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=Ic(t[0],t[1],n[e+1][0],n[e+1][1]),o+=i,r[1]=o/s,a.push(r))}),this.parsedStyle.points.segments=a}var l=0,c=0;this.parsedStyle.points.segments.forEach(function(e,n){t>=e[0]&&t<=e[1]&&(l=(t-e[0])/(e[1]-e[0]),c=n)});var u=Dc(n[c][0],n[c][1],n[c+1][0],n[c+1][1],l),f=u.x,d=u.y,h=pe(ee(),ie(f,d,0),e?this.getWorldTransform():this.getLocalTransform());return new xu(h[0],h[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(iv);ov.PARSED_STYLE_LIST=new Set([].concat(bc(iv.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var sv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),Mc(this,e,[hc({type:ou.RECT},t)])}return Ec(e,t),vc(e)}(Yg);sv.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var lv=["style"],cv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=ru(t,lv);return pc(this,e),Mc(this,e,[hc({type:ou.TEXT,style:hc({fill:"black"},n)},r)])}return Ec(e,t),vc(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Yg);cv.PARSED_STYLE_LIST=new Set([].concat(bc(Yg.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var uv=function(){return vc(function t(){pc(this,t),this.registry={},this.define(ou.CIRCLE,Hg),this.define(ou.ELLIPSE,Xg),this.define(ou.RECT,sv),this.define(ou.IMAGE,Qg),this.define(ou.LINE,tv),this.define(ou.GROUP,Ug),this.define(ou.PATH,nv),this.define(ou.POLYGON,iv),this.define(ou.POLYLINE,ov),this.define(ou.TEXT,cv),this.define(ou.HTML,Zg)},[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),fv=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,a=t.syntax;Pg.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:a})},dv=function(t){function e(){var t;pc(this,e),(t=Mc(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Pg.AnimationTimeline(t)}catch(t){}var n={};return Mh.forEach(function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=y(i)?i(ou.GROUP):i)}),t.documentElement=new Ug({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return Ec(e,t),vc(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?cv:Ug);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(ku)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach(function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)}),a.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return null;var l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,u=l.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement}},{key:"elementFromPoint",value:(r=eu(Jc().mark(function t(e,n){var r,i,a,o,s,l,c,u,f,d,h;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(i<0||a<0||i>s||a>l)){t.next=1;break}return t.abrupt("return",null);case 1:return c=this.defaultView.viewport2Client({x:i,y:a}),u=c.x,f=c.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 2:return d=t.sent,h=d.picked,t.abrupt("return",h&&h[0]||this.documentElement);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return[];var l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,u=l.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f}},{key:"elementsFromPoint",value:(n=eu(Jc().mark(function t(e,n){var r,i,a,o,s,l,c,u,f,d,h;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(i<0||a<0||i>s||a>l)){t.next=1;break}return t.abrupt("return",[]);case 1:return c=this.defaultView.viewport2Client({x:i,y:a}),u=c.x,f=c.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 2:return d=t.sent,(h=d.picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),t.abrupt("return",h);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Mu)}},{key:"insertBefore",value:function(t,e){throw new Error(Mu)}},{key:"removeChild",value:function(t,e){throw new Error(Mu)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Mu)}},{key:"append",value:function(){throw new Error(Mu)}},{key:"prepend",value:function(){throw new Error(Mu)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(qp),hv=function(){function t(e){pc(this,t),this.strategies=e}return vc(t,[{key:"apply",value:function(e){var n=e.config,r=e.camera,i=e.renderingService,a=e.renderingContext,o=this.strategies;i.hooks.cull.tap(t.tag,function(t){if(t){var e,i=t.cullable;if(0===o.length?i.visible=a.unculledEntities.indexOf(t.entity)>-1:i.visible=o.every(function(e){return e.isVisible(r,t)}),!t.isCulled()&&t.isVisible())return t;var s=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return t.dispatchEvent(new Hp(tg.CULLED),s,s),null}return t}),i.hooks.afterRender.tap(t.tag,function(t){t.cullable.visibilityPlaneMask=-1})}}])}();hv.tag="Culling";var pv=function(){function t(){var e=this;pc(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Gp(null),this.rootWheelEvent=new Yp(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=nu(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.bootstrapEvent(e.rootPointerEvent,o,r,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=nu(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.bootstrapEvent(e.rootPointerEvent,o,i,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return vc(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)}),r.hooks.pointerDown.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=nu(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=n.bootstrapEvent(n.rootPointerEvent,o,i,t);n.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=nu(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=e.value,l=n.bootstrapEvent(n.rootPointerEvent,s,i,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,function(t){var e,r=nu(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=e.value,o=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(o)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,o=i.y;t.viewport.x=a,t.viewport.y=o;var s=this.context.eventService.viewport2Canvas(t.viewport),l=s.x,c=s.y;return t.canvas.x=l,t.canvas.y=c,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Zh[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var a=this.context.eventService.viewport2Canvas(e.viewport),o=a.x,s=a.y;return e.canvas.x=o,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Qh.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];V(i.button)&&(i.button=0),V(i.buttons)&&(i.buttons=1),V(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),V(i.width)&&(i.width=i.radiusX||1),V(i.height)&&(i.height=i.radiusY||1),V(i.tiltX)&&(i.tiltX=0),V(i.tiltY)&&(i.tiltY=0),V(i.pointerType)&&(i.pointerType="touch"),V(i.pointerId)&&(i.pointerId=i.identifier||0),V(i.pressure)&&(i.pressure=i.force||.5),V(i.twist)&&(i.twist=0),V(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;V(a.isPrimary)&&(a.isPrimary=!0),V(a.width)&&(a.width=1),V(a.height)&&(a.height=1),V(a.tiltX)&&(a.tiltX=0),V(a.tiltY)&&(a.tiltY=0),V(a.pointerType)&&(a.pointerType="mouse"),V(a.pointerId)&&(a.pointerId=1),V(a.pressure)&&(a.pressure=.5),V(a.twist)&&(a.twist=0),V(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();pv.tag="Event";var gv=[ou.CIRCLE,ou.ELLIPSE,ou.IMAGE,ou.RECT,ou.LINE,ou.POLYLINE,ou.POLYGON,ou.TEXT,ou.PATH,ou.HTML],vv=function(){return vc(function t(){pc(this,t)},[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(vu.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||yu.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==yu.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===yu.OUTSIDE||n===yu.INSIDE)return n;for(var i=yu.INSIDE,a=gv.indexOf(t.nodeName)>-1,o=0,s=r.length;o<s;++o){var l=1<<o;if(0!==(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,f=c.distance;if(fe(u,e.getPositiveFarPoint(r[o]))+f<0)return yu.OUTSIDE;fe(u,e.getNegativeFarPoint(r[o]))+f<0&&(i|=l)}}return i}}])}(),mv=function(){function t(){pc(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return vc(t,[{key:"apply",value:function(e){var n,r,i=this,a=e.config,o=e.renderingService,s=e.renderingContext,l=e.rBushRoot,c=s.root.ownerDocument.defaultView;this.rBush=l;var u=function(t){o.dirtify()},f=function(t){i.syncTasks.set(t.target,t.detail.affectChildren),o.dirtify()},d=function(t){var e=t.target;Pg.enableSizeAttenuation&&Pg.styleValueRegistry.updateSizeAttenuation(e,c.getCamera().getZoom())},h=function(t){var e=t.target,n=e.rBushNode;null!=n&&n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),Pg.sceneGraphService.dirtyToRoot(e),o.dirtify()};o.hooks.init.tap(t.tag,function(){c.addEventListener(tg.MOUNTED,d),c.addEventListener(tg.UNMOUNTED,h),c.addEventListener(tg.ATTR_MODIFIED,u),c.addEventListener(tg.BOUNDS_CHANGED,f)}),o.hooks.destroy.tap(t.tag,function(){c.removeEventListener(tg.MOUNTED,d),c.removeEventListener(tg.UNMOUNTED,h),c.removeEventListener(tg.ATTR_MODIFIED,u),c.removeEventListener(tg.BOUNDS_CHANGED,f),i.syncTasks.clear()});var p=null!==(n=Pg.globalThis.requestIdleCallback)&&void 0!==n?n:up.bind(Pg.globalThis),g=!0===(null===(r=a.future)||void 0===r?void 0:r.experimentalRICSyncRTree);o.hooks.endFrame.tap(t.tag,function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,p(function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0})):g&&Pg.globalThis.requestIdleCallback&&Pg.globalThis.cancelIdleCallback?(Pg.globalThis.cancelIdleCallback(i.ricSyncRTreeId),i.ricSyncRTreeId=Pg.globalThis.requestIdleCallback(function(){return i.syncRTree()})):i.syncRTree()})}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new vu),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=Sc(r.getMin(),2),o=a[0],s=a[1],l=Sc(r.getMax(),2),c=l[0],u=l[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=c,n.aabb.maxY=u}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach(function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement}),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();mv.tag="Prepare";var yv=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),bv=new Hp(tg.MOUNTED),xv=new Hp(tg.UNMOUNTED),wv=new Hp(yv.BEFORE_RENDER),kv=new Hp(yv.RERENDER),Mv=new Hp(yv.AFTER_RENDER),Ov=function(t){function e(t){var n;pc(this,e),(n=Mc(this,e)).Element=Yg,n.inited=!1,n.context={};var r=t.container,i=t.canvas,a=t.renderer,o=t.width,s=t.height,l=t.background,c=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,f=t.cleanUpOnDestroy,d=void 0===f||f,h=t.offscreenCanvas,p=t.devicePixelRatio,g=t.requestAnimationFrame,v=t.cancelAnimationFrame,m=t.createImage,y=t.supportsTouchEvents,b=t.supportsPointerEvents,x=t.isTouchEvent,w=t.isMouseEvent,k=t.dblClickSpeed,M=o,O=s,E=p||Vh&&window.devicePixelRatio||1;return E=E>=1?Math.ceil(E):1,i&&(M=o||function(t){var e=Kh(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/E,O=s||function(t){var e=Kh(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/E),n.customElements=new uv,n.devicePixelRatio=E,n.requestAnimationFrame=null!=g?g:up.bind(Pg.globalThis),n.cancelAnimationFrame=null!=v?v:fp.bind(Pg.globalThis),n.createImage=null!=m?m:function(){return new window.Image},n.supportsTouchEvents=null!=y?y:"ontouchstart"in Pg.globalThis,n.supportsPointerEvents=null!=b?b:!!Pg.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof Pg.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!Pg.globalThis.MouseEvent||t instanceof Pg.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Pg.globalThis.PointerEvent))},h&&(Pg.offscreenCanvas=h),n.document=new dv,n.document.defaultView=n,u||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Hh.has(r)&&Hh.get(r).destroy(n),Hh.set(r,e)}}(r,n,d),n.initRenderingContext(hc(hc({},t),{},{width:M,height:O,background:null!=l?l:"transparent",cursor:null!=c?c:"default",cleanUpOnDestroy:d,devicePixelRatio:E,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=k?k:200})),n.initDefaultCamera(M,O,a.clipSpaceNearZ),n.initRenderer(a,!0),n}return Ec(e,t),vc(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Pg.CameraContribution;i.clipSpaceNearZ=n,i.setType(Wu.EXPLORING,$u.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Yu,function(){r.context.renderingContext.renderReasons.add(Kp.CAMERA_CHANGED),Pg.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()}),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach(function(e){Pg.styleValueRegistry.updateSizeAttenuation(e,t)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise(function(e){t.resolveReadyPromise=function(){e(t)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0;Rf.clearCache();var r=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);n||this.dispatchEvent(new Hp(yv.BEFORE_DESTROY),r,r),this.frameId&&this.cancelAnimationFrame(this.frameId);var i=this.getRoot();e&&(this.unmountChildren(i),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),n||this.dispatchEvent(new Hp(yv.AFTER_DESTROY),r,r);var a=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};a(bv),a(xv),a(wv),a(kv),a(Mv),a(Wg),a(Rg),a(Ig),a(Dg),Pg.textService.clearCache()}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n,r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),a===Gu.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e);var o=!0===(null===(n=r.future)||void 0===n?void 0:n.experimentalCancelEventPropagation);this.dispatchEvent(new Hp(yv.RESIZE,{width:t,height:e}),o,o)}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e,n=this;t&&(wv.detail=t,Mv.detail=t);var r=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(wv,r,r),this.getRenderingService().render(this.getConfig(),t,function(){n.dispatchEvent(kv,r,r)}),this.dispatchEvent(Mv,r,r)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new au,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new pv,new mv,new hv([new vv])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(hc(hc({},Pg),this.context)),this.context.renderingService=new Zp(Pg,this.context),this.context.eventService=new Xp(Pg,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then(function(){e.initRenderingService(t,n)}).catch(function(t){console.error(t)})}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var i;e.inited=!0;var a=!0===(null===(i=e.getConfig().future)||void 0===i?void 0:i.experimentalCancelEventPropagation);n?r?e.requestAnimationFrame(function(){e.dispatchEvent(new Hp(yv.READY),a,a)}):e.dispatchEvent(new Hp(yv.READY),a,a):e.dispatchEvent(new Hp(yv.RENDERER_CHANGED),a,a),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach(function(t){var e,n;null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0)}),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()})}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(Pg)})}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),bc((null==n?void 0:n.getPlugins())||[]).reverse().forEach(function(t){t.destroy(Pg)}),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;if(t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited){if(t.isMutationObserved)t.dispatchEvent(xv);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);xv.target=t,this.dispatchEvent(xv,!0,r)}t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jh(t);if(this.inited){if(!t.isConnected&&(t.ownerDocument=this.document,t.isConnected=!0,!n))if(t.isMutationObserved)t.dispatchEvent(bv);else{var r,i=!0===(null===(r=this.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);bv.target=t,this.dispatchEvent(bv,!0,i)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName);t.childNodes.forEach(function(t){e.mountChildren(t,n)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Vp),Ev=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).landmarks=[],t}return Ec(e,t),vc(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=Ou(e),this.relAzimuth=Ou(t),this.relRoll=Ou(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Wu.EXPLORING){var r=Oe(Me(),[1,0,0],_u((this.rotateWorld?1:-1)*this.relElevation)),i=Oe(Me(),[0,1,0],_u((this.rotateWorld?1:-1)*this.relAzimuth)),a=Oe(Me(),[0,0,1],_u(this.relRoll)),o=Ee(Me(),i,r);o=Ee(Me(),o,a);var s=Gt(yt(),o);_t(this.matrix,this.matrix,[0,0,-this.distance]),At(this.matrix,this.matrix,s),_t(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Wu.ORBITING||this.type===Wu.EXPLORING?this._getPosition():this.type===Wu.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Su(t,e,0),r=ne(this.position);return se(r,r,ce(ee(),this.right,n[0])),se(r,r,ce(ee(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=ne(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Wu.ORBITING||this.type===Wu.EXPLORING?this._getDistance():this.type===Wu.TRACKING&&se(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,l=a.focalPoint,c=void 0===l?this.focalPoint:l,u=a.roll,f=a.zoom,d=new Pg.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),d.setFocalPoint(c[0],null!==(r=c[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=c[2])&&void 0!==i?i:this.focalPoint[2]),d.setRoll(null!=u?u:this.roll),d.setZoom(null!=f?f:this.zoom);var h={name:t,matrix:bt(d.getWorldTransform()),right:ne(d.right),up:ne(d.up),forward:ne(d.forward),position:ne(d.getPosition()),focalPoint:ne(d.getFocalPoint()),distanceVector:ne(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(h),h}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=L(t)?this.landmarks.find(function(e){return e.name===t}):t;if(r){var i=I(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,l=void 0===s?100:s,c=i.easingFunction,u=void 0===c?void 0:c,f=i.onfinish,d=void 0===f?void 0:f,h=i.onframe,p=void 0===h?void 0:h;this.cancelLandmarkAnimation();var g,v=r.position,m=r.focalPoint,y=r.zoom,b=r.roll,x=u||Pg.EasingFunction(o),w=function(){e.setFocalPoint(m),e.setPosition(v),e.setRoll(b),e.setZoom(y),e.computeMatrix(),e.triggerUpdate(),null==d||d()};if(0===l)return w();var k=function(t){void 0===g&&(g=t);var n=t-g;if(n>=l)w();else{var r,i,a=x(n/l),o=ee(),s=ee();if(he(o,e.focalPoint,m,a),he(s,e.position,v,a),i=e.roll*(1-a)+b*a,r=e.zoom*(1-a)+y*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),ye(o,m)+ye(s,v)<=.01&&void 0===y&&void 0===b)return w();e.computeMatrix(),e.triggerUpdate(),n<l&&(null==p||p(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(k))}};this.canvas.requestAnimationFrame(k)}}}])}(Vu);Pg.CameraContribution=Ev;
12
12
  /*!
13
13
  * @antv/g-web-animations-api
14
14
  * @description A simple implementation of Web Animations API.
@@ -17,7 +17,7 @@ var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toS
17
17
  * @author AntVis
18
18
  * @docs https://g.antv.antgroup.com/
19
19
  */
20
- var Nv=function(t){function e(t,n,r,i){var a;return pc(this,e),(a=Mc(this,e,[t])).currentTime=r,a.timelineTime=i,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=r,a.timelineTime=i,a}return Ec(e,t),vc(e)}(Hp),Pv=0,Cv=function(){return vc(function t(e,n){var r;pc(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Pv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Nv(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(e)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Su)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Su)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Su)}},{key:"dispatchEvent",value:function(t){throw new Error(Su)}},{key:"commitStyles",value:function(){throw new Error(Su)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Nv(null,this,this.currentTime,t);setTimeout(function(){e.onfinish&&e.onfinish(n)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Nv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),Lv=.1,jv="function"==typeof Float32Array,Rv=function(t,e){return 1-3*e+3*t},Iv=function(t,e){return 3*e-6*t},Dv=function(t){return 3*t},Bv=function(t,e,n){return((Rv(e,n)*t+Iv(e,n))*t+Dv(e))*t},Fv=function(t,e,n){return 3*Rv(e,n)*t*t+2*Iv(e,n)*t+Dv(e)},zv=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=jv?new Float32Array(11):new Array(11),a=0;a<11;++a)i[a]=Bv(a*Lv,t,n);var o=function(e){for(var r=0,a=1;10!==a&&i[a]<=e;++a)r+=Lv;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*Lv,s=Fv(o,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var a=Fv(e,n,r);if(0===a)return e;e-=(Bv(e,n,r)-t)/a}return e}(e,o,t,n):0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=Bv(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,r,r+Lv,t,n)};return function(t){return 0===t||1===t?t:Bv(o(t),e,r)}},Wv=function(t){return Math.pow(t,2)},$v=function(t){return Math.pow(t,3)},Gv=function(t){return Math.pow(t,4)},Yv=function(t){return Math.pow(t,5)},Hv=function(t){return Math.pow(t,6)},Vv=function(t){return 1-Math.cos(t*Math.PI/2)},qv=function(t){return 1-Math.sqrt(1-t*t)},Xv=function(t){return t*t*(3*t-2)},Uv=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Kv=function(t){var e=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],a=void 0===i?.5:i,o=R(Number(r),1,10),s=R(Number(a),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/s)},Zv=function(t){var e=arguments.length>2?arguments[2]:void 0,n=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,a=n[1],o=void 0===a?100:a,s=n[2],l=void 0===s?10:s,c=n[3],u=void 0===c?0:c;i=R(i,.1,1e3),o=R(o,.1,1e3),l=R(l,.1,1e3),u=R(u,.1,1e3);var f=Math.sqrt(o/i),d=l/(2*Math.sqrt(o*i)),h=d<1?f*Math.sqrt(1-d*d):0,p=d<1?(d*f-u)/h:-u+f,g=e?e*t/1e3:t;return g=d<1?Math.exp(-g*d*f)*(1*Math.cos(h*g)+p*Math.sin(h*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Qv=function(t){var e=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(R(t,0,1)*r)/r},Jv=function(t){var e=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],a=e[3];return zv(n,r,i,a)(t)},tm=zv(.42,0,1,1),em=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},nm=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},rm=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},im={steps:Qv,"step-start":function(t){return Qv(t,[1,"start"])},"step-end":function(t){return Qv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Jv,ease:function(t){return Jv(t,[.25,.1,.25,1])},in:tm,out:em(tm),"in-out":nm(tm),"out-in":rm(tm),"in-quad":Wv,"out-quad":em(Wv),"in-out-quad":nm(Wv),"out-in-quad":rm(Wv),"in-cubic":$v,"out-cubic":em($v),"in-out-cubic":nm($v),"out-in-cubic":rm($v),"in-quart":Gv,"out-quart":em(Gv),"in-out-quart":nm(Gv),"out-in-quart":rm(Gv),"in-quint":Yv,"out-quint":em(Yv),"in-out-quint":nm(Yv),"out-in-quint":rm(Yv),"in-expo":Hv,"out-expo":em(Hv),"in-out-expo":nm(Hv),"out-in-expo":rm(Hv),"in-sine":Vv,"out-sine":em(Vv),"in-out-sine":nm(Vv),"out-in-sine":rm(Vv),"in-circ":qv,"out-circ":em(qv),"in-out-circ":nm(qv),"out-in-circ":rm(qv),"in-back":Xv,"out-back":em(Xv),"in-out-back":nm(Xv),"out-in-back":rm(Xv),"in-bounce":Uv,"out-bounce":em(Uv),"in-out-bounce":nm(Uv),"out-in-bounce":rm(Uv),"in-elastic":Kv,"out-elastic":em(Kv),"in-out-elastic":nm(Kv),"out-in-elastic":rm(Kv),spring:Zv,"spring-in":Zv,"spring-out":em(Zv),"spring-in-out":nm(Zv),"spring-out-in":rm(Zv)},am=function(t){return t};function om(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var sm="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",lm=new RegExp("cubic-bezier\\(".concat(sm,",").concat(sm,",").concat(sm,",").concat(sm,"\\)")),cm=/steps\(\s*(\d+)\s*\)/,um=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function fm(t){var e=lm.exec(t);if(e)return zv.apply(void 0,bc(e.slice(1).map(Number)));var n=cm.exec(t);if(n)return om(Number(n[1]),0);var r=um.exec(t);return r?om(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):im[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||im.linear}function dm(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function hm(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?1!==e&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),l=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,l,s);return n.currentIteration=l,n.progress=c,n.easingFunction(c)}function pm(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(gm(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:fm(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,f=c;0===a&&(u=-1/0,0===c&&(s=o)),a===i.length-2&&(f=1/0,1===l&&(o=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:mm(r,i[o].value,i[s].value,e)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}(r,n);return function(t,e){if(null!==e)i.filter(function(t){return e>=t.applyFrom&&e<t.applyTo}).forEach(function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,a=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(a),!1,!1)});else for(var n in r)gm(n)&&t.setAttribute(n,null)}}function gm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var vm=function(t,e,n){return function(r){var i=ym(t,e,r);return I(i)?i:n(i)}};function mm(t,e,n,r){var i=Th[t];if(i&&i.syntax&&i.int){var a=Rg.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o=a.parser,s=o?o(e,r):e,l=o?o(n,r):n,c=a.mixer(s,l,r);if(c){var u=vm.apply(void 0,bc(c));return function(t){return 0===t?e:1===t?n:u(t)}}}}return vm(!1,!0,function(t){return t?n:e})}function ym(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;s<a;s++)o.push(ym(t[s<r?s:r-1],e[s<i?s:i-1],n));return o}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var bm=function(){return vc(function t(){pc(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=am,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=fm(t),this._easing=t}}])}();function xm(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;a<i;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}void 0!==r[a]&&null!==r[a]&&(e[a][n]=r[a])}}return e.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),e}(t));for(var n=t.map(function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),r=!0,i=-1/0,a=0;a<n.length;a++){var o=n[a].offset;if(b(o))r=!1;else{if(o<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}return n=n.filter(function(t){return Number(t.offset)>=0&&Number(t.offset)<=1}),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,a=Number(n[0].computedOffset),o=1;o<r;o++){var s=n[o].computedOffset;if(!b(s)&&!b(a)){for(var l=1;l<o-i;l++)n[i+l].computedOffset=a+(Number(s)-a)*l/(o-i);i=o,a=Number(s)}}}(),n}var wm="backwards|forwards|both|none".split("|"),km="reverse|alternate|alternate-reverse".split("|");function Mm(t,e){return function(t,e){var n=new bm;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach(function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===wm.indexOf(t[e]))return;if("direction"===e&&-1===km.indexOf(t[e]))return;n[e]=t[e]}}):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Om=function(){return vc(function t(e,n,r){var i=this;pc(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=Mm(r,!1),this.timing.effect=this,this.timing.activeDuration=dm(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=xm(n,this.timing),this.interpolations=pm(this.normalizedKeyframes,this.timing,this.target);var a=Rg.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=hm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=xm(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach(function(n){e.timing[n]=t[n]})}}])}();function Em(t,e){return Number(t.id)-Number(e.id)}var Sm=function(){return vc(function t(e){var n=this;pc(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(Em),n.animations=n.tick(t,!0,n.animations)[0],e.forEach(function(e){e[1](t)}),n.applyPendingEffects()},this.document=e},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new Om(t,e,n),i=new Cv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Em),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach(function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){null==t||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF(function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()})}},{key:"tick",value:function(t,e,n){var r,i,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],l=[],c=[];return n.forEach(function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?l.push(n):c.push(n)}),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[l,c]}}])}();function Am(t){return new _m([t],null,t,t.ownerDocument)}Rg.EasingFunction=fm,Rg.AnimationTimeline=Sm;class _m{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new _m(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new _m(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new _m([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,a]=Array.isArray(r)?r:[r,null],o=e(i,t);o.__data__=i,null!==a&&(o.__fromElements__=a),this._parent.appendChild(o),n.push(o)}return new _m(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new _m(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new _m([i],null,this._parent,this._document);const a="string"==typeof e?this.createElement(e):e();return a.id=t,n&&(a.className=n),r.appendChild(a),new _m([a],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],a=new Set(this._elements),o=[],s=new Set,l=new Map(this._elements.map((t,n)=>[e(t.__data__,n),t])),c=new Map(this._facetElements.map((t,n)=>[e(t.__data__,n),t])),u=rr(this._elements,t=>n(t.__data__));for(let f=0;f<t.length;f++){const d=t[f],h=e(d,f),p=n(d,f);if(l.has(h)){const t=l.get(h);t.__data__=d,t.__facet__=!1,i.push(t),a.delete(t),l.delete(h)}else if(c.has(h)){const t=c.get(h);t.__data__=d,t.__facet__=!0,i.push(t),c.delete(h)}else if(u.has(h)){const t=u.get(h);o.push([d,t]);for(const e of t)a.delete(e);u.delete(h)}else if(l.has(p)){const t=l.get(p);t.__toData__?t.__toData__.push(d):t.__toData__=[d],s.add(t),a.delete(t)}else r.push(d)}const f=[new _m([],r,this._parent,this._document),new _m(i,null,this._parent,this._document),new _m(a,null,this._parent,this._document),new _m([],o,this._parent,this._document),new _m(s,null,this._parent,this._document)];return new _m(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new _m(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=_m.registry[t];return e?new e:Ua(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const a=t(this._enter),o=e(this._update),s=n(this._exit),l=r(this._merge),c=i(this._split);return o.merge(a).merge(s).merge(l).merge(c)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(this._elements[t].__removed__=!0,e){const n=Array.isArray(e)?e:[e];Promise.all(n.map(t=>t.finished)).then(()=>{const e=this._elements[t];e.__removed__&&e.remove()})}else{const e=this._elements[t];e.__removed__&&e.remove()}}return new _m([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,a){void 0!==e&&(a[t]=n(r,i,a))})}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,a){void 0!==e&&(a.style[t]=n(r,i,a))})}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each(function(t,r,i){n[r]=e(t,r,i)})}on(t,e){return this.each(function(n,r,i){i.addEventListener(t,e)}),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function Tm(t,e,n){return Math.max(e,Math.min(t,n))}function Nm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Pm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Cm(t,e,n,r,i){const a=Ps(_s(r,e))+Math.PI,o=Ps(_s(r,n))+Math.PI;return t.arc(r[0],r[1],i,a,o,o-a<0),t}function Lm(t,e,n,r="y",i="between",a=!1){const o="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,a),l=so(o),[c,u]=Qn(l,t=>o[t]),f=new pa({domain:[c,u],range:[0,100]}),d=t=>I(o[t])&&!Number.isNaN(o[t])?f.map(o[t]):0,h={between:e=>`${t[e]} ${d(e)}%`,start:e=>0===e?`${t[e]} ${d(e)}%`:`${t[e-1]} ${d(e)}%, ${t[e]} ${d(e)}%`,end:e=>e===t.length-1?`${t[e]} ${d(e)}%`:`${t[e]} ${d(e)}%, ${t[e+1]} ${d(e)}%`},p=l.sort((t,e)=>d(t)-d(e)).map(h[i]||h.between).join(",");return`linear-gradient(${s}deg, ${p})`}function jm(t){const[e,n,r,i]=t;return[i,e,n,r]}function Rm(t,e,n){const[r,i,,a]=Jl(t)?jm(e):e,[o,s]=n,l=t.getCenter(),c=Cs(_s(r,l)),u=Cs(_s(i,l)),f=u===c&&o!==s?u+2*Math.PI:u,d=1e-4;return{startAngle:c+d,endAngle:(f-c>=0?f:2*Math.PI+f)-d,innerRadius:Ns(a,l),outerRadius:Ns(r,l)}}function Im(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Dm(t,e){if(!tc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Bm(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,a,o=0]]=t;return[(e+i)/2,(n+a)/2,(r+o)/2]}function Fm(t,e,n,r,i={}){const{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:f=o,radiusBottomRight:d=o,radiusTopLeft:h=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:v=1/0,minHeight:m=-1/0}=i,y=De(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!tc(r)&&!nc(r)){const n=!!Jl(r),[i,,a]=n?jm(e):e,[o,b]=i,[x,w]=_s(a,i),k=(x>0?o:o+x)+s,M=(w>0?b:b+w)+l,O=Math.abs(x)-(s+c),E=Math.abs(w)-(l+u),S=n?Tm(O,m,1/0):Tm(O,g,v),A=n?Tm(E,g,v):Tm(E,m,1/0),_=n?k:k-(S-O)/2,T=n?M-(A-E)/2:M-(A-E);return Am(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[h,p,d,f]).call(Pm,y).node()}const{y:b,y1:x}=n,w=r.getCenter(),k=Rm(r,e,[b,x]),M=yl().cornerRadius(o).padAngle(a*Math.PI/180);return Am(t.createElement("path",{})).style("d",M(k)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",o).style("inset",a).call(Pm,y).node()}_m.registry={g:Jg,rect:fv,circle:Ug,path:ov,text:hv,ellipse:Qg,image:nv,line:iv,polygon:lv,polyline:uv,html:ev};const zm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,o=De(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:l}=e;return(e,r,c)=>{const{color:u,radius:f=0}=c,d=De(c,["color","radius"]),h=d.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:m=g,radiusBottomRight:y=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:k=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:O=x,lineWidth:E=("stroke"===n||p?h:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:N=S,minWidth:P,maxWidth:C,minHeight:L}=o,j=De(o,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,D=[i?v:w,i?m:k,a?y:M,a?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Jl(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map((t,e)=>[t,D[e]]))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:N,minWidth:P,maxWidth:C,minHeight:L});return Am(Fm(l,e,r,s,F)).call(Pm,d).style("fill","transparent").style(n,R).style(Im(t),I).style("lineWidth",E).style("stroke",void 0===p?R:p).call(Pm,j).node()}};zm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Wm=(t,e)=>zm(Object.assign({colorAttribute:"fill"},t),e);Wm.props=Object.assign(Object.assign({},zm.props),{defaultMarker:"square"});const $m=(t,e)=>zm(Object.assign({colorAttribute:"stroke"},t),e);function Gm(t,e,n){const[r,i,a,o]=t;if(Jl(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:a[0],a[1]],o]}return[r,[i[0],e?e[0][1]:i[1]],[a[0],e?e[3][1]:a[1]],o]}$m.props=Object.assign(Object.assign({},zm.props),{defaultMarker:"hollowSquare"});const Ym=(t,e)=>{const{adjustPoints:n=Gm}=t,r=De(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(t,e,o,s)=>{const{index:l}=e,{color:c}=o,u=De(o,["color"]),f=s[l+1],d=n(t,f,i),h=!!Jl(i),[p,g,v,m]=h?jm(d):d,{color:y=c,opacity:b}=e,x=Ol().curve(Fl)([p,g,v,m]);return Am(a.createElement("path",{})).call(Pm,u).style("d",x).style("fill",y).style("fillOpacity",b).call(Pm,r).node()}};function Hm(t,e,n){const[r,i,a,o]=t;if(Jl(n)){return[r,[e?e[0][0]:(i[0]+a[0])/2,i[1]],[e?e[3][0]:(i[0]+a[0])/2,a[1]],o]}return[r,[i[0],e?e[0][1]:(i[1]+a[1])/2],[a[0],e?e[3][1]:(i[1]+a[1])/2],o]}Ym.props={defaultMarker:"square"};const Vm=(t,e)=>Ym(Object.assign({adjustPoints:Hm},t),e);function qm(t){const e="function"==typeof t?t:t.render;return class extends Zg{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Vm.props={defaultMarker:"square"};const Xm=qm(t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,a=t.ownerDocument;Am(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(Pm,r),Am(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(Pm,i)});const Um=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:a=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,s=De(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:l,document:c}=e;return(t,e,u)=>{const{color:f,lineWidth:d}=u,h=De(u,["color","lineWidth"]),{color:p=f,size:g=d,seriesColor:v,seriesX:m,seriesY:y}=e,b=Dm(l,e),x=Jl(l),w=r&&v?Lm(v,m,y,r,i,x):p,k=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},h),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(tc(l)){const t=l.getCenter();M=e=>Tl(Ol().curve(Sl)).angle((n,r)=>Cs(_s(e[r],t))).radius((n,r)=>Ns(e[r],t)).defined(([t,e])=>a(t)&&a(e)).curve(n)(e)}else M=Ol().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>a(t)&&a(e)).curve(n);const[O,E]=function(t,e){const n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,a),S=Ja(k,"connect"),A=!!E.length;if(!A||o&&!Object.keys(S).length)return Am(c.createElement("path",{})).style("d",M(O)||[]).call(Pm,k).node();if(A&&!o)return Am(c.createElement("path",{})).style("d",M(t)).call(Pm,k).node();return Am(new Xm).style("style1",Object.assign(Object.assign({},k),S)).style("style2",k).style("d1",(_=E,_.map(M).join(","))).style("d2",M(t)).node();var _}};Um.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Km=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=tc(n)?Fl:wl;return Um(Object.assign({curve:i},t),e)(...r)}};Km.props=Object.assign(Object.assign({},Um.props),{defaultMarker:"line"});const Zm=(t,e)=>{const n=De(t,[]),{coordinate:r}=e;return(...t)=>{const i=tc(r)?Dl:Jl(r)?Xl:ql;return Um(Object.assign({curve:i},n),e)(...t)}};Zm.props=Object.assign(Object.assign({},Um.props),{defaultMarker:"smooth"});const Qm=(t,e)=>Um(Object.assign({curve:Ql},t),e);Qm.props=Object.assign(Object.assign({},Um.props),{defaultMarker:"hv"});const Jm=(t,e)=>Um(Object.assign({curve:Zl},t),e);Jm.props=Object.assign(Object.assign({},Um.props),{defaultMarker:"vh"});const ty=(t,e)=>Um(Object.assign({curve:Kl},t),e);function ey(t,e,n,r,i){const a=Ps(_s(n,e)),o=a+Math.PI/2,s=[r/2*Math.cos(o),r/2*Math.sin(o)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],u=[r/2*Math.cos(a),r/2*Math.sin(a)],f=Ts(e,s),d=Ts(n,l),h=Ts(d,c),p=Ts(n,c),g=_s(p,l),v=_s(n,l),m=_s(e,s),y=_s(m,u),b=_s(e,u),x=_s(f,u);t.moveTo(...f),t.lineTo(...d),t.arcTo(...h,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...m),t.arcTo(...y,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}ty.props=Object.assign(Object.assign({},Um.props),{defaultMarker:"hvh"});const ny=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:a,color:o}=r,{color:s}=i,l=De(i,["color"]),c=ul();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=a[t],o=a[t+1];[...n,...r].every(Za)&&ey(c,n,r,i,o)}return Am(n.createElement("path",{})).call(Pm,l).style("fill",o||s).style("d",c.toString()).call(Pm,t).node()}};ny.props=Object.assign(Object.assign({},Um.props),{defaultMarker:"line"});const ry=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];ry.style=["fill"];const iy=ry.bind(void 0);iy.style=["stroke","lineWidth"];const ay=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];ay.style=["fill"];const oy=ay.bind(void 0);oy.style=["fill"];const sy=ay.bind(void 0);sy.style=["stroke","lineWidth"];const ly=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};ly.style=["fill"];const cy=ly.bind(void 0);cy.style=["stroke","lineWidth"];const uy=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};uy.style=["fill"];const fy=uy.bind(void 0);fy.style=["stroke","lineWidth"];const dy=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};dy.style=["fill"];const hy=dy.bind(void 0);hy.style=["stroke","lineWidth"];const py=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};py.style=["fill"];const gy=py.bind(void 0);gy.style=["stroke","lineWidth"];const vy=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};vy.style=["fill"];const my=vy.bind(void 0);my.style=["stroke","lineWidth"];const yy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];yy.style=["stroke","lineWidth"];const by=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];by.style=["stroke","lineWidth"];const xy=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];xy.style=["stroke","lineWidth"];const wy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];wy.style=["stroke","lineWidth"];const ky=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];ky.style=["stroke","lineWidth"];const My=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];My.style=["stroke","lineWidth"];const Oy=My.bind(void 0);Oy.style=["stroke","lineWidth"];const Ey=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];Ey.style=["stroke","lineWidth"];const Sy=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];Sy.style=["stroke","lineWidth"];const Ay=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];Ay.style=["stroke","lineWidth"];const _y=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];_y.style=["stroke","lineWidth"];const Ty=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];Ty.style=["stroke","lineWidth"];const Ny=new Map([["bowtie",vy],["cross",by],["dash",Oy],["diamond",ly],["dot",My],["hexagon",py],["hollowBowtie",my],["hollowDiamond",cy],["hollowHexagon",gy],["hollowPoint",iy],["hollowSquare",sy],["hollowTriangle",fy],["hollowTriangleDown",hy],["hv",Sy],["hvh",_y],["hyphen",ky],["line",yy],["plus",wy],["point",ry],["rect",oy],["smooth",Ey],["square",ay],["tick",xy],["triangleDown",dy],["triangle",uy],["vh",Ay],["vhv",Ty]]);function Py(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function Cy(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||ic(r)){const[[t,n],[r,i]]=e,a=Math.abs((r-t)/2),o=Math.abs((i-n)/2);return Math.max(0,(a+o)/2)}return i}const Ly=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,a=De(t,["colorAttribute","symbol","mode"]),o=Ny.get(Py(r))||Ny.get("point"),{coordinate:s,document:l}=e;return(e,r,c)=>{const{lineWidth:u,color:f}=c,d=a.stroke?u||1:u,{color:h=f,transform:p,opacity:g}=r,[v,m]=Bm(e),y=Cy(i,e,r,s)||a.r||c.r;return Am(l.createElement("path",{})).call(Pm,c).style("fill","transparent").style("d",o(v,m,y)).style("lineWidth",d).style("transform",p).style("transformOrigin",`${v-y} ${m-y}`).style("stroke",h).style(Im(t),g).style(n,h).call(Pm,a).node()}};Ly.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);jy.props=Object.assign({defaultMarker:"hollowBowtie"},Ly.props);const Ry=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Ry.props=Object.assign({defaultMarker:"hollowDiamond"},Ly.props);const Iy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);Iy.props=Object.assign({defaultMarker:"hollowHexagon"},Ly.props);const Dy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Dy.props=Object.assign({defaultMarker:"hollowPoint"},Ly.props);const By=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);By.props=Object.assign({defaultMarker:"hollowSquare"},Ly.props);const Fy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Fy.props=Object.assign({defaultMarker:"hollowTriangle"},Ly.props);const zy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);zy.props=Object.assign({defaultMarker:"hollowTriangleDown"},Ly.props);const Wy=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=De(t,["colorAttribute","mode"]),{coordinate:a,document:o}=e;return(e,s,l)=>{const{lineWidth:c,color:u}=l,f=i.stroke?c||1:c,{color:d=u,transform:h,opacity:p}=s,[g,v]=Bm(e),m=Cy(r,e,s,a)||i.r||l.r;return Am(o.createElement("circle",{})).call(Pm,l).style("fill","transparent").style("cx",g).style("cy",v).style("r",m).style("lineWidth",f).style("transform",h).style("transformOrigin",`${g} ${v}`).style("stroke",d).style(Im(t),p).style(n,d).call(Pm,i).node()}},$y=(t,e)=>Wy(Object.assign({colorAttribute:"fill"},t),e);$y.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Gy=(t,e)=>Wy(Object.assign({colorAttribute:"stroke"},t),e);Gy.props=Object.assign({defaultMarker:"hollowPoint"},$y.props);const Yy=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Yy.props=Object.assign({defaultMarker:"bowtie"},Ly.props);const Hy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Hy.props=Object.assign({defaultMarker:"cross"},Ly.props);const Vy=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Vy.props=Object.assign({defaultMarker:"diamond"},Ly.props);const qy=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);qy.props=Object.assign({defaultMarker:"hexagon"},Ly.props);const Xy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Xy.props=Object.assign({defaultMarker:"hyphen"},Ly.props);const Uy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Uy.props=Object.assign({defaultMarker:"line"},Ly.props);const Ky=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Ky.props=Object.assign({defaultMarker:"plus"},Ly.props);const Zy=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Zy.props=Object.assign({defaultMarker:"point"},Ly.props);const Qy=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Qy.props=Object.assign({defaultMarker:"square"},Ly.props);const Jy=(t,e)=>Ly(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Jy.props=Object.assign({defaultMarker:"tick"},Ly.props);const tb=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);tb.props=Object.assign({defaultMarker:"triangle"},Ly.props);const eb=(t,e)=>Ly(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);eb.props=Object.assign({defaultMarker:"triangleDown"},Ly.props);const nb=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=De(t,["arrow","arrowSize"]),{document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,l=De(o,["defaultColor"]),{color:c=s,transform:u}=e,[f,d]=t,h=ul();if(h.moveTo(...f),h.lineTo(...d),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*Ns(t,e):r,a=Math.PI/6,o=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-o-a,l=o-a;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(l),e[1]-i*Math.sin(l)]]}(f,d,{arrowSize:r});h.moveTo(...t),h.lineTo(...d),h.lineTo(...e)}return Am(a.createElement("path",{})).call(Pm,l).style("d",h.toString()).style("stroke",c).style("transform",u).call(Pm,i).node()}};function rb(t,e){e(t),t.children&&t.children.forEach(function(t){t&&rb(t,e)})}function ib(t){ob(t,!0)}function ab(t){ob(t,!1)}function ob(t,e){var n=e?"visible":"hidden";rb(t,function(t){t.attr("visibility",n)})}nb.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var sb=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,$e([],We(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(ig.INSERTED,function(){ab(r)}),r}return Re(e,t),e}(Jg);function lb(t){var e=t.appendChild(new sb({class:"offscreen"}));return ab(e),e}var cb=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=De(e,["style"]);return t.call(this,Ie({style:Ie({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return Re(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=lb(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(hv);function ub(t){return t*Math.PI/180}function fb(t){return Number((180*t/Math.PI).toPrecision(5))}var db=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function hb(t,e){return y(t)?t.apply(void 0,$e([],We(e),!1)):t}var pb,gb,vb,mb,yb=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map(function(t){var e=We(t,2),r=e[0],i=e[1],a=n(i);return[r,{name:a,class:".".concat(a),id:"#".concat(a),toString:function(){return a}}]}));return Object.assign(r,{prefix:n}),r},bb=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach(function(i){var a=We(i,2),o=a[0],s=a[1],l=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?A(s)?(A(t[o])||(l[o]={}),n<r?bb(t[o],s,n+1,r):l[o]=e[o]):x(s)?(l[o]=[],l[o]=l[o].concat(s)):l[o]=s:l[o]=s)})},xb=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)bb(t,e[r]);return t},wb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},kb=(gb=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return pb||(pb=Rg.offscreenCanvasCreator.getOrCreateContext(void 0)),pb.font=[a,o,i,"".concat(n,"px"),r].join(" "),pb.measureText(t).width},vb=function(t,e){return[t,Object.values(e||Mb(t)).join()].join("")},void 0===(mb=4096)&&(mb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vb?vb.apply(this,t):t[0];Z.has(gb)||Z.set(gb,function(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}(mb));var r=Z.get(gb);if(r.has(n))return r.get(n);var i=gb.apply(this,t);return r.set(n,i),i}),Mb=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,a=t.style.fontSize;return{fontSize:a="object"==typeof a?a.value:a,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function Ob(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Eb(t,e){var n=Ob(t);n&&n.attr(e)}function Sb(t,e,n){void 0===n&&(n="..."),Eb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Ab(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var a=n[0];return[a.clientX,a.clientY]}return r&&i?[r,i]:[0,0]}function _b(t){var e=t.nativeEvent,n=t.touches,r=t.clientX,i=t.clientY;if(e)return[e.clientX,e.clientY];if(n){var a=n[0];return[a.clientX,a.clientY]}return"number"==typeof r&&"number"==typeof i?[r,i]:[0,0]}function Tb(t){return"function"==typeof t?t():L(t)||I(t)?new cb({style:{text:String(t)}}):t}function Nb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function Pb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function Cb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var a=new Array(r),o=new Array(n),s=0;for(s=0;s<r;++s)a[s]=Cb(t[s],e[s]);for(;s<n;++s)o[s]=e[s];for(s=0;s<r;++s)o[s]=a[s](i);return o}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach(function(e){var i=We(e,2),a=i[0],o=i[1];a in t?n[a]=Cb(t[a],o):r[a]=o}),function(t){return Object.entries(n).forEach(function(e){var n=We(e,2),i=n[0],a=n[1];return r[i]=a(t)}),r}}(t,e):function(e){return t}}function Lb(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,l=o.y,c=We([s+o.width,l+o.height],2),u=c[0],f=c[1];s<e&&(e=s),l<n&&(n=l),u>r&&(r=u),f>i&&(i=f)}return new db(e,n,r-e,i-n)}var jb=function(t,e,n){var r=t.width,i=t.height,a=n.flexDirection,o=void 0===a?"row":a,s=n.justifyContent,l=void 0===s?"flex-start":s,c=n.alignItems,u=void 0===c?"flex-start":c,f="row"===o,d="row"===o||"column"===o,h=f?d?[1,0]:[-1,0]:d?[0,1]:[0,-1],p=We([0,0],2),g=p[0],v=p[1],m=e.map(function(t){var e,n=t.width,r=t.height,i=We([g,v],2),a=i[0],o=i[1];return e=We([g+n*h[0],v+r*h[1]],2),g=e[0],v=e[1],new db(a,o,n,r)}),y=Lb(m),b={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},x=m.map(function(t){var e=t.x,n=t.y,r=db.fromRect(t);return r.x=f?e+b[l]:e,r.y=f?n:n+b[l],r});Lb(x);var w=function(t){var e=We(f?["height",i]:["width",r],2),n=e[0],a=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return a-t[n];case"center":return a/2-t[n]/2}},k=x.map(function(t){var e=t.x,n=t.y,r=db.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r}),M=k.map(function(e){var n,r,i=db.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i});return M},Rb=function(t,e,n){return[]};function Ib(t,e){return[t[0]*e,t[1]*e]}function Db(t,e){return[t[0]+e[0],t[1]+e[1]]}function Bb(t,e){return[t[0]-e[0],t[1]-e[1]]}function Fb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function zb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Wb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function $b(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Gb(t,e){return+t.toPrecision(e)}function Yb(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Hb(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],a=0,o=t.length;a<o;a+=2)i.push([t[a],t[a+1]]);var s,l,c,u=function(t,e,n,r){var i,a,o,s,l,c,u=[],f=!!r,d=[1/0,1/0],h=[-1/0,-1/0];if(f){d=(i=We(r,2))[0],h=i[1];for(var p=0,g=t.length;p<g;p+=1)d=Fb(d,m=t[p]),h=zb(h,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){a=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=Ib(y=Bb(o=t[n?(p+1)%v:p+1],a),e);var b=Wb(m,a),x=Wb(m,o),w=b+x;0!==w&&(b/=w,x/=w);var k=Ib(y,-b),M=Ib(y,x);l=Db(m,k),s=Fb(s=Db(m,M),zb(o,m)),s=zb(s,Fb(o,m)),l=Fb(l=Db(m,k=Ib(k=Bb(s,m),-b/x)),zb(a,m)),s=Db(m,M=Ib(M=Bb(m,l=zb(l,Fb(a,m))),x/b)),f&&(l=Fb(l=zb(l,d),h),s=Fb(s=zb(s,d),h)),u.push(c),u.push(l),c=s}else l=m,u.push(c),u.push(l);else c=m}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,d=[];for(a=0;a<f-1;a+=1)s=u[2*a],l=u[2*a+1],c=i[a+1],d.push(["C",s[0],s[1],l[0],l[1],c[0],c[1]]);return r&&(s=u[f],l=u[f+1],c=We(i,1)[0],d.push(["C",s[0],s[1],l[0],l[1],c[0],c[1]])),d}var Vb=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function qb(t){return Vb.includes(t)}function Xb(t){var e={};for(var n in t)qb(n)&&(e[n]=t[n]);return e}function Ub(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,a=r.height,o=e/Math.max(i,a);return n&&(t.style.transform="scale(".concat(o,")")),o}var Kb=function(){function t(t,n,r,i,a,o,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===a&&(a=[null,null,null,null,null]),void 0===o&&(o=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var a=0;a<this._data.length;a++){var o=this._data[a],s=We(Array.isArray(o)?o:[o,null],2),l=s[0],c=s[1];(f=r(l,a)).__data__=l,null!==c&&(f.__fromElements__=c),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(a=0;a<this._elements.length;a++){var u=this._elements[a],f=r(l=u.__data__,a);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=Ge(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),a=Ge(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return a.attr("className",i),a},t.prototype.maybeAppendByName=function(t,n){var i=Ge(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,a;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var o=[],s=[],l=new Set(this._elements),c=[],u=new Set,f=new Map(this._elements.map(function(t,n){return[e(t.__data__,n),t]})),d=new Map(this._facetElements.map(function(t,n){return[e(t.__data__,n),t]})),h=function(t,e){var n=new Map;return t.forEach(function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)}),n}(this._elements,function(t){return r(t.__data__)}),p=0;p<t.length;p++){var g=t[p],v=e(g,p),m=r(g,p);if(f.has(v))(w=f.get(v)).__data__=g,w.__facet__=!1,s.push(w),l.delete(w),f.delete(v);else if(d.has(v)){(w=d.get(v)).__data__=g,w.__facet__=!0,s.push(w),d.delete(v)}else if(h.has(v)){var y=h.get(v);c.push([g,y]);try{for(var b=(i=void 0,ze(y)),x=b.next();!x.done;x=b.next()){var w=x.value;l.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}h.delete(v)}else if(f.has(m)){(w=f.get(m)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),l.delete(w)}else o.push(g)}var k=[new n([],o,this._parent,this._document),new n(s,null,this._parent,this._document),new n(l,null,this._parent,this._document),new n([],c,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,k)},t.prototype.merge=function(t){var e=$e($e([],We(this._elements),!1),We(t._elements),!1),r=$e($e([],We(this._transitions),!1),We(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var a=t(this._enter),o=e(this._update),s=n(this._exit),l=r(this._merge),c=i(this._split);return o.merge(a).merge(s).merge(l).merge(c)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then(function(){return n.remove()}):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each(function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))})},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each(function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))})},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each(function(n,r){var i=this;Object.entries(t).forEach(function(t){var a=We(t,2),o=a[0],s=a[1],l="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(o,l.call(i,n,r))})})},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.transition=function(t){var e=new Array(this._elements.length);return this.each(function(n,r){e[r]=t.call(this,n,r)}),this._transitions=T(e),this},t.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,$e([this._parent,this],We(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var a="string"==typeof e?this.createElement(e):e();return r.appendChild(a),new n([a],null,this._parent,this._document)},t.registry={g:Jg,rect:fv,circle:Ug,path:ov,text:cb,ellipse:Qg,image:nv,line:iv,polygon:lv,polyline:uv,html:ev},t}();function Zb(t){return new Kb([t],null,t,t.ownerDocument)}function Qb(t){if(I(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function Jb(t){var e=t.getLocalBounds(),n=We([e.min,e.max],2),r=We(n[0],2),i=r[0],a=r[1],o=We(n[1],2),s=o[0],l=o[1];return{x:i,y:a,width:s-i,height:l-a,left:i,bottom:l,top:a,right:s}}function tx(t,e){var n=We(t,2),r=n[0],i=n[1],a=We(e,2),o=a[0],s=a[1];return r!==o&&i===s}function ex(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function nx(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",a=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(a):a}var rx=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function ix(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach(function(t){var i=We(t,2),a=i[0],o=i[1];if("className"===a||"class"===a);else if(rx(a,"show")&&rx(nx(a,"show"),e)!==n)a===function(t,e){return"".concat(e).concat(ex(t))}(e,"show")?r[a]=o:r[a.replace(new RegExp(ex(e)),"")]=o;else if(!rx(a,"show")&&rx(a,e)!==n){var s=nx(a,e);"filter"===s&&"function"==typeof o||(r[s]=o)}}),r}function ax(t,e){return Object.entries(t).reduce(function(t,n){var r=We(n,2),i=r[0],a=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=a:t["".concat(e).concat(ex(i))]=a,t},{})}function ox(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach(function(t){var a=We(t,2),o=a[0],s=a[1];e.includes(o)||(-1!==n.indexOf(o)?i[o]=s:r[o]=s)}),[r,i]}function sx(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,a=r.height,o=We([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:a):t}),2);return[o[0],o[1]]}(t,n,r),")")});t.attr("transform",n)}catch(t){}}var lx=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,$e([],We(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach(function(e){return t.appendChild(e)}):t.appendChild(e)):t.innerHTML=""};function cx(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):t.length>2?[t[0]]:t.split("")}function ux(){ob(this,"hidden"!==this.attributes.visibility)}var fx=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,xb({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return Re(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=lb(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&ux.call(this)},e.prototype.update=function(t,e){var n;return this.attr(xb({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return De(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(Zg),dx=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},hx=dx,px=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},gx=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},vx=gx;var mx=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function yx(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(y(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var bx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a,s=this.getSubShapeStyle(t),l=s.symbol,c=s.size,u=void 0===c?16:c,f=De(s,["symbol","size"]),d=yx(l);Nb(!!d,Zb(n),function(t){t.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call(function(t){if("image"===d){var n=2*u;t.styles({img:l,width:n,height:n,x:i-u,y:o-u})}else{n=u/2;var r=y(l)?l:e.getSymbol(l);t.styles(Ie({d:null==r?void 0:r(i,o,n)},f))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(fx);function xx(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function wx(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}bx.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),bx.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),bx.registerSymbol("line",px),bx.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),bx.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),bx.registerSymbol("circle",dx),bx.registerSymbol("point",hx),bx.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),bx.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),bx.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),bx.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),bx.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),bx.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),bx.registerSymbol("line",px),bx.registerSymbol("dot",gx),bx.registerSymbol("dash",vx),bx.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),bx.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),bx.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),bx.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),bx.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}),bx.registerSymbol("focus",function(t,e,n){var r=.2*n,i=.7*n;return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"],["M",t-i,e],["L",t-r,e],["M",t+r,e],["L",t+i,e],["M",t,e-i],["L",t,e-r],["M",t,e+r],["L",t,e+i]]});const kx=Math.sqrt(50),Mx=Math.sqrt(10),Ox=Math.sqrt(2);function Ex(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=kx?10:a>=Mx?5:a>=Ox?2:1)*10**i:-(10**-i)/(a>=kx?10:a>=Mx?5:a>=Ox?2:1)}const Sx=(t,e,n=5)=>{const r=[t,e];let i,a=0,o=r.length-1,s=r[a],l=r[o];return l<s&&([s,l]=[l,s],[a,o]=[o,a]),i=Ex(s,l,n),i>0?(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,i=Ex(s,l,n)):i<0&&(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,i=Ex(s,l,n)),i>0?(r[a]=Math.floor(s/i)*i,r[o]=Math.ceil(l/i)*i):i<0&&(r[a]=Math.ceil(s*i)/i,r[o]=Math.floor(l*i)/i),r};function Ax(t){return!V(t)&&!H(t)&&!Number.isNaN(t)}function _x(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Tx(t){const e=Ci.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a;return[255*_x(o,a,e+1/3),255*_x(o,a,e),255*_x(o,a,e-1/3),i]}(r):null}const Nx=(t,e)=>n=>t*(1-n)+e*n,Px=(t,e)=>"number"==typeof t&&"number"==typeof e?Nx(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Tx(t),r=Tx(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const a=n[i],o=r[i];e[i]=a*(1-t)+o*t}const[i,a,o,s]=e;return`rgba(${Math.round(i)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,Cx=(t,e)=>{const n=Nx(t,e);return t=>Math.round(n(t))};function Lx({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function jx(t){return"object"==typeof t?t.valueOf():t}class Rx extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=jx,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Lx({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Lx({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Ix{constructor(t){this.options=tt({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=tt({},this.options,t),this.rescale(t)}rescale(t){}}const Dx=Symbol("defaultUnknown");function Bx(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Fx(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:a}=t;let o=i.get(e);if(void 0===o){if(a!==Dx)return a;o=n.push(e)-1,i.set(e,o)}return r[o%r.length]}function zx(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Wx extends Ix{getDefaultOptions(){return{domain:[],range:[],unknown:Dx}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Bx(this.domainIndexMap,this.getDomain(),this.domainKey),Fx({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Bx(this.rangeIndexMap,this.getRange(),this.rangeKey),Fx({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=zx(e),this.rangeKey=zx(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Wx(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function $x(t){return Math.round(1e12*t)/1e12}function Gx(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,l),[u,f]=n,d=f-u,h=d/(2/l*r+1-1/l*i),p=h*i/l,g=h-l*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),m=v.reduce((t,e)=>t+e),y=g/m,b=new Rx(e.map((t,e)=>{const n=v[e]*y;return[t,o?Math.floor(n):n]})),x=new Rx(e.map((t,e)=>{const n=v[e]*y+p;return[t,o?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(d-(w-w/l*i))*s;let M=o?Math.round(k):k;const O=new Array(l);for(let t=0;t<l;t+=1){O[t]=$x(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Yx extends Wx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Dx,flex:[]}}constructor(t){super(t)}clone(){return new Yx(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Gx(t);const{range:i,paddingOuter:a,paddingInner:o,round:s,align:l}=t;let c,u,f=i[0];const d=i[1]-f,h=2*a,p=r-o;c=d/Math.max(1,h+p),s&&(c=Math.floor(c)),f+=(d-c*(r-o))*l,u=c*(1-o),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*c);return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}const Hx=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=Ex(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i},Vx=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,l;return r<i?(s=wx(r,i),l=n(a,o)):(s=wx(i,r),l=n(o,a)),xx(l,s)},qx=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,l=o?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=wx(s[t],s[t+1]),a[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}(t,e,1,r)-1,o=i[n];return xx(a[n],o)(e)}},Xx=(t,e,n,r)=>(Math.min(t.length,e.length)>2?qx:Vx)(t,e,r?Cx:n);class Ux extends Ix{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Nx,tickCount:5}}map(t){return Ax(t)?this.output(t):this.options.unknown}invert(t){return Ax(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Sx}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):dt}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:a}=this.options,o=Xx(n.map(t),r,a,i);this.output=xx(o,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,a=Xx(i,r.map(t),Nx);this.input=xx(e,n,a)}}class Kx extends Ux{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Px,tickMethod:Hx,tickCount:5}}chooseTransforms(){return[dt,dt]}clone(){return new Kx(this.options)}}var Zx=function(t){function e(e){var n=this,r=e.style,i=De(e,["style"]);return(n=t.call(this,tt({},{type:"column"},Ie({style:r},i)))||this).columnsGroup=new Jg({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return Re(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),Zb(this.columnsGroup).selectAll(".column").data(e.flat()).join(function(t){return t.append("rect").attr("className","column").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.update=function(t){this.attr(xb({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Xg),Qx=function(t){function e(e){var n=this,r=e.style,i=De(e,["style"]);return(n=t.call(this,tt({},{type:"lines"},Ie({style:r},i)))||this).linesGroup=n.appendChild(new Jg),n.areasGroup=n.appendChild(new Jg),n.render(),n}return Re(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(xb({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Zb(this.linesGroup).selectAll(".line").data(t).join(function(t){return t.append("path").attr("className","line").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.renderAreas=function(t){Zb(this.linesGroup).selectAll(".area").data(t).join(function(t){return t.append("path").attr("className","area").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.style(t)})},function(t){return t.remove()})},e}(Xg);function Jx(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map(function(t,e){return $e([e===n?"M":"L"],We(t),!1)});return e?r.reverse():r}function tw(t,e){if(void 0===e&&(e=!1),t.length<=2)return Jx(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];rt(a,n.slice(-2))||n.push.apply(n,$e([],We(a),!1))}var o=Hb(n,!1);return e?o.unshift($e(["M"],We(t[r-1]),!1)):o.unshift($e(["M"],We(t[0]),!1)),o}function ew(t,e,n){var r=U(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function nw(t){return 0===t.length?[0,0]:[P(F(t,function(t){return P(t)||0})),N(B(t,function(t){return N(t)||0}))]}function rw(t){for(var e=U(t),n=e[0].length,r=We([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],a=r[1],o=0;o<e.length;o+=1)for(var s=e[o],l=0;l<n;l+=1)s[l]>=0?(s[l]+=i[l],i[l]=s[l]):(s[l]+=a[l],a[l]=s[l]);return e}var iw=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Re(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=U(t);return I(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?rw(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=We(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=ix(this.attributes,"area"),o=ix(this.attributes,"line"),s=this.containerShape.width,l=this.data;if(0===l[0].length)return{lines:[],areas:[]};var c=this.scales,u=function(t,e){var n,r=e.x,i=e.y,a=We(i.getOptions().range||[0,0],2),o=a[0],s=a[1];return s>o&&(n=We([o,s],2),s=n[0],o=n[1]),t.map(function(t){return t.map(function(t,e){return[r.map(e),R(i.map(t),s,o)]})})}(l,{type:"line",x:c.x,y:c.y}),f=[];if(a){var d=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=t[i],o=tw(a),s=void 0;if(0===i)s=ew(o,e,n);else{var l=tw(t[i-1],!0),c=a[0];l[0][0]="L",s=$e($e($e([],We(o),!1),We(l),!1),[$e(["M"],We(c),!1),["Z"]],!1)}r.push(s)}return r}(u,s,d):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=Jx(t[i]),o=void 0;if(0===i)o=ew(a,e,n);else{var s=Jx(t[i-1],!0);s[0][0]="L",o=$e($e($e([],We(a),!1),We(s),!1),[["Z"]],!1)}r.push(o)}return r}(u,s,d):function(t,e,n,r){return t.map(function(t){return ew(e?tw(t):Jx(t),n,r)})}(u,i,s,d)}return{lines:u.map(function(e,n){return Ie({stroke:t.getColor(n),d:i?tw(e):Jx(e)},o)}),areas:f.map(function(e,n){return Ie({d:e,fill:t.getColor(n)},a)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=ix(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,a=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=rw(s));var l=this.createScales(s),c=l.x,u=l.y,f=We(nw(s),2),d=f[0],h=f[1],p=new Kx({domain:[0,h-(d>0?0:d)],range:[0,o*a]}),g=c.getBandWidth(),v=this.rawData;return{columns:s.map(function(n,i){return n.map(function(n,a){var o=g/s.length;return Ie(Ie({fill:t.getColor(i)},e),r?{x:c.map(a),y:u.map(n),width:g,height:p.map(v[i][a])}:{x:c.map(a)+o*i,y:n>=0?u.map(n):u.map(0),width:o,height:p.map(Math.abs(n))})})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Zb(n).select(r):Zb(n).append(i)).attr("className","container").node();var a=t.type,o=t.x,s=t.y,l="spark".concat(a),c=Ie({x:o,y:s},"line"===a?this.linesStyle:this.columnsStyle);Zb(e).selectAll(".spark").data([a]).join(function(t){return t.append(function(t){return"line"===t?new Qx({className:l,style:c}):new Zx({className:l,style:c})}).attr("className","spark ".concat(l))},function(t){return t.update(c)},function(t){return t.remove()})},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:y(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,a=r.scale,o=r.range,s=void 0===o?[]:o,l=r.spacing,c=this.containerShape,u=c.width,f=c.height,d=We(nw(t),2),h=d[0],p=d[1],g=new Kx({domain:[null!==(e=s[0])&&void 0!==e?e:h,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-a)]});return"line"===i?{type:i,x:new Kx({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Yx({domain:t[0].map(function(t,e){return e}),range:[0,u],paddingInner:l,paddingOuter:l/2,align:.5}),y:g}},e.tag="sparkline",e}(fx);function aw(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(function(t){var n=We(t,1)[0];return!e.includes(n)}));return Object.fromEntries(e.map(function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,Ie(Ie({},t[e]),n)]:[e,n]}))}function ow(t,e){t?t.finished.then(e):e()}function sw(t,e){"update"in t?t.update(e):t.attr(e)}function lw(t,e,n){return 0===e.length?null:n?t.animate(e,n):(sw(t,{style:e.slice(-1)[0]}),null)}function cw(t,e,n){var r={},i={};return Object.entries(e).forEach(function(e){var n=We(e,2),a=n[0],o=n[1];if(!b(o)){var s=t.style[a]||t.parsedStyle[a]||0;s!==o&&(r[a]=s,i[a]=o)}}),n?lw(t,[r,i],Ie({fill:"both"},n)):(sw(t,i),null)}function uw(t,e){return t.style.opacity||(t.style.opacity=1),cw(t,{opacity:0},e)}var fw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},dw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},hw={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},pw=yb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),gw=yb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),vw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,a=void 0===i?10:i,o=t.radius,s=void 0===o?a/4:o,l=t.orientation,c=t.classNamePrefix,u=De(t,["x","y","size","radius","orientation","classNamePrefix"]),f=a,d=2.4*f,h=c?"".concat(gw.iconRect.name," ").concat(c,"handle-icon-rect"):gw.iconRect.name,p=function(t){return c?"".concat(gw.iconLine,"-").concat(t," ").concat(c,"handle-icon-line"):"".concat(gw.iconLine,"-").concat(t)},g=Zb(e).maybeAppendByClassName(gw.iconRect,"rect").attr("className",h).styles(Ie(Ie({},u),{width:f,height:d,radius:s,x:n-f/2,y:r-d/2,transformOrigin:"center"})),v=n+1/3*f-f/2,m=n+2/3*f-f/2,y=r+1/4*d-d/2,b=r+3/4*d-d/2;g.maybeAppendByClassName("".concat(gw.iconLine,"-1"),"line").attr("className",p(1)).styles(Ie({x1:v,x2:v,y1:y,y2:b},u)),g.maybeAppendByClassName("".concat(gw.iconLine,"-2"),"line").attr("className",p(2)).styles(Ie({x1:m,x2:m,y1:y,y2:b},u)),"vertical"===l&&(g.node().style.transform="rotate(90)")},e}(fx),mw=function(t){function e(e){return t.call(this,e,hw)||this}return Re(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,a=n.showLabel,o=ix(this.attributes,"label"),s=o.x,l=void 0===s?0:s,c=o.y,u=void 0===c?0:c,f=o.transform,d=o.transformOrigin,h=We(ox(De(o,["x","y","transform","transformOrigin"]),[]),2),p=h[0],g=h[1],v=Zb(t).maybeAppendByClassName(gw.labelGroup,"g").styles(g),m=Ie(Ie({},dw),p),y=m.text,b=De(m,["text"]);Nb(!!a,v,function(t){e.label=t.maybeAppendByClassName(gw.label,"text").styles(Ie(Ie({},b),{x:r+l,y:i+u,transform:f,transformOrigin:d,text:"".concat(y)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.type,o=e.classNamePrefix,s=Ie(Ie({x:n,y:r,orientation:i,classNamePrefix:o},fw),ix(this.attributes,"icon")),l=this.attributes.iconShape,c=void 0===l?function(){return new vw({style:s})}:l;Zb(t).maybeAppendByClassName(gw.iconGroup,"g").selectAll(gw.icon.class).data([c]).join(function(t){return t.append("string"==typeof c?c:function(){return c(a)}).attr("className",gw.icon.name)},function(t){return t.update(s)},function(t){return t.remove()})},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(fx),yw=function(t){function e(e){var n=t.call(this,e,Ie(Ie(Ie({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},ax(hw,"handle")),ax(fw,"handleIcon")),ax(dw,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(_b(e));var r=n.availableSpace,i=r.x,a=r.y,o=n.getBBox(),s=o.x,l=o.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,a])-n.getOrientVal([+s,+l])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,a=e.type;t.stopPropagation();var o=n.getOrientVal(_b(t)),s=o-n.prevPos;if(s){var l=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(l);break;case"end":r&&n.setValuesOffset(0,l);break;case"selection":r&&n.setValuesOffset(l,l);break;case"track":if(!i)return;n.selectionWidth+=l,"range"===a?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,a="range"===i?t:t[1],o="range"===i?n.getValues():n.getValues()[1],s=new Up("valuechange",{detail:{oldValue:a,value:o}});n.dispatchEvent(s),null==r||r(o)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Re(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=ix(this.attributes,"sparkline");return Ie(Ie({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=We(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=We(Qb(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],a=this.shape;return{x:i,y:e,width:a.width-(i+n),height:a.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(pw.selection.class).each(function(n,r){cw(this,e[r],t)})},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&cw(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&cw(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=ix(this.attributes,"track");this.trackShape=Zb(t).maybeAppendByClassName(pw.track,"rect").styles(Ie(Ie({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=Zb(t).maybeAppendByClassName(pw.brushArea,"rect").styles(Ie({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Nb("horizontal"===n.orientation,Zb(t).maybeAppendByClassName(pw.sparklineGroup,"g"),function(t){var n=Ie(Ie({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(pw.sparkline,function(){return new iw({style:n})}).update(n)})},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,a=r?"range"===i?["start","end"]:["end"]:[],o=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(pw.handle.class).data(a.map(function(t){return{type:t}}),function(t){return t.type}).join(function(t){return t.append(function(t){var n=t.type;return new mw({style:e.getHandleStyle(n)})}).each(function(t){var e=t.type;this.attr("class","".concat(pw.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");o[n]=this,this.addEventListener("pointerdown",o.onDragStart(e))})},function(t){return t.each(function(t){var e=t.type;this.update(o.getHandleStyle(e))})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");o[n]=void 0}).remove()})},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,a=e.selectionType;this.foregroundGroup=Zb(t).maybeAppendByClassName(pw.foreground,"g");var o=ix(this.attributes,"selection"),s=function(t){return t.style("visibility",function(t){return t.show?"visible":"hidden"}).style("cursor",function(t){return"select"===a?"grab":"invert"===a?"crosshair":"default"}).styles(Ie(Ie({},o),{transform:"translate(".concat(n,", ").concat(r,")")}))},l=this;this.foregroundGroup.selectAll(pw.selection.class).data("value"===i?[]:this.calcSelectionArea().map(function(t,e){return{style:Ie({},t),index:e,show:"select"===a?1===e:1!==e}}),function(t){return t.index}).join(function(t){return t.append("rect").attr("className",pw.selection.name).call(s).each(function(t,e){var n=this;1===e?(l.selectionShape=Zb(this),this.on("pointerdown",function(t){n.attr("cursor","grabbing"),l.onDragStart("selection")(t)}),l.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),l.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),l.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){n.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){n.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){n.attr("cursor","pointer")})):this.on("pointerdown",l.onDragStart("track"))})},function(t){return t.call(s)},function(t){return t.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=We(this.range,2),i=r[0],a=r[1],o=We(this.getValues().map(function(t){return Gb(t,e)}),2),s=o[0],l=o[1],c=We(((Array.isArray(t)?t:[s,null!=t?t:l])||[s,l]).map(function(t){return Gb(t,e)}),2),u=c[0],f=c[1];if("value"===this.attributes.type)return[0,R(f,i,a)];u>f&&(u=(n=We([f,u],2))[0],f=n[1]);var d=f-u;return d>a-i?[i,a]:u<i?s===i&&l===f?[i,f]:[i,d+i]:f>a?l===a&&s===u?[u,a]:[a-d,a]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=We(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,a=i.x,o=i.y,s=i.width,l=i.height;return this.getOrientVal([[{y:o,height:l,x:a,width:n*s},{y:o,height:l,x:n*s+a,width:(r-n)*s},{y:o,height:l,x:r*s,width:(1-r)*s}],[{x:a,width:s,y:o,height:n*l},{x:a,width:s,y:n*l+o,height:(r-n)*l},{x:a,width:s,y:r*l,height:(1-r)*l}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,a=n.width,o=n.height,s=We(this.clampValues(),2),l=s[0],c=s[1],u="start"===t?-e:e,f=("start"===t?l:c)*this.getOrientVal([a,o])+u;return{x:r+this.getOrientVal([f,a/2]),y:i+this.getOrientVal([o/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,a=n.formatter,o=n.autoFitLabel,s=ix(this.attributes,"handle"),l=ix(s,"label"),c=s.spacing,u=this.getHandleSize(),f=this.clampValues(),d=a("start"===t?f[0]:f[1]),h=new cb({style:Ie(Ie(Ie({},l),this.inferTextStyle(t)),{text:d})}),p=h.getBBox(),g=p.width,v=p.height;if(h.destroy(),!o){if("value"===r)return{text:d,x:0,y:-v-c};var m=c+u+("horizontal"===i?g/2:0);return(e={text:d})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,w=x.width,k=x.height,M=this.calcSelectionArea()[1],O=M.x,E=M.y,S=M.width,A=M.height,_=c+u;if("horizontal"===i){var T=_+g/2;if("start"===t)y=O-_-g>0?-T:T;else y=w-O-S-_>g?T:-T}else{var N=v+_;b="start"===t?E-u>v?-N:_:k-(E+A)-u>v?N:-_}return{x:y,y:b,text:d}},e.prototype.getHandleLabelStyle=function(t){var e=ix(this.attributes,"handleLabel");return Ie(Ie(Ie({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=ix(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Ie({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,a=e.showLabelOnInteraction,o=e.orientation,s=this.calcHandlePosition(t),l=s.x,c=s.y,u=this.calcHandleText(t),f=i;return!i&&a&&(f=!!this.target),Ie(Ie(Ie({},ax(this.getHandleIconStyle(),"icon")),ax(Ie(Ie({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(l+n,", ").concat(c+r,")"),orientation:o,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=We(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e){void 0===e&&(e=0);var n=this.attributes.type,r=We(this.getValues(),2),i=[r[0]+("range"===n?t:0),r[1]+e].sort();this.innerSetValues(i,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new Up(n,{detail:t}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r)}},e.tag="slider",e}(fx),bw=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Up("scroll",r)),n.dispatchEvent(new Up("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=We(n.getLocalPosition(),2),r=e[0],i=e[1],a=We(n.padding,4),o=a[0],s=a[3],l=n.getOrientVal([r+s,i+o]),c=(n.getOrientVal(Ab(t))-l)/n.trackLength;n.setValue(c,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Up("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Up("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Up("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Up("trackMouseleave",{detail:t.detail}))},n}return Re(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Qb(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=We(this.range,2),n=e[0],r=e[1];return R(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=We(this.padding,4),r=n[0],i=n[1],a=n[2],o=n[3],s=We(this.getOrientVal([[e,t],[t,e]]),2);return{x:o,y:r,width:+s[0]-(o+i),height:+s[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,a=r.height;return n||this.getOrientVal([a,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=We(this.range,2),i=r[0],a=t*(r[1]-i-n);return[a,a+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.trackSize,o=e.padding,s=e.slidable,l=ix(this.attributes,"track"),c=ix(this.attributes,"thumb"),u=Ie(Ie({x:n,y:r,brushable:!1,orientation:i,padding:o,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:a,values:this.getValues()},ax(l,"track")),ax(c,"selection"));this.slider=Zb(t).maybeAppendByClassName("scrollbar",function(){return new yw({style:u})}).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=We(this.range,2),i=r[0],a=r[1];this.slider.setValues(this.getValues(R(t,i,a)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",function(e){e.stopPropagation(),t.onTrackClick(e.detail)}),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(fx),xw="grid-group",ww="main-group",kw="line-group",Mw="tick-group",Ow="label-group",Ew="title-group",Sw="grid",Aw="line",_w="line-first",Tw="line-second",Nw="tick",Pw="tick-item",Cw="label",Lw="label-item",jw="title",Rw={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new ov({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};tt({},Rw,{style:{type:"arc"}}),tt({},Rw,{style:{}});var Iw=yb({mainGroup:ww,gridGroup:xw,grid:Sw,lineGroup:kw,line:Aw,tickGroup:Mw,tick:Nw,tickItem:Pw,labelGroup:Ow,label:Cw,labelItem:Lw,titleGroup:Ew,title:jw,lineFirst:_w,lineSecond:Tw},"axis"),Dw=yb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Bw(t){return t.reduce(function(t,e,n){return t.push($e([0===n?"M":"L"],We(e),!1)),t},[])}function Fw(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,a=e.center;if("line"===i)return Bw(t);if(!a)return[];var o=Wb(t[0],a),s=n?0:1;return t.reduce(function(t,e,n){return 0===n?t.push($e(["M"],We(e),!1)):t.push($e(["A",o,o,0,0,s],We(e),!1)),t},[])}(t,e,n):Bw(t)}function zw(t,e,n){var r=n.type,i=n.connect,a=n.center,o=n.closed?[["Z"]]:[],s=We([Fw(t,n),Fw(e.slice().reverse(),n,!0)],2),l=s[0],c=s[1],u=We([t[0],e.slice(-1)[0]],2),f=u[0],d=u[1],h=function(t,e){return[l,t,c,e,o].flat()};if("line"===i||"surround"===r)return h([$e(["L"],We(d),!1)],[$e(["L"],We(f),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=We([Wb(d,a),Wb(f,a)],2),g=p[0],v=p[1];return h([$e(["A",g,g,0,0,1],We(d),!1),$e(["L"],We(d),!1)],[$e(["A",v,v,0,0,0],We(f),!1),$e(["L"],We(f),!1)])}var Ww=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.render=function(t,e){var n=De(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map(function(t){var e=t.points,n=We(e,1)[0];return Ie(Ie({},t),{points:$e($e([],We(e),!1),[n],!1)})}):n}(t),i=Zb(e).maybeAppendByClassName(Dw.lineGroup,"g"),a=Zb(e).maybeAppendByClassName(Dw.regionGroup,"g"),o=function(t,e,n,r){var i=n.animate,a=n.isBillboard,o=e.map(function(t,e){return{id:t.id||"grid-line-".concat(e),d:Fw(t.points,n)}});return t.selectAll(Dw.line.class).data(o,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){var n=hb(Xb(Ie({d:t.d},r)),[t,e,o]);this.attr(Ie({class:Dw.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))})},function(t){return t.transition(function(t,e){return cw(this,hb(Xb(Ie({d:t.d},r)),[t,e,o]),i.update)})},function(t){return t.transition(function(){var t=this,e=uw(this,i.exit);return ow(e,function(){return t.remove()}),e})}).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(t){return o[t%o.length]},l=[],c=0;c<e.length-1;c++){var u=We([e[c].points,e[c+1].points],2),f=zw(u[0],u[1],n);l.push({d:f,fill:s(c)})}return t.selectAll(Dw.region.class).data(l,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){var n=hb(t,[t,e,l]);this.attr(n)}).attr("className",Dw.region.name)},function(t){return t.transition(function(t,e){return cw(this,hb(t,[t,e,l]),r.update)})},function(t){return t.transition(function(){var t=this,e=uw(this,r.exit);return ow(e,function(){return t.remove()}),e})}).transitions()}(a,r,t);return $e($e([],We(o),!1),We(s),!1)},e}(fx);function $w(t,e){return Object.fromEntries(Object.entries(t).map(function(t){var n=We(t,2);return[n[0],hb(n[1],e)]}))}function Gw(t,e){return e&&y(e)?t.filter(e):t}function Yw(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Hw(t,e){if("linear"===e.type){var n=We(e.startPos,2),r=n[0],i=n[1],a=We(e.endPos,2),o=We([a[0]-r,a[1]-i],2);return $b([o[0],o[1]])}var s=ub(Yw(t,e));return[-Math.sin(s),Math.cos(s)]}function Vw(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Hw(t,n),"positive"!==e)}function qw(t,e){return Vw(t,e.labelDirection,e)}function Xw(t,e,n){return n?"".concat(t," ").concat(n,"axis-").concat(e):t}function Uw(t,e,n,r){return r&&t.attr("className",Xw(e.name,n,r)),t}function Kw(t,e){return"linear"===e.type?function(t,e){var n=We(e.startPos,2),r=n[0],i=n[1],a=We(e.endPos,2),o=We([a[0]-r,a[1]-i],2);return[r+o[0]*t,i+o[1]*t]}(t,e):function(t,e){var n=e.radius,r=We(e.center,2),i=r[0],a=r[1],o=ub(Yw(t,e));return[i+n*Math.cos(o),a+n*Math.sin(o)]}(t,e)}function Zw(t){return 0===Hw(0,t)[1]}function Qw(t){return 0===Hw(0,t)[0]}function Jw(t,e){return e-t===360}function tk(t,e,n,r,i){var a=e-t,o=We([i,i],2),s=o[0],l=o[1],c=We([ub(t),ub(e)],2),u=c[0],f=c[1],d=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},h=We(d(u),2),p=h[0],g=h[1],v=We(d(f),2),m=v[0],y=v[1];if(Jw(t,e)){var b=We(d((f+u)/2),2);return[["M",p,g],["A",s,l,0,1,0,b[0],b[1]],["A",s,l,0,1,0,m,y]]}var x=a>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(l,",0,").concat(x,",").concat(w,",").concat(m,",").concat(y)}function ek(t,e,n,r){var i=e.startAngle,a=e.endAngle,o=e.center,s=e.radius,l=e.classNamePrefix;return t.selectAll(Iw.line.class).data([{d:tk.apply(void 0,$e($e([i,a],We(o),!1),[s],!1))}],function(t,e){return e}).join(function(t){var n=t.append("path").attr("className",Iw.line.name).styles(e).styles({d:function(t){return t.d}});return Uw(n,Iw.line,Aw,l),n},function(t){return t.transition(function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,a=void 0===i?0:i,o=Cb(e,n),s=Math.ceil(+a/16),l=new Array(s).fill(0).map(function(t,e,n){return{__keyframe_data__:o(e/(n.length-1))}});return t.animate(l,Ie({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,a=e.radius;return $e($e([n,r],We(i),!1),[a],!1)}(this),$e($e([i,a],We(o),!1),[s],!1),r.update);if(e){var n=function(){var e=at(t.attributes,"__keyframe_data__");t.style.d=tk.apply(void 0,$e([],We(e),!1))};e.onframe=n,e.onfinish=n}return e}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function nk(t){var e=We(t,2),n=We(e[0],2),r=n[0],i=n[1],a=We(e[1],2);return{x1:r,y1:i,x2:a[0],y2:a[1]}}function rk(t,e,n,r){var i=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,l=e.lineExtension,c=e.classNamePrefix,u=We([a,o],2),f=We(u[0],2),d=f[0],h=f[1],p=We(u[1],2),g=p[0],v=p[1],m=We(l?function(t,e,n){void 0===n&&(n=[0,0]);var r=We([t,e,n],3),i=We(r[0],2),a=i[0],o=i[1],s=We(r[1],2),l=s[0],c=s[1],u=We(r[2],2),f=u[0],d=u[1],h=We([l-a,c-o],2),p=h[0],g=h[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=We([-f/v,d/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(a,o,l):new Array(4).fill(0),4),y=m[0],b=m[1],x=m[2],w=m[3],k=function(e){return t.selectAll(Iw.line.class).data(e,function(t,e){return e}).join(function(t){var e=t.append("line").styles(n).transition(function(t){return cw(this,nk(t.line),!1)});return e.attr("className",function(t){if(!c)return"".concat(Iw.line.name," ").concat(t.className);var e=Xw(Iw.line.name,Aw,c);if(t.className===Iw.lineFirst.name){var n=Xw(Iw.lineFirst.name,_w,c);return"".concat(e," ").concat(n)}if(t.className===Iw.lineSecond.name){n=Xw(Iw.lineSecond.name,Tw,c);return"".concat(e," ").concat(n)}return e}),e},function(t){return t.styles(n).transition(function(t){return cw(this,nk(t.line),r.update)})},function(t){return t.remove()}).transitions()};if(!i||!s)return k([{line:[[d+y,h+b],[g+x,v+w]],className:Iw.line.name}]);var M=We(s,2),O=M[0],E=M[1],S=g-d,A=v-h,_=We([d+S*O,h+A*O],2),T=_[0],N=_[1],P=We([d+S*E,h+A*E],2),C=P[0],L=P[1];return k([{line:[[d+y,h+b],[T,N]],className:Iw.lineFirst.name},{line:[[C,L],[g+x,v+w]],className:Iw.lineSecond.name}])}function ik(t,e,n){var r,i=e.type,a=ix(e,"line");return r="linear"===i?rk(t,e,Yb(a,"arrow"),n):ek(t,e,Yb(a,"arrow"),n),function(t,e,n,r){var i,a=n.showArrow,o=n.showTrunc,s=n.lineArrow,l=n.lineArrowOffset,c=n.lineArrowSize;if(i="arc"===e?t.select(Iw.line.class):o?t.select(Iw.lineSecond.class):t.select(Iw.line.class),!a||!s||"arc"===n.type&&Jw(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Tb(s);f.attr(r),Ub(f,c,!0),i.style("markerEnd",f).style("markerEndOffset",-l)}}(t,i,e,a),r}function ak(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function ok(t,e){var n=e.gridLength;return t.map(function(t,r){var i=t.value,a=We(Kw(i,e),2),o=a[0],s=a[1],l=We(Ib(function(t,e){return Vw(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[o,s],[o+l[0],s+l[1]]]}})}function sk(t,e,n,r){var i=n.classNamePrefix,a=ix(n,"grid"),o=a.type,s=a.areaFill,l=ak(n),c=Gw(e,n.gridFilter),u="segment"===o?ok(c,n):function(t,e){var n=e.gridControlAngles,r=ak(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=We(r,2),a=i[0],o=i[1];return t.map(function(t,r){var i=We(Kw(t.value,e),2),s=i[0],l=i[1],c=We([s-a,l-o],2),u=c[0],f=c[1],d=[];return n.forEach(function(t){var e=ub(t),n=We([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+a,l=u*i+f*r+o;d.push([s,l])}),{points:d,id:r}})}(c,n),f=Ie(Ie({},a),{center:l,areaFill:y(s)?c.map(function(t,e){return hb(s,[t,e,c])}):s,animate:r,data:u});return t.selectAll(Iw.grid.class).data([1]).join(function(t){var e=t.append(function(){return new Ww({style:f})}).attr("className",Iw.grid.name);return Uw(e,Iw.grid,Sw,i),e},function(t){return t.transition(function(){return this.update(f)})},function(t){return t.remove()}).transitions()}var lk=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=Math.cos(t),c=Math.sin(t),u=e-e*l+n*c,f=n-e*c-n*l;return[[l*i-c*s+u,c*i+l*s+f],[l*o-c*s+u,c*o+l*s+f],[l*i-c*a+u,c*i+l*a+f],[l*o-c*a+u,c*o+l*a+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function ck(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=We(r.min,2),a=i[0],o=i[1],s=We(r.max,2),l=s[0],c=s[1],u=t.getBBox(),f=u.width,d=u.height,h=0,p=0,g=a,v=o,m=Ob(t);if(m){d-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(a+l)/2:"right"!==y&&"end"!==y||(g=l),"middle"===b?v=(o+c)/2:"bottom"===b&&(v=c)}var x=We(Qb(e),4),w=x[0],k=void 0===w?0:w,M=x[1],O=void 0===M?0:M,E=x[2],S=void 0===E?k:E,A=x[3],_=new lk((h+=a)-(void 0===A?O:A),(p+=o)-k,h+f+O,p+d+S);return t.setEulerAngles(n),_.rotatedPoints(ub(n),g,v)}function uk(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function fk(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function dk(t,e){var n=fk(t[0],t[1],e[0]),r=fk(t[0],t[1],e[1]),i=fk(e[0],e[1],t[0]),a=fk(e[0],e[1],t[1]);return n!==r&&i!==a||(!(0!==n||!uk(t,e[0]))||(!(0!==r||!uk(t,e[1]))||(!(0!==i||!uk(e,t[0]))||!(0!==a||!uk(e,t[1])))))}function hk(t,e){return e.every(function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r=[e,[9999,e[1]]],i=0,a=0;do{var o=[t[a],t[(a+1)%n]];if(dk(o,r)){if(0===fk(o[0],e,o[1]))return uk(o,e);i++}a=(a+1)%n}while(0!==a);return!!(1&i)}(t,e)})}function pk(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return function(t,e){var n=We(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s=We(e,4),l=s[0],c=s[1],u=a-r,f=o-i,d=s[2]-l,h=s[3]-c,p=u*h-d*f;if(0===p)return!1;var g=p>0,v=r-l,m=i-c,y=u*m-f*v;if(y<0===g)return!1;var b=d*m-h*v;return b<0!==g&&y>p!==g&&b>p!==g}(e,t)})}function gk(t,e,n){var r,i,a=e.crossPadding,o=new Set,s=null,l=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var a=t.center,o=t.radius,s=We(a,2),l=s[0],c=s[1],u="negative"===r?0:i,f=-o-u,d=o+u,h=We(Qb(e),4),p=h[0],g=h[1],v=h[2],m=h[3];return new lk(l+f-m,c+f-p,l+d+g,c+d+v)}var y=We(t.startPos,2),b=y[0],x=y[1],w=We(t.endPos,2),k=w[0],M=w[1],O=We(Qw(t)?[-e,0,e,0]:[0,e,0,-e],4),E=O[0],S=O[1],A=O[2],_=O[3],T=Ib(qw(0,t),i),N=new lk(b,x,k,M);return N.x1+=_,N.y1+=E,N.x2+=S+T[0],N.y2+=A+T[1],N}(e,a),c=function(t){return!l||function(t,e,n){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;return hk([[r,a],[i,a],[i,o],[r,o]],ck(e,n))}(l,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,a=ck(t,n).flat(1),o=ck(e,n).flat(1),s=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var l=ze(s),c=l.next();!c.done;c=l.next())if(pk(o,c.value))return!0}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,Qb(n))};try{for(var f=ze(t),d=f.next();!d.done;d=f.next()){var h=d.value;c(h)?!s||u(s,h)?s=h:(o.add(s),o.add(h)):o.add(h)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(o)}function vk(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(kb(t,e))}var mk=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter(function(t,e){return!(e%r)||(ab(t),!1)})},yk=function(t){return t.filter(wb)};var bk=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c=mk,u=function(t){return t.forEach(r.show),t},f=2,d=t.slice(),h=t.slice(),p=Math.min.apply(Math,$e([1],We(t.map(function(t){return t.getBBox().width})),!1));if("linear"===n.type&&(Zw(n)||Qw(n))){var g=Jb(t[0]).left,v=Jb(t[i-1]).right,m=Math.abs(v-g)||1;f=Math.max(Math.floor(i*p/m),f)}for(a&&(s=d.splice(0,1)[0]),o&&(l=d.splice(-1,1)[0],d.reverse()),u(d);f<t.length&&gk(yk(l?$e($e([l],We(h),!1),[s],!1):$e([s],We(h),!1)),n,null==e?void 0:e.margin).length;){if(l&&!s&&f%2==0)d.splice(0,1).forEach(r.hide);else if(l&&s){d.splice(0,1).forEach(r.hide)}h=c(u(d),{seq:f}),f++}}}],["rotate",function(t,e,n,r){var i,a,o=e.optionalAngles,s=void 0===o?[0,45,90]:o,l=e.margin,c=e.recoverWhenFailed,u=void 0===c||c,f=t.map(function(t){return t.getLocalEulerAngles()}),d=function(){return gk(t,n,l).length<1},h=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)})};try{for(var p=ze(s),g=p.next();!g.done;g=p.next()){if(h(g.value),d())return}}catch(t){i={error:t}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}u&&h(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=0)){var i=e.suffix,a=void 0===i?"...":i,o=e.minLength,s=e.maxLength,l=void 0===s?1/0:s,c=e.step,u=void 0===c?" ":c,f=e.margin,d=void 0===f?[0,0,0,0]:f,h=Mb(r.getTextShape(t[0])),p=vk(u,h),g=o?vk(o,h):p,v=vk(l,h);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map(function(t){return t.getBBox().width})));var m=t.slice();We(d,4);for(var y=function(e){if(m.forEach(function(t){r.ellipsis(r.getTextShape(t),e,a)}),(m=gk(t,n,d)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var w=y(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r,i){var a,o=e.maxLines,s=void 0===o?3:o,l=e.recoverWhenFailed,c=void 0===l||l,u=e.margin,f=void 0===u?[0,0,0,0]:u,d=hb(null!==(a=e.wordWrapWidth)&&void 0!==a?a:50,[i]),h=t.map(function(t){return t.attr("maxLines")||1}),p=Math.min.apply(Math,$e([],We(h),!1)),g=function(){return gk(t,n,f).length<1},v=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Zw(t)?"negative"===n?"bottom":"top":"middle"}(n),m=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,d,i,v)})};if(!(p>s)){if("linear"===n.type&&Zw(n)){if(m(s),g())return}else for(var y=p;y<=s;y++)if(m(y),g())return;c&&m(h)}}]]);function xk(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*function(t){return"positive"===t?-1:1}(e)},1)}function wk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function kk(t,e){var n=We(t,2),r=n[0],i=n[1],a=We(e,2),o=a[0],s=a[1],l=We([r*o+i*s,r*s-i*o],2),c=l[0],u=l[1];return Math.atan2(u,c)}function Mk(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var a=qw(t.value,n),o=Hw(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Pb(e,-90,90)||(e+=180),e}(fb("perpendicular"===i?kk([1,0],a):kk([o[0]<0?-1:1,0],o)))}function Ok(t,e,n){var r=n.type,i=n.labelAlign,a=qw(t,n),o=wk(e),s=wk(fb(kk([1,0],a))),l="center",c="middle";return"linear"===r?[90,270].includes(s)&&0===o?(l="center",c=1===a[1]?"top":"bottom"):s%180||![90,270].includes(o)?0===s?(Pb(o,0,90,!1,!0)||Pb(o,0,90)||Pb(o,270,360))&&(l="start"):90===s?Pb(o,0,90,!1,!0)?l="start":(Pb(o,90,180)||Pb(o,270,360))&&(l="end"):270===s?Pb(o,0,90,!1,!0)?l="end":(Pb(o,90,180)||Pb(o,270,360))&&(l="start"):180===s&&(90===o?l="start":(Pb(o,0,90)||Pb(o,270,360))&&(l="end")):l="center":"parallel"===i?c=Pb(s,0,180,!0)?"top":"bottom":"horizontal"===i?Pb(s,90,270,!1)?l="end":(Pb(s,270,360,!1)||Pb(s,0,90))&&(l="start"):"perpendicular"===i&&(l=Pb(s,90,270)?"end":"start"),{textAlign:l,textBaseline:c}}function Ek(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),c=hb(s,[t,l,e]),u=We([qw(t.value,n),xk(o,a)],2),f=We(Db(Ib(u[0],c+(1===u[1]?hb(r?i:0,[t,l,e]):0)),Kw(t.value,n)),2);return{x:f[0],y:f[1]}}function Sk(t,e,n,r){var i=r.labelRender,a=(at(r,"endPos.0",400)-at(r,"startPos.0",0))/n.length,o=y(i)?hb(i,[t,e,n,qw(t.value,r)]):t.label||"",s=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body.firstElementChild;if(console.log(null==e?void 0:e.getClientRects(),11),!e)return 0;var n=e.getAttribute("style")||"",r=Object.fromEntries(n.split(";").map(function(t){return t.trim()}).filter(function(t){return t.includes(":")}).map(function(t){var e=We(t.split(":").map(function(t){return t.trim()}),2),n=e[0],r=e[1];return[n.toLowerCase(),r]})),i=function(t){if(!t)return 0;var e=t.match(/([\d.]+)px/);return e?parseFloat(e[1]):0};if(r.height)return i(r.height);var a,o=i(r["font-size"])||16,s=r["line-height"];a=s&&"normal"!==s?s.endsWith("px")?i(s):/^[\d.]+$/.test(s)?parseFloat(s)*o:o:1.2*o;var l=i(r["padding-top"]),c=i(r["padding-bottom"]);r.padding&&(1===(u=r.padding.split(/\s+/).map(i)).length||2===u.length?(l=u[0],c=u[0]):(3===u.length||4===u.length)&&(l=u[0],c=u[2]));var u,f=i(r["border-top-width"]),d=i(r["border-bottom-width"]);if(r.border){var h=r.border.match(/([\d.]+)px/);h&&(f=parseFloat(h[1]),d=parseFloat(h[1]))}return r["border-width"]&&(1===(u=r["border-width"].split(/\s+/).map(i)).length||2===u.length?(f=u[0],d=u[0]):(3===u.length||4===u.length)&&(f=u[0],d=u[2])),a+l+c+f+d}(o)||30;return function(){return e={width:a,height:s},"function"==typeof(t=o)?t():L(t)||I(t)?new ev({style:Ie(Ie({pointerEvents:"auto"},e),{innerHTML:t})}):t;var t,e}}var Ak={html:["fill"],text:[]};function _k(t,e){["text","html"].includes(t.nodeName)&&t.attr(Yb(e,Ak[t.nodeName]))}function Tk(t,e){!function(t,e,n,r){var i=e.labelOverlap,a=void 0===i?[]:i;a.length&&a.forEach(function(i){var a=i.type,o=bk.get(a);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some(function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||t.filter(function(t){return t.querySelector("text")}).length>=1)})(t,e,a)&&(null==o||o(t,i,e,r,n))})}(this.node().childNodes,t,e,{hide:ab,show:ib,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=Ok(e.__data__.value,t,n),i=e.querySelector(Iw.labelItem.class);i&&_k(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Sb(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),Eb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector(Iw.labelItem.class)}})}function Nk(t,e,n,r,i){var a=n.indexOf(e),o=i.labelRender,s=i.classNamePrefix,l=Zb(t).append(o?Sk(e,a,n,i):function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return Tb(hb(i,[t,e,n,qw(t.value,r)]))}:function(){return Tb(t.label||"")}}(e,a,n,i)).attr("className",Iw.labelItem.name).node();Uw(Zb(l),Iw.labelItem,Lw,s);var c=We(ox($w(r,[e,a,n])),2),u=c[0],f=c[1],d=f.transform,h=De(f,["transform"]);sx(l,d);var p=Mk(e,l,i);if(l.getLocalEulerAngles()||l.setLocalEulerAngles(p),_k(l,Ie(Ie({},Ok(e.value,p,i)),u)),"html"===l.nodeName){var g=l.getBBox(),v=l.style.x||0;l.attr("x",v-g.width/2)}return t.attr(h),l}function Pk(t,e,n,r,i){var a,o,s,l=n.classNamePrefix,c=Gw(e,n.labelFilter),u=ix(n,"label"),f=t.selectAll(Iw.label.class).data(c,function(t,e){return e}).join(function(t){var r=t.append("g").attr("className",Iw.label.name).transition(function(t){Nk(this,t,e,u,n);var r=Ek(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null});return Uw(r,Iw.label,Cw,l),r},function(t){return t.transition(function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&ab(t),e.isVisible()&&ib(e)};if(!n)return i(),[null];var a=n.duration,o=void 0===a?0:a,s=n.delay,l=void 0===s?0:s,c=Math.ceil(+o/2),u=+o/4,f=We(t.getGeometryBounds().center,2),d=f[0],h=f[1],p=We(e.getGeometryBounds().center,2),g=We([(d+p[0])/2-d,(h+p[1])/2-h],2),v=g[0],m=g[1],y=t.style.opacity,b=void 0===y?1:y,x=e.style.opacity,w=void 0===x?1:x,k=t.style.transform||"",M=e.style.transform||"",O=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(k)},{opacity:0,transform:"translate(".concat(v,", ").concat(m,") ").concat(k)}],Ie(Ie({fill:"both"},n),{duration:l+c+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-m,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Ie(Ie({fill:"both"},n),{duration:c+u,delay:l+c-u}));return ow(E,i),[O,E]}(this.querySelector(Iw.labelItem.class),Nk(this,t,e,u,n),r.update),a=Ek(t,e,n),o=a.x,s=a.y,l=cw(this,{transform:"translate(".concat(o,", ").concat(s,")")},r.update);return $e($e([],We(i),!1),[l],!1)})},function(t){return a=t,t.transition(function(){var t=this,e=uw(this.childNodes[0],r.exit);return ow(e,function(){return Zb(t).remove()}),e}),a}).transitions();return s=function(){Tk.call(t,n,i)},0===(o=f).length?s():Promise.all(o.map(function(t){return null==t?void 0:t.finished})).then(s),f}function Ck(t,e){return Vw(t,e.tickDirection,e)}function Lk(t,e,n,r,i){var a=We(function(t,e){var n=We(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,hb(i.tickLength,[t,e,n])),2),o=We(a[0],2),s=o[0],l=o[1],c=We(a[1],2);return{x1:s,x2:c[0],y1:l,y2:c[1]}}function jk(t,e,n,r,i,a){var o=function(t,e,n,r,i){var a=i.tickFormatter,o=i.classNamePrefix,s=Ck(e.value,i),l="line";y(a)&&(l=function(){return hb(a,[e,n,r,s])});var c=t.append(l).attr("className",Iw.tickItem.name);return Uw(c,Iw.tickItem,Pw,o),c}(Zb(this),t,e,n,r);!function(t,e,n,r,i,a,o){var s=Ck(t.value,a),l=Lk(t,e,n,s,a),c=l.x1,u=l.x2,f=l.y1,d=l.y2,h=We(ox($w(o,[t,e,n,s])),2),p=h[0],g=h[1];"line"===r.node().nodeName&&r.styles(Ie({x1:c,x2:u,y1:f,y2:d},p)),i.attr(g),r.styles(p)}(t,e,n,o,this,r,i);var s=We(Kw(t.value,r),2),l=s[0],c=s[1];return cw(this,{transform:"translate(".concat(l,", ").concat(c,")")},a)}function Rk(t,e,n,r,i){var a=We(ox(ix(r,"title")),2),o=a[0],s=a[1],l=s.transform,c=s.transformOrigin,u=De(s,["transform","transformOrigin"]);e.styles(u);var f=l||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),o.direction,o.position);t.styles(Ie(Ie({},o),{transformOrigin:c})),sx(t.node(),f);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,a=n.titleSpacing,o=cx(i),s=t.node().getLocalBounds(),l=We(s.min,2),c=l[0],u=l[1],f=We(s.halfExtents,2),d=f[0],h=f[1],p=We(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=We([c+d,u+h],2),y=m[0],b=m[1],x=We(Qb(a),4),w=x[0],k=x[1],M=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var E=n.startPos,S=n.endPos,A=We("start"===i?[E,S]:[S,E],2),_=A[0],T=A[1],N=We(Ib($b([-T[0]+_[0],-T[1]+_[1]]),w),2),P=N[0],C=N[1];return{x:_[0]+P,y:_[1]+C}}return o.includes("t")&&(b-=h+v+w),o.includes("r")&&(y+=d+g+k),o.includes("l")&&(y-=d+g+O),o.includes("b")&&(b+=h+v+M),{x:y,y:b}}(Zb(n._offscreen||n.querySelector(Iw.mainGroup.class)),e,r),h=d.x,p=d.y;return cw(e.node(),{transform:"translate(".concat(h,", ").concat(p,")")},i)}function Ik(t,e,n,r){var i=t.showLine,a=t.showTick,o=t.showLabel,s=t.classNamePrefix,l=e.maybeAppendByClassName(Iw.lineGroup,"g");Uw(l,Iw.lineGroup,kw,s);var c=Nb(i,l,function(e){return ik(e,t,r)})||[],u=e.maybeAppendByClassName(Iw.tickGroup,"g");Uw(u,Iw.tickGroup,Mw,s);var f=Nb(a,u,function(e){return function(t,e,n,r){var i=n.classNamePrefix,a=Gw(e,n.tickFilter),o=ix(n,"tick");return t.selectAll(Iw.tick.class).data(a,function(t){return t.id||t.label}).join(function(t){var e=t.append("g").attr("className",Iw.tick.name).transition(function(t,e){return jk.call(this,t,e,a,n,o,!1)});return Uw(e,Iw.tick,Nw,i),e},function(t){return t.transition(function(t,e){return this.removeChildren(),jk.call(this,t,e,a,n,o,r.update)})},function(t){return t.transition(function(){var t=this,e=uw(this.childNodes[0],r.exit);return ow(e,function(){return t.remove()}),e})}).transitions()}(e,n,t,r)})||[],d=e.maybeAppendByClassName(Iw.labelGroup,"g");Uw(d,Iw.labelGroup,Ow,s);var h=Nb(o,d,function(i){return Pk(i,n,t,r,e.node())})||[];return $e($e($e([],We(c),!1),We(f),!1),We(h),!1).filter(function(t){return!!t})}var Dk=function(t){function e(e){return t.call(this,e,Rw)||this}return Re(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,a=t.data,o=t.animate,s=t.showTitle,l=t.showGrid,c=t.dataThreshold,u=t.truncRange,f=t.classNamePrefix,d=e.className||"axis";f?e.attr("className","".concat(d," ").concat(f,"axis")):e.className||e.attr("className","axis");var h=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(a,c).filter(function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])}),p=aw(void 0===n?o:n),g=Zb(e).maybeAppendByClassName(Iw.gridGroup,"g");Uw(g,Iw.gridGroup,xw,f);var v=Nb(l,g,function(e){return sk(e,h,t,p)})||[],m=Zb(e).maybeAppendByClassName(Iw.mainGroup,"g");Uw(m,Iw.mainGroup,ww,f),i&&(!this.initialized&&p.enter||this.initialized&&p.update)&&Ik(t,Zb(this.offscreenGroup),h,aw(!1));var y=Ik(t,Zb(m.node()),h,p),b=Zb(e).maybeAppendByClassName(Iw.titleGroup,"g");Uw(b,Iw.titleGroup,Ew,f);var x=Nb(s,b,function(e){return function(t,e,n,r){var i=n.titleText,a=n.classNamePrefix;return t.selectAll(Iw.title.class).data([{title:i}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(o){var s=o.append(function(){return Tb(i)}).attr("className",Iw.title.name).transition(function(){return Rk(Zb(this),t,e,n,r.enter)});return Uw(s,Iw.title,jw,a),s},function(i){return i.transition(function(){return Rk(Zb(this),t,e,n,r.update)})},function(t){return t.remove()}).transitions()}(e,r,t,p)})||[];return $e($e($e([],We(v),!1),We(y),!1),We(x),!1).flat().filter(function(t){return!!t})},e}(fx);function Bk(t,e,n){return n?"".concat(t," ").concat(n,"legend-").concat(e):t}function Fk(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}bx.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),bx.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=t+.4*r;return[["M",t,e],["L",o,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",o,e-i],["Z"],["M",o,e+a],["L",t+r-2,e+a],["M",o,e-a],["L",t+r-2,e-a]]}),bx.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=e+.4*r;return[["M",t,e],["L",t-i,o],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,o],["Z"],["M",t-a,o],["L",t-a,e+r-2],["M",t+a,o],["L",t+a,e+r-2]]});var zk="title",Wk="item",$k="marker",Gk="label",Yk="value",Hk="focus-icon",Vk="background",qk="ribbon",Xk="track",Uk="selection",Kk="handle",Zk="handle-marker",Qk="handle-label",Jk="indicator",tM="prev-btn",eM="next-btn",nM="page-info",rM=yb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),iM={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},aM=function(t){function e(e){return t.call(this,e,iM)||this}return Re(e,t),e.prototype.render=function(t,e){var n=Zb(e).maybeAppendByClassName(rM.markerGroup,"g");this.renderMarker(n);var r=Zb(e).maybeAppendByClassName(rM.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.classNamePrefix,a=n.markerSymbol,o=void 0===a?Fk(r,"horizontalHandle","verticalHandle"):a;Nb(!!o,t,function(t){var n=ix(e.attributes,"marker"),r=Ie({symbol:o},n),a=Bk(rM.marker.name,Zk,i);if(e.marker=t.maybeAppendByClassName(rM.marker,function(){return new bx({style:r,className:a})}).update(r),i){var s=e.marker.node().querySelector(".marker");if(s){var l=Bk((s.getAttribute("class")||"").split(" ")[0],Zk,i);s.setAttribute("class",l)}}})},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,a=n.spacing,o=void 0===a?0:a,s=n.formatter,l=n.classNamePrefix;Nb(r,t,function(t){var n,r=ix(e.attributes,"label"),a=r.text,c=De(r,["text"]),u=(null===(n=t.select(rM.marker.class))||void 0===n?void 0:n.node().getBBox())||{},f=u.width,d=void 0===f?0:f,h=u.height,p=We(Fk(i,[0,(void 0===h?0:h)+o,"center","top"],[d+o,0,"start","middle"]),4),g=p[0],v=p[1],m=p[2],y=p[3],b=Bk(rM.label.name,Qk,l);t.maybeAppendByClassName(rM.label,"text").attr("className",b).styles(Ie(Ie({},c),{x:g,y:v,text:s(a).toString(),textAlign:m,textBaseline:y}))})},e}(fx),oM={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},sM=xb({},oM,{}),lM=xb({},oM,ax(iM,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),cM=yb({title:"title",html:"html",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),uM=yb({text:"text"},"title");function fM(t,e){var n=Object.entries(e).reduce(function(e,n){var r=We(n,2),i=r[0],a=r[1];return t.node().attr(i)||(e[i]=a),e},{});t.styles(n)}var dM,hM=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return Re(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,a=t.inset,o=this.querySelector(uM.text.class);if(!o)return new db(0,0,+e,+n);var s=o.getBBox(),l=s.width,c=s.height,u=We(Qb(i),4),f=u[0],d=u[1],h=u[2],p=u[3],g=We([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=cx(r);if(x.includes("i"))return new db(v,m,y,b);x.forEach(function(t,r){var i,a,o,s;"t"===t&&(i=We(0===r?[c+h,+n-c-h]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(a=We([+e-l-p],1),y=a[0]),"b"===t&&(o=We([+n-c-f],1),b=o[0]),"l"===t&&(s=We(0===r?[l+d,+e-l-d]:[0,+e],2),v=s[0],y=s[1])});var w=We(Qb(a),4),k=w[0],M=w[1],O=w[2],E=w[3],S=We([E+M,k+O],2),A=S[0],_=S[1];return new db(v+E,m+k,y-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new db(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=t.classNamePrefix,i=De(t,["width","height","position","spacing","classNamePrefix"]),a=We(ox(i),1)[0],o=function(t){var e,n,r,i,a=t,o=a.width,s=a.height,l=a.position,c=We([+o/2,+s/2],2),u=We([+c[0],+c[1],"center","middle"],4),f=u[0],d=u[1],h=u[2],p=u[3],g=cx(l);return g.includes("l")&&(f=(e=We([0,"start"],2))[0],h=e[1]),g.includes("r")&&(f=(n=We([+o,"end"],2))[0],h=n[1]),g.includes("t")&&(d=(r=We([0,"top"],2))[0],p=r[1]),g.includes("b")&&(d=(i=We([+s,"bottom"],2))[0],p=i[1]),{x:f,y:d,textAlign:h,textBaseline:p}}(t),s=o.x,l=o.y,c=o.textAlign,u=o.textBaseline;Nb(!!i.text,Zb(e),function(t){var e=Bk(uM.text.name,zk,r);n.title=t.maybeAppendByClassName(uM.text,"text").attr("className",e).styles(a).call(fM,{x:s,y:l,textAlign:c,textBaseline:u}).node()})},e}(fx),pM=yb({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),gM=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:mx(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Jg({class:pM.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Jg({class:pM.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Re(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return R(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=We(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map(function(e,n){return t.map(function(t){return t[n]})}))||[]}(this.pageViews.map(function(t){var e=t.getBBox();return[e.width,e.height]})).map(function(t){return Math.max.apply(Math,$e([],We(t),!1))}),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,a=void 0===i?e:i,o=r.pageHeight;return{pageWidth:a,pageHeight:void 0===o?n:o}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,a=this.pageShape,o=a.pageWidth,s=a.pageHeight;return new db(n,r,o+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,a=r.playState,o=r.playWindow,s=r.pageViews;if("idle"!==a||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var l=We(this.getFollowingPageDiff(t),2),c=l[0],u=l[1];this.playState="running";var f=lw(o,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-c,", ").concat(-u,")")}],n);return ow(f,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:R(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:R(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(pM.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach(function(e,n){t.includes(n)?ib(e):ab(e)})},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,a=i.orientation,o=i.controllerPadding,s=r.getBBox().width,l=We("horizontal"===a?[-180,0]:[-90,90],2),c=l[0],u=l[1];e.setLocalEulerAngles(c),n.setLocalEulerAngles(u);var f=e.getBBox(),d=f.width,h=f.height,p=n.getBBox(),g=p.width,v=p.height,m=Math.max(d,s,g),y="horizontal"===a?{offset:[[0,0],[d/2+o,0],[d+s+2*o,0]],textAlign:"start"}:{offset:[[m/2,-h-o],[m/2,0],[m/2,v+o]],textAlign:"center"},b=We(y.offset,3),x=We(b[0],2),w=x[0],k=x[1],M=We(b[1],2),O=M[0],E=M[1],S=We(b[2],2),A=S[0],_=S[1],T=y.textAlign,N=r.querySelector("text");N&&(N.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(O,E),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(pM.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,a=r.pageHeight,o=t<e?-1:1;return"horizontal"===n?[o*i,0]:[0,o*a]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=We(this.getFollowingPageDiff(t),2),i=r[0],a=r[1];n[t].setLocalPosition(i,a)}},e.prototype.renderController=function(t){var e=this,n=this.attributes,r=n.controllerSpacing,i=n.classNamePrefix,a=void 0===i?"":i,o=this.pageShape,s=o.pageWidth,l=o.pageHeight,c=this.pageViews.length>=2,u=t.maybeAppendByClassName(pM.controller,"g");if(ob(u.node(),c),c){var f=ix(this.attributes,"button"),d=ix(this.attributes,"pageNum"),h=We(ox(f),2),p=h[0],g=h[1],v=p.size,m=De(p,["size"]),y=!u.select(pM.prevBtnGroup.class).node(),b=u.maybeAppendByClassName(pM.prevBtnGroup,"g").styles(g);this.prevBtnGroup=b.node();var x=b.maybeAppendByClassName(pM.prevBtn,"path");if(a){var w=Bk(pM.prevBtn.name,tM,a);x.node().setAttribute("class",w)}var k=u.maybeAppendByClassName(pM.nextBtnGroup,"g").styles(g);this.nextBtnGroup=k.node();var M=k.maybeAppendByClassName(pM.nextBtn,"path");if(a){var O=Bk(pM.nextBtn.name,eM,a);M.node().setAttribute("class",O)}[x,M].forEach(function(t){t.styles(Ie(Ie({},m),{transformOrigin:"center"})),Ub(t.node(),v,!0)});var E=u.maybeAppendByClassName(pM.pageInfoGroup,"g");this.pageInfoGroup=E.node();var S=E.maybeAppendByClassName(pM.pageInfo,"text");if(S.styles(d),a){var A=Bk(pM.pageInfo.name,nM,a);S.node().setAttribute("class",A)}this.updatePageInfo(),u.node().setLocalPosition(s+r,l/2),y&&(this.prevBtnGroup.addEventListener("click",function(){e.prev()}),this.nextBtnGroup.addEventListener("click",function(){e.next()}))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(a,")"));var o=Zb(e);this.renderClipPath(o),this.renderController(o),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=K(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(ig.INSERTED,e),this.playWindow.addEventListener(ig.REMOVED,e)},e}(fx),vM="component-poptip",mM="component-poptip-arrow",yM="component-poptip-text",bM=((dM={})[".".concat(vM)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},dM[".".concat(yM)]={"text-align":"center"},dM[".".concat(vM,"[data-position='top']")]={transform:"translate(-50%, -100%)"},dM[".".concat(vM,"[data-position='left']")]={transform:"translate(-100%, -50%)"},dM[".".concat(vM,"[data-position='right']")]={transform:"translate(0, -50%)"},dM[".".concat(vM,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},dM[".".concat(vM,"[data-position='top-left']")]={transform:"translate(0,-100%)"},dM[".".concat(vM,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},dM[".".concat(vM,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},dM[".".concat(vM,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},dM[".".concat(vM,"[data-position='right-top']")]={transform:"translate(0, 0)"},dM[".".concat(vM,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},dM[".".concat(vM,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},dM[".".concat(vM,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},dM[".".concat(mM)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},dM[".".concat(vM,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},dM["[data-position='top'] .".concat(mM)]={bottom:"-2px"},dM[".".concat(vM,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},dM["[data-position='left'] .".concat(mM)]={right:"-2px"},dM[".".concat(vM,"[data-position='right']")]={transform:"translate(5px, -50%)"},dM["[data-position='right'] .".concat(mM)]={left:"-2px"},dM[".".concat(vM,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},dM["[data-position='bottom'] .".concat(mM)]={top:"-2px"},dM[".".concat(vM,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},dM["[data-position='top-left'] .".concat(mM)]={left:"10px",bottom:"-2px"},dM[".".concat(vM,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},dM["[data-position='top-right'] .".concat(mM)]={right:"10px",bottom:"-2px"},dM[".".concat(vM,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},dM["[data-position='left-top'] .".concat(mM)]={right:"-2px",top:"8px"},dM[".".concat(vM,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},dM["[data-position='left-bottom'] .".concat(mM)]={right:"-2px",bottom:"8px"},dM[".".concat(vM,"[data-position='right-top']")]={transform:"translate(5px, 0)"},dM["[data-position='right-top'] .".concat(mM)]={left:"-2px",top:"8px"},dM[".".concat(vM,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},dM["[data-position='right-bottom'] .".concat(mM)]={left:"-2px",bottom:"8px"},dM[".".concat(vM,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},dM["[data-position='bottom-left'] .".concat(mM)]={top:"-2px",left:"8px"},dM[".".concat(vM,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},dM["[data-position='bottom-right'] .".concat(mM)]={top:"-2px",right:"8px"},dM),xM=window;function wM(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function kM(t){var e=function(t){var e;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e||(e=t.apply(xM,n)),e}}(wM)(t);return e}var MM=function(t){function e(n){var r=t.call(this,tt({style:{id:"component-poptip"}},e.defaultOptions,n))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return Re(e,t),Object.defineProperty(e.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},e.prototype.update=function(t){this.attr(tt({},this.style,t)),this.render(this.attributes,this)},e.prototype.bind=function(t,e){var n=this;if(t){var r=this.style.text,i=function(i){var a=t,o=n.style,s=r;if(e){var l="function"==typeof e?e.call(null,i):e,c=l.html,u=l.target,f=De(l,["html","target"]);o=function(t,e,n,r){return e&&q(t,e),n&&q(t,n),r&&q(t,r),t}({},n.style,f),(u||!1===u)&&(a=u),"string"==typeof c&&(s=c)}var d=o.position,h=o.arrowPointAtCenter,p=o.follow,g=o.offset;if(a){var v=i,m=We(function(t,e,n,r,i,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),a)return[t,e];var o=n.getBoundingClientRect(),s=o.x,l=o.y,c=o.width,u=o.height;switch(r){case"top":return i?[s+c/2,l]:[t,l];case"left":return i?[s,l+u/2]:[s,e];case"bottom":return i?[s+c/2,l+u]:[t,l+u];case"right":return i?[s+c,l+u/2]:[s+c,e];case"top-right":case"right-top":return[s+c,l];case"left-bottom":case"bottom-left":return[s,l+u];case"right-bottom":case"bottom-right":return[s+c,l+u];default:return[s,l]}}(v.clientX,v.clientY,a,d,h,p),2),y=m[0],b=m[1];n.showTip(y,b,{text:s,position:d,offset:g})}else n.hideTip()},a=function(){n.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",a),this.map.set(t,[i,a])}},e.prototype.unbind=function(t){if(this.map.has(t)){var e=We(this.map.get(t)||[],2),n=e[0],r=e[1];n&&t.removeEventListener("mousemove",n),r&&t.removeEventListener("mouseleave",r),this.map.delete(t)}},e.prototype.clear=function(){this.container.innerHTML=""},e.prototype.destroy=function(){var e,n=this;$e([],We(this.map.keys()),!1).forEach(function(t){return n.unbind(t)}),null===(e=this.container)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.showTip=function(t,e,n){var r=at(n,"text");if((!r||"string"==typeof r)&&(this.applyStyles(),t&&e&&n)){var i=n.offset,a=n.position;if(a&&this.container.setAttribute("data-position",a),this.setOffsetPosition(t,e,i),"string"==typeof r){var o=this.container.querySelector(".".concat(yM));o&&(o.innerHTML=r)}this.visibility="visible",this.container.style.visibility="visible"}},e.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},e.prototype.getContainer=function(){return this.container},e.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(vM).concat(t?" ".concat(t):"")},e.prototype.initShape=function(){var t=this,e=this.style.id;this.container=kM(e),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},e.prototype.updatePoptipElement=function(){var t=this.container;this.clear();var e=this.style,n=e.id,r=e.template,i=e.text;this.container.setAttribute("id",n),this.container.className=this.getClassName();var a,o='<span class="'.concat(mM,'"></span>');t.innerHTML=o,L(r)?t.innerHTML+=r:r&&((a=r)instanceof Element||a instanceof Document)&&t.appendChild(r),i&&(t.getElementsByClassName(yM)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility},e.prototype.applyStyles=function(){var t=xb({},bM,this.style.domStyles),e=Object.entries(t).reduce(function(t,e){var n=We(e,2),r=n[0],i=n[1],a=Object.entries(i).reduce(function(t,e){var n=We(e,2),r=n[0],i=n[1];return"".concat(t).concat(r,": ").concat(i,";")},"");return"".concat(t).concat(r,"{").concat(a,"}")},"");if(this.domStyles!==e){this.domStyles=e;var n=this.container.querySelector("style");n&&this.container.removeChild(n),(n=document.createElement("style")).innerHTML=e,this.container.appendChild(n)}},e.prototype.setOffsetPosition=function(t,e,n){void 0===n&&(n=this.style.offset);var r=We(n,2),i=r[0],a=void 0===i?0:i,o=r[1],s=void 0===o?0:o;this.container.style.left="".concat(t+a,"px"),this.container.style.top="".concat(e+s,"px")},e.tag="poptip",e.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:bM,template:'<div class="'.concat(yM,'"></div>')}},e}(fx),OM=yb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),EM={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};var SM=function(t){function e(e,n){var r=t.call(this,e,{span:[1,1],marker:function(){return new Ug({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this;return r.keyFields={},r.keyFields=n||{},r}return Re(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes,r=n.markerSize,i=n.focus,a=n.focusMarkerSize,o=t.node().getBBox(),s=o.width,l=o.height,c=e.node().getBBox(),u=c.width,f=c.height;return{markerWidth:r,labelWidth:s,valueWidth:u,focusWidth:i?null!=a?a:12:0,height:Math.max(r,l,f)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=We(Qb(t),2),n=e[0],r=e[1],i=this.showValue?r:0,a=n+i;return[n/a,i/a]},enumerable:!1,configurable:!0}),e.prototype.setAttribute=function(e,n){t.prototype.setAttribute.call(this,e,n)},Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,a=i.markerWidth,o=i.focusWidth,s=i.height,l=this.actualSpace,c=l.labelWidth,u=l.valueWidth,f=We(this.spacing,3),d=f[0],h=f[1],p=f[2];if(r){var g=r-n-d-h-o-p,v=We(this.span,2);c=(t=We([v[0]*g,v[1]*g],2))[0],u=t[1]}return{width:a+c+u+d+h+o+p,height:s,markerWidth:a,labelWidth:c,valueWidth:u,focusWidth:o}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes,e=t.spacing,n=t.focus;if(!e)return[0,0,0];var r=We(Qb(e),3),i=r[0],a=r[1],o=r[2];return[i,this.showValue?a:0,n?o:0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.focusWidth,a=t.width,o=t.height,s=We(this.spacing,3),l=s[0],c=s[1];return{height:o,width:a,markerWidth:e,labelWidth:n,valueWidth:r,focusWidth:i,position:[e/2,e+l,e+n+l+c,e+n+r+l+c+s[2]+i/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(OM.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,a=e.markerLineWidth,o=void 0===a?t.lineWidth:a,s=e.markerStroke,l=void 0===s?t.stroke:s,c=+(i||o||(l?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,d=u.height;return(1-c/Math.max(f,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.marker,i=n.classNamePrefix,a=ix(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(OM.markerGroup,"g").style("zIndex",0),Nb(!!r,this.markerGroup,function(){var t,n=e.markerGroup.node(),o=null===(t=n.childNodes)||void 0===t?void 0:t[0],s=Bk(OM.marker.name,$k,i),l="string"==typeof r?new bx({style:{symbol:r},className:s}):r();if(o)if(l.nodeName===o.nodeName)o instanceof bx?o.update(Ie(Ie({},a),{symbol:r})):(!function(t,e){var n,r,i=e.attributes;try{for(var a=ze(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=We(o.value,2),l=s[0],c=s[1];"id"!==l&&"className"!==l&&t.attr(l,c)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}(o,l),Zb(o).styles(a));else{if(o.remove(),!(l instanceof bx)){var c=Bk(OM.marker.name,$k,i);l.className=c}Zb(l).styles(a),n.appendChild(l)}else{if(!(l instanceof bx)){var u=Bk(OM.marker.name,$k,i);l.className=u,Zb(l).styles(a)}n.appendChild(l)}e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var f=Ub(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(f,")")})},e.prototype.renderLabel=function(t){var e=ix(this.attributes,"label"),n=e.text,r=De(e,["text"]),i=this.attributes.classNamePrefix;this.labelGroup=t.maybeAppendByClassName(OM.labelGroup,"g").style("zIndex",0);var a=Bk(OM.label.name,Gk,i),o=this.labelGroup.maybeAppendByClassName(OM.label,function(){return Tb(n)});o.node().setAttribute("class",a),o.styles(r)},e.prototype.renderValue=function(t){var e=this,n=ix(this.attributes,"value"),r=n.text,i=De(n,["text"]),a=this.attributes.classNamePrefix;this.valueGroup=t.maybeAppendByClassName(OM.valueGroup,"g").style("zIndex",0),Nb(this.showValue,this.valueGroup,function(){var t=Bk(OM.value.name,Yk,a),n=e.valueGroup.maybeAppendByClassName(OM.value,function(){return Tb(r)});n.node().setAttribute("class",t),n.styles(i)})},e.prototype.createPoptip=function(){var t=De(this.attributes.poptip||{},["render"]),e=new MM({style:xb(EM,t)});return this.poptipGroup=e,e},e.prototype.bindPoptip=function(t){var e=this,n=this.attributes.poptip;n&&(this.poptipGroup||this.createPoptip()).bind(t,function(){var t=e.attributes,r=t.labelText,i=t.valueText,a=t.markerFill,o="string"==typeof r?r:null==r?void 0:r.attr("text"),s="string"==typeof i?i:null==i?void 0:i.attr("text");if("function"==typeof n.render)return{html:n.render(Ie(Ie({},e.keyFields),{label:o,value:s,color:a}))};var l="";return"string"!=typeof o&&"number"!=typeof o||(l+='<div class="component-poptip-label">'.concat(o,"</div>")),"string"!=typeof s&&"number"!=typeof s||(l+='<div class="component-poptip-value">'.concat(s,"</div>")),{html:l}})},e.prototype.renderFocus=function(t){var e=this,n=this.attributes,r=n.focus,i=n.focusMarkerSize,a=n.classNamePrefix,o={x:0,y:0,size:i,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};V(r)||(this.focusGroup=t.maybeAppendByClassName(OM.focusGroup,"g").style("zIndex",0),Nb(r,this.focusGroup,function(){var n=Bk(OM.focus.name,Hk,a),r=new bx({style:Ie(Ie({},o),{symbol:"focus"}),className:n}),i=new Ug({style:{r:o.size/2,fill:"transparent"}}),s=e.focusGroup.node();s.appendChild(i),s.appendChild(r),r.update({opacity:0}),t.node().addEventListener("pointerenter",function(){r.update({opacity:1})}),t.node().addEventListener("pointerleave",function(){r.update({opacity:0})})}))},e.prototype.renderPoptip=function(t){var e=this;this.attributes.poptip&&[t.maybeAppendByClassName(OM.value,"g").node(),t.maybeAppendByClassName(OM.label,"g").node()].forEach(function(t){t&&e.bindPoptip(t)})},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=ix(this.attributes,"background");this.background=t.maybeAppendByClassName(OM.backgroundGroup,"g").style("zIndex",-1);var a=this.background.maybeAppendByClassName(OM.background,"rect");a.styles(Ie({width:n,height:r},i));var o=this.attributes.classNamePrefix,s=void 0===o?"":o;if(s){var l=Bk(OM.background.name,Vk,s);a.node().setAttribute("class",l)}},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=We(t.position,4),a=i[0],o=i[1],s=i[2],l=i[3],c=r/2;this.markerGroup.styles({transform:"translate(".concat(a,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(o,", ").concat(c,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(l,", ").concat(c,")")}),Sb(this.labelGroup.select(OM.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),Sb(this.valueGroup.select(OM.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Zb(e),r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a;n.styles({transform:"translate(".concat(i,", ").concat(o,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.renderPoptip(n),this.renderFocus(n),this.adjustLayout()},e}(fx),AM=yb({page:"item-page",navigator:"navigator",item:"item"},"items"),_M=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},TM=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:ft,mouseenter:ft,mouseleave:ft})||this;return n.navigatorShape=[0,0],n}return Re(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=t.poptip,i=t.focus,a=t.focusMarkerSize,o=t.classNamePrefix,s=ix(this.attributes,"item"),l=e.map(function(t,l){var c=t.id,u=void 0===c?l:c,f=t.label,d=t.value;return{id:"".concat(u),index:l,style:Ie({layout:n,labelText:f,valueText:d,poptip:r,focus:i,focusMarkerSize:a,classNamePrefix:o},Object.fromEntries(Object.entries(s).map(function(n){var r=We(n,2);return[r[0],hb(r[1],[t,l,e])]})))}});return l},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,a=e.colPadding,o=We(this.navigatorShape,1)[0],s=We(this.grid,2),l=s[0],c=s[1],u=c*l,f=0;return this.pageViews.children.map(function(e,s){var d,h,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(c,l),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=We(m,2),b=y[0],x=y[1],w=(r-o-(c-1)*a)/c,k=e.getBBox().height,M=We([0,0],2),O=M[0],E=M[1];return"horizontal"===n?(O=(d=We([f,b*(k+i)],2))[0],E=d[1],f=x===c-1?0:f+w+a):(O=(h=We([x*(w+a),f],2))[0],E=h[1],f=b===l-1?0:f+k+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:k,x:O,y:E}})},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,a=We(this.navigatorShape,1)[0],o=We(this.grid,2),s=o[0],l=o[1],c=We([e-a,n],2),u=c[0],f=c[1],d=We([0,0,0,0,0,0,0,0],8),h=d[0],p=d[1],g=d[2],v=d[3],m=d[4],y=d[5],b=d[6],x=d[7];return this.pageViews.children.map(function(t,e){var n,a,o,c,d=t.getBBox(),w=d.width,k=d.height,M=0===b?0:i,O=b+M+w;return O<=u&&_M(m,function(t){return t<l})?(n=We([b+M,x,O],3),h=n[0],p=n[1],b=n[2],{width:w,height:k,x:h,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(a=We([y+1,0,0,x+k+r],4),y=a[0],m=a[1],b=a[2],(x=a[3])+k<=f&&_M(y,function(t){return t<s})?(o=We([b,x,w],3),h=o[0],p=o[1],b=o[2],{width:w,height:k,x:h,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(c=We([0,0,w,0,g+1,0,0,0],8),h=c[0],p=c[1],b=c[2],x=c[3],g=c[4],v=c[5],y=c[6],m=c[7],{width:w,height:k,x:h,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Fk(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(AM.item.class).forEach(function(e){t.appendChild(e)}),t.querySelectorAll(AM.page.class).forEach(function(e){t.removeChild(e).destroy()})},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=e.classNamePrefix;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this),s=Bk(AM.item.name,Wk,a);Zb(t).selectAll(AM.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){var e=t.style,n=De(t,["style"]);return new SM({style:e},n)}).attr("className",s).on("click",function(){null==n||n(this),o("itemClick",{item:this})}).on("pointerenter",function(){null==r||r(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){null==i||i(this),o("itemMouseleave",{item:this})})},function(t){return t.each(function(t){var e=t.style;this.update(e)})},function(t){return t.remove()})},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,a=We(this.navigatorShape,2),o=a[0],s=a[1];this.navigator.update("grid"===n?{pageWidth:r-o,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce(function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t},{}))).map(function(t){var e=We(t,2);return{page:e[0],layouts:e[1]}}),i=$e([],We(this.navigator.getContainer().children),!1);r.forEach(function(t){var e=t.layouts,r=n.pageViews.appendChild(new Jg({className:AM.page.name}));e.forEach(function(t){var e=t.x,n=t.y,a=t.index,o=t.width,s=t.height,l=i[a];r.appendChild(l),ot(l,"__layout__",t),l.update({x:e,y:n,width:o,height:s})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes,n=e.orientation,r=e.classNamePrefix,i=ix(this.attributes,"nav"),a=xb({orientation:n,classNamePrefix:r},i),o=this;return t.selectAll(AM.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new gM({style:a})}).attr("className",AM.navigator.name).each(function(){o.navigator=this})},function(t){return t.each(function(){this.update(a)})},function(t){return t.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(Zb(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Up(t,{detail:e});this.dispatchEvent(n)},e}(fx),NM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.update=function(t){this.attr(t)},e}(ev),PM=function(t){function e(e){return t.call(this,e,sM)||this}return Re(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,a=r.titleText,o=r.classNamePrefix,s=We(ox(ix(this.attributes,"title")),2),l=s[0],c=s[1];this.titleGroup=t.maybeAppendByClassName(cM.titleGroup,"g").styles(c);var u=Ie(Ie({width:e,height:n},l),{text:i?a:"",classNamePrefix:o});this.title=this.titleGroup.maybeAppendByClassName(cM.title,function(){return new hM({style:u})}).update(u)},e.prototype.renderCustom=function(t){var e=this.attributes.data,n={innerHTML:this.attributes.render(e),pointerEvents:"auto"};t.maybeAppendByClassName(cM.html,function(){return new NM({className:cM.html.name,style:n})}).update(n)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,a=e.height,o=We(ox(ix(this.attributes,"title",!0)),2),s=o[0],l=o[1],c=Ie(Ie({},s),{width:i,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(cM.itemsGroup,"g").styles(Ie(Ie({},l),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(cM.items.class).data(["items"]).join(function(t){return t.append(function(){return new TM({style:c})}).attr("className",cM.items.name).each(function(){u.items=Zb(this)})},function(t){return t.update(c)},function(t){return t.remove()})},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new db(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),l=e.getBBox(),c=cx(r),u=We(Qb(o?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],g=We(Qb(a),4),v=g[0],m=g[1],y=g[2],b=g[3],x=We([p+d,f+h],2),w=x[0],k=x[1],M=We([b+m,v+y],2),O=M[0],E=M[1];if("l"===c[0])return new db(s.x,s.y,l.width+s.width+w+O,Math.max(l.height+E,s.height));if("t"===c[0])return new db(s.x,s.y,Math.max(l.width+O,s.width),l.height+s.height+k+E);var S=We([e.attributes.width||l.width,e.attributes.height||l.height],2),A=S[0],_=S[1];return new db(l.x,l.y,A+s.width+w+O,_+s.height+k+E)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,a=n.x,o=void 0===a?0:a,s=n.y,l=void 0===s?0:s,c=n.classNamePrefix,u=n.render,f=Zb(e),d=e.className||"legend-category";c?e.attr("className","".concat(d," ").concat(c,"legend")):e.className||e.attr("className","legend-category"),e.style.transform="translate(".concat(o,", ").concat(l,")"),u?this.renderCustom(f):(this.renderTitle(f,r,i),this.renderItems(f,this.availableSpace),this.adjustLayout())},e}(fx),CM={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},LM=yb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),jM=function(t){function e(e){var n=t.call(this,e,CM)||this;return n.point=[0,0],n.group=n.appendChild(new Jg({})),n.isMutationObserved=!0,n}return Re(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=We(Qb(t.padding),4),r=n[0],i=n[1],a=n[2],o=n[3],s=this.label.node().getLocalBounds(),l=s.min,c=s.max,u=new db(l[0]-o,l[1]-r,c[0]+i-l[0]+o,c[1]+a-l[1]+r),f=this.getPath(e,u),d=ix(this.attributes,"background");this.background=Zb(this.group).maybeAppendByClassName(LM.background,"path").styles(Ie(Ie({},d),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=We(ox(ix(this.attributes,"label")),2),i=r[0],a=r[1],o=De(i,["text"]);(this.label=Zb(this.group).maybeAppendByClassName(LM.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(LM.label,function(){return Tb(e(n))}).style("text",e(n).toString()).selectAll("text").styles(o)},e.prototype.adjustLayout=function(){var t=We(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,a=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(a-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,a=e.width,o=e.height,s=[["M",r+n,i],["L",r+a-n,i],["A",n,n,0,0,1,r+a,i+n],["L",r+a,i+o-n],["A",n,n,0,0,1,r+a-n,i+o],["L",r+n,i+o],["A",n,n,0,0,1,r,i+o-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],c=this.createCorner([s[l].slice(-2),s[l+1].slice(-2)]);return s.splice.apply(s,$e([l+1,1],We(c),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=tx.apply(void 0,$e([],We(t),!1)),r=We(t,2),i=We(r[0],2),a=i[0],o=i[1],s=We(r[1],2),l=s[0],c=s[1],u=We(n?[l-a,[a,l]]:[c-o,[o,c]],2),f=u[0],d=We(u[1],2),h=d[0],p=d[1],g=f/2,v=e*(f/Math.abs(f)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=We([h,h+g-m,h+g,h+g+m,p],5),x=b[0],w=b[1],k=b[2],M=b[3],O=b[4];return n?(this.point=[k,o-y],[["L",x,o],["L",w,o],["L",k,o-y],["L",M,o],["L",O,o]]):(this.point=[a+y,k],[["L",a,x],["L",a,w],["L",a+y,k],["L",a,M],["L",a,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?ab(this):ib(this)},e.prototype.bindEvents=function(){this.label.on(ig.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(fx);function RM(t,e){var n=We(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var IM=yb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function DM(t){var e=t.orientation,n=t.size,r=t.length;return Fk(e,[r,n],[n,r])}function BM(t){var e=t.type,n=We(DM(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function FM(t){return BM(t)}function zM(t){var e,n=t.orientation,r=t.color,i=t.block,a=t.partition;if(y(r)){e=new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))})}else e=r;var o=e.length,s=e.map(function(t){return Md(t).toString()});return o?1===o?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce(function(e,n,a){var o=r[a%r.length];return e+" ".concat(t[a],":").concat(o).concat(a<i-1?" ".concat(t[a+1],":").concat(o):"")},"l(".concat("horizontal"===n?"0":"270",")"))}(a,s,n):s.reduce(function(t,e,n){return t+" ".concat(n/(o-1),":").concat(e)},"l(".concat(Fk(n,"0","270"),")")):""}function WM(t){var e=t.orientation,n=t.range;if(!n)return[];var r=We(DM(t),2),i=r[0],a=r[1],o=We(n,2),s=o[0],l=o[1],c=Fk(e,s*i,0),u=Fk(e,0,s*a),f=Fk(e,l*i,i),d=Fk(e,a,l*a);return[["M",c,u],["L",c,d],["L",f,d],["L",f,u],["Z"]]}var $M=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return Re(e,t),e.prototype.render=function(t,e){!function(t,e){var n=ix(e,"track"),r=e.classNamePrefix,i=Bk(IM.track.name,Xk,r);t.maybeAppendByClassName(IM.track,"path").attr("className",i).styles(Ie({d:BM(e)},n))}(Zb(e).maybeAppendByClassName(IM.trackGroup,"g"),t),function(t,e){var n=ix(e,"selection"),r=zM(e),i=e.classNamePrefix,a=Bk(IM.selection.name,Uk,i),o=t.maybeAppendByClassName(IM.selection,"path").attr("className",a).styles(Ie({d:FM(e),fill:r},n)),s=o.maybeAppendByClassName(IM.clipPath,"path").styles({d:WM(e)}).node();o.style("clipPath",s)}(Zb(e).maybeAppendByClassName(IM.selectionGroup,"g"),t)},e}(fx);var GM=function(t){function e(e){var n=t.call(this,e,lM)||this;return n.eventToOffsetScale=new Kx({}),n.innerRibbonScale=new Kx({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var a=n.getValueByCanvasPoint(t);if(i){var o=RM(r.map(function(t){return t.value}),a).range,s=n.getRealSelection(o);n.showIndicator((o[0]+o[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(a,o)}else{var l=n.getTickValue(a);n.showIndicator(l,"".concat(n.getRealValue(l))),n.dispatchIndicated(l)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=We(n.selection,2),i=r[0],a=r[1],o=n.getTickValue(n.getValueByCanvasPoint(t)),s=o-n.prevValue;"start"===e?i!==o&&n.updateSelection(o,a):"end"===e?a!==o&&n.updateSelection(i,o):"ribbon"===e&&0!==s&&(n.prevValue=o,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return Re(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new db(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.classNamePrefix,i=e.className||"legend-continuous";r?e.attr("className","".concat(i," ").concat(r,"legend")):e.className||e.attr("className","legend-continuous");var a=t.showLabel;this.renderTitle(Zb(e));var o=this.availableSpace,s=o.x,l=o.y,c=Zb(e).maybeAppendByClassName(cM.contentGroup,"g").styles({transform:"translate(".concat(s,", ").concat(l,")")});Nb(!!a,c.maybeAppendByClassName(cM.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)});var u=c.maybeAppendByClassName(cM.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=c.maybeAppendByClassName(cM.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(u),this.renderIndicator(c),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,$e([],We(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,$e([],We(t.map(function(t){return t.value})),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=We(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=We(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Fk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,a=e.height,o=e.classNamePrefix,s=ix(this.attributes,"title"),l=Ie(Ie({},s),{width:i,height:a,text:r,classNamePrefix:o}),c=this;t.selectAll(cM.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new hM({style:l})}).attr("className",cM.title.name).each(function(){c.title=this})},function(t){return t.update(l)},function(t){return t.each(function(){c.title=void 0}).remove()})},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new db(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new db(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Iw.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new db(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,a=i.width,o=i.height;return{width:a,height:o,size:this.ifHorizontal(o,a)+r+this.labelFixedSpacing,length:this.ifHorizontal(a,o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,a=r.height,o=this.labelShape,s=o.size,l=o.length,c=We(this.ifHorizontal([a,i],[i,a]),2),u=c[0],f=c[1],d=e?this.handleShape:{size:0,length:0},h=d.size,p=d.length,g=this.handleOffsetRatio,v=0,m=this.labelPosition;v=n||(["bottom","right"].includes(m)?Math.min(u-s,(u-h)/g):u*(1-g)>h?Math.max(u-s,0):Math.max((u-s-h)/g,0));var y=Math.max(p,l),b=f-y,x=We(this.ifHorizontal([b,v],[v,b]),2),w=x[0],k=x[1],M=["top","left"].includes(m)?s:0,O=We(this.ifHorizontal([y/2,M],[M,y/2]),2),E=O[0],S=O[1];return new db(E,S,w,k)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,o=e.block,s=e.classNamePrefix,l=ix(this.attributes,"ribbon"),c=this.range,u=c.min,f=c.max,d=this.ribbonBBox,h=d.x,p=d.y,g=this.ribbonShape,v=g.length,m=g.size,y=xb({transform:"translate(".concat(h,", ").concat(p,")"),length:v,size:m,type:r,orientation:i,color:a,block:o,partition:n.map(function(t){return(t.value-u)/(f-u)}),range:this.ribbonRange,classNamePrefix:s},l),b=Bk(cM.ribbon.name,qk,s);this.ribbon=t.maybeAppendByClassName(cM.ribbon,function(){return new $M({style:y,className:b})}).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(cM.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=t.classNamePrefix,i=ix(this.attributes,"handle"),a=We(this.selection,2),o=a[0],s=a[1],l=Ie(Ie({},i),{orientation:n,classNamePrefix:r}),c=i.shape,u="basic"===(void 0===c?"slider":c)?aM:mw,f=this,d=Bk(cM.handle.name,Kk,r);this.handlesGroup.selectAll(cM.handle.class).data(e?[{value:o,type:"start"},{value:s,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new u({style:l,className:d})}).attr("className",function(t){var e=t.type;return"".concat(d," ").concat(f.getHandleClassName(e))}).each(function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");f[r]=this,this.addEventListener("pointerdown",f.onDragStart(e))})},function(t){return t.update(l).each(function(t){var e=t.value;this.update({labelText:e})})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");f[n]=void 0}).remove()})},e.prototype.adjustHandles=function(){var t=We(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n);var r=this.attributes,i=r.classNamePrefix,a=r.showHandle,o=ix(this.attributes,"handle").shape;a&&"slider"===(void 0===o?"slider":o)&&i&&(this.startHandle&&this.updateSliderHandleClassNames(this.startHandle,i),this.endHandle&&this.updateSliderHandleClassNames(this.endHandle,i))},e.prototype.updateSliderHandleClassNames=function(t,e){var n=t.container||t,r=n.querySelector(".handle-icon-rect");if(r){var i=Bk("handle-icon-rect",Zk,e);r.setAttribute("class",i),r.querySelectorAll("line").forEach(function(t){var n=Bk((t.getAttribute("class")||"").split(" ")[0],Zk,e);t.setAttribute("class",n)})}var a=n.querySelector(".handle-label");if(a){var o=Bk("handle-label",Qk,e);a.setAttribute("class",o)}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new db(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,a=r.height,o=We([Math.max(e,i),Math.max(n,a)],2),s=o[0],l=o[1];return this.cacheHandleBBox=new db(0,0,s,l),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=We(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,a=r.y,o=this.ribbonShape.size,s=this.getOffset(e),l=We(this.ifHorizontal([i+s,a+o*this.handleOffsetRatio],[i+o*this.handleOffsetRatio,a+s]),2),c=l[0],u=l[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(c,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=this.attributes.classNamePrefix,n=ix(this.attributes,"indicator"),r=Bk(cM.indicator.name,Jk,e);this.indicator=t.maybeAppendByClassName(cM.indicator,function(){return new jM({style:n,className:r})}).update(n)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce(function(e,n,r,i){var a,o,s=null!==(a=null==n?void 0:n.id)&&void 0!==a?a:r.toString();if(e.push(Ie(Ie({},n),{id:s,index:r,type:"value",label:null!==(o=null==n?void 0:n.label)&&void 0!==o?o:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var l=i[r+1],c=We([n.value,l.value],2),u=c[0],f=c[1],d=(u+f)/2;e.push(Ie(Ie({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(d)}))}return e},[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=We(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,a=e.labelFormatter,o=ix(this.attributes,"tick"),s=ix(this.attributes,"label"),l=s.align,c=xb(Ie({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),ax(o,"tick"),ax(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===l&&(!i||i(t,t.index,n.filter(function(t){return t.type===l})))},labelFormatter:a},f=Ie(Ie(Ie({},c),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(cM.label,function(){return new Dk({style:f})}).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,a=this.ribbonShape.size,o=this.labelPosition,s=this.labelFixedSpacing,l=We([0,0,0],3),c=l[0],u=l[1],f=l[2],d=null!=i?i:a;return e?(f=d,u=s,"positive"===n?"right"===o?(c=d,f=d):"bottom"===o&&(c=f):"negative"===n&&("top"===o||"left"===o)&&(c=a)):"positive"===n?"right"===o?u=d:"bottom"===o&&(c=a+s,u=r):"negative"===n&&("left"===o||"top"===o)&&(u=r),{offset:c,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,a=this.labelAxisStyle,o=a.offset,s=a.spacing,l=a.tickLength,c=We(this.ifHorizontal([[e,n+o],[e+r,n+o]],[[e+o,n+i],[e+o,n]]),2),u=c[0],f=c[1];this.label.update({startPos:u,endPos:f,tickLength:l,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,a=this.ribbonBBox,o=a.x,s=a.y,l=R(t,r,i),c=this.getOffset(l),u=this.ifHorizontal([c+o,s],[o,c+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),ib(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){ab(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=We(this.selection,2),a=i[0],o=i[1],s=We([t,e],2),l=s[0],c=s[1];n&&(l+=a,c+=o);var u=this.range;r=We(function(t,e,n){var r,i=We(t,2),a=i[0],o=i[1],s=We(e,2),l=s[0],c=s[1],u=We(n,2),f=u[0],d=u[1],h=We([l,c],2),p=h[0],g=h[1],v=g-p;return p>g&&(p=(r=We([g,p],2))[0],g=r[1]),v>o-a?[a,o]:p<a?f===a&&d===g?[a,g]:[a,v+a]:g>o?d===o&&f===p?[p,o]:[o-v,o]:[p,g]}([u.min,u.max],[l,c],this.selection),2),l=r[0],c=r[1],this.update({defaultValue:[l,c]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return V(e)?Gb(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?RM(n.map(function(t){return t.value}),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=We(this.ribbon.node().getPosition(),2),a=i[0],o=i[1],s=this.ifHorizontal(a,o),l=this.ifHorizontal.apply(this,$e([],We(Ab(t)),!1))-s;return R(this.getOffset(l,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,a=this.ribbonShape.length,o=this.eventToOffsetScale;return o.update({domain:[r,i],range:[0,a]}),e?o.invert(t):o.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=We(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Up("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal(function(){return{value:t,range:e}},function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}}),a=new Up("indicate",{detail:i});this.dispatchEvent(a)},e}(fx);function YM(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var HM={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function VM(t){var e;void 0===t&&(t="");var n=YM(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=Ie({flex:1},HM),e[".".concat(n.VALUE)]=Ie({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},HM),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var qM=function(t){function e(e){var n,r,i=this,a=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,o=YM(a);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,'" data-index={index}>\n <span class="').concat(o.NAME,'">\n <span class="').concat(o.MARKER,'" style="background:{color}"></span>\n <span class="').concat(o.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(o.VALUE,'" title="{value}">{value}</span>\n </li>')},style:VM(a)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return Re(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map(function(t,e){var r=t.name,i=void 0===r?"":r,a=t.color,o=void 0===a?"black":a,s=t.index,l=De(t,["name","color","index"]),c=Ie({name:i,color:o,index:null!=s?s:e},l);return Nn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]}):t}(n.item,c))})},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=Nn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:lx(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,a=n.enterable,o=n.style,s=n.content,l=YM(r.prefixCls),c=this.element;if(this.element.style.pointerEvents=a?"auto":"none",s)this.renderCustomContent();else{i?(c.innerHTML=r.title,c.getElementsByClassName(l.TITLE)[0].innerHTML=i):null===(e=null===(t=c.getElementsByClassName(l.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=l.LIST,lx(f,u);var d=this.element.querySelector(".".concat(l.LIST));d?d.replaceWith(f):c.appendChild(f)}!function(t,e){Object.entries(e).forEach(function(e){var n=We(e,2),r=n[0],i=n[1];$e([t],We(t.querySelectorAll(r)),!1).filter(function(t){return t.matches(r)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(i).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})}(c,o)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},o=this.elementSize,s=o.width,l=o.height,c=[-s/2,-l/2];return i.forEach(function(t){var e=We(c,2),n=e[0],i=e[1],o=We(a[t],2),u=o[0],f=o[1];c=[n+(s/2+r[0])*u,i+(l/2+r[1])*f]}),c},e.prototype.setOffsetPosition=function(t){var e=We(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=void 0===a?0:a,s=i.y,l=void 0===s?0:s,c=i.container,u=c.x,f=c.y;this.element.style.left="".concat(+o+u+n,"px"),this.element.style.top="".concat(+l+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=We(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=i.y,s=i.bounding,l=i.position;if(!s)return[n,r];var c=this.element,u=c.offsetWidth,f=c.offsetHeight,d=We([+a+n,+o+r],2),h=d[0],p=d[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:h<v,right:h+u>v+s.width,top:p<m,bottom:p+f>m+s.height},b=[];l.split("-").forEach(function(t){y[t]?b.push(g[t]):b.push(t)});var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,a=n.width,o=n.height;return new db(r,i,a,o).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout(function(){e.element.style.transition=n},10)},e.tag="tooltip",e}(fx),XM=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[ig.BOUNDS_CHANGED,ig.INSERTED,ig.REMOVED],n.$margin=Qb(0),n.$padding=Qb(0);var r=e.style||{},i=r.margin,a=void 0===i?0:i,o=r.padding,s=void 0===o?0:o;return n.margin=a,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return Re(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Qb(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Qb(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,a=t.width,o=t.height,s=We(this.$margin,4),l=s[0],c=s[1],u=s[2],f=s[3];return new db(n-f,i-l,a+f+c,o+l+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=We(this.$padding,4),i=r[0],a=r[1],o=r[2],s=r[3],l=We(this.$margin,4),c=l[0],u=l[3];return new db(s+u,i+c,e-s-a,n-i-o)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:jb,grid:Rb},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map(function(t){return t.getBBox()}),this.attributes);this.children.forEach(function(t,e){var n=r[e],i=n.x,a=n.y;t.style.transform="translate(".concat(i,", ").concat(a,")")})}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach(function(e){t.addEventListener(e,function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())})})},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(Jg);function UM(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let a=0,o=0;return e>0&&(a=e),r<0&&(a=r),n>0&&(o=n),i<0&&(o=i),[a,o]}const KM=qm(t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:a,labelTransform:o,labelTransformOrigin:s,x:l,y:c,x0:u=l,y0:f=c,text:d,background:h,connector:p,startMarker:g,endMarker:v,coordCenter:m,innerHTML:y}=e,b=De(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${l}, ${c})`,[l,c,u,f].some(t=>!I(t)))return void t.children.forEach(t=>t.remove());const x=Ja(b,"background"),{padding:w}=x,k=De(x,["padding"]),M=Ja(b,"connector"),{points:O=[]}=M,E=De(M,["points"]);let S;S=y?Am(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",y).call(Pm,Object.assign({transform:o,transformOrigin:s},b)).node():Am(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Pm,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},b)).node();const A=Am(t).maybeAppend("background","rect").style("zIndex",-1).call(Pm,function(t,e=[]){const[n=0,r=0,i=n,a=r]=e,o=t.parentNode,s=o.getEulerAngles();o.setEulerAngles(0);const{min:l,halfExtents:c}=t.getLocalBounds(),[u,f]=l,[d,h]=c;return o.setEulerAngles(s),{x:u-a,y:f-n,width:2*d+a+r,height:2*h+n+i}}(S,w)).call(Pm,h?k:{}).node(),_=function(t,e,n,r,i=!0,a=!0){const o=t=>Ol()(t);if(!e[0]&&!e[1])return o([UM(t),e]);if(!n.length)return o([[0,0],e]);const[s,l]=n,c=[...l],u=[...s];if(l[0]!==s[0]){const t=i?-4:4;c[1]=l[1],a&&!i&&(c[0]=Math.max(s[0],l[0]-t),l[1]<s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.max(u[0],c[0]-t))),a||i||(c[0]=Math.max(s[0],l[0]-t),l[1]>s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.max(u[0],c[0]-t))),!a&&i&&(c[0]=Math.min(s[0],l[0]-t),l[1]>s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.min(u[0],c[0]-t))),a&&i&&(c[0]=Math.min(s[0],l[0]-t),l[1]<s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.min(u[0],c[0]-t)))}return o([l,c,u,s,e])}(A,[+u-+l,+f-+c],O,0,+u<m[0],+f<m[1]),T=g&&new bx({id:"startMarker",style:Object.assign({x:0,y:0},Ja(b,"startMarker"))}),N=v&&new bx({id:"endMarker",style:Object.assign({x:0,y:0},Ja(b,"endMarker"))});Am(t).maybeAppend("connector","path").style("zIndex",0).style("d",_).style("markerStart",T).style("markerEnd",N).call(Pm,p?E:{})}),ZM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:l=0,transform:c=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s},[[f,d]]=e;return Am(new KM).style("x",f).style("y",d).call(Pm,i).style("transform",`${c}rotate(${+l})`).style("coordCenter",n.getCenter()).call(Pm,u).call(Pm,t).node()}};ZM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const QM=qm(t=>{const e=De(t.attributes,["class","x","y","transform"]),n=Ja(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[s,l]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,l],["L",a,o],["Z"]]}(r/2),a=Am(t).maybeAppend("marker",()=>new bx({})).call(t=>t.node().update(Object.assign({symbol:i},n))).node(),[o,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(a);Am(t).maybeAppend("text","text").style("x",o).style("y",s).call(Pm,e)}),JM=(t,e)=>{const n=De(t,[]);return(t,e,r)=>{const{color:i}=r,a=De(r,["color"]),{color:o=i,text:s=""}=e,l={text:String(s),stroke:o,fill:o},[[c,u]]=t;return Am(new QM).call(Pm,a).style("transform",`translate(${c},${u})`).call(Pm,l).call(Pm,n).node()}};JM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tO=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:l=0,transform:c=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,d]]=e;return Am(new hv).style("x",f).style("y",d).call(Pm,i).style("transformOrigin","center center").style("transform",`${c}rotate(${l}deg)`).style("coordCenter",n.getCenter()).call(Pm,u).call(Pm,t).node()}};tO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eO=qm(t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,a=t.ownerDocument;Am(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(Pm,i),Am(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(Pm,r)}),nO=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,o=De(t,["curve","gradient","defined","connect"]),{coordinate:s,document:l}=e;return(t,e,c)=>{const{color:u}=c,{color:f=u,seriesColor:d,seriesX:h,seriesY:p}=e,g=Jl(s),v=Dm(s,e),m=r&&d?Lm(d,h,p,r,void 0,g):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},c),{stroke:m,fill:m}),v&&{transform:v}),o),[b,x]=function(t,e){const n=[],r=[],i=[];let a=!1,o=null;const s=t.length/2;for(let l=0;l<s;l++){const c=t[l],u=t[l+s];if([...c,...u].some(t=>!e(t)))a=!0;else{if(n.push(c),r.push(u),a&&o){a=!1;const[t,e]=o;i.push([t,c,e,u])}o=[c,u]}}return[n.concat(r),i]}(t,i),w=Ja(y,"connect"),k=!!x.length,M=t=>Am(l.createElement("path",{})).style("d",t||"").call(Pm,y).node();if(tc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),a=t.slice(t.length/2);return function(){var t=El().curve(Sl),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Tl(n())},delete t.lineX0,t.lineEndAngle=function(){return Tl(r())},delete t.lineX1,t.lineInnerRadius=function(){return Tl(i())},delete t.lineY0,t.lineOuterRadius=function(){return Tl(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(_l(t)):e()._curve},t}().angle((t,n)=>Cs(_s(r[n],e))).outerRadius((t,n)=>Ns(r[n],e)).innerRadius((t,n)=>Ns(a[n],e)).defined((t,e)=>[...r[e],...a[e]].every(i)).curve(n)(a)};return!k||a&&!Object.keys(w).length?M(e(b)):k&&!a?M(e(t)):Am(new eO).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?El().y((t,n)=>e[n][1]).x1((t,n)=>e[n][0]).x0((t,e)=>r[e][0]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e):El().x((t,n)=>e[n][0]).y1((t,n)=>e[n][1]).y0((t,e)=>r[e][1]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e)};return!k||a&&!Object.keys(w).length?M(e(b)):k&&!a?M(e(t)):Am(new eO).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};nO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const rO=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=tc(n)?Fl:wl;return nO(Object.assign({curve:i},t),e)(...r)}};rO.props=Object.assign(Object.assign({},nO.props),{defaultMarker:"square"});const iO=(t,e)=>{const n=De(t,[]),{coordinate:r}=e;return(...t)=>{const i=tc(r)?Dl:Jl(r)?Xl:ql;return nO(Object.assign({curve:i},n),e)(...t)}};iO.props=Object.assign(Object.assign({},nO.props),{defaultMarker:"smooth"});const aO=(t,e)=>(...n)=>nO(Object.assign({curve:Kl},t),e)(...n);aO.props=Object.assign(Object.assign({},nO.props),{defaultMarker:"hvh"});const oO=(t,e)=>(...n)=>nO(Object.assign({curve:Zl},t),e)(...n);oO.props=Object.assign(Object.assign({},nO.props),{defaultMarker:"vh"});const sO=(t,e)=>(...n)=>nO(Object.assign({curve:Ql},t),e)(...n);sO.props=Object.assign(Object.assign({},nO.props),{defaultMarker:"hv"});const lO=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>nb(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};lO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const cO=(t,e)=>{const n=De(t,[]),{document:r}=e;return(t,e,i)=>{const{color:a}=i,o=De(i,["color"]),{color:s=a,transform:l}=e,[c,u]=t,f=ul();return f.moveTo(c[0],c[1]),f.bezierCurveTo(c[0]/2+u[0]/2,c[1],c[0]/2+u[0]/2,u[1],u[0],u[1]),Am(r.createElement("path",{})).call(Pm,o).style("d",f.toString()).style("stroke",s).style("transform",l).call(Pm,n).node()}};function uO(t,e,n,r){const i=ul();if(tc(n)){const a=n.getCenter(),o=Ns(t,a),s=(Ns(e,a)-o)*r+o;return i.moveTo(t[0],t[1]),Cm(i,t,e,a,s),i.lineTo(e[0],e[1]),i}return Jl(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}cO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fO=(t,e)=>{const{cornerRatio:n=1/3}=t,r=De(t,["cornerRatio"]),{coordinate:i,document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,l=De(o,["defaultColor"]),{color:c=s,transform:u}=e,[f,d]=t,h=uO(f,d,i,n);return Am(a.createElement("path",{})).call(Pm,l).style("d",h.toString()).style("stroke",c).style("transform",u).call(Pm,r).node()}};fO.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dO=(t,e)=>{const n=De(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,transform:c}=e,[u,f]=t,d=ul();if(d.moveTo(u[0],u[1]),tc(r)){const t=r.getCenter();d.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Cm(d,u,f,Rs(u,f),Ns(u,f)/2)}return Am(i.createElement("path",{})).call(Pm,s).style("d",d.toString()).style("stroke",l).style("transform",c).call(Pm,n).node()}};function hO(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function pO(t={}){return[...hO(t),{name:"title",scale:"identity"}]}function gO(){return[{type:Ao,channel:"color"},{type:zo,channel:["x","y"]}]}function vO(){return[{type:Ao,channel:"x"},{type:zo,channel:["y"]}]}function mO(t={}){return hO(t)}function yO(){return[{type:Co}]}function bO(t,e){return t.getBandWidth(t.invert(e))}function xO(t,e,n={}){const{x:r,y:i,series:a}=e,{x:o,y:s,series:l}=t,{style:{bandOffset:c=(l?0:.5),bandOffsetX:u=c,bandOffsetY:f=c}={}}=n,d=!!(null==o?void 0:o.getBandWidth),h=!!(null==s?void 0:s.getBandWidth),p=!!(null==l?void 0:l.getBandWidth);return d||h?(t,e)=>{const n=d?bO(o,r[e]):0,c=h?bO(s,i[e]):0,g=p&&a?(bO(l,a[e])/2+ +a[e])*n:0,[v,m]=t;return[v+u*n+g,m+f*c]}:t=>t}function wO(t){return parseFloat(t)/100}function kO(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions(),l=Array.from(t,t=>{const e=i[t],n=a[t];return[["string"==typeof e?wO(e)*o:+e,"string"==typeof n?wO(n)*s:+n]]});return[t,l]}dO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const MO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,src:c="",size:u=32,transform:f=""}=i;let{width:d=u,height:h=u}=t;const[[p,g]]=e,[v,m]=n.getSize();d="string"==typeof d?wO(d)*v:d,h="string"==typeof h?wO(h)*m:h;const y=p-Number(d)/2,b=g-Number(h)/2;return Am(r.createElement("image",{})).call(Pm,s).style("x",y).style("y",b).style("src",c).style("stroke",l).style("transform",f).call(Pm,t).style("width",d).style("height",h).node()}};function OO(t,e){const n=ul();if(tc(e)){const r=e.getCenter(),i=[...t,t[0]],a=i.map(t=>Ns(t,r));return i.forEach((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const o=a[i],s=t[i-1],l=a[i-1];void 0!==l&&Math.abs(o-l)<1e-10?Cm(n,s,e,r,o):n.lineTo(e[0],e[1])}),n.closePath(),n}return function(t,e){return e.forEach((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])),t.closePath(),t}(n,t)}MO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const EO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,transform:c}=i,u=OO(e,n);return Am(r.createElement("path",{})).call(Pm,s).style("d",u.toString()).style("stroke",l).style("fill",l).style("transform",c).call(Pm,t).node()}};function SO(t,e){const[n,r,i,a]=t,o=ul();if(tc(e)){const t=e.getCenter(),s=Ns(t,n);return o.moveTo(n[0],n[1]),o.quadraticCurveTo(t[0],t[1],i[0],i[1]),Cm(o,i,a,t,s),o.quadraticCurveTo(t[0],t[1],r[0],r[1]),Cm(o,r,n,t,s),o.closePath(),o}return o.moveTo(n[0],n[1]),o.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(n[0],n[1]),o.closePath(),o}EO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const AO=(t,e)=>{const n=De(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,transform:c}=e,u=SO(t,r);return Am(i.createElement("path",{})).call(Pm,s).style("d",u.toString()).style("fill",l||o).style("stroke",l||o).style("transform",c).call(Pm,n).node()}};function _O(t,e){const n=ul();if(tc(e)){const r=e.getCenter(),[i,a]=r,o=Ps(_s(t[0],r)),s=Ps(_s(t[1],r)),l=Ns(r,t[2]),c=Ns(r,t[3]),u=Ns(r,t[8]),f=Ns(r,t[10]),d=Ns(r,t[11]);n.moveTo(...t[0]),n.arc(i,a,l,o,s),n.arc(i,a,l,s,o,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,a,c,o,s),n.lineTo(...t[6]),n.arc(i,a,f,s,o,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,a,u,o,s),n.arc(i,a,u,s,o,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,a,d,o,s),n.arc(i,a,d,s,o,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}AO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const TO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:l,fill:c=l,stroke:u=l}=a,f=De(a,["color","fill","stroke"]),d=_O(e,n);return Am(r.createElement("path",{})).call(Pm,f).style("d",d.toString()).style("stroke",u).style("fill",o||c).style("transform",s).call(Pm,t).node()}};function NO(t,e,n=4){const r=ul();if(!tc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[a,o]=i,s=Ns(i,t[3]),l=Ns(i,t[8]),c=Ns(i,t[10]),u=Ps(_s(t[2],i)),f=Math.asin(n/l),d=u-f,h=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(d)*s+a,Math.sin(d)*s+o),r.arc(a,o,s,d,h),r.lineTo(Math.cos(h)*c+a,Math.sin(h)*c+o),r.arc(a,o,c,h,d,!0),r.lineTo(Math.cos(d)*s+a,Math.sin(d)*s+o),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(d+h)/2;return r.moveTo(Math.cos(p)*(l+n/2)+a,Math.sin(p)*(l+n/2)+o),r.arc(Math.cos(p)*l+a,Math.sin(p)*l+o,n/2,p,2*Math.PI+p),r.closePath(),r}TO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:l,fill:c=l,stroke:u=l}=a,f=De(a,["color","fill","stroke"]),d=NO(e,n,4);return Am(r.createElement("path",{})).call(Pm,f).style("d",d.toString()).style("stroke",u).style("fill",o||c).style("transform",s).call(Pm,t).node()}};PO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CO=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=De(t,["arrow","arrowSize"]),{coordinate:a,document:o}=e;return(t,e,s)=>{const{color:l,lineWidth:c}=s,u=De(s,["color","lineWidth"]),{color:f=l,size:d=c}=e,h=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(o,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},Ja(i,"arrow"))):null,p=function(t,e){if(!tc(e))return Ol().x(t=>t[0]).y(t=>t[1])(t);const n=e.getCenter();return yl()({startAngle:0,endAngle:2*Math.PI,outerRadius:Ns(t[0],n),innerRadius:Ns(t[1],n)})}(t,a),g=function(t,e){if(!tc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(a,e.transform);return Am(o.createElement("path",{})).call(Pm,u).style("d",p).style("stroke",f).style("lineWidth",d).style("transform",g).style("markerEnd",h).call(Pm,i).node()}};function LO(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}CO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jO=(t,e)=>{const{offsetX:n=0,sourceOffsetX:r=n,targetOffsetX:i=n,offsetY:a=0,sourceOffsetY:o=a,targetOffsetY:s=a,connectLength1:l,endMarker:c=!0}=t,u=De(t,["offsetX","sourceOffsetX","targetOffsetX","offsetY","sourceOffsetY","targetOffsetY","connectLength1","endMarker"]),{coordinate:f}=e;return(t,e,n)=>{const{color:a,connectLength1:d}=n,h=De(n,["color","connectLength1"]),{color:p,transform:g}=e,v=function(t,e,n,r,i,a,o=0){const[[s,l],[c,u]]=e;if(Jl(t)){const t=s+n,e=t+o,f=l+i,d=u+a;return[[t,f],[e,f],[e,d],[c+r,d]]}const f=l-n,d=f-o,h=s-i,p=c-a;return[[h,f],[h,d],[p,d],[p,u-r]]}(f,t,o,s,r,i,null!=l?l:d),m=Ja(Object.assign(Object.assign({},u),n),"endMarker");return Am(new ov).call(Pm,h).style("d",function(t){return Ol().x(t=>t[0]).y(t=>t[1])(t)}(v)).style("stroke",p||a).style("transform",g).style("markerEnd",c?new bx({className:"marker",style:Object.assign(Object.assign({},m),{symbol:LO})}):null).call(Pm,u).node()}};function RO(t,e,n,r){const{bounds:i}=n,[[a,o],[s,l]]=i,c=s-a,u=l-o,f=t=>{const{x:e,y:r}=t,i=no(n.x,c),s=no(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+a,y:(s||r)+o})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAlign:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function IO(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s}=n,l=r.getCenter(),c=Rm(r,e,[i,a]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=c,p="inside"===t?(d+h)/2:h,g=BO(p,o,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[a,o]="inside"===t?DO(l,p,i):Rs(n,r);return{x:a,y:o}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function DO(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function BO(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function FO(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s,radius:l=.5,offset:c=0}=n,u=Rm(r,e,[i,a]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:BO(p,o,s)},{innerRadius:v,outerRadius:m}=u,y=v+(m-v)*l+c,[b,x]=DO(h,p,y);return Object.assign({x:b,y:x},g)}function zO(t){return void 0===t?null:t}function WO(t,e,n,r){const{bounds:i}=n,[a]=i;return{x:zO(a[0]),y:zO(a[1])}}function $O(t,e,n,r){const{bounds:i}=n;if(1===i.length)return WO(0,0,n);return(ec(r)?IO:ac(r)?FO:RO)(t,e,n,r)}function GO(t,e,n){const r=Rm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:a}=r;return i+(a-i)}function YO(t,e,n){const r=Rm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:a}=r;return(i+a)/2}function HO(t,e,n,r){const{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,f=r.getCenter(),d=YO(e,n,r),h=Math.sin(d)>0?1:-1,p=BO(d,i,a),g={textAlign:h>0||ec(r)?"start":"end",textBaseline:"middle",rotate:p},v=GO(e,n,r),m=v+(s?l:o),[[y,b],[x,w],[k,M]]=function(t,e,n,r,i){const[a,o]=DO(t,e,n),[s,l]=DO(t,e,r);return[[a,o],[s,l],[s+(Math.sin(e)>0?1:-1)*i,l]]}(f,d,v,m,s?c:0),O=s?+u*h:0,E=k+O,S={connector:s,connectorPoints:[[x-E,w-M],[k-E,M-M]]};return Object.assign(Object.assign({x0:y,y0:b,x:k+O,y:M},g),S)}function VO(t,e={}){const{labelHeight:n=14,height:r}=e,i=lr(t,t=>t.y),a=i.length,o=new Array(a);for(let t=0;t<a;t++){const e=i[t],{y:r}=e;o[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=o.length-1;t>0;t--){const e=o[t],n=o[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),o.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let l=0;for(const t of o){const{y:e,labels:r}=t;let a=e-n;for(const t of r){const e=i[l++],r=a+n-t;e.connectorPoints[0][1]-=r,e.y=a+n,a+=n}}}function qO(t,e){const n=lr(t,t=>t.y),{height:r,labelHeight:i=14}=e,a=Math.ceil(r/i);if(n.length<=a)return VO(n,e);const o=[];for(let t=0;t<n.length;t++)t<n.length-a?(n[t].opacity=0,n[t].connector=!1):o.push(n[t]);VO(o,e)}jO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const XO=new WeakMap;var UO=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,a=e.slice(0,i),o=e.slice(i);let s=wr(a,(t,e)=>Math.abs(t[1]-o[e][1]));s=Math.max(Math.min(s,i-2),1);const l=t=>[a[t][0],(a[t][1]+o[t][1])/2],c=l(s),u=l(s-1),f=Ps(_s(l(s+1),u))/Math.PI*180;return{x:c[0],y:c[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:$O,bottomLeft:$O,bottomRight:$O,inside:$O,left:$O,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?WO(0,0,n):(ec(r)?IO:ac(r)?HO:RO)(t,e,n,r)},right:$O,spider:function(t,e,n,r,i,a){if(!ac(r))return{};if(XO.has(e))return XO.get(e);const o=a.map(t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:a}=e,o=De(HO(0,t,e,n),[]),s=n.getCenter(),l=GO(t,e,n),c=YO(t,e,n),u=l+r+i,f=Math.sin(c)>0?1:-1,d=s[0]+(u+ +a)*f,{x:h}=o,p=d-h;return o.x+=p,o.connectorPoints[0][0]-=p,o}(t,n,r)),{width:s,height:l}=r.getOptions(),c=o.filter(t=>t.x<s/2),u=o.filter(t=>t.x>=s/2),f=Object.assign(Object.assign({},i),{height:l});return qO(c,f),qO(u,f),o.forEach((t,e)=>XO.set(a[e],t)),XO.get(e)},surround:function(t,e,n,r){if(!ac(r))return{};const{connectorLength:i,connectorLength2:a,connectorDistance:o}=n,s=De(HO(0,e,n,r),[]),{x0:l,y0:c}=s,u=r.getCenter(),f=function(t){if(ac(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(t=>"polar"===t[0]);if(r)return Math.max(e,n)/2*r[4]}return 0}(r),d=f+i,h=Cs([l-u[0],c-u[1]]),p=Math.sin(h)>0?1:-1,[g,v]=DO(u,h,d);return s.x=g+(a+o)*p,s.y=v,s},top:$O,topLeft:$O,topRight:$O});function KO(t,e,n,r,i,a){const{position:o}=e,{render:s}=i,l=function(t,e){return void 0!==t?t:ac(e)?"inside":Jl(e)?"right":"top"}(o,n),c=r[s?"htmlLabel":"inside"===l?"innerLabel":"label"],u=Object.assign({},c,e),f=UO[Py(l)];if(!f)throw new Error(`Unknown position: ${l}`);return Object.assign(Object.assign({},c),f(l,t,u,n,i,a))}const ZO=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,a,o,s)=>{const{text:l,x:c,y:u,transform:f="",transformOrigin:d,className:h=""}=a,p=De(a,["text","x","y","transform","transformOrigin","className"]),g=KO(e,a,n,r,t,s),{rotate:v=0,transform:m=""}=g,y=De(g,["rotate","transform"]);return Am(new KM).call(Pm,y).style("text",`${l}`).style("className",`${h} g2-label`).style("innerHTML",i?i(l,a.datum,a.index):void 0).style("labelTransform",`${m} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",d).style("coordCenter",n.getCenter()).call(Pm,p).node()}};ZO.props={defaultMarker:"point"};const QO=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=De(t,["arrow","colorAttribute"]),{coordinate:a,document:o}=e;return(t,e,n)=>{const{color:s,stroke:l}=n,c=De(n,["color","stroke"]),{d:u,color:f=s}=e,[d,h]=a.getSize();return Am(o.createElement("path",{})).call(Pm,c).style("d","function"==typeof u?u({width:d,height:h}):u).style(r,f).call(Pm,i).node()}};QO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const JO=(t,e)=>QO(Object.assign({colorAttribute:"fill"},t),e);JO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tE=(t,e)=>QO(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);tE.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eE=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:a}=r,{color:o}=i,s=De(i,["color"]),{color:l=o}=r,[c,...u]=e,f=ul();return f.moveTo(...c),u.forEach(([t,e])=>{f.lineTo(t,e)}),f.closePath(),Am(n.createElement("path",{})).call(Pm,s).style("d",f.toString()).style("stroke",l||o).style("fill",l||o).style("fillOpacity",.4).style("transform",a).call(Pm,t).node()}};function nE(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}function rE(t,e=(...t)=>`${t[0]}`,n=16){const r=nE(n);return(...n)=>{const i=e(...n);let a=r.get(i);return r.has(i)?r.get(i):(a=t(...n),r.set(i,a),a)}}function iE(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}eE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},nE(3);const aE=rE((t,e,n)=>{const r=iE(n,2*t,2*t),i=r.getContext("2d"),a=t,o=t;if(1===e)i.beginPath(),i.arc(a,o,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(a,o,t*e,a,o,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r},t=>`${t}`);function oE(t,e,n,r,i,a,o){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},a);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const l=iE(o,t,e).getContext("2d"),c=function(t,e){const n=iE(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map(t=>{const[e,n]=t.split(":");return[+e,n]}):t}(t).forEach(([t,e])=>{r.addColorStop(t,e)}),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,o);l.clearRect(0,0,t,e),function(t,e,n,r,i,a){const{blur:o}=i;let s=r.length;for(;s--;){const{x:i,y:l,value:c,radius:u}=r[s],f=Math.min(c,n),d=i-u,h=l-u,p=aE(u,1-o,a),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,d,h)}}(l,n,r,i,s,o);const u=function(t,e,n,r,i){const{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=e,u=n,f=t.getImageData(0,0,c,u),d=f.data,h=d.length;for(let t=3;t<h;t+=4){const e=d[t],n=4*e;if(!n)continue;const i=o||Math.max(0,Math.min(s,Math.max(a,e)));d[t-3]=r[n],d[t-2]=r[n+1],d[t-1]=r[n+2],d[t]=l?r[n+3]:i}return f}(l,t,e,c,s),f=iE(o,t,e).getContext("2d");return f.putImageData(u,0,0),f}const sE=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:o,useGradientOpacity:s}=t,l=De(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:c,createCanvas:u,document:f}=e;return(t,e,d)=>{const{transform:h}=e,[p,g]=c.getSize(),v=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),m=kr(t,t=>t[2]),y=xr(t,t=>t[2]),b=p&&g?oE(p,g,m,y,v,function(t,e){return Object.keys(t).reduce((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n},{})}({gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:o,useGradientOpacity:s},t=>void 0===t),u):{canvas:null};return Am(f.createElement("image",{})).call(Pm,d).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",h).call(Pm,l).node()}};sE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const lE=(t,e)=>{const{render:n}=t,r=De(t,["render"]);return t=>{const[[i,a]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:a}),e)}};lE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const cE="main-layer",uE="label-layer",fE="element",dE="view",hE="plot",pE="component",gE="label",vE="area",mE="axis-breaks",yE="axis-breaks-group",bE=.03,xE={fill:"#fff",stroke:"#aaa",lineDash:"4 3",lineWidth:.5,fillOpacity:1,strokeOpacity:1},wE=(t,e,n,r,i,a)=>{const o=[],s=[],l=r-1;for(let r=1;r<l;r++){const c=r/l*e,u=t+(r%2==0?n:-n);o.push(`${c},${u}`),s.push(`${c},${i?u-a:u+a}`)}return o.push(`${e},${t}`),s.push(`${e+a},${t}`),[o,s]},kE=(t,e)=>{const{context:n,selection:r,view:i}=e,a=r.select(`.${hE}`).node(),{document:o}=n.canvas,{scale:s}=i,l=new Map;return t=>{const{key:e,start:r,end:i,gap:c=bE,vertices:u=50,lineWidth:f=.5,verticeOffset:d=3}=t,h=De(t,["key","start","end","gap","vertices","lineWidth","verticeOffset"]),p=o.createElement("g",{id:`break-group-${e}`,className:yE}),g=at(s,"x.sortedDomain",[]),v=s.y.getOptions(),{range:m,domain:y}=v,b=y.indexOf(r),x=y.indexOf(i),{width:w,height:k}=a.getBBox();if(-1===b||-1===x||!g.length)return p;const M=m[0]>m[1],O=m[b]*k,E=m[x]*k;let S="",A="";for(const[t,{y:e,isLower:n}]of[{y:E,isLower:!1},{y:O,isLower:!0}].entries()){const r=M?f:-f,[i,a]=wE(e,w-0,d,u,n,r);0===t?(S=`M 0,${e} L ${i.join(" L ")} `,A=`M ${0-f},${e+r} L ${a.join(" L ")} `):(S+=`L ${w-0},${e} L ${[...i].reverse().join(" L ")} L 0,${e} Z`,A+=`L ${w-0+f+2},${e-r} L ${[...a].reverse().join(" L ")} L ${0-f},${e-r} Z`)}const _=Object.assign(Object.assign({},xE),h);try{const t=new ov({style:Object.assign(Object.assign({},_),{d:S})}),o=new ov({style:Object.assign(Object.assign({},_),{d:A,lineWidth:0,cursor:"pointer"})});o.addEventListener("click",t=>Fe(void 0,void 0,void 0,function*(){t.stopPropagation(),2===t.detail&&(yield((t,e,r)=>Fe(void 0,void 0,void 0,function*(){const{update:i,setState:a}=n.externals;a("options",n=>{const{marks:i}=n;if(!i||!i.length)return n;const a=i.map(t=>{const n=at(t,"scale.y.breaks",[]),i=n.filter(t=>t.start!==e&&t.end!==r&&!t.collapsed);return n.forEach(t=>{t.start===e&&t.end===r&&(t.collapsed=!0)}),console.log("breaks group:",n,i),tt({},t,{scale:{y:{breaks:i}}})});return l.set(t,{start:e,end:r}),Object.assign(Object.assign({},n),{marks:a})}),yield i()}))(e,r,i))})),p.appendChild(t),p.appendChild(o),a.addEventListener("click",t=>Fe(void 0,void 0,void 0,function*(){2===t.detail&&(yield Fe(void 0,void 0,void 0,function*(){if(!l.size)return;const{update:t,setState:e}=n.externals;e("options",t=>{const{marks:e}=t,n=e.map(t=>{const e=at(t,"scale.y.breaks",[]);return ot(t,"scale.y.breaks",e.map(t=>Object.assign(Object.assign({},t),{collapsed:!1}))),t});return l.clear(),Object.assign(Object.assign({},t),{marks:n})}),yield t()}))})),a.appendChild(p)}catch(t){console.error("Failed to create break path:",t)}return p}};function ME(t,e){return t.getBandWidth(t.invert(e))}kE.props={};const OE={rect:Wm,hollow:$m,funnel:Ym,pyramid:Vm},EE=()=>(t,e,n,r)=>{const{x:i,y1:a,series:o,size:s}=n;let{y:l}=n;l=l.map(t=>void 0!==t?t:1);const c=e.x,u=e.series,[f]=r.getSize(),d=s?s.map(t=>+t/f):null,h=s?(t,e,n)=>{const r=t+e/2,i=d[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,t=>{const e=ME(c,i[t]),n=e*(u?ME(u,null==o?void 0:o[t]):1),s=(+(null==o?void 0:o[t])||0)*e,f=+i[t]+s,[d,p]=h(f,n,t),g=+l[t],v=+a[t];return[[d,g],[p,g],[p,v],[d,v]].map(t=>r.map(t))});return[t,p]};EE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:OE,channels:[...pO({shapes:Object.keys(OE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...yO(),{type:Fn},{type:_o}],postInference:[...vO()],interaction:{shareTooltip:!0}};const SE={rect:Wm,hollow:$m},AE=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n,l=Array.from(t,t=>[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t)));return[t,l]};AE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:SE,channels:[...pO({shapes:Object.keys(SE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yO(),{type:Fn}],postInference:[...vO()],interaction:{shareTooltip:!0}};const _E={line:Km,smooth:Zm,hv:Qm,vh:Jm,hvh:ty,trail:ny},TE=(t,e,n,r)=>{var i,a;const{series:o,x:s,y:l}=n,{x:c,y:u}=e;if(void 0===s||void 0===l)throw new Error("Missing encode for x or y channel.");const f=o?Array.from(rr(t,t=>o[t]).values()):[t],d=f.map(t=>t[0]).filter(t=>void 0!==t),h=((null===(i=null==c?void 0:c.getBandWidth)||void 0===i?void 0:i.call(c))||0)/2,p=((null===(a=null==u?void 0:u.getBandWidth)||void 0===a?void 0:a.call(u))||0)/2,g=Array.from(f,t=>t.map(t=>r.map([+s[t]+h,+l[t]+p])));return[d,g,f]},NE=(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===i.length)throw new Error("Missing encode for position channel.");tc(r)&&i.push(i[0]);const a=Array.from(t,t=>{const e=i.map(e=>+e[t]),n=r.map(e),a=[];for(let t=0;t<n.length;t+=2)a.push([n[t],n[t+1]]);return a});return[t,a]},PE=()=>(t,e,n,r)=>(rc(r)?NE:TE)(t,e,n,r);PE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:_E,channels:[...pO({shapes:Object.keys(_E)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...yO(),{type:Ho},{type:Lo}],postInference:[...vO(),{type:Ao,channel:"color"},{type:zo,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const CE={hollow:Dy,hollowDiamond:Ry,hollowHexagon:Iy,hollowSquare:By,hollowTriangleDown:zy,hollowTriangle:Fy,hollowBowtie:jy,hollowCircle:Gy,point:Zy,plus:Ky,diamond:Vy,square:Qy,triangle:tb,hexagon:qy,cross:Hy,bowtie:Yy,hyphen:Xy,line:Uy,tick:Jy,triangleDown:eb,circle:$y},LE=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s,y1:l,size:c,dx:u,dy:f}=r,[d,h]=i.getSize(),p=xO(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+a[t]+ +s[t])/2:+a[t])+e,(l?(+o[t]+ +l[t])/2:+o[t])+n]},v=c?Array.from(e,t=>{const[e,n]=g(t),r=+c[t],a=r/d,o=r/h,s=[e-a,n-o],l=[e+a,n+o];return[i.map(p(s,t)),i.map(p(l,t))]}):Array.from(e,t=>[i.map(p(g(t),t))]);return[e,v]};LE.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:CE,channels:[...pO({shapes:Object.keys(CE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...yO(),{type:_o},{type:To}],postInference:[{type:Po},...gO()]};const jE={text:ZM,badge:JM,tag:tO},RE=t=>{const{cartesian:e=!1}=t;return e?kO:(e,n,r,i)=>{const{x:a,y:o}=r,s=xO(n,r,t),l=Array.from(e,t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]});return[e,l]}};RE.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:jE,channels:[...pO({shapes:Object.keys(jE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...yO(),{type:Yo},{type:$o}],postInference:[...gO()]};const IE={cell:Wm,hollow:$m},DE=()=>(t,e,n,r)=>{const{x:i,y:a}=n,o=e.x,s=e.y,l=Array.from(t,t=>{const e=o.getBandWidth(o.invert(+i[t])),n=s.getBandWidth(s.invert(+a[t])),l=+i[t],c=+a[t];return[[l,c],[l+e,c],[l+e,c+n],[l,c+n]].map(t=>r.map(t))});return[t,l]};DE.props={defaultShape:"cell",defaultLabelShape:"label",shape:IE,composite:!1,channels:[...pO({shapes:Object.keys(IE)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...yO(),{type:_o},{type:To},{type:Wo}],postInference:[...gO()]};const BE={area:rO,smooth:iO,hvh:aO,vh:oO,hv:sO},FE=()=>(t,e,n,r)=>{var i,a;const{x:o,y:s,y1:l,series:c}=n,{x:u,y:f}=e,d=c?Array.from(rr(t,t=>c[t]).values()):[t],h=d.map(t=>t[0]).filter(t=>void 0!==t),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(a=null==f?void 0:f.getBandWidth)||void 0===a?void 0:a.call(f))||0)/2,v=Array.from(d,t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const a=t[i];n[i]=r.map([+o[a]+p,+s[a]+g]),n[e+i]=r.map([+o[a]+p,+l[a]+g])}return n});return[h,v,d]};FE.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:BE,channels:[...pO({shapes:Object.keys(BE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...yO(),{type:Lo},{type:Fn},{type:Wo}],postInference:[...vO()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const zE={link:lO,arc:dO,smooth:cO,vhv:fO},WE=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s=a,y1:l=o}=r,c=xO(n,r,t),u=e.map(t=>[i.map(c([+a[t],+o[t]],t)),i.map(c([+s[t],+l[t]],t))]);return[e,u]};WE.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:zE,channels:[...pO({shapes:Object.keys(zE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yO(),{type:Io},{type:Do}],postInference:[...gO()]};const $E={image:MO},GE=t=>{const{cartesian:e}=t;return e?kO:(e,n,r,i)=>{const{x:a,y:o}=r,s=xO(n,r,t),l=Array.from(e,t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]});return[e,l]}};GE.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:$E,channels:[...pO({shapes:Object.keys($E)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...yO(),{type:Yo},{type:$o}],postInference:[...gO()]};const YE={polygon:EO,ribbon:AO},HE=()=>(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),a=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),o=t.map(t=>{const e=[];for(let n=0;n<i.length;n++){const o=i[n][t];if(void 0===o)break;const s=a[n][t];e.push(r.map([+o,+s]))}return e});return[t,o]};HE.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:YE,channels:[...pO({shapes:Object.keys(YE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yO()],postInference:[...gO()]};const VE={box:TO,violin:PO},qE=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,y2:s,y3:l,y4:c,series:u}=n,f=e.x,d=e.series,h=Array.from(t,t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(d?d.getBandWidth(d.invert(+(null==u?void 0:u[t]))):1),h=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+h+n/2,[g,v,m,y,b]=[+a[t],+o[t],+s[t],+l[t],+c[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,v],[p-n/2,v],[p-n/2,m],[p+n/2,m],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map(t=>r.map(t))});return[t,h]};qE.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:VE,channels:[...pO({shapes:Object.keys(VE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...yO(),{type:_o}],postInference:[...vO()],interaction:{shareTooltip:!0}};const XE={vector:nb},UE=()=>(t,e,n,r)=>{const{x:i,y:a,size:o,rotate:s}=n,[l,c]=r.getSize(),u=t.map(t=>{const e=+s[t]/180*Math.PI,n=+o[t],u=n/c,f=n/l*Math.cos(e),d=-u*Math.sin(e);return[r.map([+i[t]-f/2,+a[t]-d/2]),r.map([+i[t]+f/2,+a[t]+d/2])]});return[t,u]};UE.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:XE,channels:[...pO({shapes:Object.keys(XE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...yO()],postInference:[...gO()]};const KE={line:CO},ZE=t=>(e,n,r,i)=>{const{y:a}=r,o=xO(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[0,a[t]],[1,a[t]]].map(e=>i.map(o(e,t))));return[e,s]};ZE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:KE,channels:[...mO({shapes:Object.keys(KE)}),{name:"y",required:!0}],preInference:[...yO(),{type:jo}],postInference:[]};const QE={line:CO},JE=t=>(e,n,r,i)=>{const{x:a}=r,o=xO(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[a[t],1],[a[t],0]].map(e=>i.map(o(e,t))));return[e,s]};JE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:QE,channels:[...mO({shapes:Object.keys(QE)}),{name:"x",required:!0}],preInference:[...yO(),{type:Ro}],postInference:[]};const tS={connector:jO},eS=(...t)=>WE(...t);function nS(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:a}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+n]}}function rS(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,a)=>{const o=nS("x",e,i,r.x),s=nS("y",n,i,r.y),l=Array.from(t,t=>{const[e,n]=o(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map(t=>a.map(t))});return[t,l]}}eS.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:tS,channels:[...mO({shapes:Object.keys(tS)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yO()],postInference:[]};const iS={range:Wm},aS=()=>rS();aS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:iS,channels:[...mO({shapes:Object.keys(iS)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yO()],postInference:[]};const oS={range:Wm},sS=()=>rS({extendY:!0});sS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:oS,channels:[...mO({shapes:Object.keys(oS)}),{name:"x",required:!0}],preInference:[...yO(),{type:Bo}],postInference:[]};const lS={range:Wm},cS=()=>rS({extendX:!0});cS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:lS,channels:[...mO({shapes:Object.keys(lS)}),{name:"y",required:!0}],preInference:[...yO(),{type:Fo}],postInference:[]};const uS={path:JO,hollow:tE},fS=t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])];function dS(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function hS(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=gS)):void 0===e&&(e=pS);for(var n,r,i,a,o,s=new yS(t),l=[s];n=l.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;a>=0;--a)l.push(r=i[a]=new yS(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(mS)}function pS(t){return t.children}function gS(t){return Array.isArray(t)?t[1]:null}function vS(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function mS(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function yS(t){this.data=t,this.depth=this.height=0,this.parent=null}function bS(t){return null==t?null:xS(t)}function xS(t){if("function"!=typeof t)throw new Error;return t}function wS(){return 0}function kS(t){return function(){return t}}function MS(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function OS(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}fS.props={defaultShape:"path",defaultLabelShape:"label",shape:uS,composite:!1,channels:[...pO({shapes:Object.keys(uS)}),{name:"d",scale:"identity"}],preInference:[...yO()],postInference:[]},yS.prototype=hS.prototype={constructor:yS,count:function(){return this.eachAfter(dS)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i=this,a=[i],o=-1;i=a.pop();)if(t.call(e,i,++o,this),n=i.children)for(r=n.length-1;r>=0;--r)a.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return hS(this).eachBefore(vS)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n])}while(a.length)}};var ES={depth:-1},SS={},AS={};function _S(t){return t.id}function TS(t){return t.parentId}function NS(){var t,e=_S,n=TS;function r(r){var i,a,o,s,l,c,u,f,d=Array.from(r),h=e,p=n,g=new Map;if(null!=t){const e=d.map((e,n)=>function(t){t=`${t}`;let e=t.length;CS(t,e-1)&&!CS(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r))),n=e.map(PS),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(PS(t)),d.push(AS));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(o=0,i=d.length;o<i;++o)a=d[o],c=d[o]=new yS(a),null!=(u=h(a,o,r))&&(u+="")&&(f=c.id=u,g.set(f,g.has(f)?SS:c)),null!=(u=p(a,o,r))&&(u+="")&&(c.parent=u);for(o=0;o<i;++o)if(u=(c=d[o]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===SS)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===AS&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(c=d[t]).data===AS;--t)c.data=null}if(s.parent=ES,s.eachBefore(function(t){t.depth=t.parent.depth+1,--i}).eachBefore(mS),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=bS(t),r):e},r.parentId=function(t){return arguments.length?(n=bS(t),r):n},r.path=function(e){return arguments.length?(t=bS(e),r):t},r}function PS(t){let e=t.length;if(e<2)return"";for(;--e>1&&!CS(t,e););return t.slice(0,e)}function CS(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function LS(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var jS=(1+Math.sqrt(5))/2;function RS(t,e,n,r,i,a){for(var o,s,l,c,u,f,d,h,p,g,v,m=[],y=e.children,b=0,x=0,w=y.length,k=e.value;b<w;){l=i-n,c=a-r;do{u=y[x++].value}while(!u&&x<w);for(f=d=u,v=u*u*(g=Math.max(c/l,l/c)/(k*t)),p=Math.max(d/v,v/f);x<w;++x){if(u+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),v=u*u*g,(h=Math.max(d/v,v/f))>p){u-=s;break}p=h}m.push(o={value:u,dice:l<c,children:y.slice(b,x)}),o.dice?OS(o,n,r,i,k?r+=c*u/k:a):LS(o,n,r,k?n+=l*u/k:i,a),k-=u,b=x}return m}var IS=function t(e){function n(t,n,r,i,a){RS(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(jS);function DS(t,e,n,r,i){var a,o,s=t.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function t(e,n,r,i,a,o,l){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}var f=c[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var g=h+p>>>1;c[g]<d?h=g+1:p=g}d-c[h-1]<c[h]-d&&e+1<h&&--h;var v=c[h]-f,m=r-v;if(o-i>l-a){var y=r?(i*m+o*v)/r:o;t(e,h,v,i,a,y,l),t(h,n,m,y,a,o,l)}else{var b=r?(a*m+l*v)/r:l;t(e,h,v,i,a,o,b),t(h,n,m,i,b,o,l)}}(0,l,t.value,e,n,r,i)}function BS(t,e,n,r,i){(1&t.depth?LS:OS)(t,e,n,r,i)}var FS=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,f=-1,d=o.length,h=t.value;++f<d;){for(l=(s=o[f]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?OS(s,n,r,i,h?r+=(a-r)*s.value/h:a):LS(s,n,r,h?n+=(i-n)*s.value/h:i,a),h-=s.value}else t._squarify=o=RS(e,t,n,r,i,a),o.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(jS);function zS(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach(n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],zS(n,n.path)})}function WS(t){const e=at(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach(t=>{WS(t)})}function $S(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:DS,treemapDice:OS,treemapSlice:LS,treemapSliceDice:BS,treemapSquarify:IS,treemapResquarify:FS},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),a=function(t,e){return Array.isArray(t)?"function"==typeof e?NS().path(e)(t):NS()(t):hS(t)}(t,e.path);x(t)?WS(a):zS(a),r?a.sum(t=>e.ignoreParentValue&&t.children?0:function(t){return"function"==typeof t?t:e=>e[t]}(r)(t)).sort(e.sort):a.count(),function(){var t=IS,e=!1,n=1,r=1,i=[0],a=wS,o=wS,s=wS,l=wS,c=wS;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(MS),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<u&&(u=d=(u+d)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=a(e)/2,r+=c(e)-n,u+=o(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=l(e)-n)<u&&(u=d=(u+d)/2),t(e,r,u,f,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=xS(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:kS(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:kS(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:kS(+t),u):s},u.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:kS(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:kS(+t),u):c},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(a);const o=a.descendants().map(t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]})),s=o.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,o]}const GS=t=>{const{cartesian:e}=t;return e?kO:(e,n,r,i)=>{const{x:a,y:o}=r,s=xO(n,r,t),l=Array.from(e,t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]});return[e,l]}};function YS(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,s,l,c,u,f,d,h=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(v+y)/2))?v=o:y=o,i=h,!(h=h[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,h.data),l=+t._y.call(null,h.data),e===s&&n===l)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(v+y)/2))?v=o:y=o}while((f=u<<1|c)==(d=(l>=o)<<1|s>=a));return i[d]=h,i[f]=p,t}function HS(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function VS(t){return t[0]}function qS(t){return t[1]}function XS(t,e,n){var r=new US(null==e?VS:e,null==n?qS:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function US(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function KS(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}GS.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:lE},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yO(),{type:Yo},{type:$o},{type:Go}]};var ZS=XS.prototype=US.prototype;function QS(t){return function(){return t}}function JS(t){return 1e-6*(t()-.5)}function tA(t){return t.x+t.vx}function eA(t){return t.y+t.vy}ZS.copy=function(){var t,e,n=new US(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=KS(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=KS(e));return n},ZS.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return YS(this.cover(e,n),e,n,t)},ZS.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,s[n]=i,r<l&&(l=r),r>u&&(u=r),i<c&&(c=i),i>f&&(f=i));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;n<a;++n)YS(this,o[n],s[n],t[n]);return this},ZS.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;n>t||t>=i||r>e||e>=a;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this},ZS.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},ZS.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ZS.find=function(t,e,n){var r,i,a,o,s,l,c,u=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new HS(g,u,f,d,h)),null==n?n=1/0:(u=t-n,f=e-n,d=t+n,h=e+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>h||(o=l.x1)<u||(s=l.y1)<f))if(g.length){var v=(i+o)/2,m=(a+s)/2;p.push(new HS(g[3],v,m,o,s),new HS(g[2],i,m,v,s),new HS(g[1],v,a,o,m),new HS(g[0],i,a,v,m)),(c=(e>=m)<<1|t>=v)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);u=t-w,f=e-w,d=t+w,h=e+w,r=g.data}}return r},ZS.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,s,l,c,u,f,d,h=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!h)return this;if(h.length)for(;;){if((c=a>=(s=(p+v)/2))?p=s:v=s,(u=o>=(l=(g+m)/2))?g=l:m=l,e=h,!(h=h[f=u<<1|c]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},ZS.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},ZS.root=function(){return this._root},ZS.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},ZS.visit=function(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new HS(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var c=(r+a)/2,u=(i+o)/2;(n=l[3])&&s.push(new HS(n,c,u,a,o)),(n=l[2])&&s.push(new HS(n,r,u,c,o)),(n=l[1])&&s.push(new HS(n,c,i,a,u)),(n=l[0])&&s.push(new HS(n,r,i,c,u))}return this},ZS.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new HS(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,f=(s+c)/2;(a=i[0])&&n.push(new HS(a,o,s,u,f)),(a=i[1])&&n.push(new HS(a,u,s,l,f)),(a=i[2])&&n.push(new HS(a,o,f,u,c)),(a=i[3])&&n.push(new HS(a,u,f,l,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},ZS.x=function(t){return arguments.length?(this._x=t,this):this._x},ZS.y=function(t){return arguments.length?(this._y=t,this):this._y};var nA={value:()=>{}};function rA(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new iA(r)}function iA(t){this._=t}function aA(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function oA(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=nA,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}iA.prototype=rA.prototype={constructor:iA,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=oA(i[n],t.name,e);else if(null==e)for(n in i)i[n]=oA(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=aA(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new iA(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var sA,lA,cA=0,uA=0,fA=0,dA=0,hA=0,pA=0,gA="object"==typeof performance&&performance.now?performance:Date,vA="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mA(){return hA||(vA(yA),hA=gA.now()+pA)}function yA(){hA=0}function bA(){this._call=this._time=this._next=null}function xA(t,e,n){var r=new bA;return r.restart(t,e,n),r}function wA(){hA=(dA=gA.now())+pA,cA=uA=0;try{!function(){mA(),++cA;for(var t,e=sA;e;)(t=hA-e._time)>=0&&e._call.call(void 0,t),e=e._next;--cA}()}finally{cA=0,function(){var t,e,n=sA,r=1/0;for(;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:sA=e);lA=t,MA(r)}(),hA=0}}function kA(){var t=gA.now(),e=t-dA;e>1e3&&(pA-=e,dA=t)}function MA(t){cA||(uA&&(uA=clearTimeout(uA)),t-hA>24?(t<1/0&&(uA=setTimeout(wA,t-gA.now()-pA)),fA&&(fA=clearInterval(fA))):(fA||(dA=gA.now(),fA=setInterval(kA,1e3)),cA=1,vA(wA)))}bA.prototype=xA.prototype={constructor:bA,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?mA():+n)+(null==e?0:+e),this._next||lA===this||(lA?lA._next=this:sA=this,lA=this),this._call=t,this._time=n,MA()},stop:function(){this._call&&(this._call=null,this._time=1/0,MA())}};const OA=4294967296;var EA=Math.PI*(3-Math.sqrt(5));function SA(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,l=xA(f),c=rA("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%OA)/OA}();function f(){d(),c.call("tick",e),n<r&&(l.stop(),c.call("end",e))}function d(r){var l,c,u=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(a-n)*i,s.forEach(function(t){t(n)}),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),a=n*EA;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return l.restart(f),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,l,c=0,u=t.length;for(null==r?r=1/0:r*=r,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=n-s.y)*a)<r&&(l=s,r=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}const AA=(t,e)=>Fe(void 0,void 0,void 0,function*(){const{width:n,height:r}=e,{data:i,encode:a={},scale:o,style:s={},layout:l={}}=t,c=De(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(i,a);return tt({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily},tooltip:{items:[t=>({name:t.text,value:t.value})]}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},l)]},encode:a,scale:o,style:s},c),{axis:!1}))});AA.props={};const _A={density:eE},TA=()=>(t,e,n,r)=>{const{x:i,series:a}=n,o=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===i||void 0===o||void 0===s)throw new Error("Missing encode for x or y or size channel.");const l=e.x,c=e.series,u=Array.from(t,e=>{const n=l.getBandWidth(l.invert(+i[e])),u=n*(c?c.getBandWidth(c.invert(+(null==a?void 0:a[e]))):1),f=(+(null==a?void 0:a[e])||0)*n,d=+i[e]+f+u/2;return[...o.map((n,r)=>[d+ +s[r][e]/t.length,+o[r][e]]),...o.map((n,r)=>[d-+s[r][e]/t.length,+o[r][e]]).reverse()].map(t=>r.map(t))});return[t,u]};TA.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:_A,channels:[...pO({shapes:Object.keys(_A)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...yO(),{type:Fn},{type:_o}],postInference:[...vO()],interaction:{shareTooltip:!0}};const NA={heatmap:sE},PA=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n,l=Array.from(t,t=>{const e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]});return[[0],[l]]};PA.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:NA,channels:[...pO({shapes:Object.keys(NA)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...yO(),{type:_o},{type:To}],postInference:[...gO()]};const CA={hollow:Dy,hollowDiamond:Ry,hollowHexagon:Iy,hollowSquare:By,hollowTriangleDown:zy,hollowTriangle:Fy,hollowBowtie:jy,hollowCircle:Gy,point:Zy,plus:Ky,diamond:Vy,square:Qy,triangle:tb,hexagon:qy,cross:Hy,bowtie:Yy,hyphen:Xy,line:Uy,tick:Jy,triangleDown:eb,circle:$y},LA=t=>(e,n,r,i)=>{const{x:a,y:o,size:s}=r;if(!a.length||!o.length)return[e,o.map(()=>[[]])];const[l,c]=i.getSize(),u=xO(n,r,t),f=Array.from(e,t=>({i:t,x:+a[t]*l,y:+o[t]*c,r:+s[t]||4})),d=SA(f).stop().force("collide",function(t){var e,n,r,i=1,a=1;function o(){for(var t,o,l,c,u,f,d,h=e.length,p=0;p<a;++p)for(o=XS(e,tA,eA).visitAfter(s),t=0;t<h;++t)l=e[t],f=n[l.index],d=f*f,c=l.x+l.vx,u=l.y+l.vy,o.visit(g);function g(t,e,n,a,o){var s=t.data,h=t.r,p=f+h;if(!s)return e>c+p||a<c-p||n>u+p||o<u-p;if(s.index>l.index){var g=c-s.x-s.vx,v=u-s.y-s.vy,m=g*g+v*v;m<p*p&&(0===g&&(m+=(g=JS(r))*g),0===v&&(m+=(v=JS(r))*v),m=(p-(m=Math.sqrt(m)))/m*i,l.vx+=(g*=m)*(p=(h*=h)/(d+h)),l.vy+=(v*=m)*p,s.vx-=g*(p=1-p),s.vy-=v*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r<a;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=QS(null==t?1:+t)),o.initialize=function(t,n){e=t,r=n,l()},o.iterations=function(t){return arguments.length?(a=+t,o):a},o.strength=function(t){return arguments.length?(i=+t,o):i},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:QS(+e),l(),o):t},o}().radius(t=>t.r+1).strength(1));d.force("x",function(t){var e,n,r,i=QS(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(r[a]-i.x)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=QS(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:QS(+t),o(),a):i},a.x=function(e){return arguments.length?(t="function"==typeof e?e:QS(+e),o(),a):t},a}(t=>t.x).strength(.5)),d.force("y",function(t){var e,n,r,i=QS(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(r[a]-i.y)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=QS(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:QS(+t),o(),a):i},a.y=function(e){return arguments.length?(t="function"==typeof e?e:QS(+e),o(),a):t},a}(t=>t.y).strength(5));for(let t=0;t<200;t++)d.tick();d.stop();const h=t=>{const e=f.find(e=>e.i===t);return[e.x/l,e.y/c]},p=s?Array.from(e,t=>{const[e,n]=h(t),r=+s[t],a=r/l,o=r/c,f=[e-a,n-o],d=[e+a,n+o];return[i.map(u(f,t)),i.map(u(d,t))]}):Array.from(e,t=>[i.map(u(h(t),t))]);return[e,p]};LA.props={defaultShape:"point",defaultLabelShape:"label",composite:!1,shape:CA,channels:[...pO({shapes:Object.keys(CA)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"}],preInference:[...yO(),{type:_o},{type:To}],postInference:[{type:Po},...gO()]};const jA="partition",RA="markType",IA="childNodeCount",DA=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];DA.props={};const BA=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];BA.props={};const FA=t=>new Ui(t);FA.props={};const zA=t=>new pa(t);zA.props={};const WA=t=>new Vi(t);WA.props={};const $A=t=>new ca(t);$A.props={};const GA=t=>new ga(t);GA.props={};const YA=t=>new Ba(t);YA.props={};const HA=t=>new wa(t);HA.props={};const VA=t=>new ma(t);VA.props={};const qA=t=>new ba(t);qA.props={};const XA=t=>new Oa(t);XA.props={};const UA=t=>new ka(t);UA.props={};const KA=t=>new ya(t);KA.props={};const ZA=t=>new Wa(t);ZA.props={};const QA=t=>new Zi(t);QA.props={};const JA="g2-";function t_(t){return`.${JA}${t}`}const e_=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]],n_=["lineX","lineY","rangeX","rangeY","range","connector"];function r_({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:a,padding2:o,padding3:s,alpha90:l,alpha65:c,alpha45:u,alpha25:f,alpha10:d,category10:h,category20:p,sizeDefault:g=1,padding:v="auto",margin:m=16}){return{padding:v,margin:m,size:g,color:t,category10:h,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:d,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:a,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:l,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:l,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,focusMarkerSize:12,itemSpacing:[a,a,a/2],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:a,colPadding:o,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:l,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:l,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:c,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{[t_("tooltip")]:{"font-family":"sans-serif"}}}}}const i_=r_({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),a_=t=>tt({},i_,t);a_.props={};const o_=t=>tt({},a_(),{category10:"category10",category20:"category20"},t);o_.props={};const s_=r_({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),l_=t=>tt({},s_,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{[t_("tooltip")]:{background:"#1f1f1f",opacity:.95},[t_("tooltip-title")]:{color:"#A6A6A6"},[t_("tooltip-list-item-name-label")]:{color:"#A6A6A6"},[t_("tooltip-list-item-value")]:{color:"#A6A6A6"}}}},t),c_=t=>Object.assign({},l_(),{category10:"category10",category20:"category20"},t);c_.props={};const u_=r_({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),f_=t=>tt({},u_,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function d_(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}f_.props={};var h_,p_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function g_(t){if(!(e=p_.exec(t)))throw new Error("invalid format: "+t);var e;return new v_({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function v_(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 m_(t,e){var n=d_(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}g_.prototype=v_.prototype,v_.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 y_={"%":(t,e)=>(100*t).toFixed(e),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,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>m_(100*t,e),r:m_,s:function(t,e){var n=d_(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(h_=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+d_(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function b_(t){return t}var x_,w_,k_=Array.prototype.map,M_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function O_(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?b_:(e=k_.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?b_:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(k_.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=g_(t)).fill,n=t.align,f=t.sign,d=t.symbol,h=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):y_[y]||(void 0===v&&(v=12),m=!0,y="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===d?a:/[%p]/.test(y)?l:"",w=y_[y],k=/[defgprs%]/.test(y);function M(t){var i,a,l,d=b,M=x;if("c"===y)M=w(t)+M,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0===+t&&"+"!==f&&(O=!1),d=(O?"("===f?f:c:"-"===f||"("===f?"":f)+d,M=("s"===y?M_[8+h_/3]:"")+M+(O&&"("===f?")":""),k)for(i=-1,a=t.length;++i<a;)if(48>(l=t.charCodeAt(i))||l>57){M=(46===l?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!h&&(t=r(t,1/0));var E=d.length+t.length+M.length,S=E<p?new Array(p-E+1).join(e):"";switch(g&&h&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=d+t+M+S;break;case"=":t=d+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+d+t+M+S.slice(E);break;default:t=S+d+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=g_(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=d_(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),a=M_[8+r/3];return function(t){return n(i*t)+a}}}}function E_(t,e,n){return t.querySelector(e)?Am(t).select(e):Am(t).append(n)}function S_(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function A_(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}x_=O_({thousands:",",grouping:[3],currency:["$",""]}),w_=x_.format;class __ extends XM{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class T_ extends __{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function N_(t,e){var n;return null===(n=t.filter(t=>t.getOptions().name===e))||void 0===n?void 0:n[0]}function P_(t){return"vertical"===t||t===-Math.PI/2}function C_(t,e,n){const{bbox:r}=t,{position:i="top",size:a,length:o}=e,s=["top","bottom","center"].includes(i),[l,c]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,d=a||u||l,h=o||f||c,p=s?"horizontal":"vertical",[g,v]=s?[h,d]:[d,h];return{orientation:p,width:g,height:v,size:d,length:h}}function L_(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=De(t,["style"]),i={};return Object.entries(r).forEach(([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n}),Object.assign(Object.assign({},i),n)}function j_(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function R_(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function I_(t,e,n,r,i,a,o,s){var l;void 0===n&&void 0===a||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),a&&{tickMethod:a}));const c=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=Qn(e,t=>+t),{tickCount:a}=t.getOptions();return n(r,i,a)}(t,e,a),u=i?c.filter(i):c,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),d=r||(null===(l=t.getFormatter)||void 0===l?void 0:l.call(t))||f,h=function(t,e){if(tc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:a,insetBottom:o,insetLeft:s,insetRight:l}=n,[c,u,f]="left"===t||"right"===t?[a,o,i]:[s,l,r],d=new pa({domain:[0,1],range:[c/f,1-u/f]});return t=>d.map(t)}(o,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!ic(e))return i;const a="bottom"===t?[i,1]:[0,i],o=e.map(a);if("bottom"===t){const t=o[0];return new pa({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=o[1];return new pa({domain:[0,r],range:[0,1]}).map(t)}return i}}(o,s),g=t=>["left","right"].includes(t);return tc(s)||Jl(s)?u.map((e,n,r)=>{var i,a;const l=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,c=h(t.map(e)+l);return{value:ec(s)&&"center"===o||Jl(s)&&(null===(a=t.getTicks)||void 0===a?void 0:a.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(o)||Jl(s)&&g(o)?1-c:c,label:f(d(Nm(e),n,r)),id:String(n)}}):u.map((e,n,r)=>{var i;const a=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(h(t.map(e)+a));return{value:g(o)?1-s:s,label:f(d(Nm(e),n,r)),id:String(n)}})}function D_(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:a}=e,o=[],s=(t,e)=>{e&&o.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},a),o}function B_(t,e,n){return!function(t){return tc(t)&&Jl(t)}(e)&&!rc(e)&&(void 0===t?!!n.getTicks:t)}function F_(t,e,n,r,i,a){const o=function(t,e,n,r,i){const a=n.axis,o=["top","right","bottom","left"].includes(i)?n[`axis${Xa(i)}`]:n.axisLinear,s=t.getOptions().name,l=n[`axis${G(s)}`]||{};return Object.assign({},a,o,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},o),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:P_(a)?10:0,tick:"center"!==r&&void 0}):o}const z_=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var a;const{scales:[o]}=i,s=(null===(a=o.getTicks)||void 0===a?void 0:a.call(o))||o.getOptions().domain,l="string"==typeof n?w_(n):n,c=Object.assign(Object.assign({},e),{labelFormatter:l,labelFilter:(t,e,n)=>r(s[e],e,s),scale:o});return t(c)(i)}},W_=z_(t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:a,actualPosition:o,position:s,size:l,style:c={},title:u,tickCount:f,tickFilter:d,tickMethod:h,tickLength:p,transform:g,indexBBox:v}=t,m=De(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","tickLength","transform","indexBBox"]);return({scales:i,value:y,coordinate:b,theme:x})=>{const{bbox:w}=y,[k]=i,{domain:M,xScale:O}=k.getOptions(),E=F_(k,0,x,e,s,a),S=Object.assign(Object.assign(Object.assign({},E),c),m),A=function(t,e,n="xy"){const[r,i,a]=R_(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?a:r:t.includes("bottom")||t.includes("top")?i:a}(o||s,b,t.plane),_=function(t,e,n,r,i){const{x:a,y:o,width:s,height:l}=n;if("bottom"===t)return{startPos:[a,o],endPos:[a+s,o]};if("left"===t)return{startPos:[a+s,o+l],endPos:[a+s,o]};if("right"===t)return{startPos:[a,o+l],endPos:[a,o]};if("top"===t)return{startPos:[a,o+l],endPos:[a+s,o+l]};if("center"===t){if("vertical"===e)return{startPos:[a,o],endPos:[a,o+l]};if("horizontal"===e)return{startPos:[a,o],endPos:[a+s,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[c,u]=oc(r),[f,d]=sc(r),h=Math.min(s,l)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=c*h,m=u*h,[y,b]=[t+a-p,n+o-g],[x,w]=[Math.cos(e),Math.sin(e)],k=[y+m*x,b+m*w],M=[y+v*x,b+v*w],O=()=>{const{domain:t}=i.getOptions();return t.length},E=tc(r)&&i?O():3;return{startPos:k,endPos:M,gridClosed:Math.abs(d-f-360)<1e-6,gridCenter:[y,b],gridControlAngles:new Array(E).fill(0).map((t,e,n)=>(d-f)/E*e)}}}return{}}(s,a,w,b,O),T=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(b),N=I_(k,M,f,r,d,h,s,b),P=v?N.map((t,e)=>{const n=v.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):N,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},S),{type:"linear",data:P,crossSize:l,titleText:S_(u),labelOverlap:D_(g,S),grid:B_(S.grid,b,k),gridLength:A,line:!0,indexBBox:v,classNamePrefix:JA}),void 0!==p?{tickLength:p}:null),S.line?null:{lineOpacity:0}),_),T),n),L=C.labelOverlap.find(t=>"hide"===t.type);return L&&(C.crossSize=!1),new Dk({className:"axis",style:L_(C)})}}),$_=z_(t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:a,tickFilter:o,tickCount:s,tickMethod:l,tickLength:c,important:u={},style:f={},indexBBox:d,title:h,grid:p=!1}=t,g=De(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","tickLength","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:f}=e,{domain:v}=t.getOptions(),m=I_(t,v,s,a,o,l,r,n),y=d?m.map((t,e)=>{const n=d.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):m,[b,x]=oc(n),w=function(t,e,n,r,i){const{x:a,y:o,width:s,height:l}=e,c=[a+s/2,o+l/2],u=Math.min(s,l)/2,[f,d]=sc(i),[h,p]=R_(i),g={center:c,radius:u,startAngle:f,endAngle:d,gridLength:(r-n)*(Math.min(h,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[c[0]-t,c[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,f,b,x,n),{axis:k,axisArc:M={}}=i,O=L_(tt({},k,M,w,Object.assign(Object.assign(Object.assign({type:"arc",data:y,titleText:S_(h),grid:p,classNamePrefix:JA},void 0!==c?{tickLength:c}:null),g),u)));return new Dk({style:ct(O,["transform"])})}});W_.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},$_.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const G_=t=>(...e)=>{const n=W_(Object.assign({},{crossPadding:50},t))(...e);return j_(n,t),n};G_.props=Object.assign(Object.assign({},W_.props),{defaultPosition:"bottom"});const Y_=t=>(...e)=>{const n=W_(Object.assign({},{crossPadding:10},t))(...e);return j_(n,t),n};function H_(t,e,n,r){const{radar:i}=t,[a]=r,o=a.getOptions().name,[s,l]=sc(n),{axisRadar:c={}}=e;return Object.assign(Object.assign({},c),{grid:"position"===o,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>(l-s)/i.count*e)})}Y_.props=Object.assign(Object.assign({},W_.props),{defaultPosition:"left"});const V_=t=>{const{important:e={}}=t,n=De(t,["important"]);return r=>{const{theme:i,coordinate:a,scales:o}=r;return W_(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},H_(t,i,a,o)),e)}))(r)}};function q_(t,e){const n=N_(t,"shape"),r=N_(t,"color"),i=n?n.clone():null,a=[];for(const[t,n]of e){const e=t.type,o=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map((e,r)=>{var a;return i?i.map(e||"point"):(null===(a=null==t?void 0:t.style)||void 0===a?void 0:a.shape)||n.defaultShape||"point"});"string"==typeof e&&a.push([e,o])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const{range:o}=n.getOptions();return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){const r=o[t%o.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}function X_(t,e){const{scales:n,library:r,markState:i}=e,[a,o]=q_(n,i),{itemMarker:s,itemMarkerSize:l}=t,c=(t,e)=>{var n,i,o;const s=(null===(o=null===(i=null===(n=r[`mark.${a}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===o?void 0:o.props.defaultMarker)||j(t.split(".")),c="function"==typeof l?l(e):l;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:a,stroke:o,color:s}=e,l=De(e,["d","fill","lineWidth","path","stroke","color"]);const c=Ny.get(t)||Ny.get("point");return(...t)=>new ov({style:Object.assign(Object.assign({},l),{d:c(...t),stroke:c.style.includes("stroke")?s||o:"",fill:c.style.includes("fill")?s||r:"",lineWidth:c.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,c)},u=t=>`${o[t]}`;return N_(n,"shape")&&!s?(t,e)=>c(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?c(n,t):n}:(t,e)=>c(s||u(e),t)}function U_(t){const e=N_(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function K_(t,e){const{scales:n,markState:r}=e,[i,a]=q_(n,r),{itemMarker:o,itemMarkerLineWidth:s}=t;if(void 0!==s)return s;const l=["line","hyphen","dash","smooth","hv","hvh","vh","vhv"];if("string"==typeof o&&l.includes(o))return 4;if("function"==typeof o)return(t,e)=>{const n=o(t.id,e);if("string"==typeof n&&l.includes(n))return 4};const c=(Array.isArray(a)?a:[a]).some(t=>l.includes(t));return c?4:void 0}function Z_(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,a=function(t,e){const n=N_(t,"size");return n instanceof ca?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),o={itemMarker:X_(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:U_(r),itemMarkerLineWidth:K_(t,e)},s="string"==typeof n?w_(n):n,l=N_(r,"color"),c=function(t){return t.find(t=>t.getOptions().domain.length>0).getOptions().domain}(r),u=l?t=>l.map(t):()=>e.theme.color;return Object.assign(Object.assign({},o),{data:c.map(t=>({id:t,label:s(t),color:u(t)}))})}V_.props=Object.assign(Object.assign({},W_.props),{defaultPosition:"center"});const Q_=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,cols:l,itemMarker:c,render:u}=t,f=De(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker","render"]),{gridRow:d}=f;return e=>{const{value:r,theme:i}=e,{bbox:o}=r,{width:c,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:a}=C_(t,e,n);return{width:i,height:a}}(r,t,Q_),p=A_(a,n),g=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(a)?"vertical":"horizontal",width:c,height:h,layout:void 0!==l?"grid":"flex"},void 0!==l&&{gridCol:l}),void 0!==d&&{gridRow:d}),{titleText:S_(s)}),Z_(t,e)),{legendCategory:v={}}=i,m=L_(Object.assign({},v,function(t){return Object.assign(Object.assign({},t),{data:(null==t?void 0:t.data.filter(t=>""!==t.id))||[]})}(g),f,{classNamePrefix:JA}));if(u)return new PM({style:Object.assign(Object.assign({},m),{x:o.x,y:o.y,render:u})});const y=new T_({style:Object.assign(Object.assign({x:o.x,y:o.y,width:o.width,height:o.height},p),{subOptions:m})});return y.appendChild(new PM({className:"legend-category",style:m})),y}};function J_(t,e,n,r,i){const a=e.thresholds,o=function(t){return e=>({value:e/t,label:String(e),domainValue:e})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...a,r].map(o)})}function tT(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],co(e)];return[n,r]}function eT(t,e,n,r,i,a){const{length:o}=t,s=n||r,l=i.color?a.legendContinuous.ribbonFill||"black":a.color,c=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[Md(e).toString()]})),r}(s,l),[u,f]=tT(c),[d,h]=tT([e,n,r].filter(t=>void 0!==t).find(t=>!(t instanceof Zi)));return Object.assign(Object.assign({},t),{domain:[d,h],data:c.getTicks().map(t=>({value:t})),color:new Array(Math.floor(o)).fill(0).map((t,e)=>{const n=(f-u)/(o-1)*e+u,i=c.map(n)||l,a=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${a})`)})})}function nT(t,e,n,r,i,a){const o=N_(t,"color"),s=function(t,e,n){const{size:r}=e,i=C_(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(o instanceof ba){const{range:t}=o.getOptions(),[e,n]=tT(o);return o instanceof ka||o instanceof Oa?J_(s,o,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map((t,e)=>({value:e,domainValue:t,label:t}));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,o,t)}return eT(s,o,N_(t,"size"),N_(t,"opacity"),e,a)}Q_.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const rT=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,style:l,crossPadding:c,padding:u}=t,f=De(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:o,scale:c})=>{const{bbox:u}=i,{x:d,y:h,width:p,height:g}=u,v=A_(a,n),{legendContinuous:m={}}=o,y=L_(Object.assign({},m,Object.assign(Object.assign(Object.assign({titleText:S_(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>w_(e)(t.label):e},nT(r,c,i,t,rT,o)),l),{classNamePrefix:JA}),f)),b=new __({style:Object.assign(Object.assign({x:d,y:h,width:p,height:g},v),{subOptions:y})});return b.appendChild(new GM({className:"legend-continuous",style:y})),b}};rT.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const iT=t=>(...e)=>rT(Object.assign({},{block:!0},t))(...e);iT.props=Object.assign(Object.assign({},rT.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const aT=t=>e=>{const{scales:n}=e,r=N_(n,"size");return rT(Object.assign({},{type:"size",data:r.getTicks().map((t,e)=>({value:t,label:String(t)}))},t))(e)};aT.props=Object.assign(Object.assign({},rT.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const oT=t=>aT(Object.assign({},{block:!0},t));function sT(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}oT.props=Object.assign(Object.assign({},rT.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const lT=(cT={render(t,e){const{width:n,title:r,subtitle:i,spacing:a=2,align:o="left",x:s,y:l}=t,c=De(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${l})`;const u=Ja(c,"title"),f=Ja(c,"subtitle"),d=E_(e,".title","text").attr("className","title").call(Pm,Object.assign(Object.assign(Object.assign({},sT(0,0,n,o)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();E_(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},sT(0,d.max[1]+a,n,o)),{fontSize:12,textBaseline:"top",text:i}),f))})}},class extends Zg{constructor(t){super(t),this.descriptor=cT}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(tt({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var cT;const uT=t=>({value:e,theme:n})=>{const{x:r,y:i,width:a,height:o}=e.bbox;return new lT({style:tt({},n.title,Object.assign({x:r,y:i,width:a,height:o},t))})};function fT(t){return!!t.getBandWidth}function dT(t,e,n){if(!fT(t))return t.invert(e);const{adjustedRange:r}=t;if(r.includes(e))return t.invert(e);const{domain:i}=t.getOptions(),a=n?-1:0,o=t.getStep(),s=n?r:r.map(t=>t+o),l=function(t,e,n){return Math.min(n,Math.max(e,t))}(qn(s,e)+a,0,i.length-1);return i[l]}function hT(t,e,n){if(!e)return t.getOptions().domain;if(!fT(t)){const r=lr(e);if(!n)return r;const[i]=r,{range:a}=t.getOptions(),[o,s]=a,l=o>s?-1:1;return[i,t.invert(t.map(i)+l*n)]}const{domain:r}=t.getOptions(),i=e[0],a=r.indexOf(i);if(n){const t=a+Math.round(r.length*n);return r.slice(a,t)}const o=e[e.length-1],s=r.indexOf(o);return r.slice(a,s+1)}function pT(t,e,n,r,i,a){const{x:o,y:s}=i,l=(t,e)=>{const[n,r]=a.invert(t);return[dT(o,n,e),dT(s,r,e)]},c=l([t,e],!0),u=l([n,r],!1);return[hT(o,[c[0],u[0]]),hT(s,[c[1],u[1]])]}function gT(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}uT.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const vT=(t,e)=>{var n,r;const[i,a]=t,o=(null===(r=null===(n=e.getOptions)||void 0===n?void 0:n.call(e))||void 0===r?void 0:r.domain)||[],s=o.indexOf(i),l=o.indexOf(a);if(-1===s||-1===l)return[e.map(i),e.map(a)];const c=o.length;return c<=1?[0,1]:[s/(c-1),l/(c-1)]};const mT=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:a}=t,o=De(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[l],value:c,theme:u,coordinate:f}=r,{bbox:d}=c,{width:h,height:p}=d,{slider:g={}}=u,v=(null===(s=l.getFormatter)||void 0===s?void 0:s.call(l))||(t=>t+""),m="string"==typeof n?w_(n):n,y="horizontal"===e,b=Jl(f)&&y,{trackSize:x=g.trackSize}=i,[w,k]=function(t,e,n){const{x:r,y:i,width:a,height:o}=t;return"left"===e?[r+a-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+o-n]:void 0}(d,a,x);return new yw({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:k,trackLength:y?h:p,orientation:e,formatter:t=>(m||v)(dT(l,b?1-t:t,!0)),sparklineData:yT(t,r)},i),o))})}};function yT(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter(([t])=>"line"===t.type||"area"===t.type||"interval"===t.type).filter(([t])=>t.slider).map(([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}});if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t),{});return Object.values(r)}(n,["y","series"])}mT.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const bT=t=>mT(Object.assign(Object.assign({},t),{orientation:"horizontal"}));bT.props=Object.assign(Object.assign({},mT.props),{defaultPosition:"bottom"});const xT=t=>mT(Object.assign(Object.assign({},t),{orientation:"vertical"}));xT.props=Object.assign(Object.assign({},mT.props),{defaultPosition:"left"});const wT=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=De(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:a})=>{const{bbox:o}=n,{x:s,y:l,width:c,height:u}=o,{scrollbar:f={}}=a,{ratio:d,range:h}=t.getOptions(),p="horizontal"===e?c:u,g=p/d,[v,m]=h,y=m>v?0:1;return new bw({className:`${JA}scrollbar`,style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:l,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};wT.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const kT=t=>wT(Object.assign(Object.assign({},t),{orientation:"horizontal"}));kT.props=Object.assign(Object.assign({},wT.props),{defaultPosition:"bottom"});const MT=t=>wT(Object.assign(Object.assign({},t),{orientation:"vertical"}));MT.props=Object.assign(Object.assign({},wT.props),{defaultPosition:"left"});const OT=t=>()=>new Jg;OT.props={};const ET=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[u,f]=Jl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],d=[{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c}];return a.animate(d,Object.assign(Object.assign({},i),t))}},ST=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[u,f]=Jl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],d=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(d,Object.assign(Object.assign({},i),t))}},AT=(t,e)=>{const n=1e-4,{coordinate:r}=e;return gv({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:af.NUMBER}),(e,i,a)=>{const[o]=e;return tc(r)?(e=>{const{__data__:i,style:o}=e,{fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=o,{points:u,y:f,y1:d}=i,h=Rm(r,u,[f,d]),{innerRadius:p,outerRadius:g}=h,v=[{scaleInYRadius:p+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:p+n,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{scaleInYRadius:g,fillOpacity:s,strokeOpacity:l,opacity:c}];return e.animate(v,Object.assign(Object.assign({},a),t))})(o):(e=>{const{style:n}=e,{transform:i="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=n,[c,u]=Jl(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:c,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l}];return e.animate(f,Object.assign(Object.assign({},a),t))})(o)}},_T=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[u,f]=Jl(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],d=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(d,Object.assign(Object.assign({},i),t))}},TT=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,l=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}];return i.animate(l,Object.assign(Object.assign({},r),t))};TT.props={};const NT=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,l=[{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(l,Object.assign(Object.assign({},r),t))};NT.props={};const PT={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},CT={[uu.CIRCLE]:["cx","cy","r"],[uu.ELLIPSE]:["cx","cy","rx","ry"],[uu.RECT]:["x","y","width","height"],[uu.IMAGE]:["x","y","width","height"],[uu.LINE]:["x1","y1","x2","y2"],[uu.POLYLINE]:["points"],[uu.POLYGON]:["points"]};function LT(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=PT[i])}return r}const jT=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function RT(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[a,o]=n;return[r,i,a-r,o-i]}function IT(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function DT(t,e){const[n,r,i,a]=RT(t),o=a/i,s=Math.ceil(Math.sqrt(e/o)),l=[],c=a/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,a=r+u*c;l.push(IT([t,a,e,c]))}f-=t,u+=1}return l}function BT(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function FT(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function zT(t){const e=eh(t);if(e&&!function(t){return!FT(t,"m")||!FT(t,"M")}(e))return e}function WT(t){const{nodeName:e}=t;if("path"===e){const e=at(t,"attributes");return e.markerEnd||e.markerStart}return!1}function $T(t,e,n,r){const{nodeName:i}=e,{nodeName:a}=n,o=zT(e),s=zT(n),{opacity:l=1,strokeOpacity:c=1,fillOpacity:u=1}=e.style,{opacity:f=1,strokeOpacity:d=1,fillOpacity:h=1}=n.style,p=i===a&&"path"!==i,g=void 0===o||void 0===s,v=WT(e)||WT(n);if(p||g||v)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;BT(e,t);let a=jT;if(t.nodeName===uu.GROUP){const[n,i,a,o]=RT(t),[s,l,c,u]=RT(e);r=`translate(${n-s}, ${i-l}) scale(${a/c}, ${o/u})`}else a=a.concat(CT[t.nodeName]||[]);const o=[Object.assign({transform:null!=r?r:"none"},LT(t,a,!0)),Object.assign({transform:null!=i?i:"none"},LT(e,a,!0))];return e.animate(o,n)}(e,n,r);const m=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new ov({style:Object.assign(Object.assign({},LT(t,jT)),{d:e})});return BT(r,t),r}(t,o),y=Object.assign(Object.assign({},LT(e,jT)),{opacity:l,strokeOpacity:c,fillOpacity:u}),b=Object.assign(Object.assign({},LT(n,jT)),{opacity:f,strokeOpacity:d,fillOpacity:h}),x=[y,b];if(o!==s){x[0].d=o,x[1].d=s;const t=m.animate(x,r);return t.onfinish=()=>{Ka(m,n),m.style.d=s,m.style.transform="none"},m.style.transform="none",t}return rt(y,b)?null:m.animate(x,r)}const GT=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:DT}(t.split),a=Object.assign(Object.assign({},r),t),{length:o}=e,{length:s}=n;if(1===o&&1===s||o>1&&s>1){const[t]=e,[r]=n;return $T(t,t,r,a)}if(1===o&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((e,r)=>$T(e,new ov({style:Object.assign({d:i[r]},LT(t,jT))}),e,n))}(t,n,a,i)}if(o>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=e.style,l=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:a,strokeOpacity:o,opacity:s}],c=e.animate(l,n),u=t.map((t,r)=>$T(t,t,new ov({style:{d:i[r],fill:e.style.fill}}),n));return[...u,c]}(e,t,a,i)}return null};GT.props={};const YT=(t,e)=>{const n=1e-4;gv({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:af.NUMBER});const{coordinate:r}=e;return(i,a,o)=>{const[s]=i;if(!tc(r))return ET(t,e)(i,a,o);const{__data__:l,style:c}=s,{radius:u=0,inset:f=0,fillOpacity:d=1,strokeOpacity:h=1,opacity:p=1}=c,{points:g,y:v,y1:m}=l,y=yl().cornerRadius(u).padAngle(f*Math.PI/180),b=Rm(r,g,[v,m]),{startAngle:x,endAngle:w}=b,k=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:d,strokeOpacity:h,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:d,strokeOpacity:h,opacity:p}],M=s.animate(k,Object.assign(Object.assign({},o),t));return M.onframe=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:w}))},M}};YT.props={};const HT=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=i.style,c="center center",u=[{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:`${a} scale(1)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l}];return i.animate(u,Object.assign(Object.assign({},r),t))},VT=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=i.style,c="center center",u=[{transform:`${a} scale(1)`.trimStart(),transformOrigin:c},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.99},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},qT=t=>(e,n,r)=>{var i,a;const[o]=e,s=(null===(a=(i=o).getTotalLength)||void 0===a?void 0:a.call(i))||0,l=[{lineDash:[0,s]},{lineDash:[s,0]}];return o.animate(l,Object.assign(Object.assign({},r),t))};qT.props={};const XT=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:l}=a.getLocalBounds(),c=2*l[0],u=2*l[1],f=new ov({style:{d:`M${o},${s}L${o+c},${s}L${o+c},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return ET(t,e)([f],r,i)};XT.props={};const UT=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:l}=a.getLocalBounds(),c=2*l[0],u=2*l[1],f=new ov({style:{d:`M${o},${s}L${o+c},${s}L${o+c},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return AT(t,e)([f],r,i)};
20
+ var Sv=function(t){function e(t,n,r,i){var a;return pc(this,e),(a=Mc(this,e,[t])).currentTime=r,a.timelineTime=i,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=r,a.timelineTime=i,a}return Ec(e,t),vc(e)}(Wp),Av=0,_v=function(){return vc(function t(e,n){var r;pc(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Av++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Sv(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(e)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(ku)}},{key:"addEventListener",value:function(t,e,n){throw new Error(ku)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(ku)}},{key:"dispatchEvent",value:function(t){throw new Error(ku)}},{key:"commitStyles",value:function(){throw new Error(ku)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Sv(null,this,this.currentTime,t);setTimeout(function(){e.onfinish&&e.onfinish(n)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Sv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),Tv=.1,Nv="function"==typeof Float32Array,Pv=function(t,e){return 1-3*e+3*t},Cv=function(t,e){return 3*e-6*t},Lv=function(t){return 3*t},jv=function(t,e,n){return((Pv(e,n)*t+Cv(e,n))*t+Lv(e))*t},Rv=function(t,e,n){return 3*Pv(e,n)*t*t+2*Cv(e,n)*t+Lv(e)},Iv=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Nv?new Float32Array(11):new Array(11),a=0;a<11;++a)i[a]=jv(a*Tv,t,n);var o=function(e){for(var r=0,a=1;10!==a&&i[a]<=e;++a)r+=Tv;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*Tv,s=Rv(o,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var a=Rv(e,n,r);if(0===a)return e;e-=(jv(e,n,r)-t)/a}return e}(e,o,t,n):0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=jv(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,r,r+Tv,t,n)};return function(t){return 0===t||1===t?t:jv(o(t),e,r)}},Dv=function(t){return Math.pow(t,2)},Bv=function(t){return Math.pow(t,3)},Fv=function(t){return Math.pow(t,4)},zv=function(t){return Math.pow(t,5)},Wv=function(t){return Math.pow(t,6)},$v=function(t){return 1-Math.cos(t*Math.PI/2)},Gv=function(t){return 1-Math.sqrt(1-t*t)},Yv=function(t){return t*t*(3*t-2)},Hv=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Vv=function(t){var e=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],a=void 0===i?.5:i,o=R(Number(r),1,10),s=R(Number(a),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/s)},qv=function(t){var e=arguments.length>2?arguments[2]:void 0,n=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,a=n[1],o=void 0===a?100:a,s=n[2],l=void 0===s?10:s,c=n[3],u=void 0===c?0:c;i=R(i,.1,1e3),o=R(o,.1,1e3),l=R(l,.1,1e3),u=R(u,.1,1e3);var f=Math.sqrt(o/i),d=l/(2*Math.sqrt(o*i)),h=d<1?f*Math.sqrt(1-d*d):0,p=d<1?(d*f-u)/h:-u+f,g=e?e*t/1e3:t;return g=d<1?Math.exp(-g*d*f)*(1*Math.cos(h*g)+p*Math.sin(h*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Xv=function(t){var e=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(R(t,0,1)*r)/r},Uv=function(t){var e=Sc(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],a=e[3];return Iv(n,r,i,a)(t)},Kv=Iv(.42,0,1,1),Zv=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},Qv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Jv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},tm={steps:Xv,"step-start":function(t){return Xv(t,[1,"start"])},"step-end":function(t){return Xv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Uv,ease:function(t){return Uv(t,[.25,.1,.25,1])},in:Kv,out:Zv(Kv),"in-out":Qv(Kv),"out-in":Jv(Kv),"in-quad":Dv,"out-quad":Zv(Dv),"in-out-quad":Qv(Dv),"out-in-quad":Jv(Dv),"in-cubic":Bv,"out-cubic":Zv(Bv),"in-out-cubic":Qv(Bv),"out-in-cubic":Jv(Bv),"in-quart":Fv,"out-quart":Zv(Fv),"in-out-quart":Qv(Fv),"out-in-quart":Jv(Fv),"in-quint":zv,"out-quint":Zv(zv),"in-out-quint":Qv(zv),"out-in-quint":Jv(zv),"in-expo":Wv,"out-expo":Zv(Wv),"in-out-expo":Qv(Wv),"out-in-expo":Jv(Wv),"in-sine":$v,"out-sine":Zv($v),"in-out-sine":Qv($v),"out-in-sine":Jv($v),"in-circ":Gv,"out-circ":Zv(Gv),"in-out-circ":Qv(Gv),"out-in-circ":Jv(Gv),"in-back":Yv,"out-back":Zv(Yv),"in-out-back":Qv(Yv),"out-in-back":Jv(Yv),"in-bounce":Hv,"out-bounce":Zv(Hv),"in-out-bounce":Qv(Hv),"out-in-bounce":Jv(Hv),"in-elastic":Vv,"out-elastic":Zv(Vv),"in-out-elastic":Qv(Vv),"out-in-elastic":Jv(Vv),spring:qv,"spring-in":qv,"spring-out":Zv(qv),"spring-in-out":Qv(qv),"spring-out-in":Jv(qv)},em=function(t){return t};function nm(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var rm="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",im=new RegExp("cubic-bezier\\(".concat(rm,",").concat(rm,",").concat(rm,",").concat(rm,"\\)")),am=/steps\(\s*(\d+)\s*\)/,om=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function sm(t){var e=im.exec(t);if(e)return Iv.apply(void 0,bc(e.slice(1).map(Number)));var n=am.exec(t);if(n)return nm(Number(n[1]),0);var r=om.exec(t);return r?nm(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):tm[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||tm.linear}function lm(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function cm(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?1!==e&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),l=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,l,s);return n.currentIteration=l,n.progress=c,n.easingFunction(c)}function um(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(fm(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:sm(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,f=c;0===a&&(u=-1/0,0===c&&(s=o)),a===i.length-2&&(f=1/0,1===l&&(o=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:hm(r,i[o].value,i[s].value,e)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}(r,n);return function(t,e){if(null!==e)i.filter(function(t){return e>=t.applyFrom&&e<t.applyTo}).forEach(function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,a=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(a),!1,!1)});else for(var n in r)fm(n)&&t.setAttribute(n,null)}}function fm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var dm=function(t,e,n){return function(r){var i=pm(t,e,r);return I(i)?i:n(i)}};function hm(t,e,n,r){var i=Eh[t];if(i&&i.syntax&&i.int){var a=Pg.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o=a.parser,s=o?o(e,r):e,l=o?o(n,r):n,c=a.mixer(s,l,r);if(c){var u=dm.apply(void 0,bc(c));return function(t){return 0===t?e:1===t?n:u(t)}}}}return dm(!1,!0,function(t){return t?n:e})}function pm(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;s<a;s++)o.push(pm(t[s<r?s:r-1],e[s<i?s:i-1],n));return o}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var gm=function(){return vc(function t(){pc(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=em,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=sm(t),this._easing=t}}])}();function vm(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;a<i;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}void 0!==r[a]&&null!==r[a]&&(e[a][n]=r[a])}}return e.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),e}(t));for(var n=t.map(function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),r=!0,i=-1/0,a=0;a<n.length;a++){var o=n[a].offset;if(b(o))r=!1;else{if(o<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}return n=n.filter(function(t){return Number(t.offset)>=0&&Number(t.offset)<=1}),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,a=Number(n[0].computedOffset),o=1;o<r;o++){var s=n[o].computedOffset;if(!b(s)&&!b(a)){for(var l=1;l<o-i;l++)n[i+l].computedOffset=a+(Number(s)-a)*l/(o-i);i=o,a=Number(s)}}}(),n}var mm="backwards|forwards|both|none".split("|"),ym="reverse|alternate|alternate-reverse".split("|");function bm(t,e){return function(t,e){var n=new gm;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach(function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===mm.indexOf(t[e]))return;if("direction"===e&&-1===ym.indexOf(t[e]))return;n[e]=t[e]}}):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var xm=function(){return vc(function t(e,n,r){var i=this;pc(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=bm(r,!1),this.timing.effect=this,this.timing.activeDuration=lm(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=vm(n,this.timing),this.interpolations=um(this.normalizedKeyframes,this.timing,this.target);var a=Pg.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=cm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=vm(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach(function(n){e.timing[n]=t[n]})}}])}();function wm(t,e){return Number(t.id)-Number(e.id)}var km=function(){return vc(function t(e){var n=this;pc(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(wm),n.animations=n.tick(t,!0,n.animations)[0],e.forEach(function(e){e[1](t)}),n.applyPendingEffects()},this.document=e},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new xm(t,e,n),i=new _v(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(wm),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach(function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){null==t||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF(function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()})}},{key:"tick",value:function(t,e,n){var r,i,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],l=[],c=[];return n.forEach(function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?l.push(n):c.push(n)}),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[l,c]}}])}();function Mm(t){return new Om([t],null,t,t.ownerDocument)}Pg.EasingFunction=sm,Pg.AnimationTimeline=km;class Om{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Om(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Om(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Om([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,a]=Array.isArray(r)?r:[r,null],o=e(i,t);o.__data__=i,null!==a&&(o.__fromElements__=a),this._parent.appendChild(o),n.push(o)}return new Om(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new Om(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Om([i],null,this._parent,this._document);const a="string"==typeof e?this.createElement(e):e();return a.id=t,n&&(a.className=n),r.appendChild(a),new Om([a],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],a=new Set(this._elements),o=[],s=new Set,l=new Map(this._elements.map((t,n)=>[e(t.__data__,n),t])),c=new Map(this._facetElements.map((t,n)=>[e(t.__data__,n),t])),u=rr(this._elements,t=>n(t.__data__));for(let f=0;f<t.length;f++){const d=t[f],h=e(d,f),p=n(d,f);if(l.has(h)){const t=l.get(h);t.__data__=d,t.__facet__=!1,i.push(t),a.delete(t),l.delete(h)}else if(c.has(h)){const t=c.get(h);t.__data__=d,t.__facet__=!0,i.push(t),c.delete(h)}else if(u.has(h)){const t=u.get(h);o.push([d,t]);for(const e of t)a.delete(e);u.delete(h)}else if(l.has(p)){const t=l.get(p);t.__toData__?t.__toData__.push(d):t.__toData__=[d],s.add(t),a.delete(t)}else r.push(d)}const f=[new Om([],r,this._parent,this._document),new Om(i,null,this._parent,this._document),new Om(a,null,this._parent,this._document),new Om([],o,this._parent,this._document),new Om(s,null,this._parent,this._document)];return new Om(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Om(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Om.registry[t];return e?new e:Ua(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const a=t(this._enter),o=e(this._update),s=n(this._exit),l=r(this._merge),c=i(this._split);return o.merge(a).merge(s).merge(l).merge(c)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(this._elements[t].__removed__=!0,e){const n=Array.isArray(e)?e:[e];Promise.all(n.map(t=>t.finished)).then(()=>{const e=this._elements[t];e.__removed__&&e.remove()})}else{const e=this._elements[t];e.__removed__&&e.remove()}}return new Om([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,a){void 0!==e&&(a[t]=n(r,i,a))})}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each(function(r,i,a){void 0!==e&&(a.style[t]=n(r,i,a))})}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each(function(t,r,i){n[r]=e(t,r,i)})}on(t,e){return this.each(function(n,r,i){i.addEventListener(t,e)}),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function Em(t,e,n){return Math.max(e,Math.min(t,n))}function Sm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Am(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function _m(t,e,n,r,i){const a=Ps(_s(r,e))+Math.PI,o=Ps(_s(r,n))+Math.PI;return t.arc(r[0],r[1],i,a,o,o-a<0),t}function Tm(t,e,n,r="y",i="between",a=!1){const o="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,a),l=so(o),[c,u]=Qn(l,t=>o[t]),f=new pa({domain:[c,u],range:[0,100]}),d=t=>I(o[t])&&!Number.isNaN(o[t])?f.map(o[t]):0,h={between:e=>`${t[e]} ${d(e)}%`,start:e=>0===e?`${t[e]} ${d(e)}%`:`${t[e-1]} ${d(e)}%, ${t[e]} ${d(e)}%`,end:e=>e===t.length-1?`${t[e]} ${d(e)}%`:`${t[e]} ${d(e)}%, ${t[e+1]} ${d(e)}%`},p=l.sort((t,e)=>d(t)-d(e)).map(h[i]||h.between).join(",");return`linear-gradient(${s}deg, ${p})`}function Nm(t){const[e,n,r,i]=t;return[i,e,n,r]}function Pm(t,e,n){const[r,i,,a]=Jl(t)?Nm(e):e,[o,s]=n,l=t.getCenter(),c=Cs(_s(r,l)),u=Cs(_s(i,l)),f=u===c&&o!==s?u+2*Math.PI:u,d=1e-4;return{startAngle:c+d,endAngle:(f-c>=0?f:2*Math.PI+f)-d,innerRadius:Ns(a,l),outerRadius:Ns(r,l)}}function Cm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Lm(t,e){if(!tc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function jm(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,a,o=0]]=t;return[(e+i)/2,(n+a)/2,(r+o)/2]}function Rm(t,e,n,r,i={}){const{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:f=o,radiusBottomRight:d=o,radiusTopLeft:h=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:v=1/0,minHeight:m=-1/0}=i,y=De(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!tc(r)&&!nc(r)){const n=!!Jl(r),[i,,a]=n?Nm(e):e,[o,b]=i,[x,w]=_s(a,i),k=(x>0?o:o+x)+s,M=(w>0?b:b+w)+l,O=Math.abs(x)-(s+c),E=Math.abs(w)-(l+u),S=n?Em(O,m,1/0):Em(O,g,v),A=n?Em(E,g,v):Em(E,m,1/0),_=n?k:k-(S-O)/2,T=n?M-(A-E)/2:M-(A-E);return Mm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[h,p,d,f]).call(Am,y).node()}const{y:b,y1:x}=n,w=r.getCenter(),k=Pm(r,e,[b,x]),M=yl().cornerRadius(o).padAngle(a*Math.PI/180);return Mm(t.createElement("path",{})).style("d",M(k)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",o).style("inset",a).call(Am,y).node()}Om.registry={g:Ug,rect:sv,circle:Hg,path:nv,text:cv,ellipse:Xg,image:Qg,line:tv,polygon:iv,polyline:ov,html:Zg};const Im=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,o=De(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:l}=e;return(e,r,c)=>{const{color:u,radius:f=0}=c,d=De(c,["color","radius"]),h=d.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:m=g,radiusBottomRight:y=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:k=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:O=x,lineWidth:E=("stroke"===n||p?h:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:N=S,minWidth:P,maxWidth:C,minHeight:L}=o,j=De(o,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,D=[i?v:w,i?m:k,a?y:M,a?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Jl(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map((t,e)=>[t,D[e]]))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:N,minWidth:P,maxWidth:C,minHeight:L});return Mm(Rm(l,e,r,s,F)).call(Am,d).style("fill","transparent").style(n,R).style(Cm(t),I).style("lineWidth",E).style("stroke",void 0===p?R:p).call(Am,j).node()}};Im.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dm=(t,e)=>Im(Object.assign({colorAttribute:"fill"},t),e);Dm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"square"});const Bm=(t,e)=>Im(Object.assign({colorAttribute:"stroke"},t),e);function Fm(t,e,n){const[r,i,a,o]=t;if(Jl(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:a[0],a[1]],o]}return[r,[i[0],e?e[0][1]:i[1]],[a[0],e?e[3][1]:a[1]],o]}Bm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"hollowSquare"});const zm=(t,e)=>{const{adjustPoints:n=Fm}=t,r=De(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(t,e,o,s)=>{const{index:l}=e,{color:c}=o,u=De(o,["color"]),f=s[l+1],d=n(t,f,i),h=!!Jl(i),[p,g,v,m]=h?Nm(d):d,{color:y=c,opacity:b}=e,x=Ol().curve(Fl)([p,g,v,m]);return Mm(a.createElement("path",{})).call(Am,u).style("d",x).style("fill",y).style("fillOpacity",b).call(Am,r).node()}};function Wm(t,e,n){const[r,i,a,o]=t;if(Jl(n)){return[r,[e?e[0][0]:(i[0]+a[0])/2,i[1]],[e?e[3][0]:(i[0]+a[0])/2,a[1]],o]}return[r,[i[0],e?e[0][1]:(i[1]+a[1])/2],[a[0],e?e[3][1]:(i[1]+a[1])/2],o]}zm.props={defaultMarker:"square"};const $m=(t,e)=>zm(Object.assign({adjustPoints:Wm},t),e);function Gm(t){const e="function"==typeof t?t:t.render;return class extends qg{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}$m.props={defaultMarker:"square"};const Ym=Gm(t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,a=t.ownerDocument;Mm(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(Am,r),Mm(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(Am,i)});const Hm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:a=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,s=De(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:l,document:c}=e;return(t,e,u)=>{const{color:f,lineWidth:d}=u,h=De(u,["color","lineWidth"]),{color:p=f,size:g=d,seriesColor:v,seriesX:m,seriesY:y}=e,b=Lm(l,e),x=Jl(l),w=r&&v?Tm(v,m,y,r,i,x):p,k=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},h),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(tc(l)){const t=l.getCenter();M=e=>Tl(Ol().curve(Sl)).angle((n,r)=>Cs(_s(e[r],t))).radius((n,r)=>Ns(e[r],t)).defined(([t,e])=>a(t)&&a(e)).curve(n)(e)}else M=Ol().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>a(t)&&a(e)).curve(n);const[O,E]=function(t,e){const n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,a),S=Ja(k,"connect"),A=!!E.length;if(!A||o&&!Object.keys(S).length)return Mm(c.createElement("path",{})).style("d",M(O)||[]).call(Am,k).node();if(A&&!o)return Mm(c.createElement("path",{})).style("d",M(t)).call(Am,k).node();return Mm(new Ym).style("style1",Object.assign(Object.assign({},k),S)).style("style2",k).style("d1",(_=E,_.map(M).join(","))).style("d2",M(t)).node();var _}};Hm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Vm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=tc(n)?Fl:wl;return Hm(Object.assign({curve:i},t),e)(...r)}};Vm.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"line"});const qm=(t,e)=>{const n=De(t,[]),{coordinate:r}=e;return(...t)=>{const i=tc(r)?Dl:Jl(r)?Xl:ql;return Hm(Object.assign({curve:i},n),e)(...t)}};qm.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"smooth"});const Xm=(t,e)=>Hm(Object.assign({curve:Ql},t),e);Xm.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"hv"});const Um=(t,e)=>Hm(Object.assign({curve:Zl},t),e);Um.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"vh"});const Km=(t,e)=>Hm(Object.assign({curve:Kl},t),e);function Zm(t,e,n,r,i){const a=Ps(_s(n,e)),o=a+Math.PI/2,s=[r/2*Math.cos(o),r/2*Math.sin(o)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],u=[r/2*Math.cos(a),r/2*Math.sin(a)],f=Ts(e,s),d=Ts(n,l),h=Ts(d,c),p=Ts(n,c),g=_s(p,l),v=_s(n,l),m=_s(e,s),y=_s(m,u),b=_s(e,u),x=_s(f,u);t.moveTo(...f),t.lineTo(...d),t.arcTo(...h,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...m),t.arcTo(...y,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Km.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"hvh"});const Qm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:a,color:o}=r,{color:s}=i,l=De(i,["color"]),c=ul();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=a[t],o=a[t+1];[...n,...r].every(Za)&&Zm(c,n,r,i,o)}return Mm(n.createElement("path",{})).call(Am,l).style("fill",o||s).style("d",c.toString()).call(Am,t).node()}};Qm.props=Object.assign(Object.assign({},Hm.props),{defaultMarker:"line"});const Jm=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];Jm.style=["fill"];const ty=Jm.bind(void 0);ty.style=["stroke","lineWidth"];const ey=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];ey.style=["fill"];const ny=ey.bind(void 0);ny.style=["fill"];const ry=ey.bind(void 0);ry.style=["stroke","lineWidth"];const iy=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};iy.style=["fill"];const ay=iy.bind(void 0);ay.style=["stroke","lineWidth"];const oy=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};oy.style=["fill"];const sy=oy.bind(void 0);sy.style=["stroke","lineWidth"];const ly=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};ly.style=["fill"];const cy=ly.bind(void 0);cy.style=["stroke","lineWidth"];const uy=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};uy.style=["fill"];const fy=uy.bind(void 0);fy.style=["stroke","lineWidth"];const dy=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};dy.style=["fill"];const hy=dy.bind(void 0);hy.style=["stroke","lineWidth"];const py=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];py.style=["stroke","lineWidth"];const gy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];gy.style=["stroke","lineWidth"];const vy=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];vy.style=["stroke","lineWidth"];const my=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];my.style=["stroke","lineWidth"];const yy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];yy.style=["stroke","lineWidth"];const by=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];by.style=["stroke","lineWidth"];const xy=by.bind(void 0);xy.style=["stroke","lineWidth"];const wy=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];wy.style=["stroke","lineWidth"];const ky=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];ky.style=["stroke","lineWidth"];const My=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];My.style=["stroke","lineWidth"];const Oy=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];Oy.style=["stroke","lineWidth"];const Ey=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];Ey.style=["stroke","lineWidth"];const Sy=new Map([["bowtie",dy],["cross",gy],["dash",xy],["diamond",iy],["dot",by],["hexagon",uy],["hollowBowtie",hy],["hollowDiamond",ay],["hollowHexagon",fy],["hollowPoint",ty],["hollowSquare",ry],["hollowTriangle",sy],["hollowTriangleDown",cy],["hv",ky],["hvh",Oy],["hyphen",yy],["line",py],["plus",my],["point",Jm],["rect",ny],["smooth",wy],["square",ey],["tick",vy],["triangleDown",ly],["triangle",oy],["vh",My],["vhv",Ey]]);function Ay(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function _y(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||ic(r)){const[[t,n],[r,i]]=e,a=Math.abs((r-t)/2),o=Math.abs((i-n)/2);return Math.max(0,(a+o)/2)}return i}const Ty=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,a=De(t,["colorAttribute","symbol","mode"]),o=Sy.get(Ay(r))||Sy.get("point"),{coordinate:s,document:l}=e;return(e,r,c)=>{const{lineWidth:u,color:f}=c,d=a.stroke?u||1:u,{color:h=f,transform:p,opacity:g}=r,[v,m]=jm(e),y=_y(i,e,r,s)||a.r||c.r;return Mm(l.createElement("path",{})).call(Am,c).style("fill","transparent").style("d",o(v,m,y)).style("lineWidth",d).style("transform",p).style("transformOrigin",`${v-y} ${m-y}`).style("stroke",h).style(Cm(t),g).style(n,h).call(Am,a).node()}};Ty.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ny=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);Ny.props=Object.assign({defaultMarker:"hollowBowtie"},Ty.props);const Py=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Py.props=Object.assign({defaultMarker:"hollowDiamond"},Ty.props);const Cy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);Cy.props=Object.assign({defaultMarker:"hollowHexagon"},Ty.props);const Ly=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Ly.props=Object.assign({defaultMarker:"hollowPoint"},Ty.props);const jy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);jy.props=Object.assign({defaultMarker:"hollowSquare"},Ty.props);const Ry=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Ry.props=Object.assign({defaultMarker:"hollowTriangle"},Ty.props);const Iy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Iy.props=Object.assign({defaultMarker:"hollowTriangleDown"},Ty.props);const Dy=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=De(t,["colorAttribute","mode"]),{coordinate:a,document:o}=e;return(e,s,l)=>{const{lineWidth:c,color:u}=l,f=i.stroke?c||1:c,{color:d=u,transform:h,opacity:p}=s,[g,v]=jm(e),m=_y(r,e,s,a)||i.r||l.r;return Mm(o.createElement("circle",{})).call(Am,l).style("fill","transparent").style("cx",g).style("cy",v).style("r",m).style("lineWidth",f).style("transform",h).style("transformOrigin",`${g} ${v}`).style("stroke",d).style(Cm(t),p).style(n,d).call(Am,i).node()}},By=(t,e)=>Dy(Object.assign({colorAttribute:"fill"},t),e);By.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Fy=(t,e)=>Dy(Object.assign({colorAttribute:"stroke"},t),e);Fy.props=Object.assign({defaultMarker:"hollowPoint"},By.props);const zy=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);zy.props=Object.assign({defaultMarker:"bowtie"},Ty.props);const Wy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Wy.props=Object.assign({defaultMarker:"cross"},Ty.props);const $y=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);$y.props=Object.assign({defaultMarker:"diamond"},Ty.props);const Gy=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Gy.props=Object.assign({defaultMarker:"hexagon"},Ty.props);const Yy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Yy.props=Object.assign({defaultMarker:"hyphen"},Ty.props);const Hy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Hy.props=Object.assign({defaultMarker:"line"},Ty.props);const Vy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Vy.props=Object.assign({defaultMarker:"plus"},Ty.props);const qy=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);qy.props=Object.assign({defaultMarker:"point"},Ty.props);const Xy=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Xy.props=Object.assign({defaultMarker:"square"},Ty.props);const Uy=(t,e)=>Ty(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Uy.props=Object.assign({defaultMarker:"tick"},Ty.props);const Ky=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Ky.props=Object.assign({defaultMarker:"triangle"},Ty.props);const Zy=(t,e)=>Ty(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Zy.props=Object.assign({defaultMarker:"triangleDown"},Ty.props);const Qy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=De(t,["arrow","arrowSize"]),{document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,l=De(o,["defaultColor"]),{color:c=s,transform:u}=e,[f,d]=t,h=ul();if(h.moveTo(...f),h.lineTo(...d),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*Ns(t,e):r,a=Math.PI/6,o=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-o-a,l=o-a;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(l),e[1]-i*Math.sin(l)]]}(f,d,{arrowSize:r});h.moveTo(...t),h.lineTo(...d),h.lineTo(...e)}return Mm(a.createElement("path",{})).call(Am,l).style("d",h.toString()).style("stroke",c).style("transform",u).call(Am,i).node()}};function Jy(t,e){e(t),t.children&&t.children.forEach(function(t){t&&Jy(t,e)})}function tb(t){nb(t,!0)}function eb(t){nb(t,!1)}function nb(t,e){var n=e?"visible":"hidden";Jy(t,function(t){t.attr("visibility",n)})}Qy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var rb=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,$e([],We(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(tg.INSERTED,function(){eb(r)}),r}return Re(e,t),e}(Ug);function ib(t){var e=t.appendChild(new rb({class:"offscreen"}));return eb(e),e}var ab=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=De(e,["style"]);return t.call(this,Ie({style:Ie({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return Re(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=ib(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(cv);function ob(t){return t*Math.PI/180}function sb(t){return Number((180*t/Math.PI).toPrecision(5))}var lb=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function cb(t,e){return y(t)?t.apply(void 0,$e([],We(e),!1)):t}var ub,fb,db,hb,pb=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map(function(t){var e=We(t,2),r=e[0],i=e[1],a=n(i);return[r,{name:a,class:".".concat(a),id:"#".concat(a),toString:function(){return a}}]}));return Object.assign(r,{prefix:n}),r},gb=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach(function(i){var a=We(i,2),o=a[0],s=a[1],l=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?A(s)?(A(t[o])||(l[o]={}),n<r?gb(t[o],s,n+1,r):l[o]=e[o]):x(s)?(l[o]=[],l[o]=l[o].concat(s)):l[o]=s:l[o]=s)})},vb=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)gb(t,e[r]);return t},mb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},yb=(fb=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return ub||(ub=Pg.offscreenCanvasCreator.getOrCreateContext(void 0)),ub.font=[a,o,i,"".concat(n,"px"),r].join(" "),ub.measureText(t).width},db=function(t,e){return[t,Object.values(e||bb(t)).join()].join("")},void 0===(hb=4096)&&(hb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=db?db.apply(this,t):t[0];Z.has(fb)||Z.set(fb,function(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}(hb));var r=Z.get(fb);if(r.has(n))return r.get(n);var i=fb.apply(this,t);return r.set(n,i),i}),bb=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,a=t.style.fontSize;return{fontSize:a="object"==typeof a?a.value:a,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function xb(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function wb(t,e){var n=xb(t);n&&n.attr(e)}function kb(t,e,n){void 0===n&&(n="..."),wb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Mb(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var a=n[0];return[a.clientX,a.clientY]}return r&&i?[r,i]:[0,0]}function Ob(t){var e=t.nativeEvent,n=t.touches,r=t.clientX,i=t.clientY;if(e)return[e.clientX,e.clientY];if(n){var a=n[0];return[a.clientX,a.clientY]}return"number"==typeof r&&"number"==typeof i?[r,i]:[0,0]}function Eb(t){return"function"==typeof t?t():L(t)||I(t)?new ab({style:{text:String(t)}}):t}function Sb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function Ab(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function _b(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var a=new Array(r),o=new Array(n),s=0;for(s=0;s<r;++s)a[s]=_b(t[s],e[s]);for(;s<n;++s)o[s]=e[s];for(s=0;s<r;++s)o[s]=a[s](i);return o}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach(function(e){var i=We(e,2),a=i[0],o=i[1];a in t?n[a]=_b(t[a],o):r[a]=o}),function(t){return Object.entries(n).forEach(function(e){var n=We(e,2),i=n[0],a=n[1];return r[i]=a(t)}),r}}(t,e):function(e){return t}}function Tb(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,l=o.y,c=We([s+o.width,l+o.height],2),u=c[0],f=c[1];s<e&&(e=s),l<n&&(n=l),u>r&&(r=u),f>i&&(i=f)}return new lb(e,n,r-e,i-n)}var Nb=function(t,e,n){var r=t.width,i=t.height,a=n.flexDirection,o=void 0===a?"row":a,s=n.justifyContent,l=void 0===s?"flex-start":s,c=n.alignItems,u=void 0===c?"flex-start":c,f="row"===o,d="row"===o||"column"===o,h=f?d?[1,0]:[-1,0]:d?[0,1]:[0,-1],p=We([0,0],2),g=p[0],v=p[1],m=e.map(function(t){var e,n=t.width,r=t.height,i=We([g,v],2),a=i[0],o=i[1];return e=We([g+n*h[0],v+r*h[1]],2),g=e[0],v=e[1],new lb(a,o,n,r)}),y=Tb(m),b={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},x=m.map(function(t){var e=t.x,n=t.y,r=lb.fromRect(t);return r.x=f?e+b[l]:e,r.y=f?n:n+b[l],r});Tb(x);var w=function(t){var e=We(f?["height",i]:["width",r],2),n=e[0],a=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return a-t[n];case"center":return a/2-t[n]/2}},k=x.map(function(t){var e=t.x,n=t.y,r=lb.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r}),M=k.map(function(e){var n,r,i=lb.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i});return M},Pb=function(t,e,n){return[]};function Cb(t,e){return[t[0]*e,t[1]*e]}function Lb(t,e){return[t[0]+e[0],t[1]+e[1]]}function jb(t,e){return[t[0]-e[0],t[1]-e[1]]}function Rb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Ib(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Db(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Bb(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Fb(t,e){return+t.toPrecision(e)}function zb(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Wb(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],a=0,o=t.length;a<o;a+=2)i.push([t[a],t[a+1]]);var s,l,c,u=function(t,e,n,r){var i,a,o,s,l,c,u=[],f=!!r,d=[1/0,1/0],h=[-1/0,-1/0];if(f){d=(i=We(r,2))[0],h=i[1];for(var p=0,g=t.length;p<g;p+=1)d=Rb(d,m=t[p]),h=Ib(h,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){a=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=Cb(y=jb(o=t[n?(p+1)%v:p+1],a),e);var b=Db(m,a),x=Db(m,o),w=b+x;0!==w&&(b/=w,x/=w);var k=Cb(y,-b),M=Cb(y,x);l=Lb(m,k),s=Rb(s=Lb(m,M),Ib(o,m)),s=Ib(s,Rb(o,m)),l=Rb(l=Lb(m,k=Cb(k=jb(s,m),-b/x)),Ib(a,m)),s=Lb(m,M=Cb(M=jb(m,l=Ib(l,Rb(a,m))),x/b)),f&&(l=Rb(l=Ib(l,d),h),s=Rb(s=Ib(s,d),h)),u.push(c),u.push(l),c=s}else l=m,u.push(c),u.push(l);else c=m}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,d=[];for(a=0;a<f-1;a+=1)s=u[2*a],l=u[2*a+1],c=i[a+1],d.push(["C",s[0],s[1],l[0],l[1],c[0],c[1]]);return r&&(s=u[f],l=u[f+1],c=We(i,1)[0],d.push(["C",s[0],s[1],l[0],l[1],c[0],c[1]])),d}var $b=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Gb(t){return $b.includes(t)}function Yb(t){var e={};for(var n in t)Gb(n)&&(e[n]=t[n]);return e}function Hb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,a=r.height,o=e/Math.max(i,a);return n&&(t.style.transform="scale(".concat(o,")")),o}var Vb=function(){function t(t,n,r,i,a,o,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===a&&(a=[null,null,null,null,null]),void 0===o&&(o=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var a=0;a<this._data.length;a++){var o=this._data[a],s=We(Array.isArray(o)?o:[o,null],2),l=s[0],c=s[1];(f=r(l,a)).__data__=l,null!==c&&(f.__fromElements__=c),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(a=0;a<this._elements.length;a++){var u=this._elements[a],f=r(l=u.__data__,a);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=Ge(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),a=Ge(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return a.attr("className",i),a},t.prototype.maybeAppendByName=function(t,n){var i=Ge(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,a;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var o=[],s=[],l=new Set(this._elements),c=[],u=new Set,f=new Map(this._elements.map(function(t,n){return[e(t.__data__,n),t]})),d=new Map(this._facetElements.map(function(t,n){return[e(t.__data__,n),t]})),h=function(t,e){var n=new Map;return t.forEach(function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)}),n}(this._elements,function(t){return r(t.__data__)}),p=0;p<t.length;p++){var g=t[p],v=e(g,p),m=r(g,p);if(f.has(v))(w=f.get(v)).__data__=g,w.__facet__=!1,s.push(w),l.delete(w),f.delete(v);else if(d.has(v)){(w=d.get(v)).__data__=g,w.__facet__=!0,s.push(w),d.delete(v)}else if(h.has(v)){var y=h.get(v);c.push([g,y]);try{for(var b=(i=void 0,ze(y)),x=b.next();!x.done;x=b.next()){var w=x.value;l.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}h.delete(v)}else if(f.has(m)){(w=f.get(m)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),l.delete(w)}else o.push(g)}var k=[new n([],o,this._parent,this._document),new n(s,null,this._parent,this._document),new n(l,null,this._parent,this._document),new n([],c,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,k)},t.prototype.merge=function(t){var e=$e($e([],We(this._elements),!1),We(t._elements),!1),r=$e($e([],We(this._transitions),!1),We(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var a=t(this._enter),o=e(this._update),s=n(this._exit),l=r(this._merge),c=i(this._split);return o.merge(a).merge(s).merge(l).merge(c)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then(function(){return n.remove()}):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each(function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))})},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each(function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))})},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each(function(n,r){var i=this;Object.entries(t).forEach(function(t){var a=We(t,2),o=a[0],s=a[1],l="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(o,l.call(i,n,r))})})},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each(function(e,r){t&&this.update&&this.update(n.call(this,e,r))})},t.prototype.transition=function(t){var e=new Array(this._elements.length);return this.each(function(n,r){e[r]=t.call(this,n,r)}),this._transitions=T(e),this},t.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,$e([this._parent,this],We(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var a="string"==typeof e?this.createElement(e):e();return r.appendChild(a),new n([a],null,this._parent,this._document)},t.registry={g:Ug,rect:sv,circle:Hg,path:nv,text:ab,ellipse:Xg,image:Qg,line:tv,polygon:iv,polyline:ov,html:Zg},t}();function qb(t){return new Vb([t],null,t,t.ownerDocument)}function Xb(t){if(I(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function Ub(t){var e=t.getLocalBounds(),n=We([e.min,e.max],2),r=We(n[0],2),i=r[0],a=r[1],o=We(n[1],2),s=o[0],l=o[1];return{x:i,y:a,width:s-i,height:l-a,left:i,bottom:l,top:a,right:s}}function Kb(t,e){var n=We(t,2),r=n[0],i=n[1],a=We(e,2),o=a[0],s=a[1];return r!==o&&i===s}function Zb(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Qb(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",a=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(a):a}var Jb=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function tx(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach(function(t){var i=We(t,2),a=i[0],o=i[1];if("className"===a||"class"===a);else if(Jb(a,"show")&&Jb(Qb(a,"show"),e)!==n)a===function(t,e){return"".concat(e).concat(Zb(t))}(e,"show")?r[a]=o:r[a.replace(new RegExp(Zb(e)),"")]=o;else if(!Jb(a,"show")&&Jb(a,e)!==n){var s=Qb(a,e);"filter"===s&&"function"==typeof o||(r[s]=o)}}),r}function ex(t,e){return Object.entries(t).reduce(function(t,n){var r=We(n,2),i=r[0],a=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=a:t["".concat(e).concat(Zb(i))]=a,t},{})}function nx(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach(function(t){var a=We(t,2),o=a[0],s=a[1];e.includes(o)||(-1!==n.indexOf(o)?i[o]=s:r[o]=s)}),[r,i]}function rx(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,a=r.height,o=We([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:a):t}),2);return[o[0],o[1]]}(t,n,r),")")});t.attr("transform",n)}catch(t){}}var ix=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,$e([],We(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach(function(e){return t.appendChild(e)}):t.appendChild(e)):t.innerHTML=""};function ax(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):t.length>2?[t[0]]:t.split("")}function ox(){nb(this,"hidden"!==this.attributes.visibility)}var sx=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,vb({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return Re(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=ib(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&ox.call(this)},e.prototype.update=function(t,e){var n;return this.attr(vb({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return De(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(qg),lx=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},cx=lx,ux=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},fx=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},dx=fx;var hx=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function px(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(y(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var gx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a,s=this.getSubShapeStyle(t),l=s.symbol,c=s.size,u=void 0===c?16:c,f=De(s,["symbol","size"]),d=px(l);Sb(!!d,qb(n),function(t){t.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call(function(t){if("image"===d){var n=2*u;t.styles({img:l,width:n,height:n,x:i-u,y:o-u})}else{n=u/2;var r=y(l)?l:e.getSymbol(l);t.styles(Ie({d:null==r?void 0:r(i,o,n)},f))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(sx);function vx(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function mx(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}gx.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),gx.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),gx.registerSymbol("line",ux),gx.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),gx.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),gx.registerSymbol("circle",lx),gx.registerSymbol("point",cx),gx.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),gx.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),gx.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),gx.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),gx.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),gx.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),gx.registerSymbol("line",ux),gx.registerSymbol("dot",fx),gx.registerSymbol("dash",dx),gx.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),gx.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),gx.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),gx.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),gx.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}),gx.registerSymbol("focus",function(t,e,n){var r=.2*n,i=.7*n;return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"],["M",t-i,e],["L",t-r,e],["M",t+r,e],["L",t+i,e],["M",t,e-i],["L",t,e-r],["M",t,e+r],["L",t,e+i]]});const yx=Math.sqrt(50),bx=Math.sqrt(10),xx=Math.sqrt(2);function wx(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=yx?10:a>=bx?5:a>=xx?2:1)*10**i:-(10**-i)/(a>=yx?10:a>=bx?5:a>=xx?2:1)}const kx=(t,e,n=5)=>{const r=[t,e];let i,a=0,o=r.length-1,s=r[a],l=r[o];return l<s&&([s,l]=[l,s],[a,o]=[o,a]),i=wx(s,l,n),i>0?(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,i=wx(s,l,n)):i<0&&(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,i=wx(s,l,n)),i>0?(r[a]=Math.floor(s/i)*i,r[o]=Math.ceil(l/i)*i):i<0&&(r[a]=Math.ceil(s*i)/i,r[o]=Math.floor(l*i)/i),r};function Mx(t){return!V(t)&&!H(t)&&!Number.isNaN(t)}function Ox(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Ex(t){const e=Ci.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a;return[255*Ox(o,a,e+1/3),255*Ox(o,a,e),255*Ox(o,a,e-1/3),i]}(r):null}const Sx=(t,e)=>n=>t*(1-n)+e*n,Ax=(t,e)=>"number"==typeof t&&"number"==typeof e?Sx(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Ex(t),r=Ex(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const a=n[i],o=r[i];e[i]=a*(1-t)+o*t}const[i,a,o,s]=e;return`rgba(${Math.round(i)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,_x=(t,e)=>{const n=Sx(t,e);return t=>Math.round(n(t))};function Tx({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Nx(t){return"object"==typeof t?t.valueOf():t}class Px extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Nx,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Tx({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Tx({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Cx{constructor(t){this.options=tt({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=tt({},this.options,t),this.rescale(t)}rescale(t){}}const Lx=Symbol("defaultUnknown");function jx(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Rx(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:a}=t;let o=i.get(e);if(void 0===o){if(a!==Lx)return a;o=n.push(e)-1,i.set(e,o)}return r[o%r.length]}function Ix(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Dx extends Cx{getDefaultOptions(){return{domain:[],range:[],unknown:Lx}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&jx(this.domainIndexMap,this.getDomain(),this.domainKey),Rx({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&jx(this.rangeIndexMap,this.getRange(),this.rangeKey),Rx({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Ix(e),this.rangeKey=Ix(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Dx(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Bx(t){return Math.round(1e12*t)/1e12}function Fx(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,l),[u,f]=n,d=f-u,h=d/(2/l*r+1-1/l*i),p=h*i/l,g=h-l*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),m=v.reduce((t,e)=>t+e),y=g/m,b=new Px(e.map((t,e)=>{const n=v[e]*y;return[t,o?Math.floor(n):n]})),x=new Px(e.map((t,e)=>{const n=v[e]*y+p;return[t,o?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(d-(w-w/l*i))*s;let M=o?Math.round(k):k;const O=new Array(l);for(let t=0;t<l;t+=1){O[t]=Bx(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class zx extends Dx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Lx,flex:[]}}constructor(t){super(t)}clone(){return new zx(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Fx(t);const{range:i,paddingOuter:a,paddingInner:o,round:s,align:l}=t;let c,u,f=i[0];const d=i[1]-f,h=2*a,p=r-o;c=d/Math.max(1,h+p),s&&(c=Math.floor(c)),f+=(d-c*(r-o))*l,u=c*(1-o),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*c);return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}const Wx=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=wx(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i},$x=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,l;return r<i?(s=mx(r,i),l=n(a,o)):(s=mx(i,r),l=n(o,a)),vx(l,s)},Gx=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,l=o?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=mx(s[t],s[t+1]),a[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}(t,e,1,r)-1,o=i[n];return vx(a[n],o)(e)}},Yx=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Gx:$x)(t,e,r?_x:n);class Hx extends Cx{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Sx,tickCount:5}}map(t){return Mx(t)?this.output(t):this.options.unknown}invert(t){return Mx(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return kx}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):dt}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:a}=this.options,o=Yx(n.map(t),r,a,i);this.output=vx(o,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,a=Yx(i,r.map(t),Sx);this.input=vx(e,n,a)}}class Vx extends Hx{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Ax,tickMethod:Wx,tickCount:5}}chooseTransforms(){return[dt,dt]}clone(){return new Vx(this.options)}}var qx=function(t){function e(e){var n=this,r=e.style,i=De(e,["style"]);return(n=t.call(this,tt({},{type:"column"},Ie({style:r},i)))||this).columnsGroup=new Ug({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return Re(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),qb(this.columnsGroup).selectAll(".column").data(e.flat()).join(function(t){return t.append("rect").attr("className","column").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.update=function(t){this.attr(vb({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Yg),Xx=function(t){function e(e){var n=this,r=e.style,i=De(e,["style"]);return(n=t.call(this,tt({},{type:"lines"},Ie({style:r},i)))||this).linesGroup=n.appendChild(new Ug),n.areasGroup=n.appendChild(new Ug),n.render(),n}return Re(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(vb({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){qb(this.linesGroup).selectAll(".line").data(t).join(function(t){return t.append("path").attr("className","line").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},e.prototype.renderAreas=function(t){qb(this.linesGroup).selectAll(".area").data(t).join(function(t){return t.append("path").attr("className","area").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.style(t)})},function(t){return t.remove()})},e}(Yg);function Ux(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map(function(t,e){return $e([e===n?"M":"L"],We(t),!1)});return e?r.reverse():r}function Kx(t,e){if(void 0===e&&(e=!1),t.length<=2)return Ux(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];rt(a,n.slice(-2))||n.push.apply(n,$e([],We(a),!1))}var o=Wb(n,!1);return e?o.unshift($e(["M"],We(t[r-1]),!1)):o.unshift($e(["M"],We(t[0]),!1)),o}function Zx(t,e,n){var r=U(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Qx(t){return 0===t.length?[0,0]:[P(F(t,function(t){return P(t)||0})),N(B(t,function(t){return N(t)||0}))]}function Jx(t){for(var e=U(t),n=e[0].length,r=We([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],a=r[1],o=0;o<e.length;o+=1)for(var s=e[o],l=0;l<n;l+=1)s[l]>=0?(s[l]+=i[l],i[l]=s[l]):(s[l]+=a[l],a[l]=s[l]);return e}var tw=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Re(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=U(t);return I(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?Jx(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=We(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=tx(this.attributes,"area"),o=tx(this.attributes,"line"),s=this.containerShape.width,l=this.data;if(0===l[0].length)return{lines:[],areas:[]};var c=this.scales,u=function(t,e){var n,r=e.x,i=e.y,a=We(i.getOptions().range||[0,0],2),o=a[0],s=a[1];return s>o&&(n=We([o,s],2),s=n[0],o=n[1]),t.map(function(t){return t.map(function(t,e){return[r.map(e),R(i.map(t),s,o)]})})}(l,{type:"line",x:c.x,y:c.y}),f=[];if(a){var d=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=t[i],o=Kx(a),s=void 0;if(0===i)s=Zx(o,e,n);else{var l=Kx(t[i-1],!0),c=a[0];l[0][0]="L",s=$e($e($e([],We(o),!1),We(l),!1),[$e(["M"],We(c),!1),["Z"]],!1)}r.push(s)}return r}(u,s,d):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=Ux(t[i]),o=void 0;if(0===i)o=Zx(a,e,n);else{var s=Ux(t[i-1],!0);s[0][0]="L",o=$e($e($e([],We(a),!1),We(s),!1),[["Z"]],!1)}r.push(o)}return r}(u,s,d):function(t,e,n,r){return t.map(function(t){return Zx(e?Kx(t):Ux(t),n,r)})}(u,i,s,d)}return{lines:u.map(function(e,n){return Ie({stroke:t.getColor(n),d:i?Kx(e):Ux(e)},o)}),areas:f.map(function(e,n){return Ie({d:e,fill:t.getColor(n)},a)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=tx(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,a=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=Jx(s));var l=this.createScales(s),c=l.x,u=l.y,f=We(Qx(s),2),d=f[0],h=f[1],p=new Vx({domain:[0,h-(d>0?0:d)],range:[0,o*a]}),g=c.getBandWidth(),v=this.rawData;return{columns:s.map(function(n,i){return n.map(function(n,a){var o=g/s.length;return Ie(Ie({fill:t.getColor(i)},e),r?{x:c.map(a),y:u.map(n),width:g,height:p.map(v[i][a])}:{x:c.map(a)+o*i,y:n>=0?u.map(n):u.map(0),width:o,height:p.map(Math.abs(n))})})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?qb(n).select(r):qb(n).append(i)).attr("className","container").node();var a=t.type,o=t.x,s=t.y,l="spark".concat(a),c=Ie({x:o,y:s},"line"===a?this.linesStyle:this.columnsStyle);qb(e).selectAll(".spark").data([a]).join(function(t){return t.append(function(t){return"line"===t?new Xx({className:l,style:c}):new qx({className:l,style:c})}).attr("className","spark ".concat(l))},function(t){return t.update(c)},function(t){return t.remove()})},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:y(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,a=r.scale,o=r.range,s=void 0===o?[]:o,l=r.spacing,c=this.containerShape,u=c.width,f=c.height,d=We(Qx(t),2),h=d[0],p=d[1],g=new Vx({domain:[null!==(e=s[0])&&void 0!==e?e:h,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-a)]});return"line"===i?{type:i,x:new Vx({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new zx({domain:t[0].map(function(t,e){return e}),range:[0,u],paddingInner:l,paddingOuter:l/2,align:.5}),y:g}},e.tag="sparkline",e}(sx);function ew(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(function(t){var n=We(t,1)[0];return!e.includes(n)}));return Object.fromEntries(e.map(function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,Ie(Ie({},t[e]),n)]:[e,n]}))}function nw(t,e){t?t.finished.then(e):e()}function rw(t,e){"update"in t?t.update(e):t.attr(e)}function iw(t,e,n){return 0===e.length?null:n?t.animate(e,n):(rw(t,{style:e.slice(-1)[0]}),null)}function aw(t,e,n){var r={},i={};return Object.entries(e).forEach(function(e){var n=We(e,2),a=n[0],o=n[1];if(!b(o)){var s=t.style[a]||t.parsedStyle[a]||0;s!==o&&(r[a]=s,i[a]=o)}}),n?iw(t,[r,i],Ie({fill:"both"},n)):(rw(t,i),null)}function ow(t,e){return t.style.opacity||(t.style.opacity=1),aw(t,{opacity:0},e)}var sw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},lw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},cw={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},uw=pb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),fw=pb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),dw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,a=void 0===i?10:i,o=t.radius,s=void 0===o?a/4:o,l=t.orientation,c=t.classNamePrefix,u=De(t,["x","y","size","radius","orientation","classNamePrefix"]),f=a,d=2.4*f,h=c?"".concat(fw.iconRect.name," ").concat(c,"handle-icon-rect"):fw.iconRect.name,p=function(t){return c?"".concat(fw.iconLine,"-").concat(t," ").concat(c,"handle-icon-line"):"".concat(fw.iconLine,"-").concat(t)},g=qb(e).maybeAppendByClassName(fw.iconRect,"rect").attr("className",h).styles(Ie(Ie({},u),{width:f,height:d,radius:s,x:n-f/2,y:r-d/2,transformOrigin:"center"})),v=n+1/3*f-f/2,m=n+2/3*f-f/2,y=r+1/4*d-d/2,b=r+3/4*d-d/2;g.maybeAppendByClassName("".concat(fw.iconLine,"-1"),"line").attr("className",p(1)).styles(Ie({x1:v,x2:v,y1:y,y2:b},u)),g.maybeAppendByClassName("".concat(fw.iconLine,"-2"),"line").attr("className",p(2)).styles(Ie({x1:m,x2:m,y1:y,y2:b},u)),"vertical"===l&&(g.node().style.transform="rotate(90)")},e}(sx),hw=function(t){function e(e){return t.call(this,e,cw)||this}return Re(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,a=n.showLabel,o=tx(this.attributes,"label"),s=o.x,l=void 0===s?0:s,c=o.y,u=void 0===c?0:c,f=o.transform,d=o.transformOrigin,h=We(nx(De(o,["x","y","transform","transformOrigin"]),[]),2),p=h[0],g=h[1],v=qb(t).maybeAppendByClassName(fw.labelGroup,"g").styles(g),m=Ie(Ie({},lw),p),y=m.text,b=De(m,["text"]);Sb(!!a,v,function(t){e.label=t.maybeAppendByClassName(fw.label,"text").styles(Ie(Ie({},b),{x:r+l,y:i+u,transform:f,transformOrigin:d,text:"".concat(y)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.type,o=e.classNamePrefix,s=Ie(Ie({x:n,y:r,orientation:i,classNamePrefix:o},sw),tx(this.attributes,"icon")),l=this.attributes.iconShape,c=void 0===l?function(){return new dw({style:s})}:l;qb(t).maybeAppendByClassName(fw.iconGroup,"g").selectAll(fw.icon.class).data([c]).join(function(t){return t.append("string"==typeof c?c:function(){return c(a)}).attr("className",fw.icon.name)},function(t){return t.update(s)},function(t){return t.remove()})},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(sx),pw=function(t){function e(e){var n=t.call(this,e,Ie(Ie(Ie({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},ex(cw,"handle")),ex(sw,"handleIcon")),ex(lw,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Ob(e));var r=n.availableSpace,i=r.x,a=r.y,o=n.getBBox(),s=o.x,l=o.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,a])-n.getOrientVal([+s,+l])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,a=e.type;t.stopPropagation();var o=n.getOrientVal(Ob(t)),s=o-n.prevPos;if(s){var l=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(l);break;case"end":r&&n.setValuesOffset(0,l);break;case"selection":r&&n.setValuesOffset(l,l);break;case"track":if(!i)return;n.selectionWidth+=l,"range"===a?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,a="range"===i?t:t[1],o="range"===i?n.getValues():n.getValues()[1],s=new Hp("valuechange",{detail:{oldValue:a,value:o}});n.dispatchEvent(s),null==r||r(o)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Re(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=tx(this.attributes,"sparkline");return Ie(Ie({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=We(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=We(Xb(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],a=this.shape;return{x:i,y:e,width:a.width-(i+n),height:a.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(uw.selection.class).each(function(n,r){aw(this,e[r],t)})},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&aw(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&aw(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=tx(this.attributes,"track");this.trackShape=qb(t).maybeAppendByClassName(uw.track,"rect").styles(Ie(Ie({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=qb(t).maybeAppendByClassName(uw.brushArea,"rect").styles(Ie({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Sb("horizontal"===n.orientation,qb(t).maybeAppendByClassName(uw.sparklineGroup,"g"),function(t){var n=Ie(Ie({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(uw.sparkline,function(){return new tw({style:n})}).update(n)})},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,a=r?"range"===i?["start","end"]:["end"]:[],o=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(uw.handle.class).data(a.map(function(t){return{type:t}}),function(t){return t.type}).join(function(t){return t.append(function(t){var n=t.type;return new hw({style:e.getHandleStyle(n)})}).each(function(t){var e=t.type;this.attr("class","".concat(uw.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");o[n]=this,this.addEventListener("pointerdown",o.onDragStart(e))})},function(t){return t.each(function(t){var e=t.type;this.update(o.getHandleStyle(e))})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");o[n]=void 0}).remove()})},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,a=e.selectionType;this.foregroundGroup=qb(t).maybeAppendByClassName(uw.foreground,"g");var o=tx(this.attributes,"selection"),s=function(t){return t.style("visibility",function(t){return t.show?"visible":"hidden"}).style("cursor",function(t){return"select"===a?"grab":"invert"===a?"crosshair":"default"}).styles(Ie(Ie({},o),{transform:"translate(".concat(n,", ").concat(r,")")}))},l=this;this.foregroundGroup.selectAll(uw.selection.class).data("value"===i?[]:this.calcSelectionArea().map(function(t,e){return{style:Ie({},t),index:e,show:"select"===a?1===e:1!==e}}),function(t){return t.index}).join(function(t){return t.append("rect").attr("className",uw.selection.name).call(s).each(function(t,e){var n=this;1===e?(l.selectionShape=qb(this),this.on("pointerdown",function(t){n.attr("cursor","grabbing"),l.onDragStart("selection")(t)}),l.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),l.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),l.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){n.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){n.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){n.attr("cursor","pointer")})):this.on("pointerdown",l.onDragStart("track"))})},function(t){return t.call(s)},function(t){return t.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=We(this.range,2),i=r[0],a=r[1],o=We(this.getValues().map(function(t){return Fb(t,e)}),2),s=o[0],l=o[1],c=We(((Array.isArray(t)?t:[s,null!=t?t:l])||[s,l]).map(function(t){return Fb(t,e)}),2),u=c[0],f=c[1];if("value"===this.attributes.type)return[0,R(f,i,a)];u>f&&(u=(n=We([f,u],2))[0],f=n[1]);var d=f-u;return d>a-i?[i,a]:u<i?s===i&&l===f?[i,f]:[i,d+i]:f>a?l===a&&s===u?[u,a]:[a-d,a]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=We(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,a=i.x,o=i.y,s=i.width,l=i.height;return this.getOrientVal([[{y:o,height:l,x:a,width:n*s},{y:o,height:l,x:n*s+a,width:(r-n)*s},{y:o,height:l,x:r*s,width:(1-r)*s}],[{x:a,width:s,y:o,height:n*l},{x:a,width:s,y:n*l+o,height:(r-n)*l},{x:a,width:s,y:r*l,height:(1-r)*l}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,a=n.width,o=n.height,s=We(this.clampValues(),2),l=s[0],c=s[1],u="start"===t?-e:e,f=("start"===t?l:c)*this.getOrientVal([a,o])+u;return{x:r+this.getOrientVal([f,a/2]),y:i+this.getOrientVal([o/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,a=n.formatter,o=n.autoFitLabel,s=tx(this.attributes,"handle"),l=tx(s,"label"),c=s.spacing,u=this.getHandleSize(),f=this.clampValues(),d=a("start"===t?f[0]:f[1]),h=new ab({style:Ie(Ie(Ie({},l),this.inferTextStyle(t)),{text:d})}),p=h.getBBox(),g=p.width,v=p.height;if(h.destroy(),!o){if("value"===r)return{text:d,x:0,y:-v-c};var m=c+u+("horizontal"===i?g/2:0);return(e={text:d})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,w=x.width,k=x.height,M=this.calcSelectionArea()[1],O=M.x,E=M.y,S=M.width,A=M.height,_=c+u;if("horizontal"===i){var T=_+g/2;if("start"===t)y=O-_-g>0?-T:T;else y=w-O-S-_>g?T:-T}else{var N=v+_;b="start"===t?E-u>v?-N:_:k-(E+A)-u>v?N:-_}return{x:y,y:b,text:d}},e.prototype.getHandleLabelStyle=function(t){var e=tx(this.attributes,"handleLabel");return Ie(Ie(Ie({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=tx(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Ie({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,a=e.showLabelOnInteraction,o=e.orientation,s=this.calcHandlePosition(t),l=s.x,c=s.y,u=this.calcHandleText(t),f=i;return!i&&a&&(f=!!this.target),Ie(Ie(Ie({},ex(this.getHandleIconStyle(),"icon")),ex(Ie(Ie({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(l+n,", ").concat(c+r,")"),orientation:o,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=We(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e){void 0===e&&(e=0);var n=this.attributes.type,r=We(this.getValues(),2),i=[r[0]+("range"===n?t:0),r[1]+e].sort();this.innerSetValues(i,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new Hp(n,{detail:t}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r)}},e.tag="slider",e}(sx),gw=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Hp("scroll",r)),n.dispatchEvent(new Hp("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=We(n.getLocalPosition(),2),r=e[0],i=e[1],a=We(n.padding,4),o=a[0],s=a[3],l=n.getOrientVal([r+s,i+o]),c=(n.getOrientVal(Mb(t))-l)/n.trackLength;n.setValue(c,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Hp("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Hp("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Hp("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Hp("trackMouseleave",{detail:t.detail}))},n}return Re(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Xb(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=We(this.range,2),n=e[0],r=e[1];return R(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=We(this.padding,4),r=n[0],i=n[1],a=n[2],o=n[3],s=We(this.getOrientVal([[e,t],[t,e]]),2);return{x:o,y:r,width:+s[0]-(o+i),height:+s[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,a=r.height;return n||this.getOrientVal([a,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=We(this.range,2),i=r[0],a=t*(r[1]-i-n);return[a,a+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.trackSize,o=e.padding,s=e.slidable,l=tx(this.attributes,"track"),c=tx(this.attributes,"thumb"),u=Ie(Ie({x:n,y:r,brushable:!1,orientation:i,padding:o,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:a,values:this.getValues()},ex(l,"track")),ex(c,"selection"));this.slider=qb(t).maybeAppendByClassName("scrollbar",function(){return new pw({style:u})}).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=We(this.range,2),i=r[0],a=r[1];this.slider.setValues(this.getValues(R(t,i,a)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",function(e){e.stopPropagation(),t.onTrackClick(e.detail)}),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(sx),vw="grid-group",mw="main-group",yw="line-group",bw="tick-group",xw="label-group",ww="title-group",kw="grid",Mw="line",Ow="line-first",Ew="line-second",Sw="tick",Aw="tick-item",_w="label",Tw="label-item",Nw="title",Pw={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new nv({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};tt({},Pw,{style:{type:"arc"}}),tt({},Pw,{style:{}});var Cw=pb({mainGroup:mw,gridGroup:vw,grid:kw,lineGroup:yw,line:Mw,tickGroup:bw,tick:Sw,tickItem:Aw,labelGroup:xw,label:_w,labelItem:Tw,titleGroup:ww,title:Nw,lineFirst:Ow,lineSecond:Ew},"axis"),Lw=pb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function jw(t){return t.reduce(function(t,e,n){return t.push($e([0===n?"M":"L"],We(e),!1)),t},[])}function Rw(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,a=e.center;if("line"===i)return jw(t);if(!a)return[];var o=Db(t[0],a),s=n?0:1;return t.reduce(function(t,e,n){return 0===n?t.push($e(["M"],We(e),!1)):t.push($e(["A",o,o,0,0,s],We(e),!1)),t},[])}(t,e,n):jw(t)}function Iw(t,e,n){var r=n.type,i=n.connect,a=n.center,o=n.closed?[["Z"]]:[],s=We([Rw(t,n),Rw(e.slice().reverse(),n,!0)],2),l=s[0],c=s[1],u=We([t[0],e.slice(-1)[0]],2),f=u[0],d=u[1],h=function(t,e){return[l,t,c,e,o].flat()};if("line"===i||"surround"===r)return h([$e(["L"],We(d),!1)],[$e(["L"],We(f),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=We([Db(d,a),Db(f,a)],2),g=p[0],v=p[1];return h([$e(["A",g,g,0,0,1],We(d),!1),$e(["L"],We(d),!1)],[$e(["A",v,v,0,0,0],We(f),!1),$e(["L"],We(f),!1)])}var Dw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.render=function(t,e){var n=De(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map(function(t){var e=t.points,n=We(e,1)[0];return Ie(Ie({},t),{points:$e($e([],We(e),!1),[n],!1)})}):n}(t),i=qb(e).maybeAppendByClassName(Lw.lineGroup,"g"),a=qb(e).maybeAppendByClassName(Lw.regionGroup,"g"),o=function(t,e,n,r){var i=n.animate,a=n.isBillboard,o=e.map(function(t,e){return{id:t.id||"grid-line-".concat(e),d:Rw(t.points,n)}});return t.selectAll(Lw.line.class).data(o,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){var n=cb(Yb(Ie({d:t.d},r)),[t,e,o]);this.attr(Ie({class:Lw.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))})},function(t){return t.transition(function(t,e){return aw(this,cb(Yb(Ie({d:t.d},r)),[t,e,o]),i.update)})},function(t){return t.transition(function(){var t=this,e=ow(this,i.exit);return nw(e,function(){return t.remove()}),e})}).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(t){return o[t%o.length]},l=[],c=0;c<e.length-1;c++){var u=We([e[c].points,e[c+1].points],2),f=Iw(u[0],u[1],n);l.push({d:f,fill:s(c)})}return t.selectAll(Lw.region.class).data(l,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){var n=cb(t,[t,e,l]);this.attr(n)}).attr("className",Lw.region.name)},function(t){return t.transition(function(t,e){return aw(this,cb(t,[t,e,l]),r.update)})},function(t){return t.transition(function(){var t=this,e=ow(this,r.exit);return nw(e,function(){return t.remove()}),e})}).transitions()}(a,r,t);return $e($e([],We(o),!1),We(s),!1)},e}(sx);function Bw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){var n=We(t,2);return[n[0],cb(n[1],e)]}))}function Fw(t,e){return e&&y(e)?t.filter(e):t}function zw(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Ww(t,e){if("linear"===e.type){var n=We(e.startPos,2),r=n[0],i=n[1],a=We(e.endPos,2),o=We([a[0]-r,a[1]-i],2);return Bb([o[0],o[1]])}var s=ob(zw(t,e));return[-Math.sin(s),Math.cos(s)]}function $w(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Ww(t,n),"positive"!==e)}function Gw(t,e){return $w(t,e.labelDirection,e)}function Yw(t,e,n){return n?"".concat(t," ").concat(n,"axis-").concat(e):t}function Hw(t,e,n,r){return r&&t.attr("className",Yw(e.name,n,r)),t}function Vw(t,e){return"linear"===e.type?function(t,e){var n=We(e.startPos,2),r=n[0],i=n[1],a=We(e.endPos,2),o=We([a[0]-r,a[1]-i],2);return[r+o[0]*t,i+o[1]*t]}(t,e):function(t,e){var n=e.radius,r=We(e.center,2),i=r[0],a=r[1],o=ob(zw(t,e));return[i+n*Math.cos(o),a+n*Math.sin(o)]}(t,e)}function qw(t){return 0===Ww(0,t)[1]}function Xw(t){return 0===Ww(0,t)[0]}function Uw(t,e){return e-t===360}function Kw(t,e,n,r,i){var a=e-t,o=We([i,i],2),s=o[0],l=o[1],c=We([ob(t),ob(e)],2),u=c[0],f=c[1],d=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},h=We(d(u),2),p=h[0],g=h[1],v=We(d(f),2),m=v[0],y=v[1];if(Uw(t,e)){var b=We(d((f+u)/2),2);return[["M",p,g],["A",s,l,0,1,0,b[0],b[1]],["A",s,l,0,1,0,m,y]]}var x=a>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(l,",0,").concat(x,",").concat(w,",").concat(m,",").concat(y)}function Zw(t,e,n,r){var i=e.startAngle,a=e.endAngle,o=e.center,s=e.radius,l=e.classNamePrefix;return t.selectAll(Cw.line.class).data([{d:Kw.apply(void 0,$e($e([i,a],We(o),!1),[s],!1))}],function(t,e){return e}).join(function(t){var n=t.append("path").attr("className",Cw.line.name).styles(e).styles({d:function(t){return t.d}});return Hw(n,Cw.line,Mw,l),n},function(t){return t.transition(function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,a=void 0===i?0:i,o=_b(e,n),s=Math.ceil(+a/16),l=new Array(s).fill(0).map(function(t,e,n){return{__keyframe_data__:o(e/(n.length-1))}});return t.animate(l,Ie({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,a=e.radius;return $e($e([n,r],We(i),!1),[a],!1)}(this),$e($e([i,a],We(o),!1),[s],!1),r.update);if(e){var n=function(){var e=at(t.attributes,"__keyframe_data__");t.style.d=Kw.apply(void 0,$e([],We(e),!1))};e.onframe=n,e.onfinish=n}return e}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function Qw(t){var e=We(t,2),n=We(e[0],2),r=n[0],i=n[1],a=We(e[1],2);return{x1:r,y1:i,x2:a[0],y2:a[1]}}function Jw(t,e,n,r){var i=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,l=e.lineExtension,c=e.classNamePrefix,u=We([a,o],2),f=We(u[0],2),d=f[0],h=f[1],p=We(u[1],2),g=p[0],v=p[1],m=We(l?function(t,e,n){void 0===n&&(n=[0,0]);var r=We([t,e,n],3),i=We(r[0],2),a=i[0],o=i[1],s=We(r[1],2),l=s[0],c=s[1],u=We(r[2],2),f=u[0],d=u[1],h=We([l-a,c-o],2),p=h[0],g=h[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=We([-f/v,d/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(a,o,l):new Array(4).fill(0),4),y=m[0],b=m[1],x=m[2],w=m[3],k=function(e){return t.selectAll(Cw.line.class).data(e,function(t,e){return e}).join(function(t){var e=t.append("line").styles(n).transition(function(t){return aw(this,Qw(t.line),!1)});return e.attr("className",function(t){if(!c)return"".concat(Cw.line.name," ").concat(t.className);var e=Yw(Cw.line.name,Mw,c);if(t.className===Cw.lineFirst.name){var n=Yw(Cw.lineFirst.name,Ow,c);return"".concat(e," ").concat(n)}if(t.className===Cw.lineSecond.name){n=Yw(Cw.lineSecond.name,Ew,c);return"".concat(e," ").concat(n)}return e}),e},function(t){return t.styles(n).transition(function(t){return aw(this,Qw(t.line),r.update)})},function(t){return t.remove()}).transitions()};if(!i||!s)return k([{line:[[d+y,h+b],[g+x,v+w]],className:Cw.line.name}]);var M=We(s,2),O=M[0],E=M[1],S=g-d,A=v-h,_=We([d+S*O,h+A*O],2),T=_[0],N=_[1],P=We([d+S*E,h+A*E],2),C=P[0],L=P[1];return k([{line:[[d+y,h+b],[T,N]],className:Cw.lineFirst.name},{line:[[C,L],[g+x,v+w]],className:Cw.lineSecond.name}])}function tk(t,e,n){var r,i=e.type,a=tx(e,"line");return r="linear"===i?Jw(t,e,zb(a,"arrow"),n):Zw(t,e,zb(a,"arrow"),n),function(t,e,n,r){var i,a=n.showArrow,o=n.showTrunc,s=n.lineArrow,l=n.lineArrowOffset,c=n.lineArrowSize;if(i="arc"===e?t.select(Cw.line.class):o?t.select(Cw.lineSecond.class):t.select(Cw.line.class),!a||!s||"arc"===n.type&&Uw(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Eb(s);f.attr(r),Hb(f,c,!0),i.style("markerEnd",f).style("markerEndOffset",-l)}}(t,i,e,a),r}function ek(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function nk(t,e){var n=e.gridLength;return t.map(function(t,r){var i=t.value,a=We(Vw(i,e),2),o=a[0],s=a[1],l=We(Cb(function(t,e){return $w(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[o,s],[o+l[0],s+l[1]]]}})}function rk(t,e,n,r){var i=n.classNamePrefix,a=tx(n,"grid"),o=a.type,s=a.areaFill,l=ek(n),c=Fw(e,n.gridFilter),u="segment"===o?nk(c,n):function(t,e){var n=e.gridControlAngles,r=ek(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=We(r,2),a=i[0],o=i[1];return t.map(function(t,r){var i=We(Vw(t.value,e),2),s=i[0],l=i[1],c=We([s-a,l-o],2),u=c[0],f=c[1],d=[];return n.forEach(function(t){var e=ob(t),n=We([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+a,l=u*i+f*r+o;d.push([s,l])}),{points:d,id:r}})}(c,n),f=Ie(Ie({},a),{center:l,areaFill:y(s)?c.map(function(t,e){return cb(s,[t,e,c])}):s,animate:r,data:u});return t.selectAll(Cw.grid.class).data([1]).join(function(t){var e=t.append(function(){return new Dw({style:f})}).attr("className",Cw.grid.name);return Hw(e,Cw.grid,kw,i),e},function(t){return t.transition(function(){return this.update(f)})},function(t){return t.remove()}).transitions()}var ik=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=Math.cos(t),c=Math.sin(t),u=e-e*l+n*c,f=n-e*c-n*l;return[[l*i-c*s+u,c*i+l*s+f],[l*o-c*s+u,c*o+l*s+f],[l*i-c*a+u,c*i+l*a+f],[l*o-c*a+u,c*o+l*a+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function ak(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=We(r.min,2),a=i[0],o=i[1],s=We(r.max,2),l=s[0],c=s[1],u=t.getBBox(),f=u.width,d=u.height,h=0,p=0,g=a,v=o,m=xb(t);if(m){d-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(a+l)/2:"right"!==y&&"end"!==y||(g=l),"middle"===b?v=(o+c)/2:"bottom"===b&&(v=c)}var x=We(Xb(e),4),w=x[0],k=void 0===w?0:w,M=x[1],O=void 0===M?0:M,E=x[2],S=void 0===E?k:E,A=x[3],_=new ik((h+=a)-(void 0===A?O:A),(p+=o)-k,h+f+O,p+d+S);return t.setEulerAngles(n),_.rotatedPoints(ob(n),g,v)}function ok(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function sk(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function lk(t,e){var n=sk(t[0],t[1],e[0]),r=sk(t[0],t[1],e[1]),i=sk(e[0],e[1],t[0]),a=sk(e[0],e[1],t[1]);return n!==r&&i!==a||(!(0!==n||!ok(t,e[0]))||(!(0!==r||!ok(t,e[1]))||(!(0!==i||!ok(e,t[0]))||!(0!==a||!ok(e,t[1])))))}function ck(t,e){return e.every(function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r=[e,[9999,e[1]]],i=0,a=0;do{var o=[t[a],t[(a+1)%n]];if(lk(o,r)){if(0===sk(o[0],e,o[1]))return ok(o,e);i++}a=(a+1)%n}while(0!==a);return!!(1&i)}(t,e)})}function uk(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return function(t,e){var n=We(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s=We(e,4),l=s[0],c=s[1],u=a-r,f=o-i,d=s[2]-l,h=s[3]-c,p=u*h-d*f;if(0===p)return!1;var g=p>0,v=r-l,m=i-c,y=u*m-f*v;if(y<0===g)return!1;var b=d*m-h*v;return b<0!==g&&y>p!==g&&b>p!==g}(e,t)})}function fk(t,e,n){var r,i,a=e.crossPadding,o=new Set,s=null,l=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var a=t.center,o=t.radius,s=We(a,2),l=s[0],c=s[1],u="negative"===r?0:i,f=-o-u,d=o+u,h=We(Xb(e),4),p=h[0],g=h[1],v=h[2],m=h[3];return new ik(l+f-m,c+f-p,l+d+g,c+d+v)}var y=We(t.startPos,2),b=y[0],x=y[1],w=We(t.endPos,2),k=w[0],M=w[1],O=We(Xw(t)?[-e,0,e,0]:[0,e,0,-e],4),E=O[0],S=O[1],A=O[2],_=O[3],T=Cb(Gw(0,t),i),N=new ik(b,x,k,M);return N.x1+=_,N.y1+=E,N.x2+=S+T[0],N.y2+=A+T[1],N}(e,a),c=function(t){return!l||function(t,e,n){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;return ck([[r,a],[i,a],[i,o],[r,o]],ak(e,n))}(l,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,a=ak(t,n).flat(1),o=ak(e,n).flat(1),s=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var l=ze(s),c=l.next();!c.done;c=l.next())if(uk(o,c.value))return!0}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,Xb(n))};try{for(var f=ze(t),d=f.next();!d.done;d=f.next()){var h=d.value;c(h)?!s||u(s,h)?s=h:(o.add(s),o.add(h)):o.add(h)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(o)}function dk(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(yb(t,e))}var hk=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter(function(t,e){return!(e%r)||(eb(t),!1)})},pk=function(t){return t.filter(mb)};var gk=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c=hk,u=function(t){return t.forEach(r.show),t},f=2,d=t.slice(),h=t.slice(),p=Math.min.apply(Math,$e([1],We(t.map(function(t){return t.getBBox().width})),!1));if("linear"===n.type&&(qw(n)||Xw(n))){var g=Ub(t[0]).left,v=Ub(t[i-1]).right,m=Math.abs(v-g)||1;f=Math.max(Math.floor(i*p/m),f)}for(a&&(s=d.splice(0,1)[0]),o&&(l=d.splice(-1,1)[0],d.reverse()),u(d);f<t.length&&fk(pk(l?$e($e([l],We(h),!1),[s],!1):$e([s],We(h),!1)),n,null==e?void 0:e.margin).length;){if(l&&!s&&f%2==0)d.splice(0,1).forEach(r.hide);else if(l&&s){d.splice(0,1).forEach(r.hide)}h=c(u(d),{seq:f}),f++}}}],["rotate",function(t,e,n,r){var i,a,o=e.optionalAngles,s=void 0===o?[0,45,90]:o,l=e.margin,c=e.recoverWhenFailed,u=void 0===c||c,f=t.map(function(t){return t.getLocalEulerAngles()}),d=function(){return fk(t,n,l).length<1},h=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)})};try{for(var p=ze(s),g=p.next();!g.done;g=p.next()){if(h(g.value),d())return}}catch(t){i={error:t}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}u&&h(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=0)){var i=e.suffix,a=void 0===i?"...":i,o=e.minLength,s=e.maxLength,l=void 0===s?1/0:s,c=e.step,u=void 0===c?" ":c,f=e.margin,d=void 0===f?[0,0,0,0]:f,h=bb(r.getTextShape(t[0])),p=dk(u,h),g=o?dk(o,h):p,v=dk(l,h);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map(function(t){return t.getBBox().width})));var m=t.slice();We(d,4);for(var y=function(e){if(m.forEach(function(t){r.ellipsis(r.getTextShape(t),e,a)}),(m=fk(t,n,d)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var w=y(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r,i){var a,o=e.maxLines,s=void 0===o?3:o,l=e.recoverWhenFailed,c=void 0===l||l,u=e.margin,f=void 0===u?[0,0,0,0]:u,d=cb(null!==(a=e.wordWrapWidth)&&void 0!==a?a:50,[i]),h=t.map(function(t){return t.attr("maxLines")||1}),p=Math.min.apply(Math,$e([],We(h),!1)),g=function(){return fk(t,n,f).length<1},v=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&qw(t)?"negative"===n?"bottom":"top":"middle"}(n),m=function(e){return t.forEach(function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,d,i,v)})};if(!(p>s)){if("linear"===n.type&&qw(n)){if(m(s),g())return}else for(var y=p;y<=s;y++)if(m(y),g())return;c&&m(h)}}]]);function vk(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*function(t){return"positive"===t?-1:1}(e)},1)}function mk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function yk(t,e){var n=We(t,2),r=n[0],i=n[1],a=We(e,2),o=a[0],s=a[1],l=We([r*o+i*s,r*s-i*o],2),c=l[0],u=l[1];return Math.atan2(u,c)}function bk(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var a=Gw(t.value,n),o=Ww(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Ab(e,-90,90)||(e+=180),e}(sb("perpendicular"===i?yk([1,0],a):yk([o[0]<0?-1:1,0],o)))}function xk(t,e,n){var r=n.type,i=n.labelAlign,a=Gw(t,n),o=mk(e),s=mk(sb(yk([1,0],a))),l="center",c="middle";return"linear"===r?[90,270].includes(s)&&0===o?(l="center",c=1===a[1]?"top":"bottom"):s%180||![90,270].includes(o)?0===s?(Ab(o,0,90,!1,!0)||Ab(o,0,90)||Ab(o,270,360))&&(l="start"):90===s?Ab(o,0,90,!1,!0)?l="start":(Ab(o,90,180)||Ab(o,270,360))&&(l="end"):270===s?Ab(o,0,90,!1,!0)?l="end":(Ab(o,90,180)||Ab(o,270,360))&&(l="start"):180===s&&(90===o?l="start":(Ab(o,0,90)||Ab(o,270,360))&&(l="end")):l="center":"parallel"===i?c=Ab(s,0,180,!0)?"top":"bottom":"horizontal"===i?Ab(s,90,270,!1)?l="end":(Ab(s,270,360,!1)||Ab(s,0,90))&&(l="start"):"perpendicular"===i&&(l=Ab(s,90,270)?"end":"start"),{textAlign:l,textBaseline:c}}function wk(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),c=cb(s,[t,l,e]),u=We([Gw(t.value,n),vk(o,a)],2),f=We(Lb(Cb(u[0],c+(1===u[1]?cb(r?i:0,[t,l,e]):0)),Vw(t.value,n)),2);return{x:f[0],y:f[1]}}function kk(t,e,n,r){var i=r.labelRender,a=(at(r,"endPos.0",400)-at(r,"startPos.0",0))/n.length,o=y(i)?cb(i,[t,e,n,Gw(t.value,r)]):t.label||"",s=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body.firstElementChild;if(console.log(null==e?void 0:e.getClientRects(),11),!e)return 0;var n=e.getAttribute("style")||"",r=Object.fromEntries(n.split(";").map(function(t){return t.trim()}).filter(function(t){return t.includes(":")}).map(function(t){var e=We(t.split(":").map(function(t){return t.trim()}),2),n=e[0],r=e[1];return[n.toLowerCase(),r]})),i=function(t){if(!t)return 0;var e=t.match(/([\d.]+)px/);return e?parseFloat(e[1]):0};if(r.height)return i(r.height);var a,o=i(r["font-size"])||16,s=r["line-height"];a=s&&"normal"!==s?s.endsWith("px")?i(s):/^[\d.]+$/.test(s)?parseFloat(s)*o:o:1.2*o;var l=i(r["padding-top"]),c=i(r["padding-bottom"]);r.padding&&(1===(u=r.padding.split(/\s+/).map(i)).length||2===u.length?(l=u[0],c=u[0]):(3===u.length||4===u.length)&&(l=u[0],c=u[2]));var u,f=i(r["border-top-width"]),d=i(r["border-bottom-width"]);if(r.border){var h=r.border.match(/([\d.]+)px/);h&&(f=parseFloat(h[1]),d=parseFloat(h[1]))}return r["border-width"]&&(1===(u=r["border-width"].split(/\s+/).map(i)).length||2===u.length?(f=u[0],d=u[0]):(3===u.length||4===u.length)&&(f=u[0],d=u[2])),a+l+c+f+d}(o)||30;return function(){return e={width:a,height:s},"function"==typeof(t=o)?t():L(t)||I(t)?new Zg({style:Ie(Ie({pointerEvents:"auto"},e),{innerHTML:t})}):t;var t,e}}var Mk={html:["fill"],text:[]};function Ok(t,e){["text","html"].includes(t.nodeName)&&t.attr(zb(e,Mk[t.nodeName]))}function Ek(t,e){!function(t,e,n,r){var i=e.labelOverlap,a=void 0===i?[]:i;a.length&&a.forEach(function(i){var a=i.type,o=gk.get(a);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some(function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||t.filter(function(t){return t.querySelector("text")}).length>=1)})(t,e,a)&&(null==o||o(t,i,e,r,n))})}(this.node().childNodes,t,e,{hide:eb,show:tb,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=xk(e.__data__.value,t,n),i=e.querySelector(Cw.labelItem.class);i&&Ok(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&kb(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),wb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector(Cw.labelItem.class)}})}function Sk(t,e,n,r,i){var a=n.indexOf(e),o=i.labelRender,s=i.classNamePrefix,l=qb(t).append(o?kk(e,a,n,i):function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return Eb(cb(i,[t,e,n,Gw(t.value,r)]))}:function(){return Eb(t.label||"")}}(e,a,n,i)).attr("className",Cw.labelItem.name).node();Hw(qb(l),Cw.labelItem,Tw,s);var c=We(nx(Bw(r,[e,a,n])),2),u=c[0],f=c[1],d=f.transform,h=De(f,["transform"]);rx(l,d);var p=bk(e,l,i);if(l.getLocalEulerAngles()||l.setLocalEulerAngles(p),Ok(l,Ie(Ie({},xk(e.value,p,i)),u)),"html"===l.nodeName){var g=l.getBBox(),v=l.style.x||0;l.attr("x",v-g.width/2)}return t.attr(h),l}function Ak(t,e,n,r,i){var a,o,s,l=n.classNamePrefix,c=Fw(e,n.labelFilter),u=tx(n,"label"),f=t.selectAll(Cw.label.class).data(c,function(t,e){return e}).join(function(t){var r=t.append("g").attr("className",Cw.label.name).transition(function(t){Sk(this,t,e,u,n);var r=wk(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null});return Hw(r,Cw.label,_w,l),r},function(t){return t.transition(function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&eb(t),e.isVisible()&&tb(e)};if(!n)return i(),[null];var a=n.duration,o=void 0===a?0:a,s=n.delay,l=void 0===s?0:s,c=Math.ceil(+o/2),u=+o/4,f=We(t.getGeometryBounds().center,2),d=f[0],h=f[1],p=We(e.getGeometryBounds().center,2),g=We([(d+p[0])/2-d,(h+p[1])/2-h],2),v=g[0],m=g[1],y=t.style.opacity,b=void 0===y?1:y,x=e.style.opacity,w=void 0===x?1:x,k=t.style.transform||"",M=e.style.transform||"",O=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(k)},{opacity:0,transform:"translate(".concat(v,", ").concat(m,") ").concat(k)}],Ie(Ie({fill:"both"},n),{duration:l+c+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-m,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Ie(Ie({fill:"both"},n),{duration:c+u,delay:l+c-u}));return nw(E,i),[O,E]}(this.querySelector(Cw.labelItem.class),Sk(this,t,e,u,n),r.update),a=wk(t,e,n),o=a.x,s=a.y,l=aw(this,{transform:"translate(".concat(o,", ").concat(s,")")},r.update);return $e($e([],We(i),!1),[l],!1)})},function(t){return a=t,t.transition(function(){var t=this,e=ow(this.childNodes[0],r.exit);return nw(e,function(){return qb(t).remove()}),e}),a}).transitions();return s=function(){Ek.call(t,n,i)},0===(o=f).length?s():Promise.all(o.map(function(t){return null==t?void 0:t.finished})).then(s),f}function _k(t,e){return $w(t,e.tickDirection,e)}function Tk(t,e,n,r,i){var a=We(function(t,e){var n=We(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,cb(i.tickLength,[t,e,n])),2),o=We(a[0],2),s=o[0],l=o[1],c=We(a[1],2);return{x1:s,x2:c[0],y1:l,y2:c[1]}}function Nk(t,e,n,r,i,a){var o=function(t,e,n,r,i){var a=i.tickFormatter,o=i.classNamePrefix,s=_k(e.value,i),l="line";y(a)&&(l=function(){return cb(a,[e,n,r,s])});var c=t.append(l).attr("className",Cw.tickItem.name);return Hw(c,Cw.tickItem,Aw,o),c}(qb(this),t,e,n,r);!function(t,e,n,r,i,a,o){var s=_k(t.value,a),l=Tk(t,e,n,s,a),c=l.x1,u=l.x2,f=l.y1,d=l.y2,h=We(nx(Bw(o,[t,e,n,s])),2),p=h[0],g=h[1];"line"===r.node().nodeName&&r.styles(Ie({x1:c,x2:u,y1:f,y2:d},p)),i.attr(g),r.styles(p)}(t,e,n,o,this,r,i);var s=We(Vw(t.value,r),2),l=s[0],c=s[1];return aw(this,{transform:"translate(".concat(l,", ").concat(c,")")},a)}function Pk(t,e,n,r,i){var a=We(nx(tx(r,"title")),2),o=a[0],s=a[1],l=s.transform,c=s.transformOrigin,u=De(s,["transform","transformOrigin"]);e.styles(u);var f=l||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),o.direction,o.position);t.styles(Ie(Ie({},o),{transformOrigin:c})),rx(t.node(),f);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,a=n.titleSpacing,o=ax(i),s=t.node().getLocalBounds(),l=We(s.min,2),c=l[0],u=l[1],f=We(s.halfExtents,2),d=f[0],h=f[1],p=We(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=We([c+d,u+h],2),y=m[0],b=m[1],x=We(Xb(a),4),w=x[0],k=x[1],M=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var E=n.startPos,S=n.endPos,A=We("start"===i?[E,S]:[S,E],2),_=A[0],T=A[1],N=We(Cb(Bb([-T[0]+_[0],-T[1]+_[1]]),w),2),P=N[0],C=N[1];return{x:_[0]+P,y:_[1]+C}}return o.includes("t")&&(b-=h+v+w),o.includes("r")&&(y+=d+g+k),o.includes("l")&&(y-=d+g+O),o.includes("b")&&(b+=h+v+M),{x:y,y:b}}(qb(n._offscreen||n.querySelector(Cw.mainGroup.class)),e,r),h=d.x,p=d.y;return aw(e.node(),{transform:"translate(".concat(h,", ").concat(p,")")},i)}function Ck(t,e,n,r){var i=t.showLine,a=t.showTick,o=t.showLabel,s=t.classNamePrefix,l=e.maybeAppendByClassName(Cw.lineGroup,"g");Hw(l,Cw.lineGroup,yw,s);var c=Sb(i,l,function(e){return tk(e,t,r)})||[],u=e.maybeAppendByClassName(Cw.tickGroup,"g");Hw(u,Cw.tickGroup,bw,s);var f=Sb(a,u,function(e){return function(t,e,n,r){var i=n.classNamePrefix,a=Fw(e,n.tickFilter),o=tx(n,"tick");return t.selectAll(Cw.tick.class).data(a,function(t){return t.id||t.label}).join(function(t){var e=t.append("g").attr("className",Cw.tick.name).transition(function(t,e){return Nk.call(this,t,e,a,n,o,!1)});return Hw(e,Cw.tick,Sw,i),e},function(t){return t.transition(function(t,e){return this.removeChildren(),Nk.call(this,t,e,a,n,o,r.update)})},function(t){return t.transition(function(){var t=this,e=ow(this.childNodes[0],r.exit);return nw(e,function(){return t.remove()}),e})}).transitions()}(e,n,t,r)})||[],d=e.maybeAppendByClassName(Cw.labelGroup,"g");Hw(d,Cw.labelGroup,xw,s);var h=Sb(o,d,function(i){return Ak(i,n,t,r,e.node())})||[];return $e($e($e([],We(c),!1),We(f),!1),We(h),!1).filter(function(t){return!!t})}var Lk=function(t){function e(e){return t.call(this,e,Pw)||this}return Re(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,a=t.data,o=t.animate,s=t.showTitle,l=t.showGrid,c=t.dataThreshold,u=t.truncRange,f=t.classNamePrefix,d=e.className||"axis";f?e.attr("className","".concat(d," ").concat(f,"axis")):e.className||e.attr("className","axis");var h=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(a,c).filter(function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])}),p=ew(void 0===n?o:n),g=qb(e).maybeAppendByClassName(Cw.gridGroup,"g");Hw(g,Cw.gridGroup,vw,f);var v=Sb(l,g,function(e){return rk(e,h,t,p)})||[],m=qb(e).maybeAppendByClassName(Cw.mainGroup,"g");Hw(m,Cw.mainGroup,mw,f),i&&(!this.initialized&&p.enter||this.initialized&&p.update)&&Ck(t,qb(this.offscreenGroup),h,ew(!1));var y=Ck(t,qb(m.node()),h,p),b=qb(e).maybeAppendByClassName(Cw.titleGroup,"g");Hw(b,Cw.titleGroup,ww,f);var x=Sb(s,b,function(e){return function(t,e,n,r){var i=n.titleText,a=n.classNamePrefix;return t.selectAll(Cw.title.class).data([{title:i}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(o){var s=o.append(function(){return Eb(i)}).attr("className",Cw.title.name).transition(function(){return Pk(qb(this),t,e,n,r.enter)});return Hw(s,Cw.title,Nw,a),s},function(i){return i.transition(function(){return Pk(qb(this),t,e,n,r.update)})},function(t){return t.remove()}).transitions()}(e,r,t,p)})||[];return $e($e($e([],We(v),!1),We(y),!1),We(x),!1).flat().filter(function(t){return!!t})},e}(sx);function jk(t,e,n){return n?"".concat(t," ").concat(n,"legend-").concat(e):t}function Rk(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}gx.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),gx.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=t+.4*r;return[["M",t,e],["L",o,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",o,e-i],["Z"],["M",o,e+a],["L",t+r-2,e+a],["M",o,e-a],["L",t+r-2,e-a]]}),gx.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=e+.4*r;return[["M",t,e],["L",t-i,o],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,o],["Z"],["M",t-a,o],["L",t-a,e+r-2],["M",t+a,o],["L",t+a,e+r-2]]});var Ik="title",Dk="item",Bk="marker",Fk="label",zk="value",Wk="focus-icon",$k="background",Gk="ribbon",Yk="track",Hk="selection",Vk="handle",qk="handle-marker",Xk="handle-label",Uk="indicator",Kk="prev-btn",Zk="next-btn",Qk="page-info",Jk=pb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),tM={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},eM=function(t){function e(e){return t.call(this,e,tM)||this}return Re(e,t),e.prototype.render=function(t,e){var n=qb(e).maybeAppendByClassName(Jk.markerGroup,"g");this.renderMarker(n);var r=qb(e).maybeAppendByClassName(Jk.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.classNamePrefix,a=n.markerSymbol,o=void 0===a?Rk(r,"horizontalHandle","verticalHandle"):a;Sb(!!o,t,function(t){var n=tx(e.attributes,"marker"),r=Ie({symbol:o},n),a=jk(Jk.marker.name,qk,i);if(e.marker=t.maybeAppendByClassName(Jk.marker,function(){return new gx({style:r,className:a})}).update(r),i){var s=e.marker.node().querySelector(".marker");if(s){var l=jk((s.getAttribute("class")||"").split(" ")[0],qk,i);s.setAttribute("class",l)}}})},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,a=n.spacing,o=void 0===a?0:a,s=n.formatter,l=n.classNamePrefix;Sb(r,t,function(t){var n,r=tx(e.attributes,"label"),a=r.text,c=De(r,["text"]),u=(null===(n=t.select(Jk.marker.class))||void 0===n?void 0:n.node().getBBox())||{},f=u.width,d=void 0===f?0:f,h=u.height,p=We(Rk(i,[0,(void 0===h?0:h)+o,"center","top"],[d+o,0,"start","middle"]),4),g=p[0],v=p[1],m=p[2],y=p[3],b=jk(Jk.label.name,Xk,l);t.maybeAppendByClassName(Jk.label,"text").attr("className",b).styles(Ie(Ie({},c),{x:g,y:v,text:s(a).toString(),textAlign:m,textBaseline:y}))})},e}(sx),nM={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},rM=vb({},nM,{}),iM=vb({},nM,ex(tM,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),aM=pb({title:"title",html:"html",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),oM=pb({text:"text"},"title");function sM(t,e){var n=Object.entries(e).reduce(function(e,n){var r=We(n,2),i=r[0],a=r[1];return t.node().attr(i)||(e[i]=a),e},{});t.styles(n)}var lM,cM=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return Re(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,a=t.inset,o=this.querySelector(oM.text.class);if(!o)return new lb(0,0,+e,+n);var s=o.getBBox(),l=s.width,c=s.height,u=We(Xb(i),4),f=u[0],d=u[1],h=u[2],p=u[3],g=We([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=ax(r);if(x.includes("i"))return new lb(v,m,y,b);x.forEach(function(t,r){var i,a,o,s;"t"===t&&(i=We(0===r?[c+h,+n-c-h]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(a=We([+e-l-p],1),y=a[0]),"b"===t&&(o=We([+n-c-f],1),b=o[0]),"l"===t&&(s=We(0===r?[l+d,+e-l-d]:[0,+e],2),v=s[0],y=s[1])});var w=We(Xb(a),4),k=w[0],M=w[1],O=w[2],E=w[3],S=We([E+M,k+O],2),A=S[0],_=S[1];return new lb(v+E,m+k,y-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new lb(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=t.classNamePrefix,i=De(t,["width","height","position","spacing","classNamePrefix"]),a=We(nx(i),1)[0],o=function(t){var e,n,r,i,a=t,o=a.width,s=a.height,l=a.position,c=We([+o/2,+s/2],2),u=We([+c[0],+c[1],"center","middle"],4),f=u[0],d=u[1],h=u[2],p=u[3],g=ax(l);return g.includes("l")&&(f=(e=We([0,"start"],2))[0],h=e[1]),g.includes("r")&&(f=(n=We([+o,"end"],2))[0],h=n[1]),g.includes("t")&&(d=(r=We([0,"top"],2))[0],p=r[1]),g.includes("b")&&(d=(i=We([+s,"bottom"],2))[0],p=i[1]),{x:f,y:d,textAlign:h,textBaseline:p}}(t),s=o.x,l=o.y,c=o.textAlign,u=o.textBaseline;Sb(!!i.text,qb(e),function(t){var e=jk(oM.text.name,Ik,r);n.title=t.maybeAppendByClassName(oM.text,"text").attr("className",e).styles(a).call(sM,{x:s,y:l,textAlign:c,textBaseline:u}).node()})},e}(sx),uM=pb({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),fM=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:hx(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Ug({class:uM.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Ug({class:uM.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Re(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return R(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=We(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map(function(e,n){return t.map(function(t){return t[n]})}))||[]}(this.pageViews.map(function(t){var e=t.getBBox();return[e.width,e.height]})).map(function(t){return Math.max.apply(Math,$e([],We(t),!1))}),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,a=void 0===i?e:i,o=r.pageHeight;return{pageWidth:a,pageHeight:void 0===o?n:o}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,a=this.pageShape,o=a.pageWidth,s=a.pageHeight;return new lb(n,r,o+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,a=r.playState,o=r.playWindow,s=r.pageViews;if("idle"!==a||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var l=We(this.getFollowingPageDiff(t),2),c=l[0],u=l[1];this.playState="running";var f=iw(o,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-c,", ").concat(-u,")")}],n);return nw(f,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:R(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:R(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(uM.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach(function(e,n){t.includes(n)?tb(e):eb(e)})},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,a=i.orientation,o=i.controllerPadding,s=r.getBBox().width,l=We("horizontal"===a?[-180,0]:[-90,90],2),c=l[0],u=l[1];e.setLocalEulerAngles(c),n.setLocalEulerAngles(u);var f=e.getBBox(),d=f.width,h=f.height,p=n.getBBox(),g=p.width,v=p.height,m=Math.max(d,s,g),y="horizontal"===a?{offset:[[0,0],[d/2+o,0],[d+s+2*o,0]],textAlign:"start"}:{offset:[[m/2,-h-o],[m/2,0],[m/2,v+o]],textAlign:"center"},b=We(y.offset,3),x=We(b[0],2),w=x[0],k=x[1],M=We(b[1],2),O=M[0],E=M[1],S=We(b[2],2),A=S[0],_=S[1],T=y.textAlign,N=r.querySelector("text");N&&(N.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(O,E),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(uM.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,a=r.pageHeight,o=t<e?-1:1;return"horizontal"===n?[o*i,0]:[0,o*a]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=We(this.getFollowingPageDiff(t),2),i=r[0],a=r[1];n[t].setLocalPosition(i,a)}},e.prototype.renderController=function(t){var e=this,n=this.attributes,r=n.controllerSpacing,i=n.classNamePrefix,a=void 0===i?"":i,o=this.pageShape,s=o.pageWidth,l=o.pageHeight,c=this.pageViews.length>=2,u=t.maybeAppendByClassName(uM.controller,"g");if(nb(u.node(),c),c){var f=tx(this.attributes,"button"),d=tx(this.attributes,"pageNum"),h=We(nx(f),2),p=h[0],g=h[1],v=p.size,m=De(p,["size"]),y=!u.select(uM.prevBtnGroup.class).node(),b=u.maybeAppendByClassName(uM.prevBtnGroup,"g").styles(g);this.prevBtnGroup=b.node();var x=b.maybeAppendByClassName(uM.prevBtn,"path");if(a){var w=jk(uM.prevBtn.name,Kk,a);x.node().setAttribute("class",w)}var k=u.maybeAppendByClassName(uM.nextBtnGroup,"g").styles(g);this.nextBtnGroup=k.node();var M=k.maybeAppendByClassName(uM.nextBtn,"path");if(a){var O=jk(uM.nextBtn.name,Zk,a);M.node().setAttribute("class",O)}[x,M].forEach(function(t){t.styles(Ie(Ie({},m),{transformOrigin:"center"})),Hb(t.node(),v,!0)});var E=u.maybeAppendByClassName(uM.pageInfoGroup,"g");this.pageInfoGroup=E.node();var S=E.maybeAppendByClassName(uM.pageInfo,"text");if(S.styles(d),a){var A=jk(uM.pageInfo.name,Qk,a);S.node().setAttribute("class",A)}this.updatePageInfo(),u.node().setLocalPosition(s+r,l/2),y&&(this.prevBtnGroup.addEventListener("click",function(){e.prev()}),this.nextBtnGroup.addEventListener("click",function(){e.next()}))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(a,")"));var o=qb(e);this.renderClipPath(o),this.renderController(o),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=K(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(tg.INSERTED,e),this.playWindow.addEventListener(tg.REMOVED,e)},e}(sx),dM="component-poptip",hM="component-poptip-arrow",pM="component-poptip-text",gM=((lM={})[".".concat(dM)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},lM[".".concat(pM)]={"text-align":"center"},lM[".".concat(dM,"[data-position='top']")]={transform:"translate(-50%, -100%)"},lM[".".concat(dM,"[data-position='left']")]={transform:"translate(-100%, -50%)"},lM[".".concat(dM,"[data-position='right']")]={transform:"translate(0, -50%)"},lM[".".concat(dM,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},lM[".".concat(dM,"[data-position='top-left']")]={transform:"translate(0,-100%)"},lM[".".concat(dM,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},lM[".".concat(dM,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},lM[".".concat(dM,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},lM[".".concat(dM,"[data-position='right-top']")]={transform:"translate(0, 0)"},lM[".".concat(dM,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},lM[".".concat(dM,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},lM[".".concat(dM,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},lM[".".concat(hM)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},lM[".".concat(dM,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},lM["[data-position='top'] .".concat(hM)]={bottom:"-2px"},lM[".".concat(dM,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},lM["[data-position='left'] .".concat(hM)]={right:"-2px"},lM[".".concat(dM,"[data-position='right']")]={transform:"translate(5px, -50%)"},lM["[data-position='right'] .".concat(hM)]={left:"-2px"},lM[".".concat(dM,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},lM["[data-position='bottom'] .".concat(hM)]={top:"-2px"},lM[".".concat(dM,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},lM["[data-position='top-left'] .".concat(hM)]={left:"10px",bottom:"-2px"},lM[".".concat(dM,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},lM["[data-position='top-right'] .".concat(hM)]={right:"10px",bottom:"-2px"},lM[".".concat(dM,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},lM["[data-position='left-top'] .".concat(hM)]={right:"-2px",top:"8px"},lM[".".concat(dM,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},lM["[data-position='left-bottom'] .".concat(hM)]={right:"-2px",bottom:"8px"},lM[".".concat(dM,"[data-position='right-top']")]={transform:"translate(5px, 0)"},lM["[data-position='right-top'] .".concat(hM)]={left:"-2px",top:"8px"},lM[".".concat(dM,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},lM["[data-position='right-bottom'] .".concat(hM)]={left:"-2px",bottom:"8px"},lM[".".concat(dM,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},lM["[data-position='bottom-left'] .".concat(hM)]={top:"-2px",left:"8px"},lM[".".concat(dM,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},lM["[data-position='bottom-right'] .".concat(hM)]={top:"-2px",right:"8px"},lM),vM=window;function mM(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function yM(t){var e=function(t){var e;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e||(e=t.apply(vM,n)),e}}(mM)(t);return e}var bM=function(t){function e(n){var r=t.call(this,tt({style:{id:"component-poptip"}},e.defaultOptions,n))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return Re(e,t),Object.defineProperty(e.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},e.prototype.update=function(t){this.attr(tt({},this.style,t)),this.render(this.attributes,this)},e.prototype.bind=function(t,e){var n=this;if(t){var r=this.style.text,i=function(i){var a=t,o=n.style,s=r;if(e){var l="function"==typeof e?e.call(null,i):e,c=l.html,u=l.target,f=De(l,["html","target"]);o=function(t,e,n,r){return e&&q(t,e),n&&q(t,n),r&&q(t,r),t}({},n.style,f),(u||!1===u)&&(a=u),"string"==typeof c&&(s=c)}var d=o.position,h=o.arrowPointAtCenter,p=o.follow,g=o.offset;if(a){var v=i,m=We(function(t,e,n,r,i,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),a)return[t,e];var o=n.getBoundingClientRect(),s=o.x,l=o.y,c=o.width,u=o.height;switch(r){case"top":return i?[s+c/2,l]:[t,l];case"left":return i?[s,l+u/2]:[s,e];case"bottom":return i?[s+c/2,l+u]:[t,l+u];case"right":return i?[s+c,l+u/2]:[s+c,e];case"top-right":case"right-top":return[s+c,l];case"left-bottom":case"bottom-left":return[s,l+u];case"right-bottom":case"bottom-right":return[s+c,l+u];default:return[s,l]}}(v.clientX,v.clientY,a,d,h,p),2),y=m[0],b=m[1];n.showTip(y,b,{text:s,position:d,offset:g})}else n.hideTip()},a=function(){n.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",a),this.map.set(t,[i,a])}},e.prototype.unbind=function(t){if(this.map.has(t)){var e=We(this.map.get(t)||[],2),n=e[0],r=e[1];n&&t.removeEventListener("mousemove",n),r&&t.removeEventListener("mouseleave",r),this.map.delete(t)}},e.prototype.clear=function(){this.container.innerHTML=""},e.prototype.destroy=function(){var e,n=this;$e([],We(this.map.keys()),!1).forEach(function(t){return n.unbind(t)}),null===(e=this.container)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.showTip=function(t,e,n){var r=at(n,"text");if((!r||"string"==typeof r)&&(this.applyStyles(),t&&e&&n)){var i=n.offset,a=n.position;if(a&&this.container.setAttribute("data-position",a),this.setOffsetPosition(t,e,i),"string"==typeof r){var o=this.container.querySelector(".".concat(pM));o&&(o.innerHTML=r)}this.visibility="visible",this.container.style.visibility="visible"}},e.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},e.prototype.getContainer=function(){return this.container},e.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(dM).concat(t?" ".concat(t):"")},e.prototype.initShape=function(){var t=this,e=this.style.id;this.container=yM(e),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},e.prototype.updatePoptipElement=function(){var t=this.container;this.clear();var e=this.style,n=e.id,r=e.template,i=e.text;this.container.setAttribute("id",n),this.container.className=this.getClassName();var a,o='<span class="'.concat(hM,'"></span>');t.innerHTML=o,L(r)?t.innerHTML+=r:r&&((a=r)instanceof Element||a instanceof Document)&&t.appendChild(r),i&&(t.getElementsByClassName(pM)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility},e.prototype.applyStyles=function(){var t=vb({},gM,this.style.domStyles),e=Object.entries(t).reduce(function(t,e){var n=We(e,2),r=n[0],i=n[1],a=Object.entries(i).reduce(function(t,e){var n=We(e,2),r=n[0],i=n[1];return"".concat(t).concat(r,": ").concat(i,";")},"");return"".concat(t).concat(r,"{").concat(a,"}")},"");if(this.domStyles!==e){this.domStyles=e;var n=this.container.querySelector("style");n&&this.container.removeChild(n),(n=document.createElement("style")).innerHTML=e,this.container.appendChild(n)}},e.prototype.setOffsetPosition=function(t,e,n){void 0===n&&(n=this.style.offset);var r=We(n,2),i=r[0],a=void 0===i?0:i,o=r[1],s=void 0===o?0:o;this.container.style.left="".concat(t+a,"px"),this.container.style.top="".concat(e+s,"px")},e.tag="poptip",e.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:gM,template:'<div class="'.concat(pM,'"></div>')}},e}(sx),xM=pb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),wM={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};var kM=function(t){function e(e,n){var r=t.call(this,e,{span:[1,1],marker:function(){return new Hg({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this;return r.keyFields={},r.keyFields=n||{},r}return Re(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes,r=n.markerSize,i=n.focus,a=n.focusMarkerSize,o=t.node().getBBox(),s=o.width,l=o.height,c=e.node().getBBox(),u=c.width,f=c.height;return{markerWidth:r,labelWidth:s,valueWidth:u,focusWidth:i?null!=a?a:12:0,height:Math.max(r,l,f)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=We(Xb(t),2),n=e[0],r=e[1],i=this.showValue?r:0,a=n+i;return[n/a,i/a]},enumerable:!1,configurable:!0}),e.prototype.setAttribute=function(e,n){t.prototype.setAttribute.call(this,e,n)},Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,a=i.markerWidth,o=i.focusWidth,s=i.height,l=this.actualSpace,c=l.labelWidth,u=l.valueWidth,f=We(this.spacing,3),d=f[0],h=f[1],p=f[2];if(r){var g=r-n-d-h-o-p,v=We(this.span,2);c=(t=We([v[0]*g,v[1]*g],2))[0],u=t[1]}return{width:a+c+u+d+h+o+p,height:s,markerWidth:a,labelWidth:c,valueWidth:u,focusWidth:o}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes,e=t.spacing,n=t.focus;if(!e)return[0,0,0];var r=We(Xb(e),3),i=r[0],a=r[1],o=r[2];return[i,this.showValue?a:0,n?o:0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.focusWidth,a=t.width,o=t.height,s=We(this.spacing,3),l=s[0],c=s[1];return{height:o,width:a,markerWidth:e,labelWidth:n,valueWidth:r,focusWidth:i,position:[e/2,e+l,e+n+l+c,e+n+r+l+c+s[2]+i/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(xM.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,a=e.markerLineWidth,o=void 0===a?t.lineWidth:a,s=e.markerStroke,l=void 0===s?t.stroke:s,c=+(i||o||(l?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,d=u.height;return(1-c/Math.max(f,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.marker,i=n.classNamePrefix,a=tx(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(xM.markerGroup,"g").style("zIndex",0),Sb(!!r,this.markerGroup,function(){var t,n=e.markerGroup.node(),o=null===(t=n.childNodes)||void 0===t?void 0:t[0],s=jk(xM.marker.name,Bk,i),l="string"==typeof r?new gx({style:{symbol:r},className:s}):r();if(o)if(l.nodeName===o.nodeName)o instanceof gx?o.update(Ie(Ie({},a),{symbol:r})):(!function(t,e){var n,r,i=e.attributes;try{for(var a=ze(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=We(o.value,2),l=s[0],c=s[1];"id"!==l&&"className"!==l&&t.attr(l,c)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}(o,l),qb(o).styles(a));else{if(o.remove(),!(l instanceof gx)){var c=jk(xM.marker.name,Bk,i);l.className=c}qb(l).styles(a),n.appendChild(l)}else{if(!(l instanceof gx)){var u=jk(xM.marker.name,Bk,i);l.className=u,qb(l).styles(a)}n.appendChild(l)}e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var f=Hb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(f,")")})},e.prototype.renderLabel=function(t){var e=tx(this.attributes,"label"),n=e.text,r=De(e,["text"]),i=this.attributes.classNamePrefix;this.labelGroup=t.maybeAppendByClassName(xM.labelGroup,"g").style("zIndex",0);var a=jk(xM.label.name,Fk,i),o=this.labelGroup.maybeAppendByClassName(xM.label,function(){return Eb(n)});o.node().setAttribute("class",a),o.styles(r)},e.prototype.renderValue=function(t){var e=this,n=tx(this.attributes,"value"),r=n.text,i=De(n,["text"]),a=this.attributes.classNamePrefix;this.valueGroup=t.maybeAppendByClassName(xM.valueGroup,"g").style("zIndex",0),Sb(this.showValue,this.valueGroup,function(){var t=jk(xM.value.name,zk,a),n=e.valueGroup.maybeAppendByClassName(xM.value,function(){return Eb(r)});n.node().setAttribute("class",t),n.styles(i)})},e.prototype.createPoptip=function(){var t=De(this.attributes.poptip||{},["render"]),e=new bM({style:vb(wM,t)});return this.poptipGroup=e,e},e.prototype.bindPoptip=function(t){var e=this,n=this.attributes.poptip;n&&(this.poptipGroup||this.createPoptip()).bind(t,function(){var t=e.attributes,r=t.labelText,i=t.valueText,a=t.markerFill,o="string"==typeof r?r:null==r?void 0:r.attr("text"),s="string"==typeof i?i:null==i?void 0:i.attr("text");if("function"==typeof n.render)return{html:n.render(Ie(Ie({},e.keyFields),{label:o,value:s,color:a}))};var l="";return"string"!=typeof o&&"number"!=typeof o||(l+='<div class="component-poptip-label">'.concat(o,"</div>")),"string"!=typeof s&&"number"!=typeof s||(l+='<div class="component-poptip-value">'.concat(s,"</div>")),{html:l}})},e.prototype.renderFocus=function(t){var e=this,n=this.attributes,r=n.focus,i=n.focusMarkerSize,a=n.classNamePrefix,o={x:0,y:0,size:i,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};V(r)||(this.focusGroup=t.maybeAppendByClassName(xM.focusGroup,"g").style("zIndex",0),Sb(r,this.focusGroup,function(){var n=jk(xM.focus.name,Wk,a),r=new gx({style:Ie(Ie({},o),{symbol:"focus"}),className:n}),i=new Hg({style:{r:o.size/2,fill:"transparent"}}),s=e.focusGroup.node();s.appendChild(i),s.appendChild(r),r.update({opacity:0}),t.node().addEventListener("pointerenter",function(){r.update({opacity:1})}),t.node().addEventListener("pointerleave",function(){r.update({opacity:0})})}))},e.prototype.renderPoptip=function(t){var e=this;this.attributes.poptip&&[t.maybeAppendByClassName(xM.value,"g").node(),t.maybeAppendByClassName(xM.label,"g").node()].forEach(function(t){t&&e.bindPoptip(t)})},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=tx(this.attributes,"background");this.background=t.maybeAppendByClassName(xM.backgroundGroup,"g").style("zIndex",-1);var a=this.background.maybeAppendByClassName(xM.background,"rect");a.styles(Ie({width:n,height:r},i));var o=this.attributes.classNamePrefix,s=void 0===o?"":o;if(s){var l=jk(xM.background.name,$k,s);a.node().setAttribute("class",l)}},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=We(t.position,4),a=i[0],o=i[1],s=i[2],l=i[3],c=r/2;this.markerGroup.styles({transform:"translate(".concat(a,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(o,", ").concat(c,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(l,", ").concat(c,")")}),kb(this.labelGroup.select(xM.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),kb(this.valueGroup.select(xM.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=qb(e),r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a;n.styles({transform:"translate(".concat(i,", ").concat(o,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.renderPoptip(n),this.renderFocus(n),this.adjustLayout()},e}(sx),MM=pb({page:"item-page",navigator:"navigator",item:"item"},"items"),OM=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},EM=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:ft,mouseenter:ft,mouseleave:ft})||this;return n.navigatorShape=[0,0],n}return Re(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=t.poptip,i=t.focus,a=t.focusMarkerSize,o=t.classNamePrefix,s=tx(this.attributes,"item"),l=e.map(function(t,l){var c=t.id,u=void 0===c?l:c,f=t.label,d=t.value;return{id:"".concat(u),index:l,style:Ie({layout:n,labelText:f,valueText:d,poptip:r,focus:i,focusMarkerSize:a,classNamePrefix:o},Object.fromEntries(Object.entries(s).map(function(n){var r=We(n,2);return[r[0],cb(r[1],[t,l,e])]})))}});return l},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,a=e.colPadding,o=We(this.navigatorShape,1)[0],s=We(this.grid,2),l=s[0],c=s[1],u=c*l,f=0;return this.pageViews.children.map(function(e,s){var d,h,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(c,l),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=We(m,2),b=y[0],x=y[1],w=(r-o-(c-1)*a)/c,k=e.getBBox().height,M=We([0,0],2),O=M[0],E=M[1];return"horizontal"===n?(O=(d=We([f,b*(k+i)],2))[0],E=d[1],f=x===c-1?0:f+w+a):(O=(h=We([x*(w+a),f],2))[0],E=h[1],f=b===l-1?0:f+k+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:k,x:O,y:E}})},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,a=We(this.navigatorShape,1)[0],o=We(this.grid,2),s=o[0],l=o[1],c=We([e-a,n],2),u=c[0],f=c[1],d=We([0,0,0,0,0,0,0,0],8),h=d[0],p=d[1],g=d[2],v=d[3],m=d[4],y=d[5],b=d[6],x=d[7];return this.pageViews.children.map(function(t,e){var n,a,o,c,d=t.getBBox(),w=d.width,k=d.height,M=0===b?0:i,O=b+M+w;return O<=u&&OM(m,function(t){return t<l})?(n=We([b+M,x,O],3),h=n[0],p=n[1],b=n[2],{width:w,height:k,x:h,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(a=We([y+1,0,0,x+k+r],4),y=a[0],m=a[1],b=a[2],(x=a[3])+k<=f&&OM(y,function(t){return t<s})?(o=We([b,x,w],3),h=o[0],p=o[1],b=o[2],{width:w,height:k,x:h,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(c=We([0,0,w,0,g+1,0,0,0],8),h=c[0],p=c[1],b=c[2],x=c[3],g=c[4],v=c[5],y=c[6],m=c[7],{width:w,height:k,x:h,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Rk(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(MM.item.class).forEach(function(e){t.appendChild(e)}),t.querySelectorAll(MM.page.class).forEach(function(e){t.removeChild(e).destroy()})},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=e.classNamePrefix;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this),s=jk(MM.item.name,Dk,a);qb(t).selectAll(MM.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){var e=t.style,n=De(t,["style"]);return new kM({style:e},n)}).attr("className",s).on("click",function(){null==n||n(this),o("itemClick",{item:this})}).on("pointerenter",function(){null==r||r(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){null==i||i(this),o("itemMouseleave",{item:this})})},function(t){return t.each(function(t){var e=t.style;this.update(e)})},function(t){return t.remove()})},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,a=We(this.navigatorShape,2),o=a[0],s=a[1];this.navigator.update("grid"===n?{pageWidth:r-o,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce(function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t},{}))).map(function(t){var e=We(t,2);return{page:e[0],layouts:e[1]}}),i=$e([],We(this.navigator.getContainer().children),!1);r.forEach(function(t){var e=t.layouts,r=n.pageViews.appendChild(new Ug({className:MM.page.name}));e.forEach(function(t){var e=t.x,n=t.y,a=t.index,o=t.width,s=t.height,l=i[a];r.appendChild(l),ot(l,"__layout__",t),l.update({x:e,y:n,width:o,height:s})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes,n=e.orientation,r=e.classNamePrefix,i=tx(this.attributes,"nav"),a=vb({orientation:n,classNamePrefix:r},i),o=this;return t.selectAll(MM.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new fM({style:a})}).attr("className",MM.navigator.name).each(function(){o.navigator=this})},function(t){return t.each(function(){this.update(a)})},function(t){return t.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(qb(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Hp(t,{detail:e});this.dispatchEvent(n)},e}(sx),SM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Re(e,t),e.prototype.update=function(t){this.attr(t)},e}(Zg),AM=function(t){function e(e){return t.call(this,e,rM)||this}return Re(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,a=r.titleText,o=r.classNamePrefix,s=We(nx(tx(this.attributes,"title")),2),l=s[0],c=s[1];this.titleGroup=t.maybeAppendByClassName(aM.titleGroup,"g").styles(c);var u=Ie(Ie({width:e,height:n},l),{text:i?a:"",classNamePrefix:o});this.title=this.titleGroup.maybeAppendByClassName(aM.title,function(){return new cM({style:u})}).update(u)},e.prototype.renderCustom=function(t){var e=this.attributes.data,n={innerHTML:this.attributes.render(e),pointerEvents:"auto"};t.maybeAppendByClassName(aM.html,function(){return new SM({className:aM.html.name,style:n})}).update(n)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,a=e.height,o=We(nx(tx(this.attributes,"title",!0)),2),s=o[0],l=o[1],c=Ie(Ie({},s),{width:i,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(aM.itemsGroup,"g").styles(Ie(Ie({},l),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(aM.items.class).data(["items"]).join(function(t){return t.append(function(){return new EM({style:c})}).attr("className",aM.items.name).each(function(){u.items=qb(this)})},function(t){return t.update(c)},function(t){return t.remove()})},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new lb(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),l=e.getBBox(),c=ax(r),u=We(Xb(o?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],g=We(Xb(a),4),v=g[0],m=g[1],y=g[2],b=g[3],x=We([p+d,f+h],2),w=x[0],k=x[1],M=We([b+m,v+y],2),O=M[0],E=M[1];if("l"===c[0])return new lb(s.x,s.y,l.width+s.width+w+O,Math.max(l.height+E,s.height));if("t"===c[0])return new lb(s.x,s.y,Math.max(l.width+O,s.width),l.height+s.height+k+E);var S=We([e.attributes.width||l.width,e.attributes.height||l.height],2),A=S[0],_=S[1];return new lb(l.x,l.y,A+s.width+w+O,_+s.height+k+E)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,a=n.x,o=void 0===a?0:a,s=n.y,l=void 0===s?0:s,c=n.classNamePrefix,u=n.render,f=qb(e),d=e.className||"legend-category";c?e.attr("className","".concat(d," ").concat(c,"legend")):e.className||e.attr("className","legend-category"),e.style.transform="translate(".concat(o,", ").concat(l,")"),u?this.renderCustom(f):(this.renderTitle(f,r,i),this.renderItems(f,this.availableSpace),this.adjustLayout())},e}(sx),_M={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},TM=pb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),NM=function(t){function e(e){var n=t.call(this,e,_M)||this;return n.point=[0,0],n.group=n.appendChild(new Ug({})),n.isMutationObserved=!0,n}return Re(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=We(Xb(t.padding),4),r=n[0],i=n[1],a=n[2],o=n[3],s=this.label.node().getLocalBounds(),l=s.min,c=s.max,u=new lb(l[0]-o,l[1]-r,c[0]+i-l[0]+o,c[1]+a-l[1]+r),f=this.getPath(e,u),d=tx(this.attributes,"background");this.background=qb(this.group).maybeAppendByClassName(TM.background,"path").styles(Ie(Ie({},d),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=We(nx(tx(this.attributes,"label")),2),i=r[0],a=r[1],o=De(i,["text"]);(this.label=qb(this.group).maybeAppendByClassName(TM.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(TM.label,function(){return Eb(e(n))}).style("text",e(n).toString()).selectAll("text").styles(o)},e.prototype.adjustLayout=function(){var t=We(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,a=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(a-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,a=e.width,o=e.height,s=[["M",r+n,i],["L",r+a-n,i],["A",n,n,0,0,1,r+a,i+n],["L",r+a,i+o-n],["A",n,n,0,0,1,r+a-n,i+o],["L",r+n,i+o],["A",n,n,0,0,1,r,i+o-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],c=this.createCorner([s[l].slice(-2),s[l+1].slice(-2)]);return s.splice.apply(s,$e([l+1,1],We(c),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Kb.apply(void 0,$e([],We(t),!1)),r=We(t,2),i=We(r[0],2),a=i[0],o=i[1],s=We(r[1],2),l=s[0],c=s[1],u=We(n?[l-a,[a,l]]:[c-o,[o,c]],2),f=u[0],d=We(u[1],2),h=d[0],p=d[1],g=f/2,v=e*(f/Math.abs(f)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=We([h,h+g-m,h+g,h+g+m,p],5),x=b[0],w=b[1],k=b[2],M=b[3],O=b[4];return n?(this.point=[k,o-y],[["L",x,o],["L",w,o],["L",k,o-y],["L",M,o],["L",O,o]]):(this.point=[a+y,k],[["L",a,x],["L",a,w],["L",a+y,k],["L",a,M],["L",a,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?eb(this):tb(this)},e.prototype.bindEvents=function(){this.label.on(tg.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(sx);function PM(t,e){var n=We(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var CM=pb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function LM(t){var e=t.orientation,n=t.size,r=t.length;return Rk(e,[r,n],[n,r])}function jM(t){var e=t.type,n=We(LM(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function RM(t){return jM(t)}function IM(t){var e,n=t.orientation,r=t.color,i=t.block,a=t.partition;if(y(r)){e=new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))})}else e=r;var o=e.length,s=e.map(function(t){return bd(t).toString()});return o?1===o?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce(function(e,n,a){var o=r[a%r.length];return e+" ".concat(t[a],":").concat(o).concat(a<i-1?" ".concat(t[a+1],":").concat(o):"")},"l(".concat("horizontal"===n?"0":"270",")"))}(a,s,n):s.reduce(function(t,e,n){return t+" ".concat(n/(o-1),":").concat(e)},"l(".concat(Rk(n,"0","270"),")")):""}function DM(t){var e=t.orientation,n=t.range;if(!n)return[];var r=We(LM(t),2),i=r[0],a=r[1],o=We(n,2),s=o[0],l=o[1],c=Rk(e,s*i,0),u=Rk(e,0,s*a),f=Rk(e,l*i,i),d=Rk(e,a,l*a);return[["M",c,u],["L",c,d],["L",f,d],["L",f,u],["Z"]]}var BM=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return Re(e,t),e.prototype.render=function(t,e){!function(t,e){var n=tx(e,"track"),r=e.classNamePrefix,i=jk(CM.track.name,Yk,r);t.maybeAppendByClassName(CM.track,"path").attr("className",i).styles(Ie({d:jM(e)},n))}(qb(e).maybeAppendByClassName(CM.trackGroup,"g"),t),function(t,e){var n=tx(e,"selection"),r=IM(e),i=e.classNamePrefix,a=jk(CM.selection.name,Hk,i),o=t.maybeAppendByClassName(CM.selection,"path").attr("className",a).styles(Ie({d:RM(e),fill:r},n)),s=o.maybeAppendByClassName(CM.clipPath,"path").styles({d:DM(e)}).node();o.style("clipPath",s)}(qb(e).maybeAppendByClassName(CM.selectionGroup,"g"),t)},e}(sx);var FM=function(t){function e(e){var n=t.call(this,e,iM)||this;return n.eventToOffsetScale=new Vx({}),n.innerRibbonScale=new Vx({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var a=n.getValueByCanvasPoint(t);if(i){var o=PM(r.map(function(t){return t.value}),a).range,s=n.getRealSelection(o);n.showIndicator((o[0]+o[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(a,o)}else{var l=n.getTickValue(a);n.showIndicator(l,"".concat(n.getRealValue(l))),n.dispatchIndicated(l)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=We(n.selection,2),i=r[0],a=r[1],o=n.getTickValue(n.getValueByCanvasPoint(t)),s=o-n.prevValue;"start"===e?i!==o&&n.updateSelection(o,a):"end"===e?a!==o&&n.updateSelection(i,o):"ribbon"===e&&0!==s&&(n.prevValue=o,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return Re(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new lb(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.classNamePrefix,i=e.className||"legend-continuous";r?e.attr("className","".concat(i," ").concat(r,"legend")):e.className||e.attr("className","legend-continuous");var a=t.showLabel;this.renderTitle(qb(e));var o=this.availableSpace,s=o.x,l=o.y,c=qb(e).maybeAppendByClassName(aM.contentGroup,"g").styles({transform:"translate(".concat(s,", ").concat(l,")")});Sb(!!a,c.maybeAppendByClassName(aM.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)});var u=c.maybeAppendByClassName(aM.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=c.maybeAppendByClassName(aM.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(u),this.renderIndicator(c),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,$e([],We(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,$e([],We(t.map(function(t){return t.value})),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=We(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=We(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Rk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,a=e.height,o=e.classNamePrefix,s=tx(this.attributes,"title"),l=Ie(Ie({},s),{width:i,height:a,text:r,classNamePrefix:o}),c=this;t.selectAll(aM.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new cM({style:l})}).attr("className",aM.title.name).each(function(){c.title=this})},function(t){return t.update(l)},function(t){return t.each(function(){c.title=void 0}).remove()})},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new lb(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new lb(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Cw.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new lb(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,a=i.width,o=i.height;return{width:a,height:o,size:this.ifHorizontal(o,a)+r+this.labelFixedSpacing,length:this.ifHorizontal(a,o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,a=r.height,o=this.labelShape,s=o.size,l=o.length,c=We(this.ifHorizontal([a,i],[i,a]),2),u=c[0],f=c[1],d=e?this.handleShape:{size:0,length:0},h=d.size,p=d.length,g=this.handleOffsetRatio,v=0,m=this.labelPosition;v=n||(["bottom","right"].includes(m)?Math.min(u-s,(u-h)/g):u*(1-g)>h?Math.max(u-s,0):Math.max((u-s-h)/g,0));var y=Math.max(p,l),b=f-y,x=We(this.ifHorizontal([b,v],[v,b]),2),w=x[0],k=x[1],M=["top","left"].includes(m)?s:0,O=We(this.ifHorizontal([y/2,M],[M,y/2]),2),E=O[0],S=O[1];return new lb(E,S,w,k)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,o=e.block,s=e.classNamePrefix,l=tx(this.attributes,"ribbon"),c=this.range,u=c.min,f=c.max,d=this.ribbonBBox,h=d.x,p=d.y,g=this.ribbonShape,v=g.length,m=g.size,y=vb({transform:"translate(".concat(h,", ").concat(p,")"),length:v,size:m,type:r,orientation:i,color:a,block:o,partition:n.map(function(t){return(t.value-u)/(f-u)}),range:this.ribbonRange,classNamePrefix:s},l),b=jk(aM.ribbon.name,Gk,s);this.ribbon=t.maybeAppendByClassName(aM.ribbon,function(){return new BM({style:y,className:b})}).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(aM.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=t.classNamePrefix,i=tx(this.attributes,"handle"),a=We(this.selection,2),o=a[0],s=a[1],l=Ie(Ie({},i),{orientation:n,classNamePrefix:r}),c=i.shape,u="basic"===(void 0===c?"slider":c)?eM:hw,f=this,d=jk(aM.handle.name,Vk,r);this.handlesGroup.selectAll(aM.handle.class).data(e?[{value:o,type:"start"},{value:s,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new u({style:l,className:d})}).attr("className",function(t){var e=t.type;return"".concat(d," ").concat(f.getHandleClassName(e))}).each(function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");f[r]=this,this.addEventListener("pointerdown",f.onDragStart(e))})},function(t){return t.update(l).each(function(t){var e=t.value;this.update({labelText:e})})},function(t){return t.each(function(t){var e=t.type,n="".concat(e,"Handle");f[n]=void 0}).remove()})},e.prototype.adjustHandles=function(){var t=We(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n);var r=this.attributes,i=r.classNamePrefix,a=r.showHandle,o=tx(this.attributes,"handle").shape;a&&"slider"===(void 0===o?"slider":o)&&i&&(this.startHandle&&this.updateSliderHandleClassNames(this.startHandle,i),this.endHandle&&this.updateSliderHandleClassNames(this.endHandle,i))},e.prototype.updateSliderHandleClassNames=function(t,e){var n=t.container||t,r=n.querySelector(".handle-icon-rect");if(r){var i=jk("handle-icon-rect",qk,e);r.setAttribute("class",i),r.querySelectorAll("line").forEach(function(t){var n=jk((t.getAttribute("class")||"").split(" ")[0],qk,e);t.setAttribute("class",n)})}var a=n.querySelector(".handle-label");if(a){var o=jk("handle-label",Xk,e);a.setAttribute("class",o)}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new lb(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,a=r.height,o=We([Math.max(e,i),Math.max(n,a)],2),s=o[0],l=o[1];return this.cacheHandleBBox=new lb(0,0,s,l),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=We(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,a=r.y,o=this.ribbonShape.size,s=this.getOffset(e),l=We(this.ifHorizontal([i+s,a+o*this.handleOffsetRatio],[i+o*this.handleOffsetRatio,a+s]),2),c=l[0],u=l[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(c,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=this.attributes.classNamePrefix,n=tx(this.attributes,"indicator"),r=jk(aM.indicator.name,Uk,e);this.indicator=t.maybeAppendByClassName(aM.indicator,function(){return new NM({style:n,className:r})}).update(n)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce(function(e,n,r,i){var a,o,s=null!==(a=null==n?void 0:n.id)&&void 0!==a?a:r.toString();if(e.push(Ie(Ie({},n),{id:s,index:r,type:"value",label:null!==(o=null==n?void 0:n.label)&&void 0!==o?o:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var l=i[r+1],c=We([n.value,l.value],2),u=c[0],f=c[1],d=(u+f)/2;e.push(Ie(Ie({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(d)}))}return e},[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=We(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,a=e.labelFormatter,o=tx(this.attributes,"tick"),s=tx(this.attributes,"label"),l=s.align,c=vb(Ie({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),ex(o,"tick"),ex(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===l&&(!i||i(t,t.index,n.filter(function(t){return t.type===l})))},labelFormatter:a},f=Ie(Ie(Ie({},c),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(aM.label,function(){return new Lk({style:f})}).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,a=this.ribbonShape.size,o=this.labelPosition,s=this.labelFixedSpacing,l=We([0,0,0],3),c=l[0],u=l[1],f=l[2],d=null!=i?i:a;return e?(f=d,u=s,"positive"===n?"right"===o?(c=d,f=d):"bottom"===o&&(c=f):"negative"===n&&("top"===o||"left"===o)&&(c=a)):"positive"===n?"right"===o?u=d:"bottom"===o&&(c=a+s,u=r):"negative"===n&&("left"===o||"top"===o)&&(u=r),{offset:c,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,a=this.labelAxisStyle,o=a.offset,s=a.spacing,l=a.tickLength,c=We(this.ifHorizontal([[e,n+o],[e+r,n+o]],[[e+o,n+i],[e+o,n]]),2),u=c[0],f=c[1];this.label.update({startPos:u,endPos:f,tickLength:l,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,a=this.ribbonBBox,o=a.x,s=a.y,l=R(t,r,i),c=this.getOffset(l),u=this.ifHorizontal([c+o,s],[o,c+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),tb(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){eb(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=We(this.selection,2),a=i[0],o=i[1],s=We([t,e],2),l=s[0],c=s[1];n&&(l+=a,c+=o);var u=this.range;r=We(function(t,e,n){var r,i=We(t,2),a=i[0],o=i[1],s=We(e,2),l=s[0],c=s[1],u=We(n,2),f=u[0],d=u[1],h=We([l,c],2),p=h[0],g=h[1],v=g-p;return p>g&&(p=(r=We([g,p],2))[0],g=r[1]),v>o-a?[a,o]:p<a?f===a&&d===g?[a,g]:[a,v+a]:g>o?d===o&&f===p?[p,o]:[o-v,o]:[p,g]}([u.min,u.max],[l,c],this.selection),2),l=r[0],c=r[1],this.update({defaultValue:[l,c]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return V(e)?Fb(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?PM(n.map(function(t){return t.value}),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=We(this.ribbon.node().getPosition(),2),a=i[0],o=i[1],s=this.ifHorizontal(a,o),l=this.ifHorizontal.apply(this,$e([],We(Mb(t)),!1))-s;return R(this.getOffset(l,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,a=this.ribbonShape.length,o=this.eventToOffsetScale;return o.update({domain:[r,i],range:[0,a]}),e?o.invert(t):o.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=We(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Hp("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal(function(){return{value:t,range:e}},function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}}),a=new Hp("indicate",{detail:i});this.dispatchEvent(a)},e}(sx);function zM(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var WM={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function $M(t){var e;void 0===t&&(t="");var n=zM(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=Ie({flex:1},WM),e[".".concat(n.VALUE)]=Ie({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},WM),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var GM=function(t){function e(e){var n,r,i=this,a=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,o=zM(a);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,'" data-index={index}>\n <span class="').concat(o.NAME,'">\n <span class="').concat(o.MARKER,'" style="background:{color}"></span>\n <span class="').concat(o.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(o.VALUE,'" title="{value}">{value}</span>\n </li>')},style:$M(a)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return Re(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map(function(t,e){var r=t.name,i=void 0===r?"":r,a=t.color,o=void 0===a?"black":a,s=t.index,l=De(t,["name","color","index"]),c=Ie({name:i,color:o,index:null!=s?s:e},l);return Nn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]}):t}(n.item,c))})},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=Nn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:ix(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,a=n.enterable,o=n.style,s=n.content,l=zM(r.prefixCls),c=this.element;if(this.element.style.pointerEvents=a?"auto":"none",s)this.renderCustomContent();else{i?(c.innerHTML=r.title,c.getElementsByClassName(l.TITLE)[0].innerHTML=i):null===(e=null===(t=c.getElementsByClassName(l.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=l.LIST,ix(f,u);var d=this.element.querySelector(".".concat(l.LIST));d?d.replaceWith(f):c.appendChild(f)}!function(t,e){Object.entries(e).forEach(function(e){var n=We(e,2),r=n[0],i=n[1];$e([t],We(t.querySelectorAll(r)),!1).filter(function(t){return t.matches(r)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(i).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})}(c,o)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},o=this.elementSize,s=o.width,l=o.height,c=[-s/2,-l/2];return i.forEach(function(t){var e=We(c,2),n=e[0],i=e[1],o=We(a[t],2),u=o[0],f=o[1];c=[n+(s/2+r[0])*u,i+(l/2+r[1])*f]}),c},e.prototype.setOffsetPosition=function(t){var e=We(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=void 0===a?0:a,s=i.y,l=void 0===s?0:s,c=i.container,u=c.x,f=c.y;this.element.style.left="".concat(+o+u+n,"px"),this.element.style.top="".concat(+l+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=We(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=i.y,s=i.bounding,l=i.position;if(!s)return[n,r];var c=this.element,u=c.offsetWidth,f=c.offsetHeight,d=We([+a+n,+o+r],2),h=d[0],p=d[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:h<v,right:h+u>v+s.width,top:p<m,bottom:p+f>m+s.height},b=[];l.split("-").forEach(function(t){y[t]?b.push(g[t]):b.push(t)});var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,a=n.width,o=n.height;return new lb(r,i,a,o).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout(function(){e.element.style.transition=n},10)},e.tag="tooltip",e}(sx),YM=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[tg.BOUNDS_CHANGED,tg.INSERTED,tg.REMOVED],n.$margin=Xb(0),n.$padding=Xb(0);var r=e.style||{},i=r.margin,a=void 0===i?0:i,o=r.padding,s=void 0===o?0:o;return n.margin=a,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return Re(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Xb(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Xb(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,a=t.width,o=t.height,s=We(this.$margin,4),l=s[0],c=s[1],u=s[2],f=s[3];return new lb(n-f,i-l,a+f+c,o+l+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=We(this.$padding,4),i=r[0],a=r[1],o=r[2],s=r[3],l=We(this.$margin,4),c=l[0],u=l[3];return new lb(s+u,i+c,e-s-a,n-i-o)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:Nb,grid:Pb},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map(function(t){return t.getBBox()}),this.attributes);this.children.forEach(function(t,e){var n=r[e],i=n.x,a=n.y;t.style.transform="translate(".concat(i,", ").concat(a,")")})}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach(function(e){t.addEventListener(e,function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())})})},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(Ug);function HM(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let a=0,o=0;return e>0&&(a=e),r<0&&(a=r),n>0&&(o=n),i<0&&(o=i),[a,o]}const VM=Gm(t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:a,labelTransform:o,labelTransformOrigin:s,x:l,y:c,x0:u=l,y0:f=c,text:d,background:h,connector:p,startMarker:g,endMarker:v,coordCenter:m,innerHTML:y}=e,b=De(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${l}, ${c})`,[l,c,u,f].some(t=>!I(t)))return void t.children.forEach(t=>t.remove());const x=Ja(b,"background"),{padding:w}=x,k=De(x,["padding"]),M=Ja(b,"connector"),{points:O=[]}=M,E=De(M,["points"]);let S;S=y?Mm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",y).call(Am,Object.assign({transform:o,transformOrigin:s},b)).node():Mm(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Am,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},b)).node();const A=Mm(t).maybeAppend("background","rect").style("zIndex",-1).call(Am,function(t,e=[]){const[n=0,r=0,i=n,a=r]=e,o=t.parentNode,s=o.getEulerAngles();o.setEulerAngles(0);const{min:l,halfExtents:c}=t.getLocalBounds(),[u,f]=l,[d,h]=c;return o.setEulerAngles(s),{x:u-a,y:f-n,width:2*d+a+r,height:2*h+n+i}}(S,w)).call(Am,h?k:{}).node(),_=function(t,e,n,r,i=!0,a=!0){const o=t=>Ol()(t);if(!e[0]&&!e[1])return o([HM(t),e]);if(!n.length)return o([[0,0],e]);const[s,l]=n,c=[...l],u=[...s];if(l[0]!==s[0]){const t=i?-4:4;c[1]=l[1],a&&!i&&(c[0]=Math.max(s[0],l[0]-t),l[1]<s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.max(u[0],c[0]-t))),a||i||(c[0]=Math.max(s[0],l[0]-t),l[1]>s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.max(u[0],c[0]-t))),!a&&i&&(c[0]=Math.min(s[0],l[0]-t),l[1]>s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.min(u[0],c[0]-t))),a&&i&&(c[0]=Math.min(s[0],l[0]-t),l[1]<s[1]?u[1]=c[1]:(u[1]=s[1],u[0]=Math.min(u[0],c[0]-t)))}return o([l,c,u,s,e])}(A,[+u-+l,+f-+c],O,0,+u<m[0],+f<m[1]),T=g&&new gx({id:"startMarker",style:Object.assign({x:0,y:0},Ja(b,"startMarker"))}),N=v&&new gx({id:"endMarker",style:Object.assign({x:0,y:0},Ja(b,"endMarker"))});Mm(t).maybeAppend("connector","path").style("zIndex",0).style("d",_).style("markerStart",T).style("markerEnd",N).call(Am,p?E:{})}),qM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:l=0,transform:c=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s},[[f,d]]=e;return Mm(new VM).style("x",f).style("y",d).call(Am,i).style("transform",`${c}rotate(${+l})`).style("coordCenter",n.getCenter()).call(Am,u).call(Am,t).node()}};qM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const XM=Gm(t=>{const e=De(t.attributes,["class","x","y","transform"]),n=Ja(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[s,l]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,l],["L",a,o],["Z"]]}(r/2),a=Mm(t).maybeAppend("marker",()=>new gx({})).call(t=>t.node().update(Object.assign({symbol:i},n))).node(),[o,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(a);Mm(t).maybeAppend("text","text").style("x",o).style("y",s).call(Am,e)}),UM=(t,e)=>{const n=De(t,[]);return(t,e,r)=>{const{color:i}=r,a=De(r,["color"]),{color:o=i,text:s=""}=e,l={text:String(s),stroke:o,fill:o},[[c,u]]=t;return Mm(new XM).call(Am,a).style("transform",`translate(${c},${u})`).call(Am,l).call(Am,n).node()}};UM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const KM=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:l=0,transform:c=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,d]]=e;return Mm(new cv).style("x",f).style("y",d).call(Am,i).style("transformOrigin","center center").style("transform",`${c}rotate(${l}deg)`).style("coordCenter",n.getCenter()).call(Am,u).call(Am,t).node()}};KM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ZM=Gm(t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,a=t.ownerDocument;Mm(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(Am,i),Mm(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(Am,r)}),QM=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,o=De(t,["curve","gradient","defined","connect"]),{coordinate:s,document:l}=e;return(t,e,c)=>{const{color:u}=c,{color:f=u,seriesColor:d,seriesX:h,seriesY:p}=e,g=Jl(s),v=Lm(s,e),m=r&&d?Tm(d,h,p,r,void 0,g):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},c),{stroke:m,fill:m}),v&&{transform:v}),o),[b,x]=function(t,e){const n=[],r=[],i=[];let a=!1,o=null;const s=t.length/2;for(let l=0;l<s;l++){const c=t[l],u=t[l+s];if([...c,...u].some(t=>!e(t)))a=!0;else{if(n.push(c),r.push(u),a&&o){a=!1;const[t,e]=o;i.push([t,c,e,u])}o=[c,u]}}return[n.concat(r),i]}(t,i),w=Ja(y,"connect"),k=!!x.length,M=t=>Mm(l.createElement("path",{})).style("d",t||"").call(Am,y).node();if(tc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),a=t.slice(t.length/2);return function(){var t=El().curve(Sl),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Tl(n())},delete t.lineX0,t.lineEndAngle=function(){return Tl(r())},delete t.lineX1,t.lineInnerRadius=function(){return Tl(i())},delete t.lineY0,t.lineOuterRadius=function(){return Tl(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(_l(t)):e()._curve},t}().angle((t,n)=>Cs(_s(r[n],e))).outerRadius((t,n)=>Ns(r[n],e)).innerRadius((t,n)=>Ns(a[n],e)).defined((t,e)=>[...r[e],...a[e]].every(i)).curve(n)(a)};return!k||a&&!Object.keys(w).length?M(e(b)):k&&!a?M(e(t)):Mm(new ZM).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?El().y((t,n)=>e[n][1]).x1((t,n)=>e[n][0]).x0((t,e)=>r[e][0]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e):El().x((t,n)=>e[n][0]).y1((t,n)=>e[n][1]).y0((t,e)=>r[e][1]).defined((t,n)=>[...e[n],...r[n]].every(i)).curve(n)(e)};return!k||a&&!Object.keys(w).length?M(e(b)):k&&!a?M(e(t)):Mm(new ZM).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};QM.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const JM=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=tc(n)?Fl:wl;return QM(Object.assign({curve:i},t),e)(...r)}};JM.props=Object.assign(Object.assign({},QM.props),{defaultMarker:"square"});const tO=(t,e)=>{const n=De(t,[]),{coordinate:r}=e;return(...t)=>{const i=tc(r)?Dl:Jl(r)?Xl:ql;return QM(Object.assign({curve:i},n),e)(...t)}};tO.props=Object.assign(Object.assign({},QM.props),{defaultMarker:"smooth"});const eO=(t,e)=>(...n)=>QM(Object.assign({curve:Kl},t),e)(...n);eO.props=Object.assign(Object.assign({},QM.props),{defaultMarker:"hvh"});const nO=(t,e)=>(...n)=>QM(Object.assign({curve:Zl},t),e)(...n);nO.props=Object.assign(Object.assign({},QM.props),{defaultMarker:"vh"});const rO=(t,e)=>(...n)=>QM(Object.assign({curve:Ql},t),e)(...n);rO.props=Object.assign(Object.assign({},QM.props),{defaultMarker:"hv"});const iO=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Qy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};iO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aO=(t,e)=>{const n=De(t,[]),{document:r}=e;return(t,e,i)=>{const{color:a}=i,o=De(i,["color"]),{color:s=a,transform:l}=e,[c,u]=t,f=ul();return f.moveTo(c[0],c[1]),f.bezierCurveTo(c[0]/2+u[0]/2,c[1],c[0]/2+u[0]/2,u[1],u[0],u[1]),Mm(r.createElement("path",{})).call(Am,o).style("d",f.toString()).style("stroke",s).style("transform",l).call(Am,n).node()}};function oO(t,e,n,r){const i=ul();if(tc(n)){const a=n.getCenter(),o=Ns(t,a),s=(Ns(e,a)-o)*r+o;return i.moveTo(t[0],t[1]),_m(i,t,e,a,s),i.lineTo(e[0],e[1]),i}return Jl(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}aO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sO=(t,e)=>{const{cornerRatio:n=1/3}=t,r=De(t,["cornerRatio"]),{coordinate:i,document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,l=De(o,["defaultColor"]),{color:c=s,transform:u}=e,[f,d]=t,h=oO(f,d,i,n);return Mm(a.createElement("path",{})).call(Am,l).style("d",h.toString()).style("stroke",c).style("transform",u).call(Am,r).node()}};sO.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const lO=(t,e)=>{const n=De(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,transform:c}=e,[u,f]=t,d=ul();if(d.moveTo(u[0],u[1]),tc(r)){const t=r.getCenter();d.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{_m(d,u,f,Rs(u,f),Ns(u,f)/2)}return Mm(i.createElement("path",{})).call(Am,s).style("d",d.toString()).style("stroke",l).style("transform",c).call(Am,n).node()}};function cO(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function uO(t={}){return[...cO(t),{name:"title",scale:"identity"}]}function fO(){return[{type:Ao,channel:"color"},{type:zo,channel:["x","y"]}]}function dO(){return[{type:Ao,channel:"x"},{type:zo,channel:["y"]}]}function hO(t={}){return cO(t)}function pO(){return[{type:Co}]}function gO(t,e){return t.getBandWidth(t.invert(e))}function vO(t,e,n={}){const{x:r,y:i,series:a}=e,{x:o,y:s,series:l}=t,{style:{bandOffset:c=(l?0:.5),bandOffsetX:u=c,bandOffsetY:f=c}={}}=n,d=!!(null==o?void 0:o.getBandWidth),h=!!(null==s?void 0:s.getBandWidth),p=!!(null==l?void 0:l.getBandWidth);return d||h?(t,e)=>{const n=d?gO(o,r[e]):0,c=h?gO(s,i[e]):0,g=p&&a?(gO(l,a[e])/2+ +a[e])*n:0,[v,m]=t;return[v+u*n+g,m+f*c]}:t=>t}function mO(t){return parseFloat(t)/100}function yO(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions(),l=Array.from(t,t=>{const e=i[t],n=a[t];return[["string"==typeof e?mO(e)*o:+e,"string"==typeof n?mO(n)*s:+n]]});return[t,l]}lO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,src:c="",size:u=32,transform:f=""}=i;let{width:d=u,height:h=u}=t;const[[p,g]]=e,[v,m]=n.getSize();d="string"==typeof d?mO(d)*v:d,h="string"==typeof h?mO(h)*m:h;const y=p-Number(d)/2,b=g-Number(h)/2;return Mm(r.createElement("image",{})).call(Am,s).style("x",y).style("y",b).style("src",c).style("stroke",l).style("transform",f).call(Am,t).style("width",d).style("height",h).node()}};function xO(t,e){const n=ul();if(tc(e)){const r=e.getCenter(),i=[...t,t[0]],a=i.map(t=>Ns(t,r));return i.forEach((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const o=a[i],s=t[i-1],l=a[i-1];void 0!==l&&Math.abs(o-l)<1e-10?_m(n,s,e,r,o):n.lineTo(e[0],e[1])}),n.closePath(),n}return function(t,e){return e.forEach((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])),t.closePath(),t}(n,t)}bO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,transform:c}=i,u=xO(e,n);return Mm(r.createElement("path",{})).call(Am,s).style("d",u.toString()).style("stroke",l).style("fill",l).style("transform",c).call(Am,t).node()}};function kO(t,e){const[n,r,i,a]=t,o=ul();if(tc(e)){const t=e.getCenter(),s=Ns(t,n);return o.moveTo(n[0],n[1]),o.quadraticCurveTo(t[0],t[1],i[0],i[1]),_m(o,i,a,t,s),o.quadraticCurveTo(t[0],t[1],r[0],r[1]),_m(o,r,n,t,s),o.closePath(),o}return o.moveTo(n[0],n[1]),o.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(n[0],n[1]),o.closePath(),o}wO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const MO=(t,e)=>{const n=De(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=De(a,["color"]),{color:l=o,transform:c}=e,u=kO(t,r);return Mm(i.createElement("path",{})).call(Am,s).style("d",u.toString()).style("fill",l||o).style("stroke",l||o).style("transform",c).call(Am,n).node()}};function OO(t,e){const n=ul();if(tc(e)){const r=e.getCenter(),[i,a]=r,o=Ps(_s(t[0],r)),s=Ps(_s(t[1],r)),l=Ns(r,t[2]),c=Ns(r,t[3]),u=Ns(r,t[8]),f=Ns(r,t[10]),d=Ns(r,t[11]);n.moveTo(...t[0]),n.arc(i,a,l,o,s),n.arc(i,a,l,s,o,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,a,c,o,s),n.lineTo(...t[6]),n.arc(i,a,f,s,o,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,a,u,o,s),n.arc(i,a,u,s,o,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,a,d,o,s),n.arc(i,a,d,s,o,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}MO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const EO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:l,fill:c=l,stroke:u=l}=a,f=De(a,["color","fill","stroke"]),d=OO(e,n);return Mm(r.createElement("path",{})).call(Am,f).style("d",d.toString()).style("stroke",u).style("fill",o||c).style("transform",s).call(Am,t).node()}};function SO(t,e,n=4){const r=ul();if(!tc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[a,o]=i,s=Ns(i,t[3]),l=Ns(i,t[8]),c=Ns(i,t[10]),u=Ps(_s(t[2],i)),f=Math.asin(n/l),d=u-f,h=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(d)*s+a,Math.sin(d)*s+o),r.arc(a,o,s,d,h),r.lineTo(Math.cos(h)*c+a,Math.sin(h)*c+o),r.arc(a,o,c,h,d,!0),r.lineTo(Math.cos(d)*s+a,Math.sin(d)*s+o),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(d+h)/2;return r.moveTo(Math.cos(p)*(l+n/2)+a,Math.sin(p)*(l+n/2)+o),r.arc(Math.cos(p)*l+a,Math.sin(p)*l+o,n/2,p,2*Math.PI+p),r.closePath(),r}EO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const AO=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:l,fill:c=l,stroke:u=l}=a,f=De(a,["color","fill","stroke"]),d=SO(e,n,4);return Mm(r.createElement("path",{})).call(Am,f).style("d",d.toString()).style("stroke",u).style("fill",o||c).style("transform",s).call(Am,t).node()}};AO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _O=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=De(t,["arrow","arrowSize"]),{coordinate:a,document:o}=e;return(t,e,s)=>{const{color:l,lineWidth:c}=s,u=De(s,["color","lineWidth"]),{color:f=l,size:d=c}=e,h=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(o,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},Ja(i,"arrow"))):null,p=function(t,e){if(!tc(e))return Ol().x(t=>t[0]).y(t=>t[1])(t);const n=e.getCenter();return yl()({startAngle:0,endAngle:2*Math.PI,outerRadius:Ns(t[0],n),innerRadius:Ns(t[1],n)})}(t,a),g=function(t,e){if(!tc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(a,e.transform);return Mm(o.createElement("path",{})).call(Am,u).style("d",p).style("stroke",f).style("lineWidth",d).style("transform",g).style("markerEnd",h).call(Am,i).node()}};function TO(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}_O.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NO=(t,e)=>{const{offsetX:n=0,sourceOffsetX:r=n,targetOffsetX:i=n,offsetY:a=0,sourceOffsetY:o=a,targetOffsetY:s=a,connectLength1:l,endMarker:c=!0}=t,u=De(t,["offsetX","sourceOffsetX","targetOffsetX","offsetY","sourceOffsetY","targetOffsetY","connectLength1","endMarker"]),{coordinate:f}=e;return(t,e,n)=>{const{color:a,connectLength1:d}=n,h=De(n,["color","connectLength1"]),{color:p,transform:g}=e,v=function(t,e,n,r,i,a,o=0){const[[s,l],[c,u]]=e;if(Jl(t)){const t=s+n,e=t+o,f=l+i,d=u+a;return[[t,f],[e,f],[e,d],[c+r,d]]}const f=l-n,d=f-o,h=s-i,p=c-a;return[[h,f],[h,d],[p,d],[p,u-r]]}(f,t,o,s,r,i,null!=l?l:d),m=Ja(Object.assign(Object.assign({},u),n),"endMarker");return Mm(new nv).call(Am,h).style("d",function(t){return Ol().x(t=>t[0]).y(t=>t[1])(t)}(v)).style("stroke",p||a).style("transform",g).style("markerEnd",c?new gx({className:"marker",style:Object.assign(Object.assign({},m),{symbol:TO})}):null).call(Am,u).node()}};function PO(t,e,n,r){const{bounds:i}=n,[[a,o],[s,l]]=i,c=s-a,u=l-o,f=t=>{const{x:e,y:r}=t,i=no(n.x,c),s=no(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+a,y:(s||r)+o})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAlign:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function CO(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s}=n,l=r.getCenter(),c=Pm(r,e,[i,a]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=c,p="inside"===t?(d+h)/2:h,g=jO(p,o,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[a,o]="inside"===t?LO(l,p,i):Rs(n,r);return{x:a,y:o}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function LO(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function jO(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function RO(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s,radius:l=.5,offset:c=0}=n,u=Pm(r,e,[i,a]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:jO(p,o,s)},{innerRadius:v,outerRadius:m}=u,y=v+(m-v)*l+c,[b,x]=LO(h,p,y);return Object.assign({x:b,y:x},g)}function IO(t){return void 0===t?null:t}function DO(t,e,n,r){const{bounds:i}=n,[a]=i;return{x:IO(a[0]),y:IO(a[1])}}function BO(t,e,n,r){const{bounds:i}=n;if(1===i.length)return DO(0,0,n);return(ec(r)?CO:ac(r)?RO:PO)(t,e,n,r)}function FO(t,e,n){const r=Pm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:a}=r;return i+(a-i)}function zO(t,e,n){const r=Pm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:a}=r;return(i+a)/2}function WO(t,e,n,r){const{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,f=r.getCenter(),d=zO(e,n,r),h=Math.sin(d)>0?1:-1,p=jO(d,i,a),g={textAlign:h>0||ec(r)?"start":"end",textBaseline:"middle",rotate:p},v=FO(e,n,r),m=v+(s?l:o),[[y,b],[x,w],[k,M]]=function(t,e,n,r,i){const[a,o]=LO(t,e,n),[s,l]=LO(t,e,r);return[[a,o],[s,l],[s+(Math.sin(e)>0?1:-1)*i,l]]}(f,d,v,m,s?c:0),O=s?+u*h:0,E=k+O,S={connector:s,connectorPoints:[[x-E,w-M],[k-E,M-M]]};return Object.assign(Object.assign({x0:y,y0:b,x:k+O,y:M},g),S)}function $O(t,e={}){const{labelHeight:n=14,height:r}=e,i=lr(t,t=>t.y),a=i.length,o=new Array(a);for(let t=0;t<a;t++){const e=i[t],{y:r}=e;o[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=o.length-1;t>0;t--){const e=o[t],n=o[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),o.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let l=0;for(const t of o){const{y:e,labels:r}=t;let a=e-n;for(const t of r){const e=i[l++],r=a+n-t;e.connectorPoints[0][1]-=r,e.y=a+n,a+=n}}}function GO(t,e){const n=lr(t,t=>t.y),{height:r,labelHeight:i=14}=e,a=Math.ceil(r/i);if(n.length<=a)return $O(n,e);const o=[];for(let t=0;t<n.length;t++)t<n.length-a?(n[t].opacity=0,n[t].connector=!1):o.push(n[t]);$O(o,e)}NO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const YO=new WeakMap;var HO=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,a=e.slice(0,i),o=e.slice(i);let s=wr(a,(t,e)=>Math.abs(t[1]-o[e][1]));s=Math.max(Math.min(s,i-2),1);const l=t=>[a[t][0],(a[t][1]+o[t][1])/2],c=l(s),u=l(s-1),f=Ps(_s(l(s+1),u))/Math.PI*180;return{x:c[0],y:c[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:BO,bottomLeft:BO,bottomRight:BO,inside:BO,left:BO,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?DO(0,0,n):(ec(r)?CO:ac(r)?WO:PO)(t,e,n,r)},right:BO,spider:function(t,e,n,r,i,a){if(!ac(r))return{};if(YO.has(e))return YO.get(e);const o=a.map(t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:a}=e,o=De(WO(0,t,e,n),[]),s=n.getCenter(),l=FO(t,e,n),c=zO(t,e,n),u=l+r+i,f=Math.sin(c)>0?1:-1,d=s[0]+(u+ +a)*f,{x:h}=o,p=d-h;return o.x+=p,o.connectorPoints[0][0]-=p,o}(t,n,r)),{width:s,height:l}=r.getOptions(),c=o.filter(t=>t.x<s/2),u=o.filter(t=>t.x>=s/2),f=Object.assign(Object.assign({},i),{height:l});return GO(c,f),GO(u,f),o.forEach((t,e)=>YO.set(a[e],t)),YO.get(e)},surround:function(t,e,n,r){if(!ac(r))return{};const{connectorLength:i,connectorLength2:a,connectorDistance:o}=n,s=De(WO(0,e,n,r),[]),{x0:l,y0:c}=s,u=r.getCenter(),f=function(t){if(ac(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(t=>"polar"===t[0]);if(r)return Math.max(e,n)/2*r[4]}return 0}(r),d=f+i,h=Cs([l-u[0],c-u[1]]),p=Math.sin(h)>0?1:-1,[g,v]=LO(u,h,d);return s.x=g+(a+o)*p,s.y=v,s},top:BO,topLeft:BO,topRight:BO});function VO(t,e,n,r,i,a){const{position:o}=e,{render:s}=i,l=function(t,e){return void 0!==t?t:ac(e)?"inside":Jl(e)?"right":"top"}(o,n),c=r[s?"htmlLabel":"inside"===l?"innerLabel":"label"],u=Object.assign({},c,e),f=HO[Ay(l)];if(!f)throw new Error(`Unknown position: ${l}`);return Object.assign(Object.assign({},c),f(l,t,u,n,i,a))}const qO=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,a,o,s)=>{const{text:l,x:c,y:u,transform:f="",transformOrigin:d,className:h=""}=a,p=De(a,["text","x","y","transform","transformOrigin","className"]),g=VO(e,a,n,r,t,s),{rotate:v=0,transform:m=""}=g,y=De(g,["rotate","transform"]);return Mm(new VM).call(Am,y).style("text",`${l}`).style("className",`${h} g2-label`).style("innerHTML",i?i(l,a.datum,a.index):void 0).style("labelTransform",`${m} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",d).style("coordCenter",n.getCenter()).call(Am,p).node()}};qO.props={defaultMarker:"point"};const XO=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=De(t,["arrow","colorAttribute"]),{coordinate:a,document:o}=e;return(t,e,n)=>{const{color:s,stroke:l}=n,c=De(n,["color","stroke"]),{d:u,color:f=s}=e,[d,h]=a.getSize();return Mm(o.createElement("path",{})).call(Am,c).style("d","function"==typeof u?u({width:d,height:h}):u).style(r,f).call(Am,i).node()}};XO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const UO=(t,e)=>XO(Object.assign({colorAttribute:"fill"},t),e);UO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const KO=(t,e)=>XO(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);KO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ZO=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:a}=r,{color:o}=i,s=De(i,["color"]),{color:l=o}=r,[c,...u]=e,f=ul();return f.moveTo(...c),u.forEach(([t,e])=>{f.lineTo(t,e)}),f.closePath(),Mm(n.createElement("path",{})).call(Am,s).style("d",f.toString()).style("stroke",l||o).style("fill",l||o).style("fillOpacity",.4).style("transform",a).call(Am,t).node()}};function QO(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}function JO(t,e=(...t)=>`${t[0]}`,n=16){const r=QO(n);return(...n)=>{const i=e(...n);let a=r.get(i);return r.has(i)?r.get(i):(a=t(...n),r.set(i,a),a)}}function tE(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}ZO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},QO(3);const eE=JO((t,e,n)=>{const r=tE(n,2*t,2*t),i=r.getContext("2d"),a=t,o=t;if(1===e)i.beginPath(),i.arc(a,o,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(a,o,t*e,a,o,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r},t=>`${t}`);function nE(t,e,n,r,i,a,o){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},a);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const l=tE(o,t,e).getContext("2d"),c=function(t,e){const n=tE(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map(t=>{const[e,n]=t.split(":");return[+e,n]}):t}(t).forEach(([t,e])=>{r.addColorStop(t,e)}),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,o);l.clearRect(0,0,t,e),function(t,e,n,r,i,a){const{blur:o}=i;let s=r.length;for(;s--;){const{x:i,y:l,value:c,radius:u}=r[s],f=Math.min(c,n),d=i-u,h=l-u,p=eE(u,1-o,a),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,d,h)}}(l,n,r,i,s,o);const u=function(t,e,n,r,i){const{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=e,u=n,f=t.getImageData(0,0,c,u),d=f.data,h=d.length;for(let t=3;t<h;t+=4){const e=d[t],n=4*e;if(!n)continue;const i=o||Math.max(0,Math.min(s,Math.max(a,e)));d[t-3]=r[n],d[t-2]=r[n+1],d[t-1]=r[n+2],d[t]=l?r[n+3]:i}return f}(l,t,e,c,s),f=tE(o,t,e).getContext("2d");return f.putImageData(u,0,0),f}const rE=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:o,useGradientOpacity:s}=t,l=De(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:c,createCanvas:u,document:f}=e;return(t,e,d)=>{const{transform:h}=e,[p,g]=c.getSize(),v=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),m=kr(t,t=>t[2]),y=xr(t,t=>t[2]),b=p&&g?nE(p,g,m,y,v,function(t,e){return Object.keys(t).reduce((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n},{})}({gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:o,useGradientOpacity:s},t=>void 0===t),u):{canvas:null};return Mm(f.createElement("image",{})).call(Am,d).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",h).call(Am,l).node()}};rE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iE=(t,e)=>{const{render:n}=t,r=De(t,["render"]);return t=>{const[[i,a]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:a}),e)}};iE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aE="main-layer",oE="label-layer",sE="element",lE="view",cE="plot",uE="component",fE="label",dE="area",hE="axis-breaks",pE="axis-breaks-group",gE=.03,vE={fill:"#fff",stroke:"#aaa",lineDash:"4 3",lineWidth:.5,fillOpacity:1,strokeOpacity:1},mE=(t,e,n,r,i,a)=>{const o=[],s=[],l=r-1;for(let r=1;r<l;r++){const c=r/l*e,u=t+(r%2==0?n:-n);o.push(`${c},${u}`),s.push(`${c},${i?u-a:u+a}`)}return o.push(`${e},${t}`),s.push(`${e+a},${t}`),[o,s]},yE=(t,e)=>{const{context:n,selection:r,view:i}=e,a=r.select(`.${cE}`).node(),{document:o}=n.canvas,{scale:s}=i,l=new Map;return t=>{const{key:e,start:r,end:i,gap:c=gE,vertices:u=50,lineWidth:f=.5,verticeOffset:d=3}=t,h=De(t,["key","start","end","gap","vertices","lineWidth","verticeOffset"]),p=o.createElement("g",{id:`break-group-${e}`,className:pE}),g=at(s,"x.sortedDomain",[]),v=s.y.getOptions(),{range:m,domain:y}=v,b=y.indexOf(r),x=y.indexOf(i),{width:w,height:k}=a.getBBox();if(-1===b||-1===x||!g.length)return p;const M=m[0]>m[1],O=m[b]*k,E=m[x]*k;let S="",A="";for(const[t,{y:e,isLower:n}]of[{y:E,isLower:!1},{y:O,isLower:!0}].entries()){const r=M?f:-f,[i,a]=mE(e,w-0,d,u,n,r);0===t?(S=`M 0,${e} L ${i.join(" L ")} `,A=`M ${0-f},${e+r} L ${a.join(" L ")} `):(S+=`L ${w-0},${e} L ${[...i].reverse().join(" L ")} L 0,${e} Z`,A+=`L ${w-0+f+2},${e-r} L ${[...a].reverse().join(" L ")} L ${0-f},${e-r} Z`)}const _=Object.assign(Object.assign({},vE),h);try{const t=new nv({style:Object.assign(Object.assign({},_),{d:S})}),o=new nv({style:Object.assign(Object.assign({},_),{d:A,lineWidth:0,cursor:"pointer"})});o.addEventListener("click",t=>Fe(void 0,void 0,void 0,function*(){t.stopPropagation(),2===t.detail&&(yield((t,e,r)=>Fe(void 0,void 0,void 0,function*(){const{update:i,setState:a}=n.externals;a("options",n=>{const{marks:i}=n;if(!i||!i.length)return n;const a=i.map(t=>{const n=at(t,"scale.y.breaks",[]),i=n.filter(t=>t.start!==e&&t.end!==r&&!t.collapsed);return n.forEach(t=>{t.start===e&&t.end===r&&(t.collapsed=!0)}),console.log("breaks group:",n,i),tt({},t,{scale:{y:{breaks:i}}})});return l.set(t,{start:e,end:r}),Object.assign(Object.assign({},n),{marks:a})}),yield i()}))(e,r,i))})),p.appendChild(t),p.appendChild(o),a.addEventListener("click",t=>Fe(void 0,void 0,void 0,function*(){2===t.detail&&(yield Fe(void 0,void 0,void 0,function*(){if(!l.size)return;const{update:t,setState:e}=n.externals;e("options",t=>{const{marks:e}=t,n=e.map(t=>{const e=at(t,"scale.y.breaks",[]);return ot(t,"scale.y.breaks",e.map(t=>Object.assign(Object.assign({},t),{collapsed:!1}))),t});return l.clear(),Object.assign(Object.assign({},t),{marks:n})}),yield t()}))})),a.appendChild(p)}catch(t){console.error("Failed to create break path:",t)}return p}};function bE(t,e){return t.getBandWidth(t.invert(e))}yE.props={};const xE={rect:Dm,hollow:Bm,funnel:zm,pyramid:$m},wE=()=>(t,e,n,r)=>{const{x:i,y1:a,series:o,size:s}=n;let{y:l}=n;l=l.map(t=>void 0!==t?t:1);const c=e.x,u=e.series,[f]=r.getSize(),d=s?s.map(t=>+t/f):null,h=s?(t,e,n)=>{const r=t+e/2,i=d[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,t=>{const e=bE(c,i[t]),n=e*(u?bE(u,null==o?void 0:o[t]):1),s=(+(null==o?void 0:o[t])||0)*e,f=+i[t]+s,[d,p]=h(f,n,t),g=+l[t],v=+a[t];return[[d,g],[p,g],[p,v],[d,v]].map(t=>r.map(t))});return[t,p]};wE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:xE,channels:[...uO({shapes:Object.keys(xE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...pO(),{type:Fn},{type:_o}],postInference:[...dO()],interaction:{shareTooltip:!0}};const kE={rect:Dm,hollow:Bm},ME=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n,l=Array.from(t,t=>[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t)));return[t,l]};ME.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:kE,channels:[...uO({shapes:Object.keys(kE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...pO(),{type:Fn}],postInference:[...dO()],interaction:{shareTooltip:!0}};const OE={line:Vm,smooth:qm,hv:Xm,vh:Um,hvh:Km,trail:Qm},EE=(t,e,n,r)=>{var i,a;const{series:o,x:s,y:l}=n,{x:c,y:u}=e;if(void 0===s||void 0===l)throw new Error("Missing encode for x or y channel.");const f=o?Array.from(rr(t,t=>o[t]).values()):[t],d=f.map(t=>t[0]).filter(t=>void 0!==t),h=((null===(i=null==c?void 0:c.getBandWidth)||void 0===i?void 0:i.call(c))||0)/2,p=((null===(a=null==u?void 0:u.getBandWidth)||void 0===a?void 0:a.call(u))||0)/2,g=Array.from(f,t=>t.map(t=>r.map([+s[t]+h,+l[t]+p])));return[d,g,f]},SE=(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===i.length)throw new Error("Missing encode for position channel.");tc(r)&&i.push(i[0]);const a=Array.from(t,t=>{const e=i.map(e=>+e[t]),n=r.map(e),a=[];for(let t=0;t<n.length;t+=2)a.push([n[t],n[t+1]]);return a});return[t,a]},AE=()=>(t,e,n,r)=>(rc(r)?SE:EE)(t,e,n,r);AE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:OE,channels:[...uO({shapes:Object.keys(OE)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...pO(),{type:Ho},{type:Lo}],postInference:[...dO(),{type:Ao,channel:"color"},{type:zo,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const _E={hollow:Ly,hollowDiamond:Py,hollowHexagon:Cy,hollowSquare:jy,hollowTriangleDown:Iy,hollowTriangle:Ry,hollowBowtie:Ny,hollowCircle:Fy,point:qy,plus:Vy,diamond:$y,square:Xy,triangle:Ky,hexagon:Gy,cross:Wy,bowtie:zy,hyphen:Yy,line:Hy,tick:Uy,triangleDown:Zy,circle:By},TE=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s,y1:l,size:c,dx:u,dy:f}=r,[d,h]=i.getSize(),p=vO(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+a[t]+ +s[t])/2:+a[t])+e,(l?(+o[t]+ +l[t])/2:+o[t])+n]},v=c?Array.from(e,t=>{const[e,n]=g(t),r=+c[t],a=r/d,o=r/h,s=[e-a,n-o],l=[e+a,n+o];return[i.map(p(s,t)),i.map(p(l,t))]}):Array.from(e,t=>[i.map(p(g(t),t))]);return[e,v]};TE.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:_E,channels:[...uO({shapes:Object.keys(_E)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...pO(),{type:_o},{type:To}],postInference:[{type:Po},...fO()]};const NE={text:qM,badge:UM,tag:KM},PE=t=>{const{cartesian:e=!1}=t;return e?yO:(e,n,r,i)=>{const{x:a,y:o}=r,s=vO(n,r,t),l=Array.from(e,t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]});return[e,l]}};PE.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:NE,channels:[...uO({shapes:Object.keys(NE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...pO(),{type:Yo},{type:$o}],postInference:[...fO()]};const CE={cell:Dm,hollow:Bm},LE=()=>(t,e,n,r)=>{const{x:i,y:a}=n,o=e.x,s=e.y,l=Array.from(t,t=>{const e=o.getBandWidth(o.invert(+i[t])),n=s.getBandWidth(s.invert(+a[t])),l=+i[t],c=+a[t];return[[l,c],[l+e,c],[l+e,c+n],[l,c+n]].map(t=>r.map(t))});return[t,l]};LE.props={defaultShape:"cell",defaultLabelShape:"label",shape:CE,composite:!1,channels:[...uO({shapes:Object.keys(CE)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...pO(),{type:_o},{type:To},{type:Wo}],postInference:[...fO()]};const jE={area:JM,smooth:tO,hvh:eO,vh:nO,hv:rO},RE=()=>(t,e,n,r)=>{var i,a;const{x:o,y:s,y1:l,series:c}=n,{x:u,y:f}=e,d=c?Array.from(rr(t,t=>c[t]).values()):[t],h=d.map(t=>t[0]).filter(t=>void 0!==t),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(a=null==f?void 0:f.getBandWidth)||void 0===a?void 0:a.call(f))||0)/2,v=Array.from(d,t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const a=t[i];n[i]=r.map([+o[a]+p,+s[a]+g]),n[e+i]=r.map([+o[a]+p,+l[a]+g])}return n});return[h,v,d]};RE.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:jE,channels:[...uO({shapes:Object.keys(jE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...pO(),{type:Lo},{type:Fn},{type:Wo}],postInference:[...dO()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const IE={link:iO,arc:lO,smooth:aO,vhv:sO},DE=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s=a,y1:l=o}=r,c=vO(n,r,t),u=e.map(t=>[i.map(c([+a[t],+o[t]],t)),i.map(c([+s[t],+l[t]],t))]);return[e,u]};DE.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:IE,channels:[...uO({shapes:Object.keys(IE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...pO(),{type:Io},{type:Do}],postInference:[...fO()]};const BE={image:bO},FE=t=>{const{cartesian:e}=t;return e?yO:(e,n,r,i)=>{const{x:a,y:o}=r,s=vO(n,r,t),l=Array.from(e,t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]});return[e,l]}};FE.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:BE,channels:[...uO({shapes:Object.keys(BE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...pO(),{type:Yo},{type:$o}],postInference:[...fO()]};const zE={polygon:wO,ribbon:MO},WE=()=>(t,e,n,r)=>{const i=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),a=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),o=t.map(t=>{const e=[];for(let n=0;n<i.length;n++){const o=i[n][t];if(void 0===o)break;const s=a[n][t];e.push(r.map([+o,+s]))}return e});return[t,o]};WE.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:zE,channels:[...uO({shapes:Object.keys(zE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...pO()],postInference:[...fO()]};const $E={box:EO,violin:AO},GE=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,y2:s,y3:l,y4:c,series:u}=n,f=e.x,d=e.series,h=Array.from(t,t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(d?d.getBandWidth(d.invert(+(null==u?void 0:u[t]))):1),h=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+h+n/2,[g,v,m,y,b]=[+a[t],+o[t],+s[t],+l[t],+c[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,v],[p-n/2,v],[p-n/2,m],[p+n/2,m],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map(t=>r.map(t))});return[t,h]};GE.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:$E,channels:[...uO({shapes:Object.keys($E)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...pO(),{type:_o}],postInference:[...dO()],interaction:{shareTooltip:!0}};const YE={vector:Qy},HE=()=>(t,e,n,r)=>{const{x:i,y:a,size:o,rotate:s}=n,[l,c]=r.getSize(),u=t.map(t=>{const e=+s[t]/180*Math.PI,n=+o[t],u=n/c,f=n/l*Math.cos(e),d=-u*Math.sin(e);return[r.map([+i[t]-f/2,+a[t]-d/2]),r.map([+i[t]+f/2,+a[t]+d/2])]});return[t,u]};HE.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:YE,channels:[...uO({shapes:Object.keys(YE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...pO()],postInference:[...fO()]};const VE={line:_O},qE=t=>(e,n,r,i)=>{const{y:a}=r,o=vO(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[0,a[t]],[1,a[t]]].map(e=>i.map(o(e,t))));return[e,s]};qE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:VE,channels:[...hO({shapes:Object.keys(VE)}),{name:"y",required:!0}],preInference:[...pO(),{type:jo}],postInference:[]};const XE={line:_O},UE=t=>(e,n,r,i)=>{const{x:a}=r,o=vO(n,r,tt({style:{bandOffset:0}},t)),s=Array.from(e,t=>[[a[t],1],[a[t],0]].map(e=>i.map(o(e,t))));return[e,s]};UE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:XE,channels:[...hO({shapes:Object.keys(XE)}),{name:"x",required:!0}],preInference:[...pO(),{type:Ro}],postInference:[]};const KE={connector:NO},ZE=(...t)=>DE(...t);function QE(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:a}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+n]}}function JE(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,a)=>{const o=QE("x",e,i,r.x),s=QE("y",n,i,r.y),l=Array.from(t,t=>{const[e,n]=o(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map(t=>a.map(t))});return[t,l]}}ZE.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:KE,channels:[...hO({shapes:Object.keys(KE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...pO()],postInference:[]};const tS={range:Dm},eS=()=>JE();eS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:tS,channels:[...hO({shapes:Object.keys(tS)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...pO()],postInference:[]};const nS={range:Dm},rS=()=>JE({extendY:!0});rS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:nS,channels:[...hO({shapes:Object.keys(nS)}),{name:"x",required:!0}],preInference:[...pO(),{type:Bo}],postInference:[]};const iS={range:Dm},aS=()=>JE({extendX:!0});aS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:iS,channels:[...hO({shapes:Object.keys(iS)}),{name:"y",required:!0}],preInference:[...pO(),{type:Fo}],postInference:[]};const oS={path:UO,hollow:KO},sS=t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])];function lS(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function cS(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=fS)):void 0===e&&(e=uS);for(var n,r,i,a,o,s=new pS(t),l=[s];n=l.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;a>=0;--a)l.push(r=i[a]=new pS(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(hS)}function uS(t){return t.children}function fS(t){return Array.isArray(t)?t[1]:null}function dS(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hS(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function pS(t){this.data=t,this.depth=this.height=0,this.parent=null}function gS(t){return null==t?null:vS(t)}function vS(t){if("function"!=typeof t)throw new Error;return t}function mS(){return 0}function yS(t){return function(){return t}}function bS(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function xS(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}sS.props={defaultShape:"path",defaultLabelShape:"label",shape:oS,composite:!1,channels:[...uO({shapes:Object.keys(oS)}),{name:"d",scale:"identity"}],preInference:[...pO()],postInference:[]},pS.prototype=cS.prototype={constructor:pS,count:function(){return this.eachAfter(lS)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i=this,a=[i],o=-1;i=a.pop();)if(t.call(e,i,++o,this),n=i.children)for(r=n.length-1;r>=0;--r)a.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return cS(this).eachBefore(dS)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n])}while(a.length)}};var wS={depth:-1},kS={},MS={};function OS(t){return t.id}function ES(t){return t.parentId}function SS(){var t,e=OS,n=ES;function r(r){var i,a,o,s,l,c,u,f,d=Array.from(r),h=e,p=n,g=new Map;if(null!=t){const e=d.map((e,n)=>function(t){t=`${t}`;let e=t.length;_S(t,e-1)&&!_S(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r))),n=e.map(AS),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(AS(t)),d.push(MS));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(o=0,i=d.length;o<i;++o)a=d[o],c=d[o]=new pS(a),null!=(u=h(a,o,r))&&(u+="")&&(f=c.id=u,g.set(f,g.has(f)?kS:c)),null!=(u=p(a,o,r))&&(u+="")&&(c.parent=u);for(o=0;o<i;++o)if(u=(c=d[o]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===kS)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===MS&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(c=d[t]).data===MS;--t)c.data=null}if(s.parent=wS,s.eachBefore(function(t){t.depth=t.parent.depth+1,--i}).eachBefore(hS),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=gS(t),r):e},r.parentId=function(t){return arguments.length?(n=gS(t),r):n},r.path=function(e){return arguments.length?(t=gS(e),r):t},r}function AS(t){let e=t.length;if(e<2)return"";for(;--e>1&&!_S(t,e););return t.slice(0,e)}function _S(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function TS(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var NS=(1+Math.sqrt(5))/2;function PS(t,e,n,r,i,a){for(var o,s,l,c,u,f,d,h,p,g,v,m=[],y=e.children,b=0,x=0,w=y.length,k=e.value;b<w;){l=i-n,c=a-r;do{u=y[x++].value}while(!u&&x<w);for(f=d=u,v=u*u*(g=Math.max(c/l,l/c)/(k*t)),p=Math.max(d/v,v/f);x<w;++x){if(u+=s=y[x].value,s<f&&(f=s),s>d&&(d=s),v=u*u*g,(h=Math.max(d/v,v/f))>p){u-=s;break}p=h}m.push(o={value:u,dice:l<c,children:y.slice(b,x)}),o.dice?xS(o,n,r,i,k?r+=c*u/k:a):TS(o,n,r,k?n+=l*u/k:i,a),k-=u,b=x}return m}var CS=function t(e){function n(t,n,r,i,a){PS(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(NS);function LS(t,e,n,r,i){var a,o,s=t.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function t(e,n,r,i,a,o,l){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}var f=c[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var g=h+p>>>1;c[g]<d?h=g+1:p=g}d-c[h-1]<c[h]-d&&e+1<h&&--h;var v=c[h]-f,m=r-v;if(o-i>l-a){var y=r?(i*m+o*v)/r:o;t(e,h,v,i,a,y,l),t(h,n,m,y,a,o,l)}else{var b=r?(a*m+l*v)/r:l;t(e,h,v,i,a,o,b),t(h,n,m,i,b,o,l)}}(0,l,t.value,e,n,r,i)}function jS(t,e,n,r,i){(1&t.depth?TS:xS)(t,e,n,r,i)}var RS=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,f=-1,d=o.length,h=t.value;++f<d;){for(l=(s=o[f]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?xS(s,n,r,i,h?r+=(a-r)*s.value/h:a):TS(s,n,r,h?n+=(i-n)*s.value/h:i,a),h-=s.value}else t._squarify=o=PS(e,t,n,r,i,a),o.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(NS);function IS(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach(n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],IS(n,n.path)})}function DS(t){const e=at(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach(t=>{DS(t)})}function BS(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:LS,treemapDice:xS,treemapSlice:TS,treemapSliceDice:jS,treemapSquarify:CS,treemapResquarify:RS},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),a=function(t,e){return Array.isArray(t)?"function"==typeof e?SS().path(e)(t):SS()(t):cS(t)}(t,e.path);x(t)?DS(a):IS(a),r?a.sum(t=>e.ignoreParentValue&&t.children?0:function(t){return"function"==typeof t?t:e=>e[t]}(r)(t)).sort(e.sort):a.count(),function(){var t=CS,e=!1,n=1,r=1,i=[0],a=mS,o=mS,s=mS,l=mS,c=mS;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(bS),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<u&&(u=d=(u+d)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=a(e)/2,r+=c(e)-n,u+=o(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=l(e)-n)<u&&(u=d=(u+d)/2),t(e,r,u,f,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=vS(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:yS(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:yS(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:yS(+t),u):s},u.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:yS(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:yS(+t),u):c},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(a);const o=a.descendants().map(t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]})),s=o.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,o]}const FS=t=>{const{cartesian:e}=t;return e?yO:(e,n,r,i)=>{const{x:a,y:o}=r,s=vO(n,r,t),l=Array.from(e,t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]});return[e,l]}};function zS(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,s,l,c,u,f,d,h=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(v+y)/2))?v=o:y=o,i=h,!(h=h[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,h.data),l=+t._y.call(null,h.data),e===s&&n===l)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(v+y)/2))?v=o:y=o}while((f=u<<1|c)==(d=(l>=o)<<1|s>=a));return i[d]=h,i[f]=p,t}function WS(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function $S(t){return t[0]}function GS(t){return t[1]}function YS(t,e,n){var r=new HS(null==e?$S:e,null==n?GS:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function HS(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function VS(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}FS.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:iE},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...pO(),{type:Yo},{type:$o},{type:Go}]};var qS=YS.prototype=HS.prototype;function XS(t){return function(){return t}}function US(t){return 1e-6*(t()-.5)}function KS(t){return t.x+t.vx}function ZS(t){return t.y+t.vy}qS.copy=function(){var t,e,n=new HS(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=VS(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=VS(e));return n},qS.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return zS(this.cover(e,n),e,n,t)},qS.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,s[n]=i,r<l&&(l=r),r>u&&(u=r),i<c&&(c=i),i>f&&(f=i));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;n<a;++n)zS(this,o[n],s[n],t[n]);return this},qS.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;n>t||t>=i||r>e||e>=a;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this},qS.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},qS.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},qS.find=function(t,e,n){var r,i,a,o,s,l,c,u=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new WS(g,u,f,d,h)),null==n?n=1/0:(u=t-n,f=e-n,d=t+n,h=e+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>h||(o=l.x1)<u||(s=l.y1)<f))if(g.length){var v=(i+o)/2,m=(a+s)/2;p.push(new WS(g[3],v,m,o,s),new WS(g[2],i,m,v,s),new WS(g[1],v,a,o,m),new WS(g[0],i,a,v,m)),(c=(e>=m)<<1|t>=v)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);u=t-w,f=e-w,d=t+w,h=e+w,r=g.data}}return r},qS.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,s,l,c,u,f,d,h=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!h)return this;if(h.length)for(;;){if((c=a>=(s=(p+v)/2))?p=s:v=s,(u=o>=(l=(g+m)/2))?g=l:m=l,e=h,!(h=h[f=u<<1|c]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},qS.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},qS.root=function(){return this._root},qS.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},qS.visit=function(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new WS(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var c=(r+a)/2,u=(i+o)/2;(n=l[3])&&s.push(new WS(n,c,u,a,o)),(n=l[2])&&s.push(new WS(n,r,u,c,o)),(n=l[1])&&s.push(new WS(n,c,i,a,u)),(n=l[0])&&s.push(new WS(n,r,i,c,u))}return this},qS.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new WS(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,f=(s+c)/2;(a=i[0])&&n.push(new WS(a,o,s,u,f)),(a=i[1])&&n.push(new WS(a,u,s,l,f)),(a=i[2])&&n.push(new WS(a,o,f,u,c)),(a=i[3])&&n.push(new WS(a,u,f,l,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},qS.x=function(t){return arguments.length?(this._x=t,this):this._x},qS.y=function(t){return arguments.length?(this._y=t,this):this._y};var QS={value:()=>{}};function JS(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new tA(r)}function tA(t){this._=t}function eA(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function nA(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=QS,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}tA.prototype=JS.prototype={constructor:tA,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=nA(i[n],t.name,e);else if(null==e)for(n in i)i[n]=nA(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=eA(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new tA(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var rA,iA,aA=0,oA=0,sA=0,lA=0,cA=0,uA=0,fA="object"==typeof performance&&performance.now?performance:Date,dA="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function hA(){return cA||(dA(pA),cA=fA.now()+uA)}function pA(){cA=0}function gA(){this._call=this._time=this._next=null}function vA(t,e,n){var r=new gA;return r.restart(t,e,n),r}function mA(){cA=(lA=fA.now())+uA,aA=oA=0;try{!function(){hA(),++aA;for(var t,e=rA;e;)(t=cA-e._time)>=0&&e._call.call(void 0,t),e=e._next;--aA}()}finally{aA=0,function(){var t,e,n=rA,r=1/0;for(;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:rA=e);iA=t,bA(r)}(),cA=0}}function yA(){var t=fA.now(),e=t-lA;e>1e3&&(uA-=e,lA=t)}function bA(t){aA||(oA&&(oA=clearTimeout(oA)),t-cA>24?(t<1/0&&(oA=setTimeout(mA,t-fA.now()-uA)),sA&&(sA=clearInterval(sA))):(sA||(lA=fA.now(),sA=setInterval(yA,1e3)),aA=1,dA(mA)))}gA.prototype=vA.prototype={constructor:gA,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?hA():+n)+(null==e?0:+e),this._next||iA===this||(iA?iA._next=this:rA=this,iA=this),this._call=t,this._time=n,bA()},stop:function(){this._call&&(this._call=null,this._time=1/0,bA())}};const xA=4294967296;var wA=Math.PI*(3-Math.sqrt(5));function kA(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,l=vA(f),c=JS("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%xA)/xA}();function f(){d(),c.call("tick",e),n<r&&(l.stop(),c.call("end",e))}function d(r){var l,c,u=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(a-n)*i,s.forEach(function(t){t(n)}),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),a=n*wA;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return l.restart(f),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,l,c=0,u=t.length;for(null==r?r=1/0:r*=r,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=n-s.y)*a)<r&&(l=s,r=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}const MA=(t,e)=>Fe(void 0,void 0,void 0,function*(){const{width:n,height:r}=e,{data:i,encode:a={},scale:o,style:s={},layout:l={}}=t,c=De(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(i,a);return tt({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily},tooltip:{items:[t=>({name:t.text,value:t.value})]}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},l)]},encode:a,scale:o,style:s},c),{axis:!1}))});MA.props={};const OA={density:ZO},EA=()=>(t,e,n,r)=>{const{x:i,series:a}=n,o=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===i||void 0===o||void 0===s)throw new Error("Missing encode for x or y or size channel.");const l=e.x,c=e.series,u=Array.from(t,e=>{const n=l.getBandWidth(l.invert(+i[e])),u=n*(c?c.getBandWidth(c.invert(+(null==a?void 0:a[e]))):1),f=(+(null==a?void 0:a[e])||0)*n,d=+i[e]+f+u/2;return[...o.map((n,r)=>[d+ +s[r][e]/t.length,+o[r][e]]),...o.map((n,r)=>[d-+s[r][e]/t.length,+o[r][e]]).reverse()].map(t=>r.map(t))});return[t,u]};EA.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:OA,channels:[...uO({shapes:Object.keys(OA)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...pO(),{type:Fn},{type:_o}],postInference:[...dO()],interaction:{shareTooltip:!0}};const SA={heatmap:rE},AA=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n,l=Array.from(t,t=>{const e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]});return[[0],[l]]};AA.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:SA,channels:[...uO({shapes:Object.keys(SA)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...pO(),{type:_o},{type:To}],postInference:[...fO()]};const _A={hollow:Ly,hollowDiamond:Py,hollowHexagon:Cy,hollowSquare:jy,hollowTriangleDown:Iy,hollowTriangle:Ry,hollowBowtie:Ny,hollowCircle:Fy,point:qy,plus:Vy,diamond:$y,square:Xy,triangle:Ky,hexagon:Gy,cross:Wy,bowtie:zy,hyphen:Yy,line:Hy,tick:Uy,triangleDown:Zy,circle:By},TA=t=>(e,n,r,i)=>{const{x:a,y:o,size:s}=r;if(!a.length||!o.length)return[e,o.map(()=>[[]])];const[l,c]=i.getSize(),u=vO(n,r,t),f=Array.from(e,t=>({i:t,x:+a[t]*l,y:+o[t]*c,r:+s[t]||4})),d=kA(f).stop().force("collide",function(t){var e,n,r,i=1,a=1;function o(){for(var t,o,l,c,u,f,d,h=e.length,p=0;p<a;++p)for(o=YS(e,KS,ZS).visitAfter(s),t=0;t<h;++t)l=e[t],f=n[l.index],d=f*f,c=l.x+l.vx,u=l.y+l.vy,o.visit(g);function g(t,e,n,a,o){var s=t.data,h=t.r,p=f+h;if(!s)return e>c+p||a<c-p||n>u+p||o<u-p;if(s.index>l.index){var g=c-s.x-s.vx,v=u-s.y-s.vy,m=g*g+v*v;m<p*p&&(0===g&&(m+=(g=US(r))*g),0===v&&(m+=(v=US(r))*v),m=(p-(m=Math.sqrt(m)))/m*i,l.vx+=(g*=m)*(p=(h*=h)/(d+h)),l.vy+=(v*=m)*p,s.vx-=g*(p=1-p),s.vy-=v*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r<a;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=XS(null==t?1:+t)),o.initialize=function(t,n){e=t,r=n,l()},o.iterations=function(t){return arguments.length?(a=+t,o):a},o.strength=function(t){return arguments.length?(i=+t,o):i},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:XS(+e),l(),o):t},o}().radius(t=>t.r+1).strength(1));d.force("x",function(t){var e,n,r,i=XS(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(r[a]-i.x)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=XS(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:XS(+t),o(),a):i},a.x=function(e){return arguments.length?(t="function"==typeof e?e:XS(+e),o(),a):t},a}(t=>t.x).strength(.5)),d.force("y",function(t){var e,n,r,i=XS(.1);function a(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(r[a]-i.y)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),r=new Array(o),a=0;a<o;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=XS(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:XS(+t),o(),a):i},a.y=function(e){return arguments.length?(t="function"==typeof e?e:XS(+e),o(),a):t},a}(t=>t.y).strength(5));for(let t=0;t<200;t++)d.tick();d.stop();const h=t=>{const e=f.find(e=>e.i===t);return[e.x/l,e.y/c]},p=s?Array.from(e,t=>{const[e,n]=h(t),r=+s[t],a=r/l,o=r/c,f=[e-a,n-o],d=[e+a,n+o];return[i.map(u(f,t)),i.map(u(d,t))]}):Array.from(e,t=>[i.map(u(h(t),t))]);return[e,p]};TA.props={defaultShape:"point",defaultLabelShape:"label",composite:!1,shape:_A,channels:[...uO({shapes:Object.keys(_A)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"}],preInference:[...pO(),{type:_o},{type:To}],postInference:[{type:Po},...fO()]};const NA="partition",PA="markType",CA="childNodeCount",LA=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];LA.props={};const jA=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];jA.props={};const RA=t=>new Ui(t);RA.props={};const IA=t=>new pa(t);IA.props={};const DA=t=>new Vi(t);DA.props={};const BA=t=>new ca(t);BA.props={};const FA=t=>new ga(t);FA.props={};const zA=t=>new Ba(t);zA.props={};const WA=t=>new wa(t);WA.props={};const $A=t=>new ma(t);$A.props={};const GA=t=>new ba(t);GA.props={};const YA=t=>new Oa(t);YA.props={};const HA=t=>new ka(t);HA.props={};const VA=t=>new ya(t);VA.props={};const qA=t=>new Wa(t);qA.props={};const XA=t=>new Zi(t);XA.props={};const UA="g2-";function KA(t){return`.${UA}${t}`}const ZA=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]],QA=["lineX","lineY","rangeX","rangeY","range","connector"];function JA({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:a,padding2:o,padding3:s,alpha90:l,alpha65:c,alpha45:u,alpha25:f,alpha10:d,category10:h,category20:p,sizeDefault:g=1,padding:v="auto",margin:m=16}){return{padding:v,margin:m,size:g,color:t,category10:h,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:d,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:a,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:l,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:l,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,focusMarkerSize:12,itemSpacing:[a,a,a/2],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:a,colPadding:o,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:l,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:l,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:c,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{[KA("tooltip")]:{"font-family":"sans-serif"}}}}}const t_=JA({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),e_=t=>tt({},t_,t);e_.props={};const n_=t=>tt({},e_(),{category10:"category10",category20:"category20"},t);n_.props={};const r_=JA({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),i_=t=>tt({},r_,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{[KA("tooltip")]:{background:"#1f1f1f",opacity:.95},[KA("tooltip-title")]:{color:"#A6A6A6"},[KA("tooltip-list-item-name-label")]:{color:"#A6A6A6"},[KA("tooltip-list-item-value")]:{color:"#A6A6A6"}}}},t),a_=t=>Object.assign({},i_(),{category10:"category10",category20:"category20"},t);a_.props={};const o_=JA({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),s_=t=>tt({},o_,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function l_(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}s_.props={};var c_,u_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function f_(t){if(!(e=u_.exec(t)))throw new Error("invalid format: "+t);var e;return new d_({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function d_(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 h_(t,e){var n=l_(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}f_.prototype=d_.prototype,d_.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 p_={"%":(t,e)=>(100*t).toFixed(e),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,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>h_(100*t,e),r:h_,s:function(t,e){var n=l_(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(c_=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+l_(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function g_(t){return t}var v_,m_,y_=Array.prototype.map,b_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function x_(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?g_:(e=y_.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?g_:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(y_.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=f_(t)).fill,n=t.align,f=t.sign,d=t.symbol,h=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):p_[y]||(void 0===v&&(v=12),m=!0,y="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===d?a:/[%p]/.test(y)?l:"",w=p_[y],k=/[defgprs%]/.test(y);function M(t){var i,a,l,d=b,M=x;if("c"===y)M=w(t)+M,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0===+t&&"+"!==f&&(O=!1),d=(O?"("===f?f:c:"-"===f||"("===f?"":f)+d,M=("s"===y?b_[8+c_/3]:"")+M+(O&&"("===f?")":""),k)for(i=-1,a=t.length;++i<a;)if(48>(l=t.charCodeAt(i))||l>57){M=(46===l?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!h&&(t=r(t,1/0));var E=d.length+t.length+M.length,S=E<p?new Array(p-E+1).join(e):"";switch(g&&h&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=d+t+M+S;break;case"=":t=d+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+d+t+M+S.slice(E);break;default:t=S+d+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=f_(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=l_(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),a=b_[8+r/3];return function(t){return n(i*t)+a}}}}function w_(t,e,n){return t.querySelector(e)?Mm(t).select(e):Mm(t).append(n)}function k_(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function M_(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}v_=x_({thousands:",",grouping:[3],currency:["$",""]}),m_=v_.format;class O_ extends YM{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class E_ extends O_{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function S_(t,e){var n;return null===(n=t.filter(t=>t.getOptions().name===e))||void 0===n?void 0:n[0]}function A_(t){return"vertical"===t||t===-Math.PI/2}function __(t,e,n){const{bbox:r}=t,{position:i="top",size:a,length:o}=e,s=["top","bottom","center"].includes(i),[l,c]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,d=a||u||l,h=o||f||c,p=s?"horizontal":"vertical",[g,v]=s?[h,d]:[d,h];return{orientation:p,width:g,height:v,size:d,length:h}}function T_(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=De(t,["style"]),i={};return Object.entries(r).forEach(([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n}),Object.assign(Object.assign({},i),n)}function N_(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function P_(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function C_(t,e,n,r,i,a,o,s){var l;void 0===n&&void 0===a||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),a&&{tickMethod:a}));const c=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=Qn(e,t=>+t),{tickCount:a}=t.getOptions();return n(r,i,a)}(t,e,a),u=i?c.filter(i):c,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),d=r||(null===(l=t.getFormatter)||void 0===l?void 0:l.call(t))||f,h=function(t,e){if(tc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:a,insetBottom:o,insetLeft:s,insetRight:l}=n,[c,u,f]="left"===t||"right"===t?[a,o,i]:[s,l,r],d=new pa({domain:[0,1],range:[c/f,1-u/f]});return t=>d.map(t)}(o,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!ic(e))return i;const a="bottom"===t?[i,1]:[0,i],o=e.map(a);if("bottom"===t){const t=o[0];return new pa({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=o[1];return new pa({domain:[0,r],range:[0,1]}).map(t)}return i}}(o,s),g=t=>["left","right"].includes(t);return tc(s)||Jl(s)?u.map((e,n,r)=>{var i,a;const l=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,c=h(t.map(e)+l);return{value:ec(s)&&"center"===o||Jl(s)&&(null===(a=t.getTicks)||void 0===a?void 0:a.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(o)||Jl(s)&&g(o)?1-c:c,label:f(d(Sm(e),n,r)),id:String(n)}}):u.map((e,n,r)=>{var i;const a=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(h(t.map(e)+a));return{value:g(o)?1-s:s,label:f(d(Sm(e),n,r)),id:String(n)}})}function L_(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:a}=e,o=[],s=(t,e)=>{e&&o.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},a),o}function j_(t,e,n){return!function(t){return tc(t)&&Jl(t)}(e)&&!rc(e)&&(void 0===t?!!n.getTicks:t)}function R_(t,e,n,r,i,a){const o=function(t,e,n,r,i){const a=n.axis,o=["top","right","bottom","left"].includes(i)?n[`axis${Xa(i)}`]:n.axisLinear,s=t.getOptions().name,l=n[`axis${G(s)}`]||{};return Object.assign({},a,o,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},o),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:A_(a)?10:0,tick:"center"!==r&&void 0}):o}const I_=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var a;const{scales:[o]}=i,s=(null===(a=o.getTicks)||void 0===a?void 0:a.call(o))||o.getOptions().domain,l="string"==typeof n?m_(n):n,c=Object.assign(Object.assign({},e),{labelFormatter:l,labelFilter:(t,e,n)=>r(s[e],e,s),scale:o});return t(c)(i)}},D_=I_(t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:a,actualPosition:o,position:s,size:l,style:c={},title:u,tickCount:f,tickFilter:d,tickMethod:h,tickLength:p,transform:g,indexBBox:v}=t,m=De(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","tickLength","transform","indexBBox"]);return({scales:i,value:y,coordinate:b,theme:x})=>{const{bbox:w}=y,[k]=i,{domain:M,xScale:O}=k.getOptions(),E=R_(k,0,x,e,s,a),S=Object.assign(Object.assign(Object.assign({},E),c),m),A=function(t,e,n="xy"){const[r,i,a]=P_(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?a:r:t.includes("bottom")||t.includes("top")?i:a}(o||s,b,t.plane),_=function(t,e,n,r,i){const{x:a,y:o,width:s,height:l}=n;if("bottom"===t)return{startPos:[a,o],endPos:[a+s,o]};if("left"===t)return{startPos:[a+s,o+l],endPos:[a+s,o]};if("right"===t)return{startPos:[a,o+l],endPos:[a,o]};if("top"===t)return{startPos:[a,o+l],endPos:[a+s,o+l]};if("center"===t){if("vertical"===e)return{startPos:[a,o],endPos:[a,o+l]};if("horizontal"===e)return{startPos:[a,o],endPos:[a+s,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[c,u]=oc(r),[f,d]=sc(r),h=Math.min(s,l)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=c*h,m=u*h,[y,b]=[t+a-p,n+o-g],[x,w]=[Math.cos(e),Math.sin(e)],k=[y+m*x,b+m*w],M=[y+v*x,b+v*w],O=()=>{const{domain:t}=i.getOptions();return t.length},E=tc(r)&&i?O():3;return{startPos:k,endPos:M,gridClosed:Math.abs(d-f-360)<1e-6,gridCenter:[y,b],gridControlAngles:new Array(E).fill(0).map((t,e,n)=>(d-f)/E*e)}}}return{}}(s,a,w,b,O),T=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(b),N=C_(k,M,f,r,d,h,s,b),P=v?N.map((t,e)=>{const n=v.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):N,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},S),{type:"linear",data:P,crossSize:l,titleText:k_(u),labelOverlap:L_(g,S),grid:j_(S.grid,b,k),gridLength:A,line:!0,indexBBox:v,classNamePrefix:UA}),void 0!==p?{tickLength:p}:null),S.line?null:{lineOpacity:0}),_),T),n),L=C.labelOverlap.find(t=>"hide"===t.type);return L&&(C.crossSize=!1),new Lk({className:"axis",style:T_(C)})}}),B_=I_(t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:a,tickFilter:o,tickCount:s,tickMethod:l,tickLength:c,important:u={},style:f={},indexBBox:d,title:h,grid:p=!1}=t,g=De(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","tickLength","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:f}=e,{domain:v}=t.getOptions(),m=C_(t,v,s,a,o,l,r,n),y=d?m.map((t,e)=>{const n=d.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t}):m,[b,x]=oc(n),w=function(t,e,n,r,i){const{x:a,y:o,width:s,height:l}=e,c=[a+s/2,o+l/2],u=Math.min(s,l)/2,[f,d]=sc(i),[h,p]=P_(i),g={center:c,radius:u,startAngle:f,endAngle:d,gridLength:(r-n)*(Math.min(h,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[c[0]-t,c[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,f,b,x,n),{axis:k,axisArc:M={}}=i,O=T_(tt({},k,M,w,Object.assign(Object.assign(Object.assign({type:"arc",data:y,titleText:k_(h),grid:p,classNamePrefix:UA},void 0!==c?{tickLength:c}:null),g),u)));return new Lk({style:ct(O,["transform"])})}});D_.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},B_.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const F_=t=>(...e)=>{const n=D_(Object.assign({},{crossPadding:50},t))(...e);return N_(n,t),n};F_.props=Object.assign(Object.assign({},D_.props),{defaultPosition:"bottom"});const z_=t=>(...e)=>{const n=D_(Object.assign({},{crossPadding:10},t))(...e);return N_(n,t),n};function W_(t,e,n,r){const{radar:i}=t,[a]=r,o=a.getOptions().name,[s,l]=sc(n),{axisRadar:c={}}=e;return Object.assign(Object.assign({},c),{grid:"position"===o,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>(l-s)/i.count*e)})}z_.props=Object.assign(Object.assign({},D_.props),{defaultPosition:"left"});const $_=t=>{const{important:e={}}=t,n=De(t,["important"]);return r=>{const{theme:i,coordinate:a,scales:o}=r;return D_(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},W_(t,i,a,o)),e)}))(r)}};
21
21
  /*!
22
22
  * @antv/g-plugin-canvas-path-generator
23
23
  * @description A G plugin of path generator with Canvas2D API
@@ -26,7 +26,15 @@ var Nv=function(t){function e(t,n,r,i){var a;return pc(this,e),(a=Mc(this,e,[t])
26
26
  * @author AntVis
27
27
  * @docs https://g.antv.antgroup.com/
28
28
  */
29
- function KT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc(r,a,o,0,2*Math.PI,!1)}function ZT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,a,o,s,0,0,2*Math.PI,!1);else{var l=o>s?o:s,c=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.scale(c,u),t.arc(r,a,l,0,2*Math.PI)}}function QT(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,d=0,h=0,p=0,g=0,v=0;l&&Gg(l)&&u&&(n=o-i,r=s-a,v=Math.atan2(r,n),d=Math.cos(v)*(u||0),h=Math.sin(v)*(u||0)),c&&Gg(c)&&f&&(n=i-o,r=a-s,v=Math.atan2(r,n),p=Math.cos(v)*(f||0),g=Math.sin(v)*(f||0)),t.moveTo(i+d,a+h),t.lineTo(o+p,s+g)}function JT(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.d,c=l.absolutePath,u=l.segments,f=0,d=0,h=0,p=0,g=0;if(i&&Gg(i)&&o){var v=Sc(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),f=Math.cos(g)*(o||0),d=Math.sin(g)*(o||0)}if(a&&Gg(a)&&s){var b=Sc(a.parentNode.getEndTangent(),2),x=b[0],w=b[1];n=x[0]-w[0],r=x[1]-w[1],g=Math.atan2(r,n),h=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var k=0;k<c.length;k++){var M=c[k],O=M[0],E=c[k+1],S=0===k&&(0!==f||0!==d),A=(k===c.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==h&&0!==p,_=Sc(S?[f,d]:[0,0],2),T=_[0],N=_[1],P=Sc(A?[h,p]:[0,0],2),C=P[0],L=P[1];switch(O){case"M":t.moveTo(M[1]+T,M[2]+N);break;case"L":t.lineTo(M[1]+C,M[2]+L);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+C,M[4]+L);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+C,M[6]+L);break;case"A":var j=u[k].arcParams,R=j.cx,I=j.cy,D=j.rx,B=j.ry,F=j.startAngle,z=j.endAngle,W=j.xRotation,$=j.sweepFlag;if(t.ellipse)t.ellipse(R,I,D,B,W,F,z,!!(1-$));else{var G=D>B?D:B,Y=D>B?1:D/B,H=D>B?B/D:1;t.translate(R,I),t.rotate(W),t.scale(Y,H),t.arc(0,0,G,F,z,!!(1-$)),t.scale(1/Y,1/H),t.rotate(-W),t.translate(-R,-I)}A&&t.lineTo(M[6]+h,M[7]+p);break;case"Z":t.closePath()}}}function tN(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],f=l[0][1],d=l[c-1][0],h=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&Gg(i)&&o&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Gg(a)&&s&&(n=l[c-1][0]-l[0][0],r=l[c-1][1]-l[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),f+(g||m));for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d,h)}function eN(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],f=l[0][1],d=l[c-1][0],h=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&Gg(i)&&o&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Gg(a)&&s&&(n=l[c-2][0]-l[c-1][0],r=l[c-2][1]-l[c-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d+v,h+m)}function nN(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,a=void 0===i?0:i,o=e.radius,s=e.width,l=e.height,c=s,u=l,f=o&&o.some(function(t){return 0!==t});if(f){var d=s>0?1:-1,h=l>0?1:-1,p=d+h===0,g=o.map(function(t){return R(t,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),v=Sc(g,4),m=v[0],y=v[1],b=v[2],x=v[3];t.moveTo(d*m+r,a),t.lineTo(c-d*y+r,a),0!==y&&t.arc(c-d*y+r,h*y+a,y,-h*Math.PI/2,d>0?0:Math.PI,p),t.lineTo(c+r,u-h*b+a),0!==b&&t.arc(c-d*b+r,u-h*b+a,b,d>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,p),t.lineTo(d*x+r,u+a),0!==x&&t.arc(d*x+r,u-h*x+a,x,h>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,p),t.lineTo(r,h*m+a),0!==m&&t.arc(d*m+r,h*m+a,m,d>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,p)}else t.rect(r,a,c,u)}UT.props={};var rN=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="canvas-path-generator",t}return Ec(e,t),vc(e,[{key:"init",value:function(){var t,e=(fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},uu.CIRCLE,KT),uu.ELLIPSE,ZT),uu.RECT,nN),uu.LINE,QT),uu.POLYLINE,eN),uu.POLYGON,tN),uu.PATH,JT),uu.TEXT,void 0),uu.GROUP,void 0),uu.IMAGE,void 0),fc(fc(fc(t,uu.HTML,void 0),uu.MESH,void 0),uu.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(du),iN=ee(),aN=ee(),oN=ee(),sN=yt(),lN=function(){function t(){var e=this;pc(this,t),this.isHit=function(t,n,r,i){var a=e.context.pointInPathPickerFactory[t.nodeName];if(a){var o=Et(sN,r),s=pe(aN,oe(oN,n[0],n[1],0),o);if(a(t,new Ou(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return vc(t,[{key:"apply",value:function(e,n){var r,i=this,a=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=o.root)||void 0===r?void 0:r.ownerDocument;a.hooks.pick.tapPromise(t.tag,function(){var t=au(ru().mark(function t(e){return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()),a.hooks.pickSync.tap(t.tag,function(t){return i.pick(s,t)})}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,a=i.x,o=i.y,s=oe(iN,a,o,0),l=[],c=ou(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(c.s();!(n=c.n()).done;){var u=n.value,f=u.getWorldTransform();if(this.isHit(u,s,f,!1)){var d=Jh(u);if(d){var h=d.parsedStyle.clipPath;if(this.isHit(h,s,h.getWorldTransform(),!0)){if(r)return e.picked=[u],e;l.push(u)}}else{if(r)return e.picked=[u],e;l.push(u)}}}}catch(t){c.e(t)}finally{c.f()}return e.picked=l,e}}])}();
29
+ function G_(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc(r,a,o,0,2*Math.PI,!1)}function Y_(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,a,o,s,0,0,2*Math.PI,!1);else{var l=o>s?o:s,c=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.scale(c,u),t.arc(r,a,l,0,2*Math.PI)}}function H_(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,d=0,h=0,p=0,g=0,v=0;l&&Fg(l)&&u&&(n=o-i,r=s-a,v=Math.atan2(r,n),d=Math.cos(v)*(u||0),h=Math.sin(v)*(u||0)),c&&Fg(c)&&f&&(n=i-o,r=a-s,v=Math.atan2(r,n),p=Math.cos(v)*(f||0),g=Math.sin(v)*(f||0)),t.moveTo(i+d,a+h),t.lineTo(o+p,s+g)}function V_(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.d,c=l.absolutePath,u=l.segments,f=0,d=0,h=0,p=0,g=0;if(i&&Fg(i)&&o){var v=Sc(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),f=Math.cos(g)*(o||0),d=Math.sin(g)*(o||0)}if(a&&Fg(a)&&s){var b=Sc(a.parentNode.getEndTangent(),2),x=b[0],w=b[1];n=x[0]-w[0],r=x[1]-w[1],g=Math.atan2(r,n),h=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var k=0;k<c.length;k++){var M=c[k],O=M[0],E=c[k+1],S=0===k&&(0!==f||0!==d),A=(k===c.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==h&&0!==p,_=Sc(S?[f,d]:[0,0],2),T=_[0],N=_[1],P=Sc(A?[h,p]:[0,0],2),C=P[0],L=P[1];switch(O){case"M":t.moveTo(M[1]+T,M[2]+N);break;case"L":t.lineTo(M[1]+C,M[2]+L);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+C,M[4]+L);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+C,M[6]+L);break;case"A":var j=u[k].arcParams,R=j.cx,I=j.cy,D=j.rx,B=j.ry,F=j.startAngle,z=j.endAngle,W=j.xRotation,$=j.sweepFlag;if(t.ellipse)t.ellipse(R,I,D,B,W,F,z,!!(1-$));else{var G=D>B?D:B,Y=D>B?1:D/B,H=D>B?B/D:1;t.translate(R,I),t.rotate(W),t.scale(Y,H),t.arc(0,0,G,F,z,!!(1-$)),t.scale(1/Y,1/H),t.rotate(-W),t.translate(-R,-I)}A&&t.lineTo(M[6]+h,M[7]+p);break;case"Z":t.closePath()}}}function q_(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],f=l[0][1],d=l[c-1][0],h=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&Fg(i)&&o&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Fg(a)&&s&&(n=l[c-1][0]-l[0][0],r=l[c-1][1]-l[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),f+(g||m));for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d,h)}function X_(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],f=l[0][1],d=l[c-1][0],h=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&Fg(i)&&o&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Fg(a)&&s&&(n=l[c-2][0]-l[c-1][0],r=l[c-2][1]-l[c-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d+v,h+m)}function U_(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,a=void 0===i?0:i,o=e.radius,s=e.width,l=e.height,c=s,u=l,f=o&&o.some(function(t){return 0!==t});if(f){var d=s>0?1:-1,h=l>0?1:-1,p=d+h===0,g=o.map(function(t){return R(t,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),v=Sc(g,4),m=v[0],y=v[1],b=v[2],x=v[3];t.moveTo(d*m+r,a),t.lineTo(c-d*y+r,a),0!==y&&t.arc(c-d*y+r,h*y+a,y,-h*Math.PI/2,d>0?0:Math.PI,p),t.lineTo(c+r,u-h*b+a),0!==b&&t.arc(c-d*b+r,u-h*b+a,b,d>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,p),t.lineTo(d*x+r,u+a),0!==x&&t.arc(d*x+r,u-h*x+a,x,h>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,p),t.lineTo(r,h*m+a),0!==m&&t.arc(d*m+r,h*m+a,m,d>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,p)}else t.rect(r,a,c,u)}$_.props=Object.assign(Object.assign({},D_.props),{defaultPosition:"center"});var K_=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="canvas-path-generator",t}return Ec(e,t),vc(e,[{key:"init",value:function(){var t,e=(fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},ou.CIRCLE,G_),ou.ELLIPSE,Y_),ou.RECT,U_),ou.LINE,H_),ou.POLYLINE,X_),ou.POLYGON,q_),ou.PATH,V_),ou.TEXT,void 0),ou.GROUP,void 0),ou.IMAGE,void 0),fc(fc(fc(t,ou.HTML,void 0),ou.MESH,void 0),ou.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(lu);
30
+ /*!
31
+ * @antv/g-math
32
+ * @description Geometry util
33
+ * @version 3.0.1
34
+ * @date 5/9/2025, 8:18:51 AM
35
+ * @author AntVis
36
+ * @docs https://g.antv.antgroup.com/
37
+ */function Z_(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function Q_(t,e,n,r,i,a){var o=-1,s=1/0,l=[n,r],c=20;a&&a>200&&(c=a/10);for(var u=1/c,f=u/10,d=0;d<=c;d++){var h=d*u,p=[i.apply(void 0,bc(t.concat([h]))),i.apply(void 0,bc(e.concat([h])))],g=Z_(l[0],l[1],p[0],p[1]);g<s&&(o=h,s=g)}if(0===o)return{x:t[0],y:e[0]};if(1===o){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var m=0;m<32&&!(f<1e-4);m++){var y=o-f,b=o+f,x=[i.apply(void 0,bc(t.concat([y]))),i.apply(void 0,bc(e.concat([y])))],w=Z_(l[0],l[1],x[0],x[1]);if(y>=0&&w<s)o=y,s=w;else{var k=[i.apply(void 0,bc(t.concat([b]))),i.apply(void 0,bc(e.concat([b])))],M=Z_(l[0],l[1],k[0],k[1]);b<=1&&M<s?(o=b,s=M):f*=.5}}return{x:i.apply(void 0,bc(t.concat([o]))),y:i.apply(void 0,bc(e.concat([o])))}}function J_(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var l=[i-t,a-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))}function tT(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function eT(t,e,n,r,i,a,o,s,l,c,u){var f=function(t,e,n,r,i,a,o,s,l,c,u){return Q_([t,n,i,o],[e,r,a,s],l,c,tT,u)}(t,e,n,r,i,a,o,s,l,c,u);return Z_(f.x,f.y,l,c)}function nT(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function rT(t,e,n,r,i,a,o,s){var l=function(t,e,n,r,i,a,o,s){return Q_([t,n,i],[e,r,a],o,s,nT)}(t,e,n,r,i,a,o,s);return Z_(l.x,l.y,o,s)}
30
38
  /*!
31
39
  * @antv/g-plugin-canvas-picker
32
40
  * @description A G plugin for picking in canvas
@@ -34,7 +42,7 @@ function KT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc
34
42
  * @date 7/30/2025, 1:37:32 PM
35
43
  * @author AntVis
36
44
  * @docs https://g.antv.antgroup.com/
37
- */function cN(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,l=r.r,c=r.fill,u=r.stroke,f=r.lineWidth,d=void 0===f?1:f,h=r.increasedLineWidthForHitTesting,p=void 0===h?0:h,g=r.pointerEvents,v=void 0===g?"auto":g,m=(d+p)/2,y=Pc(a,s,e.x,e.y),b=Sc(ip(v,c,u),2),x=b[0],w=b[1];return x&&w||n?y<=l+m:x?y<=l:!!w&&(y>=l-m&&y<=l+m)}function uN(t,e,n,r){return t/(n*n)+e/(r*r)}function fN(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,l=r.rx,c=r.ry,u=r.fill,f=r.stroke,d=r.lineWidth,h=void 0===d?1:d,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,b=e.y,x=Sc(ip(m,u,f),2),w=x[0],k=x[1],M=(h+g)/2,O=(y-a)*(y-a),E=(b-s)*(b-s);return w&&k||n?uN(O,E,l+M,c+M)<=1:w?uN(O,E,l,c)<=1:!!k&&(uN(O,E,l-M,c-M)>=1&&uN(O,E,l+M,c+M)<=1)}function dN(t,e,n,r,i,a){return i>=t&&i<=t+n&&a>=e&&a<=e+r}function hN(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Pc(c.x,c.y,o,s)<=a/2}function pN(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),f=i/2;return a>=s-f&&a<=l+f&&o>=c-f&&o<=u+f&&Fc(t,e,n,r,a,o)<=i/2}function gN(t,e,n,r,i){var a=t.length;if(a<2)return!1;for(var o=0;o<a-1;o++){if(pN(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0}if(i){var s=t[0],l=t[a-1];if(pN(s[0],s[1],l[0],l[1],e,n,r))return!0}return!1}lN.tag="CanvasPicker";function vN(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function mN(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function yN(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=t[a],s=t[(a+1)%i];if(mN(o,s,[e,n]))return!0;vN(o[1]-n)>0!=vN(s[1]-n)>0&&vN(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function bN(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=yN(t[i],e,n))break}return r}function xN(t,e,n){var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=r.lineWidth,c=void 0===l?1:l,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,d=r.pointerEvents;return!(!Sc(ip(void 0===d?"auto":d,r.fill,r.stroke),2)[1]&&!n||!c)&&pN(i,a,o,s,c+f,e.x,e.y)}function wN(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=void 0===s?1:s,c=o.increasedLineWidthForHitTesting,u=void 0===c?0:c,f=o.stroke,d=o.fill,h=o.d,p=o.pointerEvents,g=void 0===p?"auto":p,v=h.segments,m=h.hasArc,y=h.polylines,b=h.polygons,x=Sc(ip(g,(null==b?void 0:b.length)&&d,f),2),w=x[0],k=x[1],M=Gd(t),O=!1;return w||n?O=m?r(t,e):bN(b,e.x,e.y)||bN(y,e.x,e.y):((k||n)&&(O=function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,f=l.prePoint,d=l.box;if(!d||dN(d.x-o,d.y-o,d.width+e,d.height+e,n,r))switch(l.command){case"L":case"Z":if(a=pN(f[0],f[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=Xc(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Gc(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=fn(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var h=l.cubicParams,p=f,g=0;g<h.length;g+=6){var v=Gc(p[0],p[1],h[g],h[g+1],h[g+2],h[g+3],h[g+4],h[g+5],n,r,i);if(p=[h[g+4],h[g+5]],a=v<=e/2)return!0}}}return a}(v,l+u,e.x,e.y,M)),O)}function kN(t,e,n){var r=t.parsedStyle,i=r.stroke,a=r.fill,o=r.lineWidth,s=void 0===o?1:o,l=r.increasedLineWidthForHitTesting,c=void 0===l?0:l,u=r.points,f=r.pointerEvents,d=Sc(ip(void 0===f?"auto":f,a,i),2),h=d[0],p=!1;return(d[1]||n)&&(p=gN(u.points,s+c,e.x,e.y,!0)),p||!h&&!n||(p=yN(u.points,e.x,e.y)),p}function MN(t,e,n){var r=t.parsedStyle,i=r.lineWidth,a=void 0===i?1:i,o=r.increasedLineWidthForHitTesting,s=void 0===o?0:o,l=r.points,c=r.pointerEvents;return!(!Sc(ip(void 0===c?"auto":c,r.fill,r.stroke),2)[1]&&!n||!a)&&gN(l.points,a+s,e.x,e.y,!1)}function ON(t,e,n,r,i){var a=t.parsedStyle,o=a.radius,s=a.fill,l=a.stroke,c=a.lineWidth,u=void 0===c?1:c,f=a.increasedLineWidthForHitTesting,d=void 0===f?0:f,h=a.x,p=void 0===h?0:h,g=a.y,v=void 0===g?0:g,m=a.width,y=a.height,b=a.pointerEvents,x=Sc(ip(void 0===b?"auto":b,s,l),2),w=x[0],k=x[1],M=o&&o.some(function(t){return 0!==t}),O=u+d;if(M){var E=!1;return(k||n)&&(E=function(t,e,n,r,i,a,o,s){var l=Sc(i,4),c=l[0],u=l[1],f=l[2],d=l[3];return pN(t+c,e,t+n-u,e,a,o,s)||pN(t+n,e+u,t+n,e+r-f,a,o,s)||pN(t+n-f,e+r,t+d,e+r,a,o,s)||pN(t,e+r-d,t,e+c,a,o,s)||hN(t+n-u,e+u,u,Math.PI,Math.PI,a,o,s)||hN(t+n-f,e+r-f,f,0,Math.PI,a,o,s)||hN(t+d,e+r-d,d,Math.PI,Math.PI,a,o,s)||hN(t+c,e+c,c,Math.PI,Math.PI,a,o,s)}(p,v,m,y,o.map(function(t){return R(t,0,Math.min(Math.abs(m)/2,Math.abs(y)/2))}),O,e.x,e.y)),E||!w&&!n||(E=r(t,e)),E}var S=O/2;return w&&k||n?dN(p-S,v-S,m+S,y+S,e.x,e.y):w?dN(p,v,m,y,e.x,e.y):!!k&&function(t,e,n,r,i,a,o){var s=i/2;return dN(t-s,e-s,n,i,a,o)||dN(t+n-s,e-s,i,r,a,o)||dN(t+s,e+r-s,n,i,a,o)||dN(t-s,e+s,i,r,a,o)}(p,v,m,y,O,e.x,e.y)}function EN(t,e,n,r,i,a){var o=t.parsedStyle,s=o.pointerEvents,l=void 0===s?"auto":s,c=o.x,u=void 0===c?0:c,f=o.y,d=void 0===f?0:f,h=o.width,p=o.height;if("non-transparent-pixel"===l){var g=i.config.offscreenCanvas,v=a.offscreenCanvasCreator.getOrCreateCanvas(g),m=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return v.width=h,v.height=p,i.defaultStyleRendererFactory[uu.IMAGE].render(m,hc(hc({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-d,1,1).data.every(function(t){return 0!==t})}return!0}function SN(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var AN=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="canvas-picker",t}return Ec(e,t),vc(e,[{key:"init",value:function(){var t,e=(fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},uu.CIRCLE,cN),uu.ELLIPSE,fN),uu.RECT,ON),uu.LINE,xN),uu.POLYLINE,MN),uu.POLYGON,kN),uu.PATH,wN),uu.TEXT,SN),uu.GROUP,null),uu.IMAGE,EN),fc(fc(t,uu.HTML,null),uu.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new lN)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(du);function _N(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var TN=0;function NN(t){return"__private_"+TN+++"_"+t}
45
+ */var iT=ee(),aT=ee(),oT=ee(),sT=yt(),lT=function(){function t(){var e=this;pc(this,t),this.isHit=function(t,n,r,i){var a=e.context.pointInPathPickerFactory[t.nodeName];if(a){var o=Et(sT,r),s=pe(aT,oe(oT,n[0],n[1],0),o);if(a(t,new xu(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return vc(t,[{key:"apply",value:function(e,n){var r,i=this,a=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=o.root)||void 0===r?void 0:r.ownerDocument;a.hooks.pick.tapPromise(t.tag,function(){var t=eu(Jc().mark(function t(e){return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()),a.hooks.pickSync.tap(t.tag,function(t){return i.pick(s,t)})}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,a=i.x,o=i.y,s=oe(iT,a,o,0),l=[],c=nu(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(c.s();!(n=c.n()).done;){var u=n.value,f=u.getWorldTransform();if(this.isHit(u,s,f,!1)){var d=Uh(u);if(d){var h=d.parsedStyle.clipPath;if(this.isHit(h,s,h.getWorldTransform(),!0)){if(r)return e.picked=[u],e;l.push(u)}}else{if(r)return e.picked=[u],e;l.push(u)}}}}catch(t){c.e(t)}finally{c.f()}return e.picked=l,e}}])}();function cT(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,l=r.r,c=r.fill,u=r.stroke,f=r.lineWidth,d=void 0===f?1:f,h=r.increasedLineWidthForHitTesting,p=void 0===h?0:h,g=r.pointerEvents,v=void 0===g?"auto":g,m=(d+p)/2,y=Z_(a,s,e.x,e.y),b=Sc(tp(v,c,u),2),x=b[0],w=b[1];return x&&w||n?y<=l+m:x?y<=l:!!w&&(y>=l-m&&y<=l+m)}function uT(t,e,n,r){return t/(n*n)+e/(r*r)}function fT(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,l=r.rx,c=r.ry,u=r.fill,f=r.stroke,d=r.lineWidth,h=void 0===d?1:d,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,b=e.y,x=Sc(tp(m,u,f),2),w=x[0],k=x[1],M=(h+g)/2,O=(y-a)*(y-a),E=(b-s)*(b-s);return w&&k||n?uT(O,E,l+M,c+M)<=1:w?uT(O,E,l,c)<=1:!!k&&(uT(O,E,l-M,c-M)>=1&&uT(O,E,l+M,c+M)<=1)}function dT(t,e,n,r,i,a){return i>=t&&i<=t+n&&a>=e&&a<=e+r}function hT(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Z_(c.x,c.y,o,s)<=a/2}function pT(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),f=i/2;return a>=s-f&&a<=l+f&&o>=c-f&&o<=u+f&&J_(t,e,n,r,a,o)<=i/2}function gT(t,e,n,r,i){var a=t.length;if(a<2)return!1;for(var o=0;o<a-1;o++){if(pT(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0}if(i){var s=t[0],l=t[a-1];if(pT(s[0],s[1],l[0],l[1],e,n,r))return!0}return!1}lT.tag="CanvasPicker";function vT(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function mT(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function yT(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=t[a],s=t[(a+1)%i];if(mT(o,s,[e,n]))return!0;vT(o[1]-n)>0!=vT(s[1]-n)>0&&vT(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function bT(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=yT(t[i],e,n))break}return r}function xT(t,e,n){var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=r.lineWidth,c=void 0===l?1:l,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,d=r.pointerEvents;return!(!Sc(tp(void 0===d?"auto":d,r.fill,r.stroke),2)[1]&&!n||!c)&&pT(i,a,o,s,c+f,e.x,e.y)}function wT(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=void 0===s?1:s,c=o.increasedLineWidthForHitTesting,u=void 0===c?0:c,f=o.stroke,d=o.fill,h=o.d,p=o.pointerEvents,g=void 0===p?"auto":p,v=h.segments,m=h.hasArc,y=h.polylines,b=h.polygons,x=Sc(tp(g,(null==b?void 0:b.length)&&d,f),2),w=x[0],k=x[1],M=Fd(t),O=!1;return w||n?O=m?r(t,e):bT(b,e.x,e.y)||bT(y,e.x,e.y):((k||n)&&(O=function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,f=l.prePoint,d=l.box;if(!d||dT(d.x-o,d.y-o,d.width+e,d.height+e,n,r))switch(l.command){case"L":case"Z":if(a=pT(f[0],f[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=rT(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=eT(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=fn(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var h=l.cubicParams,p=f,g=0;g<h.length;g+=6){var v=eT(p[0],p[1],h[g],h[g+1],h[g+2],h[g+3],h[g+4],h[g+5],n,r,i);if(p=[h[g+4],h[g+5]],a=v<=e/2)return!0}}}return a}(v,l+u,e.x,e.y,M)),O)}function kT(t,e,n){var r=t.parsedStyle,i=r.stroke,a=r.fill,o=r.lineWidth,s=void 0===o?1:o,l=r.increasedLineWidthForHitTesting,c=void 0===l?0:l,u=r.points,f=r.pointerEvents,d=Sc(tp(void 0===f?"auto":f,a,i),2),h=d[0],p=!1;return(d[1]||n)&&(p=gT(u.points,s+c,e.x,e.y,!0)),p||!h&&!n||(p=yT(u.points,e.x,e.y)),p}function MT(t,e,n){var r=t.parsedStyle,i=r.lineWidth,a=void 0===i?1:i,o=r.increasedLineWidthForHitTesting,s=void 0===o?0:o,l=r.points,c=r.pointerEvents;return!(!Sc(tp(void 0===c?"auto":c,r.fill,r.stroke),2)[1]&&!n||!a)&&gT(l.points,a+s,e.x,e.y,!1)}function OT(t,e,n,r,i){var a=t.parsedStyle,o=a.radius,s=a.fill,l=a.stroke,c=a.lineWidth,u=void 0===c?1:c,f=a.increasedLineWidthForHitTesting,d=void 0===f?0:f,h=a.x,p=void 0===h?0:h,g=a.y,v=void 0===g?0:g,m=a.width,y=a.height,b=a.pointerEvents,x=Sc(tp(void 0===b?"auto":b,s,l),2),w=x[0],k=x[1],M=o&&o.some(function(t){return 0!==t}),O=u+d;if(M){var E=!1;return(k||n)&&(E=function(t,e,n,r,i,a,o,s){var l=Sc(i,4),c=l[0],u=l[1],f=l[2],d=l[3];return pT(t+c,e,t+n-u,e,a,o,s)||pT(t+n,e+u,t+n,e+r-f,a,o,s)||pT(t+n-f,e+r,t+d,e+r,a,o,s)||pT(t,e+r-d,t,e+c,a,o,s)||hT(t+n-u,e+u,u,Math.PI,Math.PI,a,o,s)||hT(t+n-f,e+r-f,f,0,Math.PI,a,o,s)||hT(t+d,e+r-d,d,Math.PI,Math.PI,a,o,s)||hT(t+c,e+c,c,Math.PI,Math.PI,a,o,s)}(p,v,m,y,o.map(function(t){return R(t,0,Math.min(Math.abs(m)/2,Math.abs(y)/2))}),O,e.x,e.y)),E||!w&&!n||(E=r(t,e)),E}var S=O/2;return w&&k||n?dT(p-S,v-S,m+S,y+S,e.x,e.y):w?dT(p,v,m,y,e.x,e.y):!!k&&function(t,e,n,r,i,a,o){var s=i/2;return dT(t-s,e-s,n,i,a,o)||dT(t+n-s,e-s,i,r,a,o)||dT(t+s,e+r-s,n,i,a,o)||dT(t-s,e+s,i,r,a,o)}(p,v,m,y,O,e.x,e.y)}function ET(t,e,n,r,i,a){var o=t.parsedStyle,s=o.pointerEvents,l=void 0===s?"auto":s,c=o.x,u=void 0===c?0:c,f=o.y,d=void 0===f?0:f,h=o.width,p=o.height;if("non-transparent-pixel"===l){var g=i.config.offscreenCanvas,v=a.offscreenCanvasCreator.getOrCreateCanvas(g),m=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return v.width=h,v.height=p,i.defaultStyleRendererFactory[ou.IMAGE].render(m,hc(hc({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-d,1,1).data.every(function(t){return 0!==t})}return!0}function ST(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var AT=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="canvas-picker",t}return Ec(e,t),vc(e,[{key:"init",value:function(){var t,e=(fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},ou.CIRCLE,cT),ou.ELLIPSE,fT),ou.RECT,OT),ou.LINE,xT),ou.POLYLINE,MT),ou.POLYGON,kT),ou.PATH,wT),ou.TEXT,ST),ou.GROUP,null),ou.IMAGE,ET),fc(fc(t,ou.HTML,null),ou.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new lT)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(lu);function _T(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var TT=0;function NT(t){return"__private_"+TT+++"_"+t}
38
46
  /*!
39
47
  * @antv/g-plugin-image-loader
40
48
  * @description A G plugin for loading image
@@ -42,7 +50,7 @@ function KT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc
42
50
  * @date 7/30/2025, 1:35:52 PM
43
51
  * @author AntVis
44
52
  * @docs https://g.antv.antgroup.com/
45
- */var PN=function(){return vc(function t(){pc(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=hc(hc({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),CN=[],LN=[],jN=function(){function t(){pc(this,t)}return vc(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;CN.length<=0&&LN.length<=0||(LN.forEach(function(t){return t()}),LN=CN.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,l=e.naturalHeight||e.height,c=n-a,u=r-a,f=Math.ceil(s/c),d=Math.ceil(l/u),h={tileSize:[n,r],gridSize:[d,f],tiles:Array(d).fill(null).map(function(){return Array(f).fill(null)})},p=function(t){for(var a=function(a){CN.push(function(){var f=a*c,d=t*u,p=[Math.min(n,s-f),Math.min(r,l-d)],g=p[0],v=p[1],m=o.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,f,d,g,v,0,0,g,v),h.tiles[t][a]={x:f,y:d,tileX:a,tileY:t,data:m},i()})},d=0;d<f;d++)a(d)},g=0;g<d;g++)p(g);return t.stop(),t.executeTask(),h}}])}();jN.TASK_NUM_PER_FRAME=10;var RN=new PN;RN.onRefAdded=function(t){var e=this;t.addEventListener(ig.DESTROY,function(){e.releaseRef(t)},{once:!0})};var IN=function(){return vc(function t(e,n){pc(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=L(t)?t:t.src;if(RN.has(r)){var i=RN.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=L(t)?t:t.src;if(!L(t)&&!RN.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:DN(t)};RN.put(r,i,e)}if(RN.has(r)){var a=RN.get(r,e);return a.img.complete?Promise.resolve(a):new Promise(function(t,e){a.img.addEventListener("load",function(){a.size=[a.img.naturalWidth||a.img.width,a.img.naturalHeight||a.img.height],a.tileSize=DN(a.img),t(a)}),a.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var a=n.context.config.createImage();if(a){var o={img:a,size:[0,0],tileSize:DN(a)};RN.put(r,o,e),a.onload=function(){o.size=[a.naturalWidth||a.width,a.naturalHeight||a.height],o.tileSize=DN(o.img),t(o)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=r}})}},{key:"createDownSampledImage",value:(e=au(ru().mark(function t(e,n){var r,i,a,o,s,l,c,u,f,d,h,p,g,v;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(i=this.context.config.enableLargeImageOptimization,o=(a="boolean"==typeof i?{}:i).maxDownSampledImageSize,s=void 0===o?2048:o,l=a.downSamplingRateThreshold,c=void 0===l?.5:l,u=this.runtime.globalThis.createImageBitmap,f=Sc(r.size,2),d=f[0],h=f[1],p=r.img,g=Math.min((s+s)/(d+h),Math.max(.01,Math.min(c,.5))),v=hc(hc({},r),{},{downSamplingRate:g}),RN.update(r.img.src,v,n),!u){t.next=7;break}return t.prev=3,t.next=4,u(r.img,{resizeWidth:d*g,resizeHeight:h*g});case 4:p=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),g=1;case 6:t.next=8;break;case 7:g=1;case 8:return v=hc(hc({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:g}),RN.update(r.img.src,v,n),t.abrupt("return",v);case 9:case"end":return t.stop()}},t,this,[[3,5]])})),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=au(ru().mark(function t(e,n,r,i){var a,o,s,l,c;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return a=t.sent,o=i.ownerDocument.defaultView,s=o.requestAnimationFrame,l=o.cancelAnimationFrame,jN.api={requestAnimationFrame:s,cancelAnimationFrame:l,createCanvas:function(){return Jp.createCanvas()}},c=hc(hc({},a),jN.sliceImage(a.img,a.tileSize[0],a.tileSize[0],r)),RN.update(a.img.src,c,i),t.abrupt("return",c);case 2:case"end":return t.stop()}},t,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){RN.release(L(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){RN.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var l,c=e.image,u=e.repetition,f=e.transform,d=!1;if(L(c)){var h=this.getImageSync(c,t,o);l=null==h?void 0:h.img}else r?(l=r,d=!0):l=c;var p,g=l&&n.createPattern(l,u);g&&(p=f?Cp(hh(f),new Xg({})):Mt(yt()),d&&Tt(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+a[0],f:p[13]+a[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,a=t.min,o=t.width,s=t.height,l=t.angle,c=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var d=null;if(r===Zf.LinearGradient){var h=function(t,e,n,r){var i=Cu(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}}(a,o,s,l),p=h.x1,g=h.y1,v=h.x2,m=h.y2;d=e.createLinearGradient(p,g,v,m)}else if(r===Zf.RadialGradient){var y=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===zf.kPercentage&&(o=r.value/100*e),i.unit===zf.kPercentage&&(s=i.value/100*n);var l=Math.max(vn([0,0],[o,s]),vn([0,n],[o,s]),vn([e,n],[o,s]),vn([e,0],[o,s]));return a&&(a instanceof ed?l=a.value:a instanceof Jf&&("closest-side"===a.value?l=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?l=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(l=Math.min(vn([0,0],[o,s]),vn([0,n],[o,s]),vn([e,n],[o,s]),vn([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:l}}(a,o,s,c,u,f),b=y.x,x=y.y,w=y.r;d=e.createRadialGradient(b,x,0,b,x,w)}return d&&(i.forEach(function(t){var e,n=t.offset,r=t.color;n.unit===zf.kPercentage&&(null===(e=d)||void 0===e||e.addColorStop(n.value/100,r.toString()))}),this.gradientCache[n]=d),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,a=t.steps,o=t.angle,s=t.cx,l=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(a.map(function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return L(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function DN(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach(function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)}),[r,r]}IN.isSupportTile=!!Jp.createCanvas();var BN=function(){function t(){pc(this,t)}return vc(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,a=r.root.ownerDocument.defaultView,o=function(t,e,n){var r=t.parsedStyle,i=r.width,a=r.height;i&&!a?t.setAttribute("height",n/e*i):!i&&a&&t.setAttribute("width",e/n*a)},s=function(t){var e=t.target,r=e.nodeName,a=e.attributes;if(r===uu.IMAGE){var s=a.src,l=a.keepAspectRatio;i.getImageSync(s,e,function(t){var r=t.img,i=r.width,a=r.height;l&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()})}},l=function(t){var e=t.target,r=t.attrName,a=t.prevValue,s=t.newValue;e.nodeName===uu.IMAGE&&"src"===r&&(a!==s&&i.releaseImage(a,e),L(s)&&i.getOrCreateImage(s,e).then(function(t){var r=t.img,i=r.width,a=r.height;e.attributes.keepAspectRatio&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(t.tag,function(){a.addEventListener(ig.MOUNTED,s),a.addEventListener(ig.ATTR_MODIFIED,l)}),n.hooks.destroy.tap(t.tag,function(){a.removeEventListener(ig.MOUNTED,s),a.removeEventListener(ig.ATTR_MODIFIED,l)})}}])}();BN.tag="LoadImage";var FN=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="image-loader",t}return Ec(e,t),vc(e,[{key:"init",value:function(t){this.context.imagePool=new IN(this.context,t),this.addRenderingPlugin(new BN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(du),zN=NN("renderState"),WN=function(){function t(e){pc(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,zN,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=yt(),this.dprMatrix=yt(),this.tmpMat4=yt(),this.vec3a=ee(),this.vec3b=ee(),this.vec3c=ee(),this.vec3d=ee(),this.canvasRendererPluginOptions=e}return vc(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,a=i.config,o=i.camera,s=i.renderingService,l=i.renderingContext,c=i.rBushRoot,u=i.pathGeneratorFactory,f=a.renderer.getConfig().enableRenderingOptimization;a.renderer.getConfig().enableDirtyCheck=!1,a.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=c,this.pathGeneratorFactory=u;var d=e.contextService,h=l.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;null!=e&&e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,function(){h.addEventListener(ig.UNMOUNTED,p),h.addEventListener(ig.CULLED,g);var t=d.getDPR(),e=a.width,n=a.height,i=d.getContext();r.clearRect(i,0,0,e*t,n*t,a.background)}),s.hooks.destroy.tap(t.tag,function(){h.removeEventListener(ig.UNMOUNTED,p),h.removeEventListener(ig.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],_N(r,zN)[zN]={restoreStack:[],prevObject:null,currentContext:null}});var v=function(t,e){for(var i=[t];i.length>0;){var a,o=i.pop();o.isVisible()&&!o.isCulled()&&(f?r.renderDisplayObjectOptimized(o,e,r.context,_N(r,zN)[zN],n):r.renderDisplayObject(o,e,r.context,_N(r,zN)[zN],n));for(var s=(null===(a=o.sortable)||void 0===a||null===(a=a.sorted)||void 0===a?void 0:a.length)>0?o.sortable.sorted:o.childNodes,l=s.length-1;l>=0;l--)i.push(s[l])}};s.hooks.endFrame.tap(t.tag,function(){if(function(){var t,e=d.getContext(),n=d.getDPR(),i=a.width,o=a.height,l=r.canvasRendererPluginOptions,c=l.dirtyObjectNumThreshold,u=l.dirtyObjectRatioThreshold,f=s.getStats(),p=f.total,g=f.rendered,v=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=h.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>c&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,o*n,a.background))}(),0!==l.root.childNodes.length){f=a.renderer.getConfig().enableRenderingOptimization,_N(r,zN)[zN]={restoreStack:[],prevObject:null,currentContext:_N(r,zN)[zN].currentContext},_N(r,zN)[zN].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=d.getContext(),e=d.getDPR();if(Lt(r.dprMatrix,[e,e,1]),At(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),v(l.root,t),t.restore()):v(l.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(bc(r.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,a=new xu;return a.setMinMax([e,n,0],[r,i,0]),a}))));if(r.removedRBushNodeAABBs=[],xu.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),u=c.x,p=c.y,g=c.width,m=c.height,y=pe(r.vec3a,[u,p,0],r.vpMatrix),b=pe(r.vec3b,[u+g,p,0],r.vpMatrix),x=pe(r.vec3c,[u,p+m,0],r.vpMatrix),w=pe(r.vec3d,[u+g,p+m,0],r.vpMatrix),k=Math.min(y[0],b[0],w[0],x[0]),M=Math.min(y[1],b[1],w[1],x[1]),O=Math.max(y[0],b[0],w[0],x[0]),E=Math.max(y[1],b[1],w[1],x[1]),S=Math.floor(k),A=Math.floor(M),_=Math.ceil(O-k),T=Math.ceil(E-M);t.save(),r.clearRect(t,S,A,_,T,a.background),t.beginPath(),t.rect(S,A,_,T),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&h.dispatchEvent(new Up(kv.DIRTY_RECTANGLE,{dirtyRect:{x:S,y:A,width:_,height:T}})),r.searchDirtyObjects(i).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,_N(r,zN)[zN],n)}),t.restore(),r.renderQueue.forEach(function(t){r.saveDirtyAABB(t)}),r.renderQueue=[]}_N(r,zN)[zN].restoreStack.forEach(function(){t.restore()}),_N(r,zN)[zN].restoreStack=[]}else r.clearFullScreenLastFrame=!0}),s.hooks.render.tap(t.tag,function(t){r.clearFullScreen||r.renderQueue.push(t)})}},{key:"clearRect",value:function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var a=t.nodeName,o=!1,s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],c=t.parsedStyle.clipPath;if(c){(!r.prevObject||!Zt(c.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,c),r.prevObject=null);var u=this.pathGeneratorFactory[c.nodeName];u&&(e.save(),o=!0,e.beginPath(),u(e,c.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Zt(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var d=r.prevObject.nodeName;f=a===uu.TEXT?d!==uu.TEXT:a===uu.IMAGE?d!==uu.IMAGE:d===uu.TEXT||d===uu.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}l&&(e.beginPath(),l(e,t.parsedStyle),a!==uu.LINE&&a!==uu.PATH&&a!==uu.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,_N(this,zN)[zN],this,i),o&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var a=t.nodeName,o=r.restoreStack[r.restoreStack.length-1];!o||t.compareDocumentPosition(o)&Zp.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],c=t.parsedStyle.clipPath;if(c){this.applyWorldTransform(e,c);var u=this.pathGeneratorFactory[c.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,c.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),l&&(e.beginPath(),l(e,t.parsedStyle),a!==uu.LINE&&a!==uu.PATH&&a!==uu.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),b(s)||(t.lineDashOffset=s),b(a)||(t.globalAlpha*=a),b(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),b(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new xu;return t.forEach(function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)}),e}},{key:"searchDirtyObjects",value:function(t){var e=Sc(t.getMin(),2),n=e[0],r=e[1],i=Sc(t.getMax(),2),a=i[0],o=i[1];return this.rBush.search({minX:n,minY:r,maxX:a,maxY:o}).map(function(t){return t.displayObject})}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new xu);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(xt(this.tmpMat4,e.getLocalTransform()),At(this.tmpMat4,n,this.tmpMat4),At(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(xt(this.tmpMat4,e.getWorldTransform()),At(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new xu,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.add(e)}),t}}])}();
53
+ */var PT=function(){return vc(function t(){pc(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=hc(hc({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),CT=[],LT=[],jT=function(){function t(){pc(this,t)}return vc(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;CT.length<=0&&LT.length<=0||(LT.forEach(function(t){return t()}),LT=CT.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,l=e.naturalHeight||e.height,c=n-a,u=r-a,f=Math.ceil(s/c),d=Math.ceil(l/u),h={tileSize:[n,r],gridSize:[d,f],tiles:Array(d).fill(null).map(function(){return Array(f).fill(null)})},p=function(t){for(var a=function(a){CT.push(function(){var f=a*c,d=t*u,p=[Math.min(n,s-f),Math.min(r,l-d)],g=p[0],v=p[1],m=o.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,f,d,g,v,0,0,g,v),h.tiles[t][a]={x:f,y:d,tileX:a,tileY:t,data:m},i()})},d=0;d<f;d++)a(d)},g=0;g<d;g++)p(g);return t.stop(),t.executeTask(),h}}])}();jT.TASK_NUM_PER_FRAME=10;var RT=new PT;RT.onRefAdded=function(t){var e=this;t.addEventListener(tg.DESTROY,function(){e.releaseRef(t)},{once:!0})};var IT=function(){return vc(function t(e,n){pc(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=L(t)?t:t.src;if(RT.has(r)){var i=RT.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=L(t)?t:t.src;if(!L(t)&&!RT.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:DT(t)};RT.put(r,i,e)}if(RT.has(r)){var a=RT.get(r,e);return a.img.complete?Promise.resolve(a):new Promise(function(t,e){a.img.addEventListener("load",function(){a.size=[a.img.naturalWidth||a.img.width,a.img.naturalHeight||a.img.height],a.tileSize=DT(a.img),t(a)}),a.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var a=n.context.config.createImage();if(a){var o={img:a,size:[0,0],tileSize:DT(a)};RT.put(r,o,e),a.onload=function(){o.size=[a.naturalWidth||a.width,a.naturalHeight||a.height],o.tileSize=DT(o.img),t(o)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=r}})}},{key:"createDownSampledImage",value:(e=eu(Jc().mark(function t(e,n){var r,i,a,o,s,l,c,u,f,d,h,p,g,v;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(i=this.context.config.enableLargeImageOptimization,o=(a="boolean"==typeof i?{}:i).maxDownSampledImageSize,s=void 0===o?2048:o,l=a.downSamplingRateThreshold,c=void 0===l?.5:l,u=this.runtime.globalThis.createImageBitmap,f=Sc(r.size,2),d=f[0],h=f[1],p=r.img,g=Math.min((s+s)/(d+h),Math.max(.01,Math.min(c,.5))),v=hc(hc({},r),{},{downSamplingRate:g}),RT.update(r.img.src,v,n),!u){t.next=7;break}return t.prev=3,t.next=4,u(r.img,{resizeWidth:d*g,resizeHeight:h*g});case 4:p=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),g=1;case 6:t.next=8;break;case 7:g=1;case 8:return v=hc(hc({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:g}),RT.update(r.img.src,v,n),t.abrupt("return",v);case 9:case"end":return t.stop()}},t,this,[[3,5]])})),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=eu(Jc().mark(function t(e,n,r,i){var a,o,s,l,c;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return a=t.sent,o=i.ownerDocument.defaultView,s=o.requestAnimationFrame,l=o.cancelAnimationFrame,jT.api={requestAnimationFrame:s,cancelAnimationFrame:l,createCanvas:function(){return Up.createCanvas()}},c=hc(hc({},a),jT.sliceImage(a.img,a.tileSize[0],a.tileSize[0],r)),RT.update(a.img.src,c,i),t.abrupt("return",c);case 2:case"end":return t.stop()}},t,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){RT.release(L(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){RT.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var l,c=e.image,u=e.repetition,f=e.transform,d=!1;if(L(c)){var h=this.getImageSync(c,t,o);l=null==h?void 0:h.img}else r?(l=r,d=!0):l=c;var p,g=l&&n.createPattern(l,u);g&&(p=f?_p(ch(f),new Yg({})):Mt(yt()),d&&Tt(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+a[0],f:p[13]+a[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,a=t.min,o=t.width,s=t.height,l=t.angle,c=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var d=null;if(r===qf.LinearGradient){var h=function(t,e,n,r){var i=_u(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}}(a,o,s,l),p=h.x1,g=h.y1,v=h.x2,m=h.y2;d=e.createLinearGradient(p,g,v,m)}else if(r===qf.RadialGradient){var y=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===If.kPercentage&&(o=r.value/100*e),i.unit===If.kPercentage&&(s=i.value/100*n);var l=Math.max(vn([0,0],[o,s]),vn([0,n],[o,s]),vn([e,n],[o,s]),vn([e,0],[o,s]));return a&&(a instanceof Zf?l=a.value:a instanceof Uf&&("closest-side"===a.value?l=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?l=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(l=Math.min(vn([0,0],[o,s]),vn([0,n],[o,s]),vn([e,n],[o,s]),vn([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:l}}(a,o,s,c,u,f),b=y.x,x=y.y,w=y.r;d=e.createRadialGradient(b,x,0,b,x,w)}return d&&(i.forEach(function(t){var e,n=t.offset,r=t.color;n.unit===If.kPercentage&&(null===(e=d)||void 0===e||e.addColorStop(n.value/100,r.toString()))}),this.gradientCache[n]=d),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,a=t.steps,o=t.angle,s=t.cx,l=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(a.map(function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return L(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function DT(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach(function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)}),[r,r]}IT.isSupportTile=!!Up.createCanvas();var BT=function(){function t(){pc(this,t)}return vc(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,a=r.root.ownerDocument.defaultView,o=function(t,e,n){var r=t.parsedStyle,i=r.width,a=r.height;i&&!a?t.setAttribute("height",n/e*i):!i&&a&&t.setAttribute("width",e/n*a)},s=function(t){var e=t.target,r=e.nodeName,a=e.attributes;if(r===ou.IMAGE){var s=a.src,l=a.keepAspectRatio;i.getImageSync(s,e,function(t){var r=t.img,i=r.width,a=r.height;l&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()})}},l=function(t){var e=t.target,r=t.attrName,a=t.prevValue,s=t.newValue;e.nodeName===ou.IMAGE&&"src"===r&&(a!==s&&i.releaseImage(a,e),L(s)&&i.getOrCreateImage(s,e).then(function(t){var r=t.img,i=r.width,a=r.height;e.attributes.keepAspectRatio&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(t.tag,function(){a.addEventListener(tg.MOUNTED,s),a.addEventListener(tg.ATTR_MODIFIED,l)}),n.hooks.destroy.tap(t.tag,function(){a.removeEventListener(tg.MOUNTED,s),a.removeEventListener(tg.ATTR_MODIFIED,l)})}}])}();BT.tag="LoadImage";var FT=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="image-loader",t}return Ec(e,t),vc(e,[{key:"init",value:function(t){this.context.imagePool=new IT(this.context,t),this.addRenderingPlugin(new BT)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(lu),zT=NT("renderState"),WT=function(){function t(e){pc(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,zT,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=yt(),this.dprMatrix=yt(),this.tmpMat4=yt(),this.vec3a=ee(),this.vec3b=ee(),this.vec3c=ee(),this.vec3d=ee(),this.canvasRendererPluginOptions=e}return vc(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,a=i.config,o=i.camera,s=i.renderingService,l=i.renderingContext,c=i.rBushRoot,u=i.pathGeneratorFactory,f=a.renderer.getConfig().enableRenderingOptimization;a.renderer.getConfig().enableDirtyCheck=!1,a.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=c,this.pathGeneratorFactory=u;var d=e.contextService,h=l.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;null!=e&&e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,function(){h.addEventListener(tg.UNMOUNTED,p),h.addEventListener(tg.CULLED,g);var t=d.getDPR(),e=a.width,n=a.height,i=d.getContext();r.clearRect(i,0,0,e*t,n*t,a.background)}),s.hooks.destroy.tap(t.tag,function(){h.removeEventListener(tg.UNMOUNTED,p),h.removeEventListener(tg.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],_T(r,zT)[zT]={restoreStack:[],prevObject:null,currentContext:null}});var v=function(t,e){for(var i=[t];i.length>0;){var a,o=i.pop();o.isVisible()&&!o.isCulled()&&(f?r.renderDisplayObjectOptimized(o,e,r.context,_T(r,zT)[zT],n):r.renderDisplayObject(o,e,r.context,_T(r,zT)[zT],n));for(var s=(null===(a=o.sortable)||void 0===a||null===(a=a.sorted)||void 0===a?void 0:a.length)>0?o.sortable.sorted:o.childNodes,l=s.length-1;l>=0;l--)i.push(s[l])}};s.hooks.endFrame.tap(t.tag,function(){if(function(){var t,e=d.getContext(),n=d.getDPR(),i=a.width,o=a.height,l=r.canvasRendererPluginOptions,c=l.dirtyObjectNumThreshold,u=l.dirtyObjectRatioThreshold,f=s.getStats(),p=f.total,g=f.rendered,v=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=h.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>c&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,o*n,a.background))}(),0!==l.root.childNodes.length){f=a.renderer.getConfig().enableRenderingOptimization,_T(r,zT)[zT]={restoreStack:[],prevObject:null,currentContext:_T(r,zT)[zT].currentContext},_T(r,zT)[zT].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=d.getContext(),e=d.getDPR();if(Lt(r.dprMatrix,[e,e,1]),At(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),v(l.root,t),t.restore()):v(l.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(bc(r.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,a=new vu;return a.setMinMax([e,n,0],[r,i,0]),a}))));if(r.removedRBushNodeAABBs=[],vu.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),u=c.x,p=c.y,g=c.width,m=c.height,y=pe(r.vec3a,[u,p,0],r.vpMatrix),b=pe(r.vec3b,[u+g,p,0],r.vpMatrix),x=pe(r.vec3c,[u,p+m,0],r.vpMatrix),w=pe(r.vec3d,[u+g,p+m,0],r.vpMatrix),k=Math.min(y[0],b[0],w[0],x[0]),M=Math.min(y[1],b[1],w[1],x[1]),O=Math.max(y[0],b[0],w[0],x[0]),E=Math.max(y[1],b[1],w[1],x[1]),S=Math.floor(k),A=Math.floor(M),_=Math.ceil(O-k),T=Math.ceil(E-M);t.save(),r.clearRect(t,S,A,_,T,a.background),t.beginPath(),t.rect(S,A,_,T),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&h.dispatchEvent(new Hp(yv.DIRTY_RECTANGLE,{dirtyRect:{x:S,y:A,width:_,height:T}})),r.searchDirtyObjects(i).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,_T(r,zT)[zT],n)}),t.restore(),r.renderQueue.forEach(function(t){r.saveDirtyAABB(t)}),r.renderQueue=[]}_T(r,zT)[zT].restoreStack.forEach(function(){t.restore()}),_T(r,zT)[zT].restoreStack=[]}else r.clearFullScreenLastFrame=!0}),s.hooks.render.tap(t.tag,function(t){r.clearFullScreen||r.renderQueue.push(t)})}},{key:"clearRect",value:function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var a=t.nodeName,o=!1,s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],c=t.parsedStyle.clipPath;if(c){(!r.prevObject||!Zt(c.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,c),r.prevObject=null);var u=this.pathGeneratorFactory[c.nodeName];u&&(e.save(),o=!0,e.beginPath(),u(e,c.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Zt(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var d=r.prevObject.nodeName;f=a===ou.TEXT?d!==ou.TEXT:a===ou.IMAGE?d!==ou.IMAGE:d===ou.TEXT||d===ou.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}l&&(e.beginPath(),l(e,t.parsedStyle),a!==ou.LINE&&a!==ou.PATH&&a!==ou.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,_T(this,zT)[zT],this,i),o&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var a=t.nodeName,o=r.restoreStack[r.restoreStack.length-1];!o||t.compareDocumentPosition(o)&qp.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],c=t.parsedStyle.clipPath;if(c){this.applyWorldTransform(e,c);var u=this.pathGeneratorFactory[c.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,c.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),l&&(e.beginPath(),l(e,t.parsedStyle),a!==ou.LINE&&a!==ou.PATH&&a!==ou.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),b(s)||(t.lineDashOffset=s),b(a)||(t.globalAlpha*=a),b(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),b(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new vu;return t.forEach(function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)}),e}},{key:"searchDirtyObjects",value:function(t){var e=Sc(t.getMin(),2),n=e[0],r=e[1],i=Sc(t.getMax(),2),a=i[0],o=i[1];return this.rBush.search({minX:n,minY:r,maxX:a,maxY:o}).map(function(t){return t.displayObject})}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new vu);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(xt(this.tmpMat4,e.getLocalTransform()),At(this.tmpMat4,n,this.tmpMat4),At(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(xt(this.tmpMat4,e.getWorldTransform()),At(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new vu,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.add(e)}),t}}])}();
46
54
  /*!
47
55
  * @antv/g-plugin-canvas-renderer
48
56
  * @description A G plugin of renderer implementation with Canvas2D API
@@ -50,7 +58,7 @@ function KT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc
50
58
  * @date 7/30/2025, 1:36:40 PM
51
59
  * @author AntVis
52
60
  * @docs https://g.antv.antgroup.com/
53
- */function $N(t,e,n,r,i,a,o){var s,l;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,u=c.width,f=c.height;l=r.contextService.getDPR();var d=r.config.offscreenCanvas;(s=a.offscreenCanvasCreator.getOrCreateCanvas(d)).width=u*l,s.height=f*l;var h=a.offscreenCanvasCreator.getOrCreateContext(d),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach(function(t){i.renderDisplayObject(t,h,r,p,a)}),p.restoreStack.forEach(function(){h.restore()})}return o.getOrCreatePatternSync(e,t,n,s,l,e.getGeometryBounds().min,function(){e.dirty(),r.renderingService.dirtify()})}function GN(t,e,n,r){var i;if(t.type===Zf.LinearGradient||t.type===Zf.RadialGradient){var a=e.getGeometryBounds(),o=a&&2*a.halfExtents[0]||1,s=a&&2*a.halfExtents[1]||1,l=a&&a.min||[0,0];i=r.getOrCreateGradient(hc(hc({type:t.type},t.value),{},{min:l,width:o,height:s}),n)}return i}WN.tag="CanvasRenderer";var YN=["shadowBlur","shadowOffsetX","shadowOffsetY"],HN=["lineCap","lineJoin","miterLimit"],VN={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},qN={};function XN(t,e,n,r){var i=r.has(e)?r.get(e):VN[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var UN=function(){return vc(function t(e){pc(this,t),this.imagePool=e},[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,a){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?qN:r.prevObject.parsedStyle,a=e.parsedStyle;(n||a.opacity!==i.opacity)&&XN(t,"globalAlpha",b(a.opacity)?VN.globalAlpha:a.opacity,r.currentContext),(n||a.blend!==i.blend)&&XN(t,"globalCompositeOperation",b(a.blend)?VN.globalCompositeOperation:a.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?qN:r.prevObject.parsedStyle,a=e.parsedStyle,o=a.lineWidth,s=void 0===o?VN.lineWidth:o,l=a.fill&&!a.fill.isNone;if(a.stroke&&!a.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)XN(t,"strokeStyle",b(a.stroke)||Array.isArray(a.stroke)||a.stroke.isNone?VN.strokeStyle:e.attributes.stroke,r.currentContext);(n||a.lineWidth!==i.lineWidth)&&XN(t,"lineWidth",b(a.lineWidth)?VN.lineWidth:a.lineWidth,r.currentContext),(n||a.lineDash!==i.lineDash)&&XN(t,"lineDash",a.lineDash||VN.lineDash,r.currentContext),(n||a.lineDashOffset!==i.lineDashOffset)&&XN(t,"lineDashOffset",b(a.lineDashOffset)?VN.lineDashOffset:a.lineDashOffset,r.currentContext);for(var c=0;c<HN.length;c++){var u=HN[c];(n||a[u]!==i[u])&&XN(t,u,b(a[u])?VN[u]:a[u],r.currentContext)}}l&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&XN(t,"fillStyle",b(a.fill)||Array.isArray(a.fill)||a.fill.isNone?VN.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===uu.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){XN(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var a=0;a<YN.length;a++){var o=YN[a];XN(t,o,i[o]||VN[o],r.currentContext)}}i.filter&&i.filter.length&&XN(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){XN(t,"shadowColor",VN.shadowColor,r.currentContext);for(var a=0;a<YN.length;a++){var o=YN[a];XN(t,o,VN[o],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!b(s)&&s.indexOf("drop-shadow")>-1&&XN(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||VN.filter,r.currentContext)}else XN(t,"filter",VN.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle,s=o.fill,l=o.fillRule,c=null;if(Array.isArray(s)&&s.length>0)s.forEach(function(r){var i=XN(t,"fillStyle",GN(r,e,t,a.imagePool),n.currentContext);c=null!=c?c:i,l?t.fill(l):t.fill()});else{if(wd(s)){var u=$N(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,c=!0)}l?t.fill(l):t.fill()}null!==c&&XN(t,"fillStyle",c,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle.stroke,s=null;if(Array.isArray(o)&&o.length>0)o.forEach(function(r){var i=XN(t,"strokeStyle",GN(r,e,t,a.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()});else{if(wd(o)){var l=$N(o,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(l){var c=XN(t,"strokeStyle",l,n.currentContext);s=null!=s?s:c}}t.stroke()}null!==s&&XN(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var a,o=e.nodeName,s=e.parsedStyle,l=s.opacity,c=void 0===l?VN.globalAlpha:l,u=s.fillOpacity,f=void 0===u?VN.fillOpacity:u,d=s.strokeOpacity,h=void 0===d?VN.strokeOpacity:d,p=s.lineWidth,g=void 0===p?VN.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var y=!b(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,w=0===(null===(a=s.fill)||void 0===a?void 0:a.alpha),k=!(!s.filter||!s.filter.length),M=y&&m&&(o===uu.PATH||o===uu.LINE||o===uu.POLYLINE||w||x),O=null;if(v)M||this.applyShadowAndFilterStyleToContext(t,e,y,n),O=XN(t,"globalAlpha",c*f,n.currentContext),this.fillToContext(t,e,n,r,i),M||this.clearShadowAndFilterStyleForContext(t,y,k,n);if(m){var E=!1,S=XN(t,"globalAlpha",c*h,n.currentContext);if(O=v?O:S,M&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),E=!0,x)){var A=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=A,this.clearShadowAndFilterStyleForContext(t,y,k,n,!0)}this.strokeToContext(t,e,n,r,i),E&&this.clearShadowAndFilterStyleForContext(t,y,k,n)}null!==O&&XN(t,"globalAlpha",O,n.currentContext)}}}])}(),KN=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"render",value:function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=void 0===l?1:l,u=e.fillOpacity,f=void 0===u?1:u,d=e.stroke,h=e.strokeOpacity,p=void 0===h?1:h,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,y=e.lineJoin,x=e.shadowType,w=e.shadowColor,k=e.shadowBlur,M=e.filter,O=e.miterLimit,E=o&&!o.isNone,S=d&&!d.isNone&&v>0,A=0===(null==o?void 0:o.alpha),_=!(!M||!M.length),T=!b(w)&&k>0,N=n.nodeName,P="inner"===x,C=S&&T&&(N===uu.PATH||N===uu.LINE||N===uu.POLYLINE||A||P);E&&(t.globalAlpha=c*f,C||ZN(n,t,T),QN(t,n,o,s,r,i,a,this.imagePool),C||this.clearShadowAndFilter(t,_,T)),S&&(t.globalAlpha=c*p,t.lineWidth=v,b(O)||(t.miterLimit=O),b(m)||(t.lineCap=m),b(y)||(t.lineJoin=y),C&&(P&&(t.globalCompositeOperation="source-atop"),ZN(n,t,!0),P&&(JN(t,n,d,r,i,a,this.imagePool),t.globalCompositeOperation=VN.globalCompositeOperation,this.clearShadowAndFilter(t,_,!0))),JN(t,n,d,r,i,a,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!b(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(UN);function ZN(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}function QN(t,e,n,r,i,a,o,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach(function(n){t.fillStyle=GN(n,e,t,s),l||(r?t.fill(r):t.fill())}):(wd(n)&&(t.fillStyle=$N(n,e,t,i,a,o,s)),l||(r?t.fill(r):t.fill()))}function JN(t,e,n,r,i,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach(function(n){t.strokeStyle=GN(n,e,t,o),s||t.stroke()}):(wd(n)&&(t.strokeStyle=$N(n,e,t,r,i,a,o)),s||t.stroke())}var tP=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,a=r.imageCache;a.downSampled?t.drawImage(a.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then(function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(t){console.error(t)})}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,a=r.imageCache,o=r.imageRect,s=r.drawRect,l=a.size,c=t.getTransform(),u=c.a,f=c.b,d=c.c,h=c.d,p=c.e,g=c.f;if(t.resetTransform(),null!=a&&a.gridSize){for(var v=[l[0]/o[2],l[1]/o[3]],m=[a.tileSize[0]/v[0],a.tileSize[1]/v[1]],y=[Math.floor((s[0]-o[0])/m[0]),Math.ceil((s[0]+s[2]-o[0])/m[0])],b=y[0],x=y[1],w=[Math.floor((s[1]-o[1])/m[1]),Math.ceil((s[1]+s[3]-o[1])/m[1])],k=w[1],M=w[0];M<=k;M++)for(var O=b;O<=x;O++){var E=a.tiles[M][O];if(E){var S=[Math.floor(o[0]+E.tileX*m[0]),Math.floor(o[1]+E.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(E.data,S[0],S[1],S[2],S[3])}}t.setTransform(u,f,d,h,p,g)}else this.imagePool.createImageTiles(i,[],function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())},n).catch(function(t){console.error(t)})}},{key:"render",value:function(t,n,r){var i=n.x,a=void 0===i?0:i,o=n.y,s=void 0===o?0:o,l=n.width,c=n.height,u=n.src,f=n.shadowColor,d=n.shadowBlur,h=this.imagePool.getImageSync(u,r),p=null==h?void 0:h.img,g=l,v=c;if(p){var m,y,x,w,k,M,O,E,S,A,_,T,N,P,C;g||(g=p.width),v||(v=p.height),ZN(r,t,!b(f)&&d>0);try{var L=r.ownerDocument.defaultView.getContextService().getDomElement(),j=L.width,R=L.height,I=t.getTransform(),D=I.a,B=I.b,F=function(t,e){var n=pe(ee(),[t[0],t[1],0],e),r=pe(ee(),[t[0]+t[2],t[1],0],e),i=pe(ee(),[t[0],t[1]+t[3],0],e),a=pe(ee(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],a[0]),Math.min(n[1],r[1],i[1],a[1]),Math.max(n[0],r[0],i[0],a[0])-Math.min(n[0],r[0],i[0],a[0]),Math.max(n[1],r[1],i[1],a[1])-Math.min(n[1],r[1],i[1],a[1])]}([a,s,g,v],wt(D,I.c,0,0,B,I.d,0,0,0,0,1,0,I.e,I.f,0,1)),z=(m=F,y=Sc([0,0,j,R],4),x=y[0],w=y[1],k=y[2],M=y[3],O=Sc(m,4),E=O[0],S=O[1],A=O[2],_=O[3],T=Math.max(x,E),N=Math.max(w,S),P=Math.min(x+k,E+A),C=Math.min(w+M,S+_),P<=T||C<=N?null:[T,N,P-T,C-N]);if(!z)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});if(F[2]/h.size[0]<(h.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:h,drawRect:[a,s,g,v]});if(!IN.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});this.renderTile(t,n,r,{src:u,imageCache:h,imageRect:F,drawRect:z})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(KN),eP=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"render",value:function(t,e,n,r,i,a){n.getBounds();var o=e.lineWidth,s=void 0===o?1:o,l=e.textAlign,c=void 0===l?"start":l,u=e.textBaseline,f=void 0===u?"alphabetic":u,d=e.lineJoin,h=void 0===d?"miter":d,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,y=e.stroke,x=e.fill,w=e.fillRule,k=e.fillOpacity,M=void 0===k?1:k,O=e.strokeOpacity,E=void 0===O?1:O,S=e.opacity,A=void 0===S?1:S,_=e.metrics,T=e.x,N=void 0===T?0:T,P=e.y,C=void 0===P?0:P,L=e.dx,j=e.dy,R=e.shadowColor,I=e.shadowBlur,D=_.font,B=_.lines,F=_.height,z=_.lineHeight,W=_.lineMetrics;t.font=D,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var $=f;"alphabetic"===$&&($="bottom"),t.lineJoin=h,b(g)||(t.miterLimit=g);var G=C;"middle"===f?G+=-F/2-z/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?G+=-F:"top"!==f&&"hanging"!==f||(G+=-z);var Y=N+(L||0);G+=j||0,1===B.length&&("bottom"===$?($="middle",G-=.5*F):"top"===$&&($="middle",G+=.5*F)),t.textBaseline=$,ZN(n,t,!b(R)&&I>0);for(var H=0;H<B.length;H++){var V=s/2+Y;G+=z,b(y)||y.isNone||!s||this.drawLetterSpacing(t,n,B[H],W[H],c,V,G,m,x,w,M,y,E,A,!0,r,i,a),b(x)||this.drawLetterSpacing(t,n,B[H],W[H],c,V,G,m,x,w,M,y,E,A,!1,r,i,a)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,a,o,s,l,c,u,f,d,h,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=a;"center"===i||"middle"===i?b=a-r.width/2:"right"!==i&&"end"!==i||(b=a-r.width);for(var x=Array.from(n),w=t.measureText(n).width,k=0,M=0;M<x.length;++M){var O=x[M];p?this.strokeText(t,e,O,b,o,f,d,g,v,m):this.fillText(t,e,O,b,o,l,c,u,h,g,v,m),b+=w-(k=t.measureText(n.substring(M+1)).width)+s,w=k}t.textAlign=y}else p?this.strokeText(t,e,n,a,o,f,d,g,v,m):this.fillText(t,e,n,a,o,l,c,u,h,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,a,o,s,l,c,u,f){var d;QN(t,e,a,o,c,u,f,this.imagePool,!0);var h=!b(s)&&1!==s;h&&(d=t.globalAlpha,t.globalAlpha=s*l),t.fillText(n,r,i),h&&(t.globalAlpha=d)}},{key:"strokeText",value:function(t,e,n,r,i,a,o,s,l,c){var u;JN(t,e,a,s,l,c,this.imagePool,!0);var f=!b(o)&&1!==o;f&&(u=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,r,i),f&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}(KN),nP=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),(t=Mc(this,e)).name="canvas-renderer",t.options=n,t}return Ec(e,t),vc(e,[{key:"init",value:function(){var t,e=hc({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new KN(n),i=(fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},uu.CIRCLE,r),uu.ELLIPSE,r),uu.RECT,r),uu.IMAGE,new tP(n)),uu.TEXT,new eP(n)),uu.LINE,r),uu.POLYLINE,r),uu.POLYGON,r),uu.PATH,r),uu.GROUP,void 0),fc(fc(fc(t,uu.HTML,void 0),uu.MESH,void 0),uu.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new WN(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(du),rP=function(){function t(){pc(this,t)}return vc(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,l=function(t){i.hooks.pointerMove.call(t)},c=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},h=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",l,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",l,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",c,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",c,!0),t.addEventListener("touchmove",l,!0),t.addEventListener("touchcancel",h,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",c,!0),n.globalThis.removeEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",c,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",c,!0),t.removeEventListener("touchmove",l,!0),t.removeEventListener("touchcancel",h,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)})}}])}();rP.tag="DOMInteraction";var iP=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="dom-interaction",t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.addRenderingPlugin(new rP)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(du),aP=function(){function t(){pc(this,t),this.displayObjectHTMLElementMap=new WeakMap}return vc(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===uu.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach(function(t){r.updateAttribute(t,e)}),c(e,n),l.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===uu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),l.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===uu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;(e.nodeName===uu.FRAGMENT?e.childNodes:[e]).forEach(function(t){if(t.nodeName===uu.HTML){var e=r.getOrCreateEl(t);c(t,e)}})},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};o.hooks.init.tap(t.tag,function(){s.addEventListener(kv.RESIZE,p),s.addEventListener(ig.MOUNTED,u),s.addEventListener(ig.UNMOUNTED,f),s.addEventListener(ig.ATTR_MODIFIED,d),s.addEventListener(ig.BOUNDS_CHANGED,h)}),o.hooks.endFrame.tap(t.tag,function(){r.$camera&&a.renderReasons.has(tg.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),o.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(kv.RESIZE,p),s.removeEventListener(ig.MOUNTED,u),s.removeEventListener(ig.UNMOUNTED,f),s.removeEventListener(ig.ATTR_MODIFIED,d),s.removeEventListener(ig.BOUNDS_CHANGED,h)})}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",l=o.querySelector("#".concat(s));if(!l){var c=(n||document).createElement("div");c.style.overflow="hidden",c.style.pointerEvents="none",c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width="".concat(r||0,"px"),c.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");l=u,u.id=s,u.style.position="absolute",u.style.left="".concat(a.offsetLeft||0,"px"),u.style.top="".concat(a.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",c.appendChild(u),o.appendChild(c)}return l}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;L(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=I(a)?"".concat(a,"px"):a.toString();break;case"height":var o=e.parsedStyle.height;n.style.height=I(o)?"".concat(o,"px"):o.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var l=e.parsedStyle.visibility;n.style.visibility=l;break;case"pointerEvents":var c=e.parsedStyle.pointerEvents,u=void 0===c?"auto":c;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var d=e.parsedStyle.fill,h="";kd(d)?h=d.isNone?"transparent":e.getAttribute("fill"):Array.isArray(d)&&(h=e.getAttribute("fill")),n.style.background=h;break;case"stroke":var p=e.parsedStyle.stroke,g="";kd(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:b(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();
61
+ */function $T(t,e,n,r,i,a,o){var s,l;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,u=c.width,f=c.height;l=r.contextService.getDPR();var d=r.config.offscreenCanvas;(s=a.offscreenCanvasCreator.getOrCreateCanvas(d)).width=u*l,s.height=f*l;var h=a.offscreenCanvasCreator.getOrCreateContext(d),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach(function(t){i.renderDisplayObject(t,h,r,p,a)}),p.restoreStack.forEach(function(){h.restore()})}return o.getOrCreatePatternSync(e,t,n,s,l,e.getGeometryBounds().min,function(){e.dirty(),r.renderingService.dirtify()})}function GT(t,e,n,r){var i;if(t.type===qf.LinearGradient||t.type===qf.RadialGradient){var a=e.getGeometryBounds(),o=a&&2*a.halfExtents[0]||1,s=a&&2*a.halfExtents[1]||1,l=a&&a.min||[0,0];i=r.getOrCreateGradient(hc(hc({type:t.type},t.value),{},{min:l,width:o,height:s}),n)}return i}WT.tag="CanvasRenderer";var YT=["shadowBlur","shadowOffsetX","shadowOffsetY"],HT=["lineCap","lineJoin","miterLimit"],VT={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},qT={};function XT(t,e,n,r){var i=r.has(e)?r.get(e):VT[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var UT=function(){return vc(function t(e){pc(this,t),this.imagePool=e},[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,a){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?qT:r.prevObject.parsedStyle,a=e.parsedStyle;(n||a.opacity!==i.opacity)&&XT(t,"globalAlpha",b(a.opacity)?VT.globalAlpha:a.opacity,r.currentContext),(n||a.blend!==i.blend)&&XT(t,"globalCompositeOperation",b(a.blend)?VT.globalCompositeOperation:a.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?qT:r.prevObject.parsedStyle,a=e.parsedStyle,o=a.lineWidth,s=void 0===o?VT.lineWidth:o,l=a.fill&&!a.fill.isNone;if(a.stroke&&!a.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)XT(t,"strokeStyle",b(a.stroke)||Array.isArray(a.stroke)||a.stroke.isNone?VT.strokeStyle:e.attributes.stroke,r.currentContext);(n||a.lineWidth!==i.lineWidth)&&XT(t,"lineWidth",b(a.lineWidth)?VT.lineWidth:a.lineWidth,r.currentContext),(n||a.lineDash!==i.lineDash)&&XT(t,"lineDash",a.lineDash||VT.lineDash,r.currentContext),(n||a.lineDashOffset!==i.lineDashOffset)&&XT(t,"lineDashOffset",b(a.lineDashOffset)?VT.lineDashOffset:a.lineDashOffset,r.currentContext);for(var c=0;c<HT.length;c++){var u=HT[c];(n||a[u]!==i[u])&&XT(t,u,b(a[u])?VT[u]:a[u],r.currentContext)}}l&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&XT(t,"fillStyle",b(a.fill)||Array.isArray(a.fill)||a.fill.isNone?VT.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===ou.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){XT(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var a=0;a<YT.length;a++){var o=YT[a];XT(t,o,i[o]||VT[o],r.currentContext)}}i.filter&&i.filter.length&&XT(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){XT(t,"shadowColor",VT.shadowColor,r.currentContext);for(var a=0;a<YT.length;a++){var o=YT[a];XT(t,o,VT[o],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!b(s)&&s.indexOf("drop-shadow")>-1&&XT(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||VT.filter,r.currentContext)}else XT(t,"filter",VT.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle,s=o.fill,l=o.fillRule,c=null;if(Array.isArray(s)&&s.length>0)s.forEach(function(r){var i=XT(t,"fillStyle",GT(r,e,t,a.imagePool),n.currentContext);c=null!=c?c:i,l?t.fill(l):t.fill()});else{if(md(s)){var u=$T(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,c=!0)}l?t.fill(l):t.fill()}null!==c&&XT(t,"fillStyle",c,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle.stroke,s=null;if(Array.isArray(o)&&o.length>0)o.forEach(function(r){var i=XT(t,"strokeStyle",GT(r,e,t,a.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()});else{if(md(o)){var l=$T(o,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(l){var c=XT(t,"strokeStyle",l,n.currentContext);s=null!=s?s:c}}t.stroke()}null!==s&&XT(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var a,o=e.nodeName,s=e.parsedStyle,l=s.opacity,c=void 0===l?VT.globalAlpha:l,u=s.fillOpacity,f=void 0===u?VT.fillOpacity:u,d=s.strokeOpacity,h=void 0===d?VT.strokeOpacity:d,p=s.lineWidth,g=void 0===p?VT.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var y=!b(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,w=0===(null===(a=s.fill)||void 0===a?void 0:a.alpha),k=!(!s.filter||!s.filter.length),M=y&&m&&(o===ou.PATH||o===ou.LINE||o===ou.POLYLINE||w||x),O=null;if(v)M||this.applyShadowAndFilterStyleToContext(t,e,y,n),O=XT(t,"globalAlpha",c*f,n.currentContext),this.fillToContext(t,e,n,r,i),M||this.clearShadowAndFilterStyleForContext(t,y,k,n);if(m){var E=!1,S=XT(t,"globalAlpha",c*h,n.currentContext);if(O=v?O:S,M&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),E=!0,x)){var A=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=A,this.clearShadowAndFilterStyleForContext(t,y,k,n,!0)}this.strokeToContext(t,e,n,r,i),E&&this.clearShadowAndFilterStyleForContext(t,y,k,n)}null!==O&&XT(t,"globalAlpha",O,n.currentContext)}}}])}(),KT=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"render",value:function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=void 0===l?1:l,u=e.fillOpacity,f=void 0===u?1:u,d=e.stroke,h=e.strokeOpacity,p=void 0===h?1:h,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,y=e.lineJoin,x=e.shadowType,w=e.shadowColor,k=e.shadowBlur,M=e.filter,O=e.miterLimit,E=o&&!o.isNone,S=d&&!d.isNone&&v>0,A=0===(null==o?void 0:o.alpha),_=!(!M||!M.length),T=!b(w)&&k>0,N=n.nodeName,P="inner"===x,C=S&&T&&(N===ou.PATH||N===ou.LINE||N===ou.POLYLINE||A||P);E&&(t.globalAlpha=c*f,C||ZT(n,t,T),QT(t,n,o,s,r,i,a,this.imagePool),C||this.clearShadowAndFilter(t,_,T)),S&&(t.globalAlpha=c*p,t.lineWidth=v,b(O)||(t.miterLimit=O),b(m)||(t.lineCap=m),b(y)||(t.lineJoin=y),C&&(P&&(t.globalCompositeOperation="source-atop"),ZT(n,t,!0),P&&(JT(t,n,d,r,i,a,this.imagePool),t.globalCompositeOperation=VT.globalCompositeOperation,this.clearShadowAndFilter(t,_,!0))),JT(t,n,d,r,i,a,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!b(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(UT);function ZT(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}function QT(t,e,n,r,i,a,o,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach(function(n){t.fillStyle=GT(n,e,t,s),l||(r?t.fill(r):t.fill())}):(md(n)&&(t.fillStyle=$T(n,e,t,i,a,o,s)),l||(r?t.fill(r):t.fill()))}function JT(t,e,n,r,i,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach(function(n){t.strokeStyle=GT(n,e,t,o),s||t.stroke()}):(md(n)&&(t.strokeStyle=$T(n,e,t,r,i,a,o)),s||t.stroke())}var tN=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,a=r.imageCache;a.downSampled?t.drawImage(a.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then(function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(t){console.error(t)})}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,a=r.imageCache,o=r.imageRect,s=r.drawRect,l=a.size,c=t.getTransform(),u=c.a,f=c.b,d=c.c,h=c.d,p=c.e,g=c.f;if(t.resetTransform(),null!=a&&a.gridSize){for(var v=[l[0]/o[2],l[1]/o[3]],m=[a.tileSize[0]/v[0],a.tileSize[1]/v[1]],y=[Math.floor((s[0]-o[0])/m[0]),Math.ceil((s[0]+s[2]-o[0])/m[0])],b=y[0],x=y[1],w=[Math.floor((s[1]-o[1])/m[1]),Math.ceil((s[1]+s[3]-o[1])/m[1])],k=w[1],M=w[0];M<=k;M++)for(var O=b;O<=x;O++){var E=a.tiles[M][O];if(E){var S=[Math.floor(o[0]+E.tileX*m[0]),Math.floor(o[1]+E.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(E.data,S[0],S[1],S[2],S[3])}}t.setTransform(u,f,d,h,p,g)}else this.imagePool.createImageTiles(i,[],function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())},n).catch(function(t){console.error(t)})}},{key:"render",value:function(t,n,r){var i=n.x,a=void 0===i?0:i,o=n.y,s=void 0===o?0:o,l=n.width,c=n.height,u=n.src,f=n.shadowColor,d=n.shadowBlur,h=this.imagePool.getImageSync(u,r),p=null==h?void 0:h.img,g=l,v=c;if(p){var m,y,x,w,k,M,O,E,S,A,_,T,N,P,C;g||(g=p.width),v||(v=p.height),ZT(r,t,!b(f)&&d>0);try{var L=r.ownerDocument.defaultView.getContextService().getDomElement(),j=L.width,R=L.height,I=t.getTransform(),D=I.a,B=I.b,F=function(t,e){var n=pe(ee(),[t[0],t[1],0],e),r=pe(ee(),[t[0]+t[2],t[1],0],e),i=pe(ee(),[t[0],t[1]+t[3],0],e),a=pe(ee(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],a[0]),Math.min(n[1],r[1],i[1],a[1]),Math.max(n[0],r[0],i[0],a[0])-Math.min(n[0],r[0],i[0],a[0]),Math.max(n[1],r[1],i[1],a[1])-Math.min(n[1],r[1],i[1],a[1])]}([a,s,g,v],wt(D,I.c,0,0,B,I.d,0,0,0,0,1,0,I.e,I.f,0,1)),z=(m=F,y=Sc([0,0,j,R],4),x=y[0],w=y[1],k=y[2],M=y[3],O=Sc(m,4),E=O[0],S=O[1],A=O[2],_=O[3],T=Math.max(x,E),N=Math.max(w,S),P=Math.min(x+k,E+A),C=Math.min(w+M,S+_),P<=T||C<=N?null:[T,N,P-T,C-N]);if(!z)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});if(F[2]/h.size[0]<(h.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:h,drawRect:[a,s,g,v]});if(!IT.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});this.renderTile(t,n,r,{src:u,imageCache:h,imageRect:F,drawRect:z})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(KT),eN=function(t){function e(){return pc(this,e),Mc(this,e,arguments)}return Ec(e,t),vc(e,[{key:"render",value:function(t,e,n,r,i,a){n.getBounds();var o=e.lineWidth,s=void 0===o?1:o,l=e.textAlign,c=void 0===l?"start":l,u=e.textBaseline,f=void 0===u?"alphabetic":u,d=e.lineJoin,h=void 0===d?"miter":d,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,y=e.stroke,x=e.fill,w=e.fillRule,k=e.fillOpacity,M=void 0===k?1:k,O=e.strokeOpacity,E=void 0===O?1:O,S=e.opacity,A=void 0===S?1:S,_=e.metrics,T=e.x,N=void 0===T?0:T,P=e.y,C=void 0===P?0:P,L=e.dx,j=e.dy,R=e.shadowColor,I=e.shadowBlur,D=_.font,B=_.lines,F=_.height,z=_.lineHeight,W=_.lineMetrics;t.font=D,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var $=f;"alphabetic"===$&&($="bottom"),t.lineJoin=h,b(g)||(t.miterLimit=g);var G=C;"middle"===f?G+=-F/2-z/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?G+=-F:"top"!==f&&"hanging"!==f||(G+=-z);var Y=N+(L||0);G+=j||0,1===B.length&&("bottom"===$?($="middle",G-=.5*F):"top"===$&&($="middle",G+=.5*F)),t.textBaseline=$,ZT(n,t,!b(R)&&I>0);for(var H=0;H<B.length;H++){var V=s/2+Y;G+=z,b(y)||y.isNone||!s||this.drawLetterSpacing(t,n,B[H],W[H],c,V,G,m,x,w,M,y,E,A,!0,r,i,a),b(x)||this.drawLetterSpacing(t,n,B[H],W[H],c,V,G,m,x,w,M,y,E,A,!1,r,i,a)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,a,o,s,l,c,u,f,d,h,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=a;"center"===i||"middle"===i?b=a-r.width/2:"right"!==i&&"end"!==i||(b=a-r.width);for(var x=Array.from(n),w=t.measureText(n).width,k=0,M=0;M<x.length;++M){var O=x[M];p?this.strokeText(t,e,O,b,o,f,d,g,v,m):this.fillText(t,e,O,b,o,l,c,u,h,g,v,m),b+=w-(k=t.measureText(n.substring(M+1)).width)+s,w=k}t.textAlign=y}else p?this.strokeText(t,e,n,a,o,f,d,g,v,m):this.fillText(t,e,n,a,o,l,c,u,h,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,a,o,s,l,c,u,f){var d;QT(t,e,a,o,c,u,f,this.imagePool,!0);var h=!b(s)&&1!==s;h&&(d=t.globalAlpha,t.globalAlpha=s*l),t.fillText(n,r,i),h&&(t.globalAlpha=d)}},{key:"strokeText",value:function(t,e,n,r,i,a,o,s,l,c){var u;JT(t,e,a,s,l,c,this.imagePool,!0);var f=!b(o)&&1!==o;f&&(u=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,r,i),f&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}(KT),nN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),(t=Mc(this,e)).name="canvas-renderer",t.options=n,t}return Ec(e,t),vc(e,[{key:"init",value:function(){var t,e=hc({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new KT(n),i=(fc(fc(fc(fc(fc(fc(fc(fc(fc(fc(t={},ou.CIRCLE,r),ou.ELLIPSE,r),ou.RECT,r),ou.IMAGE,new tN(n)),ou.TEXT,new eN(n)),ou.LINE,r),ou.POLYLINE,r),ou.POLYGON,r),ou.PATH,r),ou.GROUP,void 0),fc(fc(fc(t,ou.HTML,void 0),ou.MESH,void 0),ou.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new WT(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(lu),rN=function(){function t(){pc(this,t)}return vc(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,l=function(t){i.hooks.pointerMove.call(t)},c=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},h=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",l,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",l,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",c,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",c,!0),t.addEventListener("touchmove",l,!0),t.addEventListener("touchcancel",h,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",c,!0),n.globalThis.removeEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",c,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",c,!0),t.removeEventListener("touchmove",l,!0),t.removeEventListener("touchcancel",h,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)})}}])}();rN.tag="DOMInteraction";var iN=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="dom-interaction",t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.addRenderingPlugin(new rN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(lu),aN=function(){function t(){pc(this,t),this.displayObjectHTMLElementMap=new WeakMap}return vc(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===ou.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach(function(t){r.updateAttribute(t,e)}),c(e,n),l.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===ou.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),l.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===ou.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;(e.nodeName===ou.FRAGMENT?e.childNodes:[e]).forEach(function(t){if(t.nodeName===ou.HTML){var e=r.getOrCreateEl(t);c(t,e)}})},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};o.hooks.init.tap(t.tag,function(){s.addEventListener(yv.RESIZE,p),s.addEventListener(tg.MOUNTED,u),s.addEventListener(tg.UNMOUNTED,f),s.addEventListener(tg.ATTR_MODIFIED,d),s.addEventListener(tg.BOUNDS_CHANGED,h)}),o.hooks.endFrame.tap(t.tag,function(){r.$camera&&a.renderReasons.has(Kp.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),o.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(yv.RESIZE,p),s.removeEventListener(tg.MOUNTED,u),s.removeEventListener(tg.UNMOUNTED,f),s.removeEventListener(tg.ATTR_MODIFIED,d),s.removeEventListener(tg.BOUNDS_CHANGED,h)})}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",l=o.querySelector("#".concat(s));if(!l){var c=(n||document).createElement("div");c.style.overflow="hidden",c.style.pointerEvents="none",c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width="".concat(r||0,"px"),c.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");l=u,u.id=s,u.style.position="absolute",u.style.left="".concat(a.offsetLeft||0,"px"),u.style.top="".concat(a.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",c.appendChild(u),o.appendChild(c)}return l}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;L(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=I(a)?"".concat(a,"px"):a.toString();break;case"height":var o=e.parsedStyle.height;n.style.height=I(o)?"".concat(o,"px"):o.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var l=e.parsedStyle.visibility;n.style.visibility=l;break;case"pointerEvents":var c=e.parsedStyle.pointerEvents,u=void 0===c?"auto":c;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var d=e.parsedStyle.fill,h="";yd(d)?h=d.isNone?"transparent":e.getAttribute("fill"):Array.isArray(d)&&(h=e.getAttribute("fill")),n.style.background=h;break;case"stroke":var p=e.parsedStyle.stroke,g="";yd(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:b(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();
54
62
  /*!
55
63
  * @antv/g-plugin-html-renderer
56
64
  * @description A G plugin for rendering HTML
@@ -58,7 +66,7 @@ function KT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc
58
66
  * @date 7/30/2025, 1:35:48 PM
59
67
  * @author AntVis
60
68
  * @docs https://g.antv.antgroup.com/
61
- */aP.tag="HTMLRendering";var oP=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="html-renderer",t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.addRenderingPlugin(new aP)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(du),sP=function(){return vc(function t(e){pc(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config},[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=L(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Kh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(tg.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=au(ru().mark(function t(){var e,n,r,i=arguments;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 1:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),lP=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="canvas-context-register",t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.context.ContextService=sP}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(du),cP=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e,[t])).registerPlugin(new lP),n.registerPlugin(new FN),n.registerPlugin(new rN),n.registerPlugin(new nP),n.registerPlugin(new iP),n.registerPlugin(new AN),n.registerPlugin(new oP),n}return Ec(e,t),vc(e)}(hu),uP=function(){function t(e){pc(this,t),this.dragndropPluginOptions=e}return vc(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,a=i.defaultView,o=function(t){var e=t.target,r=e===i,o=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(o){var s=!1,l=t.timeStamp,c=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],d=function(){var t=au(ru().mark(function t(a){var d,h,p,g,v,m;return ru().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(d=a.timeStamp-l,h=vn([a.clientX,a.clientY],c),!(d<=n.dragndropPluginOptions.dragstartTimeThreshold||h<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=1;break}return t.abrupt("return");case 1:a.type="dragstart",o.dispatchEvent(a),s=!0;case 2:if(a.type="drag",a.dx=a.clientX-f[0],a.dy=a.clientY-f[1],o.dispatchEvent(a),f=[a.clientX,a.clientY],r){t.next=4;break}return p="pointer"===n.dragndropPluginOptions.overlap?[a.canvasX,a.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(p[0],p[1]);case 3:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(a.type="dragleave",a.target=u,u.dispatchEvent(a)),m&&(a.type="dragenter",a.target=m,m.dispatchEvent(a)),(u=m)&&(a.type="dragover",a.target=u,u.dispatchEvent(a)));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();a.addEventListener("pointermove",d);var h=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",o.dispatchEvent(e),s=!1}a.removeEventListener("pointermove",d)};e.addEventListener("pointerup",h,{once:!0}),e.addEventListener("pointerupoutside",h,{once:!0})}};r.hooks.init.tap(t.tag,function(){a.addEventListener("pointerdown",o)}),r.hooks.destroy.tap(t.tag,function(){a.removeEventListener("pointerdown",o)})}}])}();
69
+ */aN.tag="HTMLRendering";var oN=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="html-renderer",t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.addRenderingPlugin(new aN)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(lu),sN=function(){return vc(function t(e){pc(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config},[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=L(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Vh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Kp.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=eu(Jc().mark(function t(){var e,n,r,i=arguments;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 1:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),lN=function(t){function e(){var t;pc(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=Mc(this,e,[].concat(r))).name="canvas-context-register",t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.context.ContextService=sN}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(lu),cN=function(t){function e(t){var n;return pc(this,e),(n=Mc(this,e,[t])).registerPlugin(new lN),n.registerPlugin(new FT),n.registerPlugin(new K_),n.registerPlugin(new nN),n.registerPlugin(new iN),n.registerPlugin(new AT),n.registerPlugin(new oN),n}return Ec(e,t),vc(e)}(cu),uN=function(){function t(e){pc(this,t),this.dragndropPluginOptions=e}return vc(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,a=i.defaultView,o=function(t){var e=t.target,r=e===i,o=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(o){var s=!1,l=t.timeStamp,c=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],d=function(){var t=eu(Jc().mark(function t(a){var d,h,p,g,v,m;return Jc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(d=a.timeStamp-l,h=vn([a.clientX,a.clientY],c),!(d<=n.dragndropPluginOptions.dragstartTimeThreshold||h<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=1;break}return t.abrupt("return");case 1:a.type="dragstart",o.dispatchEvent(a),s=!0;case 2:if(a.type="drag",a.dx=a.clientX-f[0],a.dy=a.clientY-f[1],o.dispatchEvent(a),f=[a.clientX,a.clientY],r){t.next=4;break}return p="pointer"===n.dragndropPluginOptions.overlap?[a.canvasX,a.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(p[0],p[1]);case 3:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(a.type="dragleave",a.target=u,u.dispatchEvent(a)),m&&(a.type="dragenter",a.target=m,m.dispatchEvent(a)),(u=m)&&(a.type="dragover",a.target=u,u.dispatchEvent(a)));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();a.addEventListener("pointermove",d);var h=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",o.dispatchEvent(e),s=!1}a.removeEventListener("pointermove",d)};e.addEventListener("pointerup",h,{once:!0}),e.addEventListener("pointerupoutside",h,{once:!0})}};r.hooks.init.tap(t.tag,function(){a.addEventListener("pointerdown",o)}),r.hooks.destroy.tap(t.tag,function(){a.removeEventListener("pointerdown",o)})}}])}();
62
70
  /*!
63
71
  * @antv/g-canvas
64
72
  * @description A renderer implemented by Canvas 2D API
@@ -66,4 +74,4 @@ function KT(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc
66
74
  * @date 7/30/2025, 1:38:18 PM
67
75
  * @author AntVis
68
76
  * @docs https://g.antv.antgroup.com/
69
- */uP.tag="Dragndrop";var fP=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),(t=Mc(this,e)).name="dragndrop",t.options=n,t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.addRenderingPlugin(new uP(hc({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(du),dP=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;a<i;a++)if(r[a]){var o=r[a],s=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),s.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),hP=dP;const pP={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},gP={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class vP extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var mP;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(mP||(mP={}));const yP=new Set([32,9,10,13]),bP=new Set([43,45,42,47,37,33,38,124,61,60,62]),xP=new Map([["true",mP.BOOLEAN],["false",mP.BOOLEAN],["null",mP.NULL]]),wP=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),kP=new Map([[46,mP.DOT],[91,mP.BRACKET_LEFT],[93,mP.BRACKET_RIGHT],[40,mP.PAREN_LEFT],[41,mP.PAREN_RIGHT],[44,mP.COMMA],[63,mP.QUESTION],[58,mP.COLON],[36,mP.DOLLAR]]),MP=new Map;for(const[t,e]of kP.entries())MP.set(t,{type:e,value:String.fromCharCode(t)});function OP(t){return t>=48&&t<=57}function EP(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function SP(t){return EP(t)||OP(t)}function AP(t){return bP.has(t)}var _P;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(_P||(_P={}));const TP=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),NP={type:_P.Literal,value:null},PP={type:_P.Literal,value:!0},CP={type:_P.Literal,value:!1},LP=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],a=t=>{const e=r();return null!==e&&e.type===t},o=t=>t.type===mP.OPERATOR?TP.get(t.value)||-1:t.type===mP.DOT||t.type===mP.BRACKET_LEFT?9:t.type===mP.QUESTION?1:-1,s=t=>{let n,o;if(i().type===mP.DOT){if(!a(mP.IDENTIFIER)){const t=r();throw new vP("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:_P.Identifier,name:t.value},o=!1}else{if(n=c(0),!a(mP.BRACKET_RIGHT)){const t=r();throw new vP("Expected closing bracket",e,t?t.value:"<end of input>")}i(),o=!0}return{type:_P.MemberExpression,object:t,property:n,computed:o}},l=()=>{const t=r();if(!t)throw new vP("Unexpected end of input",e,"<end of input>");if(t.type===mP.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=l();return{type:_P.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case mP.NUMBER:return i(),{type:_P.Literal,value:Number(t.value)};case mP.STRING:return i(),{type:_P.Literal,value:t.value};case mP.BOOLEAN:return i(),"true"===t.value?PP:CP;case mP.NULL:return i(),NP;case mP.IDENTIFIER:return i(),{type:_P.Identifier,name:t.value};case mP.FUNCTION:return(()=>{const t=i(),n=[];if(!a(mP.PAREN_LEFT)){const t=r();throw new vP("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(a(mP.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new vP("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!a(mP.COMMA)){const t=r();throw new vP("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=c(0);n.push(t)}return{type:_P.CallExpression,callee:{type:_P.Identifier,name:t.value},arguments:n}})();case mP.PAREN_LEFT:{i();const t=c(0);if(!a(mP.PAREN_RIGHT)){const t=r();throw new vP("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new vP(`Unexpected token: ${t.type}`,e,t.value)}},c=(u=0)=>{let f=l();for(;e<n;){const n=t[e],l=o(n);if(l<=u)break;if(n.type!==mP.QUESTION)if(n.type!==mP.OPERATOR){if(n.type!==mP.DOT&&n.type!==mP.BRACKET_LEFT)break;f=s(f)}else{i();const t=c(l);f={type:_P.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=c(0);if(!a(mP.COLON)){const t=r();throw new vP("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=c(0);f={type:_P.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=c();return{type:_P.Program,body:u}},jP=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case _P.Literal:return(t=>t.value)(t);case _P.Identifier:return(t=>{if(!(t.name in r.context))throw new vP(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case _P.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new vP("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case _P.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new vP(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map(t=>i(t)))})(t);case _P.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new vP(`Unknown operator: ${t.operator}`)}})(t);case _P.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new vP(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new vP(`Unknown operator: ${t.operator}`)}throw new vP(`Postfix operators are not supported: ${t.operator}`)})(t);case _P.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new vP(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const RP=["style","encode","labels","children"],IP=rE(t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,a=0;function o(t){const r=a+1;a++;let i="",o=!1;for(;a<n;){const n=e.charCodeAt(a);if(n===t)return o||(i=e.substring(r,a)),a++,{type:mP.STRING,value:i};92===n?(o||(i=e.substring(r,a),o=!0),a++,i+=e[a]):o&&(i+=e[a]),a++}throw new vP(`Unterminated string starting with ${String.fromCharCode(t)}`,a,e.substring(Math.max(0,a-10),a))}function s(){const t=a;for(45===e.charCodeAt(a)&&a++;a<n&&OP(e.charCodeAt(a));)a++;if(a<n&&46===e.charCodeAt(a))for(a++;a<n&&OP(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:mP.NUMBER,value:r}}function l(){a++;const t=a;if(a<n&&EP(e.charCodeAt(a)))for(a++;a<n&&SP(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:mP.FUNCTION,value:r}}function c(){const t=a++;for(;a<n&&SP(e.charCodeAt(a));)a++;const r=e.slice(t,a),i=xP.get(r);return i?{type:i,value:r}:{type:mP.IDENTIFIER,value:r}}function u(){if(a+2<n){const t=e.substring(a,a+3);if(wP.has(t))return a+=3,{type:mP.OPERATOR,value:t}}if(a+1<n){const t=e.substring(a,a+2);if(wP.has(t))return a+=2,{type:mP.OPERATOR,value:t}}const t=e[a];if(wP.has(t))return a++,{type:mP.OPERATOR,value:t};throw new vP(`Unknown operator at position ${a}: ${e.substring(a,a+1)}`,a,e.substring(Math.max(0,a-10),a))}for(;a<n;){const t=e.charCodeAt(a);if(f=t,yP.has(f)){a++;continue}const d=MP.get(t);if(d)r[i++]=d,a++;else if(34!==t&&39!==t)if(OP(t)||45===t&&a+1<n&&OP(e.charCodeAt(a+1)))r[i++]=s();else if(64!==t)if(EP(t))r[i++]=c();else{if(!AP(t))throw new vP(`Unexpected character: ${e[a]}`,a,e.substring(Math.max(0,a-10),a));r[i++]=u()}else r[i++]=l();else r[i++]=o(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=LP(e),r=((t={},e={})=>({context:t,functions:e}))({},gP);return(t={})=>jP(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},(t,e)=>String.fromCharCode(97+e)),r=Object.fromEntries(t.map((t,e)=>[n[e],t]));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}},t=>t,128);function DP(t,e=!0){if(Array.isArray(t))return t.map((n,r)=>DP(t[r],e));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=it);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach(function(r){n[r]=e(t[r],r)}),n}(t,(t,n)=>e&&RP.includes(n)?DP(t,"children"===n):e?t:DP(t,!1));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return IP(e.slice(1,-1))}return t}var BP={}.toString,FP=function(t,e){return BP.call(t)==="[object "+e+"]"},zP=function(t){return Array.isArray?Array.isArray(t):FP(t,"Array")},WP=function(t){return"object"==typeof t&&null!==t},$P=function(t){if(!WP(t)||!FP(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function GP(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&$P(a)?($P(t[i])||(t[i]={}),n<r?GP(t[i],a,n+1,r):t[i]=e[i]):zP(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var YP=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)GP(t,e[r]);return t},HP=function(t){return t};function VP(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(t,e){return function(n){return e(t(n))}},t):HP}function qP(t){return t instanceof Float32Array||t instanceof Array}var XP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},UP=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function KP(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var ZP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},QP=function(t,e,n,r,i){var a,o,s=ZP(t,2),l=s[0],c=s[1],u=vt();return o=[l,c],(a=u)[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=o[0],a[7]=o[1],a[8]=1,a};function JP(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function tC(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}const eC=Math.sqrt(50),nC=Math.sqrt(10),rC=Math.sqrt(2);function iC(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=eC?10:a>=nC?5:a>=rC?2:1)*10**i:-(10**-i)/(a>=eC?10:a>=nC?5:a>=rC?2:1)}const aC=(t,e,n=5)=>{const r=[t,e];let i,a=0,o=r.length-1,s=r[a],l=r[o];return l<s&&([s,l]=[l,s],[a,o]=[o,a]),i=iC(s,l,n),i>0?(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,i=iC(s,l,n)):i<0&&(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,i=iC(s,l,n)),i>0?(r[a]=Math.floor(s/i)*i,r[o]=Math.ceil(l/i)*i):i<0&&(r[a]=Math.ceil(s*i)/i,r[o]=Math.floor(l*i)/i),r};function oC(t){return Array.isArray(t)}var sC=function(t){return"object"==typeof t&&null!==t},lC={}.toString,cC=function(t,e){return lC.call(t)==="[object "+e+"]"},uC=function(t){if(!sC(t)||!cC(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var fC=function(t){return void 0===t};function dC(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function hC(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(dC(e,i)){var a=e[i];null!==a&&uC(a)?(uC(t[i])||(t[i]={}),n<r?hC(t[i],a,n+1,r):t[i]=e[i]):oC(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var pC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)hC(t,e[r]);return t},gC=function(t){return t};function vC(t){return!(fC(t)||(e=t,null===e)||Number.isNaN(t));var e}function mC(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function yC(t){const e=Ci.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a;return[255*mC(o,a,e+1/3),255*mC(o,a,e),255*mC(o,a,e-1/3),i]}(r):null}const bC=(t,e)=>n=>t*(1-n)+e*n,xC=(t,e)=>"number"==typeof t&&"number"==typeof e?bC(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=yC(t),r=yC(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const a=n[i],o=r[i];e[i]=a*(1-t)+o*t}const[i,a,o,s]=e;return`rgba(${Math.round(i)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,wC=(t,e)=>{const n=bC(t,e);return t=>Math.round(n(t))};function kC({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function MC(t){return"object"==typeof t?t.valueOf():t}class OC extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=MC,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(kC({map:this.map,initKey:this.initKey},t))}has(t){return super.has(kC({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class EC{constructor(t){this.options=pC({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=pC({},this.options,t),this.rescale(t)}rescale(t){}}const SC=Symbol("defaultUnknown");function AC(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function _C(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:a}=t;let o=i.get(e);if(void 0===o){if(a!==SC)return a;o=n.push(e)-1,i.set(e,o)}return r[o%r.length]}function TC(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class NC extends EC{getDefaultOptions(){return{domain:[],range:[],unknown:SC}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&AC(this.domainIndexMap,this.getDomain(),this.domainKey),_C({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&AC(this.rangeIndexMap,this.getRange(),this.rangeKey),_C({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=TC(e),this.rangeKey=TC(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new NC(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function PC(t){return Math.round(1e12*t)/1e12}function CC(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,l),[u,f]=n,d=f-u,h=d/(2/l*r+1-1/l*i),p=h*i/l,g=h-l*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),m=v.reduce((t,e)=>t+e),y=g/m,b=new OC(e.map((t,e)=>{const n=v[e]*y;return[t,o?Math.floor(n):n]})),x=new OC(e.map((t,e)=>{const n=v[e]*y+p;return[t,o?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(d-(w-w/l*i))*s;let M=o?Math.round(k):k;const O=new Array(l);for(let t=0;t<l;t+=1){O[t]=PC(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class LC extends NC{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:SC,flex:[]}}constructor(t){super(t)}clone(){return new LC(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return CC(t);const{range:i,paddingOuter:a,paddingInner:o,round:s,align:l}=t;let c,u,f=i[0];const d=i[1]-f,h=2*a,p=r-o;c=d/Math.max(1,h+p),s&&(c=Math.floor(c)),f+=(d-c*(r-o))*l,u=c*(1-o),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*c);return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}const jC=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=iC(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i},RC=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,l;return r<i?(s=tC(r,i),l=n(a,o)):(s=tC(i,r),l=n(o,a)),JP(l,s)},IC=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,l=o?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=tC(s[t],s[t+1]),a[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}(t,e,1,r)-1,o=i[n];return JP(a[n],o)(e)}},DC=(t,e,n,r)=>(Math.min(t.length,e.length)>2?IC:RC)(t,e,r?wC:n);class BC extends EC{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:bC,tickCount:5}}map(t){return vC(t)?this.output(t):this.options.unknown}invert(t){return vC(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return aC}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):gC}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:a}=this.options,o=DC(n.map(t),r,a,i);this.output=JP(o,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,a=DC(i,r.map(t),bC);this.input=JP(e,n,a)}}class FC extends BC{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:xC,tickMethod:jC,tickCount:5}}chooseTransforms(){return[gC,gC]}clone(){return new FC(this.options)}}class zC extends LC{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:SC,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new zC(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}var WC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$C=function(t,e,n,r,i){var a=new FC({range:[e,e+r]}),o=new FC({range:[n,n+i]});return{transform:function(t){var e=WC(t,2),n=e[0],r=e[1];return[a.map(n),o.map(r)]},untransform:function(t){var e=WC(t,2),n=e[0],r=e[1];return[a.invert(n),o.invert(r)]}}},GC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},YC=function(t,e,n,r,i){return(0,GC(t,1)[0])(e,n,r,i)},HC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},VC=function(t,e,n,r,i){return HC(t,1)[0]},qC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},XC=function(t,e,n,r,i){var a=qC(t,4),o=a[0],s=a[1],l=a[2],c=a[3],u=new FC({range:[l,c]}),f=new FC({range:[o,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(t){var e=qC(t,2),n=e[0],r=e[1],i=f.map(n),a=u.map(r);return[.5*(a*Math.cos(i)*h)+.5,.5*(a*Math.sin(i)*p)+.5]},untransform:function(t){var e=qC(t,2),n=e[0],r=e[1],i=2*(n-.5)/h,a=2*(r-.5)/p,l=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),c=KP(Math.atan2(a,i),o,s);return[f.invert(c),u.invert(l)]}}},UC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},KC=function(t,e,n,r,i){return{transform:function(t){var e=UC(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=UC(t,2),n=e[0];return[e[1],n]}}},ZC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},QC=function(t,e,n,r,i){var a,o,s=ZC(t,2),l=s[0],c=s[1],u=vt();return o=[l,c],(a=u)[0]=o[0],a[1]=0,a[2]=0,a[3]=0,a[4]=o[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},JC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},tL=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},eL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return QC.apply(void 0,tL([[-1,-1]],JC(e),!1))},nL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return QC.apply(void 0,tL([[-1,1]],JC(e),!1))},rL=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return QC.apply(void 0,tL([[1,-1]],JC(e),!1))},iL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},aL=function(t,e,n,r,i){var a=iL(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(vt(),a)},oL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},sL=function(t,e,n,r,i){var a=oL(t,4),o=a[0],s=a[1],l=a[2],c=(a[3]-l)/((s-0)/(2*Math.PI)+1),u=c/(2*Math.PI),f=new FC({range:[l,l+.99*c]}),d=new FC({range:[o,s]}),h=i/r,p=h>1?1:h,g=h>1?1/h:1;return{transform:function(t){var e=oL(t,2),n=e[0],r=e[1],i=d.map(n),a=f.map(r);return[.5*(Math.cos(i)*(u*i+a)*p)+.5,.5*(Math.sin(i)*(u*i+a)*g)+.5]},untransform:function(t){var e=oL(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,a=2*(r-.5)/g,l=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),h=KP(Math.atan2(a,i)+Math.floor(l/c)*Math.PI*2,o,s),v=l-u*h;return[d.invert(h),f.invert(v)]}}},lL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},cL=function(t,e,n,r,i){var a=lL(t,4),o=a[0],s=a[1],l=a[2],c=a[3],u=new FC({range:[l,c]});return{transform:function(t){for(var e=[],n=t.length,r=new zC({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[o,s]}),i=0;i<n;i++){var a=t[i],l=r.map(i),c=u.map(a);e.push(l,c)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},uL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function fL(t){return 1/Math.tan(t)}var dL=function(t,e,n,r,i){var a=fL(uL(t,1)[0]);return{transform:function(t){var e=uL(t,2),n=e[0],r=e[1];return[n+r*a,r]},untransform:function(t){var e=uL(t,2),n=e[0],r=e[1];return[n-r*a,r]}}},hL=function(t,e,n,r,i){var a=fL(uL(t,1)[0]);return{transform:function(t){var e=uL(t,2),n=e[0];return[n,e[1]+n*a]},untransform:function(t){var e=uL(t,2),n=e[0];return[n,e[1]-n*a]}}},pL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function gL(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r,s=a?-1:1;return s*o*(n+1)/(n+o/((t-e)*s))+e}function vL(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r;return o/(o*(n+1)/(t-e)-n*(a?-1:1))+e}function mL(t,e,n){return n?new FC({range:[0,1],domain:[0,e]}).map(t):t}var yL=function(t,e,n,r,i){var a=pL(t,3),o=a[0],s=a[1],l=a[2],c=mL(o,r,void 0!==l&&l);return{transform:function(t){var e=pL(t,2),n=e[0],r=e[1];return[gL(n,c,s,0,1),r]},untransform:function(t){var e=pL(t,2),n=e[0],r=e[1];return[vL(n,c,s,0,1),r]}}},bL=function(t,e,n,r,i){var a=pL(t,3),o=a[0],s=a[1],l=a[2],c=mL(o,i,void 0!==l&&l);return{transform:function(t){var e=pL(t,2);return[e[0],gL(e[1],c,s,0,1)]},untransform:function(t){var e=pL(t,2);return[e[0],vL(e[1],c,s,0,1)]}}},xL=function(t,e,n,r,i){var a=pL(t,5),o=a[0],s=a[1],l=a[2],c=a[3],u=a[4],f=void 0!==u&&u,d=mL(o,r,f),h=mL(s,i,f);return{transform:function(t){var e=pL(t,2),n=e[0],r=e[1];return[gL(n,d,l,0,1),gL(r,h,c,0,1)]},untransform:function(t){var e=pL(t,2),n=e[0],r=e[1];return[vL(n,d,l,0,1),vL(r,h,c,0,1)]}}},wL=function(t,e,n,r,i){var a=pL(t,5),o=a[0],s=a[1],l=a[2],c=a[3],u=a[4],f=void 0!==u&&u,d=new FC({range:[0,r]}),h=new FC({range:[0,i]}),p=f?o:d.map(o),g=f?s:h.map(s);return{transform:function(t){var e=pL(t,2),n=e[0],r=e[1],i=d.map(n)-p,a=h.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>l)return[n,r];var s=gL(o,0,c,0,l),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[d.invert(f),h.invert(v)]},untransform:function(t){var e=pL(t,2),n=e[0],r=e[1],i=d.map(n)-p,a=h.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>l)return[n,r];var s=vL(o,0,c,0,l),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[d.invert(f),h.invert(v)]}}},kL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ML=function(t,e,n,r,i,a,o){var s=new FC({range:[e,e+i]}),l=new FC({range:[n,n+a]}),c=new FC({range:[r,r+o]});return{transform:function(t){var e=kL(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),l.map(r),c.map(i)]},untransform:function(t){var e=kL(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),l.invert(r),c.invert(i)]}}},OL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},EL=function(t,e,n,r,i,a,o){var s=OL(t,3),l=s[0],c=s[1],u=s[2];return Ct(yt(),[l,c,u])},SL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},AL=function(t,e,n,r,i,a,o){return{transform:function(t){var e=SL(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=SL(t,3),n=e[0];return[e[1],n,e[2]]}}},_L=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},TL=function(t,e,n,r,i,a,o){var s=_L(t,3),l=s[0],c=s[1],u=s[2];return Lt(yt(),[l,c,u])},NL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},PL=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},CL=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},LL=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:$C,translate:QP,custom:YC,matrix:VC,polar:XC,transpose:KC,scale:QC,"shear.x":dL,"shear.y":hL,reflect:eL,"reflect.x":nL,"reflect.y":rL,rotate:aL,helix:sL,parallel:cL,fisheye:xL,"fisheye.x":yL,"fisheye.y":bL,"fisheye.circular":wL},this.update(t)}return t.prototype.update=function(t){this.options=YP({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:PL(PL([],NL(n),!1),[PL([],NL(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?PL([],NL(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],a=t(i);n.push.apply(n,UP([],XP(a),!1))}return n}}(t):t)};try{for(var l=CL(r),c=l.next();!c.done;c=l.next()){var u=NL(c.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=h(PL([],NL(d),!1),g,v,m,y);if(qP(b))a.push(b);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(b)||HP,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return VP.apply(void 0,PL([],NL(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=vt();return e&&t.reverse(),t.forEach(function(t){return mt(n,n,t)}),e&&function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*o-s*c,d=-u*a+s*l,h=c*a-o*l,p=n*f+r*d+i*h;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*c)*p,t[2]=(s*r-i*o)*p,t[3]=d*p,t[4]=(u*n-i*l)*p,t[5]=(-s*n+i*a)*p,t[6]=h*p,t[7]=(-c*n+r*l)*p,t[8]=(o*n-r*a)*p)}(n,function(t){var e=new gt(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return ge(e,e,n),[e[0],e[1]]}},t}(),jL=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},RL=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},IL=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},DL=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:ML,translate3D:EL,scale3D:TL,transpose3D:AL},this.update(t)}return t.prototype.update=function(t){this.options=YP({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:RL(RL([],jL(n),!1),[RL([],jL(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?RL([],jL(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],a=t(i);n.push.apply(n,UP([],XP(a),!1))}return n}}(t):t)};try{for(var l=IL(r),c=l.next();!c.done;c=l.next()){var u=jL(c.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,w=h(RL([],jL(d),!1),g,v,m,y,b,x);if(qP(w))a.push(w);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(w)||HP,!0)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return VP.apply(void 0,RL([],jL(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=yt();return e&&t.reverse(),t.forEach(function(t){return Qt(n,n,t)}),e&&Et(n,bt(n)),function(t){var e=[t[0],t[1],t[2],1];return ke(e,e,n),[e[0],e[1],e[2]]}},t}();function BL(t){return(e,...n)=>tt({},t(e,...n),e)}function FL(t){return(e,...n)=>tt({},e,t(e,...n))}function zL(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=De(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const WL=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map(t=>{var{data:e,x:s,y:l,width:c,height:u}=t,f=De(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:zL(e,o),x:null!=s?s:n,y:null!=l?l:r,width:null!=c?c:i,height:null!=u?u:a})})};WL.props={};const $L=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:a}=t,[o,s,l,c]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((t,e)=>t+e),f=t[s]-i*(e.length-1),d=r.map(t=>f*(t/u)),h=[];let p=t[o]||0;for(let n=0;n<d.length;n+=1){const r=e[n],{data:u}=r,f=De(r,["data"]),g=zL(u,a);h.push(Object.assign({[o]:p,[s]:d[n],[c]:t[c]||0,[l]:t[l],data:g},f)),p+=d[n]+i}return h};$L.props={};const GL=()=>t=>{const{children:e}=t,n=De(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:l=[],slider:c={}}=n,u=De(n,["data","scale","axis","legend","encode","transform","slider"]),f=e.map(t=>{var{data:e,scale:n={},axis:u={},legend:f={},encode:d={},transform:h=[],slider:p={}}=t,g=De(t,["data","scale","axis","legend","encode","transform","slider"]);return Object.assign({data:zL(e,r),scale:tt({},i,n),encode:tt({},s,d),transform:[...l,...h],axis:!(!u||!a)&&tt({},a,u),legend:!(!f||!o)&&tt({},o,f),slider:tt({},c,p)},g)});return[Object.assign(Object.assign({},u),{marks:f,type:"standardView",slider:c})]};GL.props={};const YL=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:l,padding:c,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:w,theme:k,component:M,interaction:O,x:E,y:S,z:A,key:_,frame:T,labelTransform:N,parentKey:P,clip:C,viewStyle:L,title:j}=e,R=De(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:S,z:A,key:_,width:n,height:r,depth:i,padding:c,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,paddingBottom:l,theme:k,coordinate:w,component:M,interaction:O,frame:T,labelTransform:N,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:P,clip:C,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};YL.props={};class HL{constructor(t){this.$value=t}static of(t){return new HL(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const VL=BL(t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(t,e)=>{var a;if(void 0===t||!i)return{};const o=rr(n,e=>e[t]),s=(null===(a=null==r?void 0:r[e])||void 0===a?void 0:a.domain)||Array.from(o.keys()),l=s.map(t=>o.has(t)?o.get(t).length:1);return{domain:s,flex:l}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"top"}},void 0===a&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"right"}},void 0===o&&{paddingInner:0}),s(o,"y"))}}}),qL=FL(t=>{const{data:e,scale:n,legend:r}=t,i=[t];let a,o,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:l={}}=t,{color:c}=n,{color:u}=r,{color:f}=l;void 0!==c&&(a=c),void 0!==u&&(o=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const l="string"==typeof a?a:"",[c,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===a)return[void 0];const i="function"==typeof a?a:t=>t[a],o=e.map(i);return o.some(t=>"number"==typeof t)?[Qn(o)]:[Array.from(new Set(o)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=c?c:[]}},scale:{color:tt({},o,{domain:c,type:u})}},void 0===r&&{legend:{color:tt({title:l},s)}})}),XL=BL(()=>({animate:{enterType:"fadeIn"}})),UL=FL(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),KL=FL(()=>({type:"cell"})),ZL=FL(t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,a=r?Array.from(new Set(e.map(t=>t[r]))):[],o=i?Array.from(new Set(e.map(t=>t[i]))):[];return(()=>{if(a.length&&o.length){const t=[];for(const e of a)for(const n of o)t.push({[r]:e,[i]:n});return t}return a.length?a.map(t=>({[r]:t})):o.length?o.map(t=>({[i]:t})):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}}),QL=FL((t,e=JL,n=ej,r=nj,i={})=>{const{data:a,encode:o,children:s,scale:l,x:c=0,y:u=0,shareData:f=!1,key:d}=t,{value:h}=a,{x:p,y:g}=o,{color:v}=l,{domain:m}=v;return{children:(t,a,o)=>{const{x:l,y:v}=a,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:w}=o,{domain:k}=l.getOptions(),{domain:M}=v.getOptions(),O=so(t),E=t.map(e),S=t.map(({x:t,y:e})=>[l.invert(t),v.invert(e)]),A=S.map(([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)}),_=A.map(t=>h.filter(t)),T=f?xr(_,t=>t.length):void 0,N=S.map(([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length})),P=N.map(t=>Array.isArray(s)?s:[s(t)].flat(1));return O.flatMap(t=>{const[e,a,o,s]=E[t],l=N[t],f=_[t];return P[t].map(v=>{var k,M,{scale:O,key:E,facet:S=!0,axis:A={},legend:_={}}=v,N=De(v,["scale","key","facet","axis","legend"]);const P=(null===(k=null==O?void 0:O.y)||void 0===k?void 0:k.guide)||A.y,C=(null===(M=null==O?void 0:O.x)||void 0===M?void 0:M.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:h,R={color:{domain:m}},I={x:rj(C,n)(l,j),y:rj(P,r)(l,j)};return Object.assign(Object.assign({key:`${E}-${t}`,data:j,margin:0,x:e+y+c+x,y:a+b+u+w,parentKey:d,width:o,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:tt(L,O,R),axis:tt({},A,I),legend:!1},N),i)})})}}});function JL(t){const{points:e}=t;return js(e)}function tj(t,e){return e.length?tt({title:!1,tick:null,label:null},t):tt({title:!1,tick:null,label:null,grid:null},t)}function ej(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return tj(t,n);const s=a===o-1&&void 0,l=n.length?void 0:null;return tt({title:s,grid:l},t)}}function nj(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return tj(t,n);const a=0===r&&void 0,o=n.length?void 0:null;return tt({title:a,grid:o},t)}}function rj(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const ij=()=>t=>[HL.of(t).call(KL).call(qL).call(XL).call(VL).call(UL).call(ZL).call(QL).value()];ij.props={};const aj=BL(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),oj=FL(t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,o,s)=>{const{x:l,y:c}=o,{paddingLeft:u,paddingTop:f,marginLeft:d,marginTop:h}=s,{domain:p}=l.getOptions(),{domain:g}=c.getOptions(),v=so(t),m=t.map(({points:t})=>js(t)),y=t.map(({x:t,y:e})=>[l.invert(t),c.invert(e)]),b=y.map(([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length})),x=b.map(t=>Array.isArray(n)?n:[n(t)].flat(1));return v.flatMap(t=>{const[n,o,s,l]=m[t],[c,p]=y[t],g=b[t];return x[t].map(v=>{var m,y;const{scale:b,key:x,encode:w,axis:k,interaction:M}=v,O=De(v,["scale","key","encode","axis","interaction"]),E=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:lj(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:cj(E)(g,e)};return Object.assign({data:e,parentKey:a,key:`${x}-${t}`,x:n+u+r+d,y:o+f+i+h,width:s,height:l,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:tt({x:{facet:!1},y:{facet:!1}},b),axis:tt({x:{tickCount:5},y:{tickCount:5}},k,S),legend:!1,encode:tt({},w,{x:c,y:p}),interaction:tt({},M,{legendFilter:!1})},O)})})}}}),sj=FL(t=>{const{encode:e}=t,n=De(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=De(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[a].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})});function lj(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return tj(t,n)}}function cj(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return tj(t,n)}}const uj=()=>t=>[HL.of(t).call(KL).call(qL).call(oj).call(sj).call(XL).call(UL).call(aj).value()],fj=BL(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),dj=BL(t=>({coordinate:{type:"polar"}})),hj=t=>{const{encode:e}=t,n=De(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function pj(t){return t=>null}function gj(t){const{points:e}=t,[n,r,i,a]=e,o=Ns(n,a),s=_s(n,a),l=Ls(s,_s(r,i)),c=1/Math.sin(l/2),u=o/(1+c),f=u*Math.sqrt(2),[d,h]=i,p=Cs(s)+l/2,g=u*c;return[d+g*Math.sin(p)-f/2,h-g*Math.cos(p)-f/2,f,f]}const vj=()=>t=>[HL.of(t).call(KL).call(hj).call(qL).call(dj).call(ZL).call(QL,gj,pj,pj,{frame:!1}).call(XL).call(UL).call(fj).value()];function mj(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const yj=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||0===o)return[];const{key:s}=e[0],l=e.map(t=>Object.assign(Object.assign({},t),{key:s})).map(t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=tt({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,a));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=mj(i,e,o);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield l[n]),t=n}e++}}};function bj(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if("plot"===o)return;const s=AF(a,t=>"element"===t.className);const l=function(t){return AF(t,t=>"component"===t.className)}(a),c=function(t){return AF(t,t=>"label"===t.className)}(a),u=s||l||c;if(!u)return;const{className:f,markType:d}=u,h=Object.assign(Object.assign({},i),{nativeEvent:!0});if("element"===f)h.data={data:Ya(u,e)},n.emit(`element:${t}`,h),n.emit(`${d}:${t}`,h);else if("label"===f){h.data={data:u.attributes.datum},n.emit(`label:${t}`,h);o.split(/\s+/).filter(Boolean).forEach(e=>{n.emit(`${e}:${t}`,h)})}else{n.emit(`component:${t}`,h);o.split(/\s+/).filter(Boolean).forEach(e=>{n.emit(`${e}:${t}`,h)})}}}function xj(){return(t,e,n)=>{const{container:r,view:i}=t,a=bj(pP.CLICK,i,n,t=>1===t.detail),o=bj(pP.DBLCLICK,i,n,t=>2===t.detail),s=bj(pP.POINTER_TAP,i,n),l=bj(pP.POINTER_DOWN,i,n),c=bj(pP.POINTER_UP,i,n),u=bj(pP.POINTER_OVER,i,n),f=bj(pP.POINTER_OUT,i,n),d=bj(pP.POINTER_MOVE,i,n),h=bj(pP.POINTER_ENTER,i,n),p=bj(pP.POINTER_LEAVE,i,n),g=bj(pP.POINTER_UPOUTSIDE,i,n),v=bj(pP.DRAG_START,i,n),m=bj(pP.DRAG,i,n),y=bj(pP.DRAG_END,i,n),b=bj(pP.DRAG_ENTER,i,n),x=bj(pP.DRAG_LEAVE,i,n),w=bj(pP.DRAG_OVER,i,n),k=bj(pP.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",d),r.addEventListener("pointerenter",h),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",d),r.removeEventListener("pointerenter",h),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function wj(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":V_,"component.axisLinear":W_,"component.axisArc":$_,"component.legendContinuousBlock":iT,"component.legendContinuousBlockSize":oT,"component.legendContinuousSize":aT,"interaction.event":xj,"composition.mark":YL,"composition.view":GL,"shape.label.label":ZO,"shape.break":kE}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Ua(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=De(t,["type"]);n||Ua("Plot type is required!");const a=r(n);return null==a?void 0:a(i,e)},r]}function kj(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Ua("Cannot find library document")}function Mj(t,e){const{coordinate:n={},coordinates:r}=t,i=De(t,["coordinate","coordinates"]);if(r)return t;const{type:a,transform:o=[]}=n,s=De(n,["type","transform"]);if(!a)return Object.assign(Object.assign({},i),{coordinates:o});const[,l]=wj("coordinate",e),{transform:c=!1}=l(a).props||{};if(c)throw new Error(`Unknown coordinate: ${a}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:a},s),...o]})}function Oj(t,e){return t.filter(t=>t.type===e)}function Ej(t){return Oj(t,"polar").length>0}function Sj(t){return Oj(t,"transpose").length%2==1}function Aj(t){return Oj(t,"theta").length>0}function _j(t){return Oj(t,"radial").length>0}function Tj(t){return Oj(t,"radar").length>0}function Nj(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}yj.props={},xj.props={reapplyWhenUpdate:!0};var Pj=Nj("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Cj=Nj("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Lj=Nj("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),jj=Nj("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),Rj=Nj("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Ij=Nj("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Dj=Nj("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Bj=Nj("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Fj=Nj("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),zj=Nj("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Wj=Nj("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function $j(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Gj(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Yj(){}var Hj=.7,Vj=1/Hj,qj="\\s*([+-]?\\d+)\\s*",Xj="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Uj="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kj=/^#([0-9a-f]{3,8})$/,Zj=new RegExp(`^rgb\\(${qj},${qj},${qj}\\)$`),Qj=new RegExp(`^rgb\\(${Uj},${Uj},${Uj}\\)$`),Jj=new RegExp(`^rgba\\(${qj},${qj},${qj},${Xj}\\)$`),tR=new RegExp(`^rgba\\(${Uj},${Uj},${Uj},${Xj}\\)$`),eR=new RegExp(`^hsl\\(${Xj},${Uj},${Uj}\\)$`),nR=new RegExp(`^hsla\\(${Xj},${Uj},${Uj},${Xj}\\)$`),rR={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 iR(){return this.rgb().formatHex()}function aR(){return this.rgb().formatRgb()}function oR(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Kj.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?sR(e):3===n?new fR(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?lR(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?lR(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Zj.exec(t))?new fR(e[1],e[2],e[3],1):(e=Qj.exec(t))?new fR(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Jj.exec(t))?lR(e[1],e[2],e[3],e[4]):(e=tR.exec(t))?lR(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=eR.exec(t))?mR(e[1],e[2]/100,e[3]/100,1):(e=nR.exec(t))?mR(e[1],e[2]/100,e[3]/100,e[4]):rR.hasOwnProperty(t)?sR(rR[t]):"transparent"===t?new fR(NaN,NaN,NaN,0):null}function sR(t){return new fR(t>>16&255,t>>8&255,255&t,1)}function lR(t,e,n,r){return r<=0&&(t=e=n=NaN),new fR(t,e,n,r)}function cR(t){return t instanceof Yj||(t=oR(t)),t?new fR((t=t.rgb()).r,t.g,t.b,t.opacity):new fR}function uR(t,e,n,r){return 1===arguments.length?cR(t):new fR(t,e,n,null==r?1:r)}function fR(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function dR(){return`#${vR(this.r)}${vR(this.g)}${vR(this.b)}`}function hR(){const t=pR(this.opacity);return`${1===t?"rgb(":"rgba("}${gR(this.r)}, ${gR(this.g)}, ${gR(this.b)}${1===t?")":`, ${t})`}`}function pR(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function gR(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vR(t){return((t=gR(t))<16?"0":"")+t.toString(16)}function mR(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bR(t,e,n,r)}function yR(t){if(t instanceof bR)return new bR(t.h,t.s,t.l,t.opacity);if(t instanceof Yj||(t=oR(t)),!t)return new bR;if(t instanceof bR)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new bR(o,s,l,t.opacity)}function bR(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function xR(t){return(t=(t||0)%360)<0?t+360:t}function wR(t){return Math.max(0,Math.min(1,t||0))}function kR(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}$j(Yj,oR,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:iR,formatHex:iR,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yR(this).formatHsl()},formatRgb:aR,toString:aR}),$j(fR,uR,Gj(Yj,{brighter(t){return t=null==t?Vj:Math.pow(Vj,t),new fR(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Hj:Math.pow(Hj,t),new fR(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new fR(gR(this.r),gR(this.g),gR(this.b),pR(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:dR,formatHex:dR,formatHex8:function(){return`#${vR(this.r)}${vR(this.g)}${vR(this.b)}${vR(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hR,toString:hR})),$j(bR,function(t,e,n,r){return 1===arguments.length?yR(t):new bR(t,e,n,null==r?1:r)},Gj(Yj,{brighter(t){return t=null==t?Vj:Math.pow(Vj,t),new bR(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Hj:Math.pow(Hj,t),new bR(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new fR(kR(t>=240?t-240:t+120,i,r),kR(t,i,r),kR(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bR(xR(this.h),wR(this.s),wR(this.l),pR(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=pR(this.opacity);return`${1===t?"hsl(":"hsla("}${xR(this.h)}, ${100*wR(this.s)}%, ${100*wR(this.l)}%${1===t?")":`, ${t})`}`}}));const MR=Math.PI/180,OR=180/Math.PI;var ER=-.14861,SR=1.78277,AR=-.29227,_R=-.90649,TR=1.97294,NR=TR*_R,PR=TR*SR,CR=SR*AR-_R*ER;function LR(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof jR)return new jR(t.h,t.s,t.l,t.opacity);t instanceof fR||(t=cR(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(CR*r+NR*e-PR*n)/(CR+NR-PR),a=r-i,o=(TR*(n-i)-AR*a)/_R,s=Math.sqrt(o*o+a*a)/(TR*i*(1-i)),l=s?Math.atan2(o,a)*OR-120:NaN;return new jR(l<0?l+360:l,s,i,t.opacity)}(t):new jR(t,e,n,null==r?1:r)}function jR(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}$j(jR,LR,Gj(Yj,{brighter(t){return t=null==t?Vj:Math.pow(Vj,t),new jR(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Hj:Math.pow(Hj,t),new jR(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*MR,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new fR(255*(e+n*(ER*r+SR*i)),255*(e+n*(AR*r+_R*i)),255*(e+n*(TR*r)),this.opacity)}}));var RR=t=>()=>t;function IR(t,e){return function(n){return t+n*e}}function DR(t){return 1===(t=+t)?BR:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):RR(isNaN(e)?n:e)}}function BR(t,e){var n=e-t;return n?IR(t,n):RR(isNaN(t)?e:t)}!function t(e){var n=DR(e);function r(t,e){var r=n((t=uR(t)).r,(e=uR(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=BR(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);var FR,zR=(FR=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}((n-r/e)*e,o,i,a,s)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),o=new Array(r);for(e=0;e<r;++e)n=uR(t[e]),i[e]=n.r||0,a[e]=n.g||0,o[e]=n.b||0;return i=FR(i),a=FR(a),o=FR(o),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=o(t),n+""}});function WR(t){return function e(n){function r(e,r){var i=t((e=LR(e)).h,(r=LR(r)).h),a=BR(e.s,r.s),o=BR(e.l,r.l),s=BR(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}WR(function(t,e){var n=e-t;return n?IR(t,n>180||n<-180?n-360*Math.round(n/360):n):RR(isNaN(t)?e:t)});var $R=WR(BR),GR=t=>zR(t[t.length-1]),YR=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Nj),HR=GR(YR),VR=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Nj),qR=GR(VR),XR=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Nj),UR=GR(XR),KR=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Nj),ZR=GR(KR),QR=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Nj),JR=GR(QR),tI=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Nj),eI=GR(tI),nI=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Nj),rI=GR(nI),iI=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Nj),aI=GR(iI),oI=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Nj),sI=GR(oI),lI=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Nj),cI=GR(lI),uI=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Nj),fI=GR(uI),dI=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Nj),hI=GR(dI),pI=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Nj),gI=GR(pI),vI=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Nj),mI=GR(vI),yI=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Nj),bI=GR(yI),xI=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Nj),wI=GR(xI),kI=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Nj),MI=GR(kI),OI=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Nj),EI=GR(OI),SI=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Nj),AI=GR(SI),_I=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Nj),TI=GR(_I),NI=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Nj),PI=GR(NI),CI=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Nj),LI=GR(CI),jI=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Nj),RI=GR(jI),II=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Nj),DI=GR(II),BI=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Nj),FI=GR(BI),zI=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Nj),WI=GR(zI),$I=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Nj),GI=GR($I);var YI=$R(LR(300,.5,0),LR(-240,.5,1)),HI=$R(LR(-100,.75,.35),LR(80,1.5,.8)),VI=$R(LR(260,.75,.35),LR(80,1.5,.8)),qI=LR();var XI=uR(),UI=Math.PI/3,KI=2*Math.PI/3;function ZI(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var QI=ZI(Nj("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),JI=ZI(Nj("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),tD=ZI(Nj("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eD=ZI(Nj("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),nD=Object.freeze({__proto__:null,schemeCategory10:Pj,schemeAccent:Cj,schemeDark2:Lj,schemeObservable10:jj,schemePaired:Rj,schemePastel1:Ij,schemePastel2:Dj,schemeSet1:Bj,schemeSet2:Fj,schemeSet3:zj,schemeTableau10:Wj,interpolateBrBG:HR,schemeBrBG:YR,interpolatePRGn:qR,schemePRGn:VR,interpolatePiYG:UR,schemePiYG:XR,interpolatePuOr:ZR,schemePuOr:KR,interpolateRdBu:JR,schemeRdBu:QR,interpolateRdGy:eI,schemeRdGy:tI,interpolateRdYlBu:rI,schemeRdYlBu:nI,interpolateRdYlGn:aI,schemeRdYlGn:iI,interpolateSpectral:sI,schemeSpectral:oI,interpolateBuGn:cI,schemeBuGn:lI,interpolateBuPu:fI,schemeBuPu:uI,interpolateGnBu:hI,schemeGnBu:dI,interpolateOrRd:gI,schemeOrRd:pI,interpolatePuBuGn:mI,schemePuBuGn:vI,interpolatePuBu:bI,schemePuBu:yI,interpolatePuRd:wI,schemePuRd:xI,interpolateRdPu:MI,schemeRdPu:kI,interpolateYlGnBu:EI,schemeYlGnBu:OI,interpolateYlGn:AI,schemeYlGn:SI,interpolateYlOrBr:TI,schemeYlOrBr:_I,interpolateYlOrRd:PI,schemeYlOrRd:NI,interpolateBlues:LI,schemeBlues:CI,interpolateGreens:RI,schemeGreens:jI,interpolateGreys:DI,schemeGreys:II,interpolatePurples:FI,schemePurples:BI,interpolateReds:WI,schemeReds:zI,interpolateOranges:GI,schemeOranges:$I,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:YI,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return qI.h=360*t-100,qI.s=1.5-1.5*e,qI.l=.8-.9*e,qI+""},interpolateWarm:HI,interpolateCool:VI,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,XI.r=255*(e=Math.sin(t))*e,XI.g=255*(e=Math.sin(t+UI))*e,XI.b=255*(e=Math.sin(t+KI))*e,XI+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:QI,interpolateMagma:JI,interpolateInferno:tD,interpolatePlasma:eD});function rD(t,e,n,r,i,a){const{guide:o={}}=n,s=function(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return bD(t,ro)}(e))return"identity";if("string"==typeof a)return"linear";if((i||a||[]).length>2)return pD(t,s);if(void 0!==i)return mD([i])?pD(t,s):yD(e)?"time":gD(t,a,o);return mD(e)?pD(t,s):yD(e)?"time":gD(t,a,o)}(t,e,n);if("string"!=typeof s)return n;const l=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return vD(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Za(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return vD(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Za(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),c=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(uD({type:t}))return function(t,e,n){const r=t.map(Number),i=new pa({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map(t=>new Date(i.map(t))):t.map(t=>i.map(t))}(e,r,t);return fD({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,l,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ii,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?Aj(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=G(e),i=nD[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:c,range:dD(s,t,e,n,c,i,a),expectedDomain:l,guide:o,name:t,type:s})}function iD(t,e){const n={};for(const r of t){const{values:t,name:i}=r,a=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map(t=>a.map(t))}}return n}function aD(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter(t=>t.startsWith(e)).map(t=>+(t.replace(e,"")||0)),a=xr(i)+1,o=`${e}${a}`;t[o]=r,r.getOptions().key=o}else t[e]=r}return t}function oD(t,e){const[n]=wj("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Va,Va];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const a=t.filter(([t])=>"function"==typeof t),o=t.filter(([t])=>"function"!=typeof t),s=new Map(o);if(r.map=t=>{for(const[e,n]of a)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const l=new Map(o.map(([t,e])=>[e,t])),c=new Map(a.map(([t,e])=>[e,t]));return r.invert=t=>c.has(t)?t:l.has(t)?l.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function sD(t){const e=t.flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale));cD(e,"x"),cD(e,"y")}function lD(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter(t=>i.includes(t)):[]}function cD(t,e){const n=t.filter(({name:t,facet:n=!0})=>n&&t===e),r=n.flatMap(t=>t.domain),i=n.every(uD)?Qn(r):n.every(fD)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function uD(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function fD(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function dD(t,e,n,r,i,a,o){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=hD(n,r,i,a,o),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[lo(e),co(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=l?l:s,null!=c?c:u]}case"band":case"point":return[null!=l?l:"size"===e?5:0,null!=c?c:"size"===e?10:1];case"ordinal":return hD(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function hD(t,e,n,r,i){const[a]=wj("palette",i),{category10:o,category20:s}=r,l=function(t){return Array.from(new Set(t))}(n).length<=o.length?o:s,{palette:c=l,offset:u}=e;if(Array.isArray(c))return c;try{return a({type:c})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=nD[`scheme${r}`],a=nD[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map((t,r)=>a(n(r/e.length)))}(c,n,u);if(e)return e;throw new Error(`Unknown Component: ${c} `)}}function pD(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function gD(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function vD(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[null!=n?n:i,null!=r?r:a]}function mD(t){return bD(t,t=>{const e=typeof t;return"string"===e||"boolean"===e})}function yD(t){return bD(t,t=>t instanceof Date)}function bD(t,e){for(const n of t)if(n.some(e))return!0;return!1}const xD={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},wD={threshold:"threshold",quantize:"quantize",quantile:"quantile"},kD={ordinal:"ordinal",band:"band",point:"point"},MD={constant:"constant"};function OD(t,e,n){const{coordinates:r=[],title:i}=e,[,a]=wj("component",n),o=t.filter(({guide:t})=>null!==t),s=[],l=function(t,e,n){const[,r]=wj("component",n),{coordinates:i}=t;function a(t,e,n,a){const o=function(t,e,n=[]){return"x"===t?Sj(n)?`${e}Y`:`${e}X`:"y"===t?Sj(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!a||!o)return;const{props:s}=r(o),{defaultPosition:l,defaultSize:c,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:l,defaultSize:c,order:u,type:o,crossPadding:f},a),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{const{slider:e,scrollbar:n,name:r}=t;return[a("slider",r,t,e),a("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);if(s.push(...l),i){const{props:t}=a("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:o,defaultCrossPadding:l}=t,c="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:l[0],defaultSize:o},c))}const c=function(t,e){const n=t.filter(t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o)||!(!["sequential"].includes(e)||!a||!o&&!i)||!(!["constant","identity"].includes(e)||!o)}(t));return[...AD(n),...TD(n,e)]}(o,r);return c.forEach(([t,e])=>{const{props:n}=a(t),{defaultPosition:i,defaultPlane:l="xy",defaultOrientation:c,defaultSize:u,defaultOrder:f,defaultLength:d,defaultPadding:h=[0,0],defaultCrossPadding:p=[0,0]}=n,g=tt({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[a,g]=CD(t,i,c,n,e,o,r);if(!a&&!g)continue;const v="left"===a||"right"===a,y=v?h[1]:h[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=d,padding:M=y,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:k,position:a,plane:l,orientation:g,padding:M,order:w,crossPadding:O,size:x,type:t,scales:e}))}}),s}function ED(t,e,n,r,i){const[a]=wj("component",r),{scaleInstances:o,scale:s,bbox:l}=t,c={bbox:l,library:r};return a(De(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:c,scale:s})}function SD(t,e){const n=["left","right","bottom","top"],r=ir(t,({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent"));return r.flatMap(([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=Tr(n);if(r>e)return t.forEach(t=>t.group=Symbol("independent")),t;const i=(e-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=i)})}const n=xr(t,t=>t.size),r=xr(t,t=>t.order),i=xr(t,t=>t.crossPadding);return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}})}function AD(t,e){const n=["shape","size","color","opacity"],r=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e)),i=r.filter(({type:t})=>"constant"===t),a=ir(r.filter(({type:t})=>"constant"!==t),t=>t.field?t.field:Symbol("independent")).map(([t,e])=>[t,[...e,...i]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort(([t],[e])=>t.localeCompare(e)),l=Array.from(o).map(([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...fo(t,n));return e}(t).sort((t,e)=>e.length-t.length),n=e.map(t=>({combination:t,option:t.map(t=>[t.name,_D(t)])}));for(const{option:t,combination:e}of n)if(!t.every(t=>"constant"===t[1])&&t.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",e];for(const[t,e]of e_)for(const{option:r,combination:i}of n)if(e.some(t=>rt(s(t),s(r))))return[t,i];return null}).filter(Za);return l}function _D(t){const{type:e}=t;return"string"!=typeof e?null:e in xD?"continuous":e in kD?"discrete":e in wD?"distribution":e in MD?"constant":null}function TD(t,e){return t.map(t=>{const{name:n}=t;if(function(t){return Oj(t,"helix").length>0}(e)||Aj(e))return null;if(Sj(e)&&(Ej(e)||_j(e)))return null;if(n.startsWith("x"))return Ej(e)?["axisArc",[t]]:_j(e)?["axisLinear",[t]]:[Sj(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return Ej(e)?["axisLinear",[t]]:_j(e)?["axisArc",[t]]:[Sj(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(Tj(e))return["axisRadar",[t]];if(!Ej(e))return["axisY",[t]]}return null}).filter(Za)}function ND(t){const e=Oj(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=Oj(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function PD(t,e,n,r,i){const{name:a}=n[0];if("axisRadar"===t){const t=r.filter(t=>t.name.startsWith("position")),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(a);if(null===e)return[null,null];const[n,o]=ND(i);return["center",(o-n)/(Tj(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return Oj(t,"parallel").length>0}(i))return Sj(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=ND(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:Ej(i)||_j(i)?["center",null]:"axisX"===t&&function(t){return Oj(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return Oj(t,"reflectY").length>0}(i)?["top",null]:e}function CD(t,e,n,r,i,a,o){const[s]=ND(o),l=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?PD(t,l,i,a,o):"string"==typeof t&&t.startsWith("legend")&&Ej(o)&&"center"===r.position?["center","vertical"]:l}function LD(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof o)return;const s=o;return(s.startsWith("axis")?BD:s.startsWith("group")?jD:s.startsWith("legendContinuous")?FD:"legendCategory"===s?zD:s.startsWith("slider")?DD:"title"===s?ID:s.startsWith("scrollbar")?RD:()=>{})(t,e,n,r,i,a)}function jD(t,e,n,r,i,a){const{children:o}=t,s=xr(o,t=>t.crossPadding);o.forEach(t=>t.crossPadding=s),o.forEach(t=>LD(t,e,n,r,i,a));const l=xr(o,t=>t.size);t.size=l,o.forEach(t=>t.size=l)}function RD(t,e,n,r,i,a){const{trackSize:o=6}=tt({},i.scrollbar,t);t.size=o}function ID(t,e,n,r,i,a){const o=tt({},i.title,t),{title:s,subtitle:l,spacing:c=0}=o,u=De(o,["title","subtitle","spacing"]);if(s){const e=VD(s,Ja(u,"title"));t.size=e.height}if(l){const e=VD(l,Ja(u,"subtitle"));t.size+=c+e.height}}function DD(t,e,n,r,i,a){const{trackSize:o,handleIconSize:s}=(()=>{const{slider:e}=i;return tt({},e,t)})(),l=Math.max(o,2.4*s);t.size=l}function BD(t,e,n,r,i,a){var o,s;t.transform=t.transform||[{type:"hide"}];const l="left"===r||"right"===r,c=YD(t,r,i),{tickLength:u=0,labelSpacing:f=0,titleSpacing:d=0,labelAutoRotate:h}=c,p=De(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),g=WD(t,a),v=$D(p,g);let m=u;if("function"==typeof t.tickLength){const e=((null===(o=g.getTicks)||void 0===o?void 0:o.call(g))||g.getOptions().domain).map((e,n,r)=>t.tickLength(e,n,r));m=Math.max(...e,0)}const y=m+f;if(v&&v.length){const r=xr(v,t=>t.width),i=xr(v,t=>t.height);if(l)t.size=r+y;else{const{tickFilter:a,labelTransform:o}=t;!function(t,e,n,r,i){const a=Tr(e,t=>t.width);if(a>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=HD(t,i),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(o,t)),c=s.map((t,e)=>e),u=-r[0],f=n+r[1],d=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<c.length;t++){const n=l[t],[r,i]=d(n,e[t]);if(r<u||i>f)return!0;const a=l[t+1];if(a){const[n]=d(a,e[t+1]);if(i>n)return!0}}return!1}(g,v,e,n,a)||o||!1===h||null===h?(t.labelTransform=null!==(s=t.labelTransform)&&void 0!==s?s:"rotate(0)",t.size=i+y):(t.labelTransform="rotate(90)",t.size=r+y)}}else t.size=m;const b=GD(p);b&&(t.size+=l?d+b.width:d+b.height)}function FD(t,e,n,r,i,a){const o=(()=>{const{legendContinuous:e}=i;return tt({},e,t)})(),{labelSpacing:s=0,titleSpacing:l=0}=o,c=De(o,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Ja(c,"ribbon"),{size:d}=f,h=Ja(c,"handleIcon"),{size:p}=h,g=Math.max(d,2.4*p);t.size=g;const v=$D(c,WD(t,a));if(v){const e=u?"width":"height",n=xr(v,t=>t[e]);t.size+=n+s}const m=GD(c);m&&(u?t.size=Math.max(t.size,m.width):t.size+=l+m.height)}function zD(t,e,n,r,i,a){const o=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,a]=Array.isArray(n)?[n,void 0]:[void 0,n];return tt({title:r},e,Object.assign(Object.assign({},t),{title:a}))})(),{focus:s,itemSpacing:l,focusMarkerSize:c,itemMarkerSize:u,titleSpacing:f,rowPadding:d,colPadding:h,maxCols:p=1/0,maxRows:g=1/0}=o,v=De(o,["focus","itemSpacing","focusMarkerSize","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:m,length:y}=t,b=t=>Math.min(t,g),x=t=>Math.min(t,p),w="left"===r||"right"===r,k=void 0===y?e+(w?0:n[0]+n[1]):y,M=GD(v),O=$D(v,WD(t,a),"itemLabel"),E=Math.max(O[0].height,u)+d,S=(t,e=0)=>u+t+l[0]+e+(s?c+l[2]:0);w?(()=>{let e=-1/0,n=0,r=1,i=0,a=-1/0,o=-1/0;const s=M?M.height:0,l=k-s;for(const{width:t}of O){const s=S(t,h);e=Math.max(e,s),n+E>l?(r++,a=Math.max(a,i),o=Math.max(o,n),i=1,n=E):(n+=E,i++)}r<=1&&(a=i,o=n),t.size=e*x(r),t.length=o+s,tt(t,{cols:x(r),gridRow:a})})():"number"==typeof m?(()=>{const e=Math.ceil(O.length/m),n=xr(O,t=>S(t.width))*m;t.size=E*b(e)-d,t.length=Math.min(n,k)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of O){const i=S(t,h);n+i>k?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*b(e)-d,t.length=r})(),M&&(w?t.size=Math.max(t.size,M.width):t.size+=f+M.height)}function WD(t,e){const[n]=wj("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==i&&(o.tickCount=i),void 0!==a&&(o.tickMethod=a),n(o)}function $D(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=De(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){const r=HD(t,n),i=r.map(t=>"number"==typeof t?Nm(t):t),a=e?"string"==typeof e?w_(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(a)}(e,r,i),l=Ja(o,n),c=s.map((t,e)=>Object.fromEntries(Object.entries(l).map(([n,r])=>[n,"function"==typeof r?r(t,e):r]))),u=s.map((t,e)=>VD(t,c[e])),f=c.some(t=>t.transform);if(!f){const e=s.map((t,e)=>e);t.indexBBox=new Map(e.map(t=>[t,[s[t],u[t]]]))}return u}function GD(t){const{title:e}=t,n=De(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Ja(n,"title"),{direction:i,transform:a}=r,o=Array.isArray(e)?e.join(","):e;if("string"!=typeof o)return null;return VD(o,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function YD(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${Xa(e)}`]:s}=n;return tt({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function HD(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function VD(t,e){const n=function(t){return t instanceof Xg?t:new hv({style:{text:`${t}`}})}(t),r=De(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function qD(t,e,n,r){var i,a,o,s;const{width:l,height:c,depth:u,x:f=0,y:d=0,z:h=0,inset:p=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:g=p,insetTop:m=p,insetBottom:y=p,insetRight:b=p,margin:x=(null!==(a=n.margin)&&void 0!==a?a:0),marginLeft:w=x,marginBottom:k=x,marginTop:M=x,marginRight:O=x,padding:E=n.padding,paddingBottom:S=E,paddingLeft:A=E,paddingRight:_=E,paddingTop:T=E}=function(t,e,n,r){const{coordinates:i}=e;if(!Ej(i)&&!_j(i))return e;const a=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===a.length)return e;const o=a.map(t=>YD(t,"axisArc"===t.type?"arc":"linear",n)),s=xr(o,t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0}),l=a.flatMap((t,e)=>$D(o[e],WD(t,r))).filter(Za),c=xr(l,t=>t.height)+s,u=a.flatMap((t,e)=>GD(o[e])).filter(t=>null!==t),f=0===u.length?0:xr(u,t=>t.height),{inset:d=c,insetLeft:h=d,insetBottom:p=d,insetTop:g=d+f,insetRight:v=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),N=16===w&&"auto"===A,P=16===O&&"auto"===_,C=at(e,"coordinates",[]).some(t=>"transpose"===t.type),L=t.find(({type:t})=>"axisX"===t),{size:R,labelTransform:I}=L||{},D=(t,n,r,i,a)=>{const{marks:o}=e;if(0===o.length)return[i,a];if(t-i-a-.25*t>0)return[i,a];const s=.75*t;return["auto"===n?s*i/(i+a):i,"auto"===r?s*a/(i+a):a]},B=t=>"auto"===t?20:null!=t?t:20,F=B(T),z=B(S),W=XD(t,c-F-z,[F+M,z+k],["left","right"],e,n,r),{paddingLeft:$,paddingRight:G}=W,Y=l-w-O;let[H,V]=D(Y,A,_,$,G),q=Y-H-V;const X=XD(t,q,[H+w,V+O],["bottom","top"],e,n,r),{paddingTop:U,paddingBottom:K}=X,Z=c-k-M,[Q,J]=D(Z,S,T,K,U),tt=Z-Q-J;if(R&&!C&&!I){const{fontSize:t=12,fontFamily:e="sans-serif",scales:n=[]}=L,r=null!==(s=null===(o=null==n?void 0:n[0])||void 0===o?void 0:o.domain)&&void 0!==s?s:[];if(!r.length)return;const i=(n,r,i,a)=>{const o=kb(r,{fontSize:t,fontFamily:e}),s=o/2-i-a;s>0&&(q-=s,"left"===n?H+=o/2-i:V+=o/2-i)};N&&i("left",function(t){if(v(t))return t[0]}(r),w,H),P&&i("right",j(r),O,V)}return{width:l,height:c,depth:u,insetLeft:g,insetTop:m,insetBottom:y,insetRight:b,innerWidth:q,innerHeight:tt,paddingLeft:H,paddingRight:V,paddingTop:J,paddingBottom:Q,marginLeft:w,marginBottom:k,marginTop:M,marginRight:O,x:f,y:d,z:h}}function XD(t,e,n,r,i,a,o){const s=rr(t,t=>t.position),{padding:l=a.padding,paddingLeft:c=l,paddingRight:u=l,paddingBottom:f=l,paddingTop:d=l}=i,h={paddingBottom:f,paddingLeft:c,paddingTop:d,paddingRight:u};for(const t of r){const r=`padding${Xa(Py(t))}`,i=s.get(t)||[],l=h[r],c=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(c),t.size=xr(t.children,t=>t.size)):t.size=t.defaultSize},f=r=>{r.size||("auto"!==l?u(r):(LD(r,e,n,t,a,o),c(r)))},d=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=kr(i,t=>t.order),v=i.filter(t=>t.type.startsWith("axis")&&t.order==g);if(v.length&&(v[0].crossPadding=0),"number"==typeof l)i.forEach(c),i.forEach(d);else if(0===i.length)h[r]=0;else{const t=SD(i,p?e+n[0]+n[1]:e);t.forEach(f);const a=t.reduce((t,{size:e,crossPadding:n=12})=>t+e+n,0);h[r]=a}}return h}function UD({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:l,marginRight:c,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:g}){const v=n+o,m=i+s,y=r+c,b=a+l,x=t-o-c,w=[v+h,m+g,f-h-p,u-g-d,"center",null,null];return{top:[v,0,f,m,"vertical",!0,zn,o,x],right:[t-y,m,y,u,"horizontal",!1,zn],bottom:[v,e-b,f,b,"vertical",!1,zn,o,x],left:[0,m,v,u,"horizontal",!0,zn],"top-left":[v,0,f,m,"vertical",!0,zn],"top-right":[v,0,f,m,"vertical",!0,zn],"bottom-left":[v,e-b,f,b,"vertical",!1,zn],"bottom-right":[v,e-b,f,b,"vertical",!1,zn],center:w,inner:w,outer:w}}function KD(t,e,n,r){const[i,a]=uo(t,t=>!("string"!=typeof t.type||!t.type.startsWith("axis")));!function(t,e,n,r){"center"===r?function(t){return rc(t)&&tc(t)}(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):tc(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n):rc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,a]=n,o=new Array(t.length).fill(0),s=e.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let e=0;e<t.length;e++){const n=t[e],i=l[e],o=l[e+1]-i;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,a]=n,o=new Array(t.length).fill(0),s=e.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let e=0;e<t.length;e++){const n=t[e],r=l[e],o=l[e+1]-r;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[l]=oc(e),c=a/2,u=l*c,f=o-u,d=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+d,width:2*u,height:2*u}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,a,o]=n,[s]=oc(e),l=o/2*s/Math.sqrt(2),c=r+a/2,u=i+o/2;for(let e=0;e<t.length;e++){t[e].bbox={x:c-l,y:u-l,width:2*l,height:2*l}}}(a,e,n)}function ZD(t,e,n){const[r,i,a,o,s,l,c,u,f]=n,[d,h,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",o,"width",a]:["x",r,"y",i,"width",a,"height",o];t.sort((t,e)=>null==c?void 0:c(t.order,e.order));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=l?h+m:h;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:a}=r,{size:o}=r;r.bbox={[d]:l?n-o-i:n+i,[p]:k(a,g,u),[v]:o,[y]:w(a,b,f)},n+=(o+i)*(l?-1:1)}const M=t.filter(t=>"group"===t.type);for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,a=n.reduce((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t},"flex-start"),o=n.map((t,e)=>{const{length:r=i,padding:a=0}=t;return r+(e===n.length-1?0:a)}),s=r-Tr(o),l="flex-start"===a?0:"center"===a?s/2:s;for(let t=0,r=e[p]+l;t<n.length;t++){const i=n[t],{padding:s=0}=i,l=t===n.length-1?0:s;i.bbox={[v]:e[v],[d]:e[d],[p]:r,[y]:o[t]-l},tt(i,{layout:{justifyContent:a}}),r+=o[t]}}}const QD=Symbol("CALLBACK_ITEM");function JD(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,o=De(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},o),{encode:r,scale:i,transform:a})]}function tB(t,e,n){return Fe(this,void 0,void 0,function*(){const{library:t}=n,{data:r}=e,[i]=wj("data",t),a=function(t){if(I(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=De(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:o=[]}=a,s=[De(a,["transform"]),...o].map(t=>i(t,n)),l=yield function(t){return t.reduce((t,e)=>n=>Fe(this,void 0,void 0,function*(){const r=yield t(n);return e(r)}),Va)}(s)(r),c=!r||Array.isArray(r)||Array.isArray(l)?l:{value:l};return[Array.isArray(l)?so(l):[],Object.assign(Object.assign({},e),{data:c})]})}function eB(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function nB(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const a=oo(r,t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Za(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some(t=>void 0!==t[e])}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}});return[t,Object.assign(Object.assign({},e),{encode:a})]}function rB(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=oo(r,(t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function iB(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=function(t){const[e]=wj("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:dB(n)})}(a),s=oo(r,t=>o(i,t));return[t,Object.assign(Object.assign({},e),{encode:s})]}function aB(t,e,n){const{tooltip:r={}}=e;return io(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:ro(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function oB(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(io(a))return[t,e];const o=e=>{if(!e)return e;if("string"==typeof e)return t.map(t=>({name:e,value:r[t][e]}));if(ro(e)){const{field:n,channel:a,color:o,name:s=n,valueFormatter:l=t=>t}=e,c="string"==typeof l?w_(l):l,u=a&&i[a],f=u&&i[a].field,d=s||f||a,h=[];for(const e of t){const t=n?r[e][n]:u?i[a].value[e]:null;h[e]={name:d,color:o,value:c(t)}}return h}if("function"==typeof e){const n=[];for(const a of t){const t=e(r[a],a,r,i);ro(t)?n[a]=Object.assign(Object.assign({},t),{[QD]:!0}):n[a]={value:t}}return n}return e},{title:s,items:l=[]}=a,c=De(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(l)?l.map(o):[]},c);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function sB(t,e,n){const{encode:r}=e,i=De(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter(([,t])=>{const{value:e}=t;return Array.isArray(e[0])}).flatMap(([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=De(n,["value"]);for(let n=0;n<i.length;n++){const a=i[n];if(Array.isArray(a))for(let i=0;i<a.length;i++){const o=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];o[1][n]=a[i],r[i]=o}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function lB(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},l="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return tt(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{const e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function cB(t,e,n){const{animate:r}=e;return r||void 0===r||tt(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function uB(t,e,n){var r,i;return tt(e,{scale:{series:Object.assign({key:`DEFAULT_${e.type}_SERIES_KEY`},null!==(i=null===(r=null==e?void 0:e.scale)||void 0===r?void 0:r.series)&&void 0!==i?i:{})}}),[t,e]}function fB(t,e,n){return Fe(this,void 0,void 0,function*(){const[r,i]=yield function(t,e,n){return Fe(this,void 0,void 0,function*(){const{library:r}=n,[i]=wj("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,l=[JD,tB,eB,nB,rB,iB,sB,cB,lB,aB,uB,...a.map(i),...s.map(i),...o.map(i),oB];let c=[],u=t;for(const t of l)[c,u]=yield t(c,u,n);return[c,u]})}(t,e,n),{encode:a,scale:o,data:s,tooltip:l,key:c}=i;if(!1===Array.isArray(s))return null;const{channels:u}=e,f=or(Object.entries(a).filter(([,t])=>Za(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find(t=>t.name===n);return(null==r?void 0:r.independent)?t:n}),d=u.filter(t=>{const{name:e,required:n}=t;if(f.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return f.filter(([t])=>t.startsWith(e)).map(([t,e],l)=>{const u=e.some(t=>t.visual),f=e.some(t=>t.constant),d=o[t]||{},{independent:h=!1,key:p=r||t,type:g=(f?"constant":u?"identity":n)}=d,v=De(d,["independent","key","type"]),m="constant"===g,y=m?void 0:i;return{name:t,values:e,scaleKey:h||m?Symbol("independent"):p,scale:Object.assign(Object.assign({type:g,markKey:c,range:y},v),{quantitative:a,ordinal:s})}})});return[i,Object.assign(Object.assign({},e),{index:r,channels:d,tooltip:l})]})}function dB(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function hB(t,e,n){return Fe(this,void 0,void 0,function*(){var r;const{library:i}=n,[a]=wj("composition",i),[o]=wj("interaction",i),s=new Set(Object.keys(i).map(t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(Za)),l=new Set(Object.keys(i).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(Za)),c=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||l.has(e)?"mark":e},u=t=>"mark"===c(t),f=t=>"standardView"===c(t),d=t=>{const{type:e}=t;return"string"==typeof e&&!!l.has(e)},h=t=>{if(f(t))return[t];const e=c(t);return a({type:e,static:d(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,a]=e?bB(e,t,i):yield vB(t,n);g.set(r,t),p.push(r);const o=a.flatMap(h).map(t=>Mj(t,i));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map(t=>mB(t,n)));sD(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];v.set(n,r)}}}else{const e=h(u(t)?t:yield jB(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(pP.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(BB(dE)).data(p,t=>t.key).join(t=>t.append("g").attr("className",dE).attr("id",t=>t.key).call(pB).each(function(t,e,r){xB(t,Am(r),k,n),b.set(t,r)}),t=>t.call(pB).each(function(t,e,r){xB(t,Am(r),k,n),w.set(t,r)}),t=>t.each(function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()}).remove());const M=(t,e,r)=>Array.from(t.entries()).map(([i,a])=>{const o=r||new Map,s=(t,e=t=>t)=>o.set(t,e),l=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=wj("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),a=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,o=LB(e),s=o.map(i).filter(a).map(t=>t[0]);return(e,r,i)=>Fe(this,void 0,void 0,function*(){const a=[],[o,l]=yield vB(e,n);xB(o,t,a,n);for(const i of s.filter(t=>t!==r))gB(i,t,e,o,n);for(const e of l)hB(e,t,n);return i(),{options:e,view:o}})}(Am(a),l,n),u={view:i,container:a,options:l,setState:s,update:(n,r)=>Fe(this,void 0,void 0,function*(){const i=qa(Array.from(o.values()))(l);return yield c(i,n,()=>{x(r)&&e(t,r,o)})})};return n.externals.update=u.update,n.externals.setState=s,u}),O=(t=w,e,r)=>{var i;const a=M(t,O,r);for(const t of a){const{options:r,container:s}=t,l=s.nameInteraction;let c=LB(r);e&&(c=c.filter(t=>e.includes(t[0])));for(const e of c){const[r,s]=e,c=l.get(r);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),s){const e=yB(t.view,r,s,o)(t,a,n.emitter);l.set(r,{destroy:e})}}}},E=M(b,O);for(const t of E){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of LB(e)){const[e,a]=i;if(a){const i=yB(t.view,e,a,o)(t,E,n.emitter);r.set(e,{destroy:i})}}}O();const{width:S,height:A}=t,_=[];for(const t of y){const r=new Promise(r=>Fe(this,void 0,void 0,function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield hB(t,e,n)}r()}));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach(t=>null==t?void 0:t.cancel()),n.animations=k,n.emitter.emit(pP.AFTER_PAINT);const T=k.filter(Za).map(TB).map(t=>t.finished);return Promise.all([...T,..._])})}function pB(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function gB(t,e,n,r,i){var a;const{library:o}=i,[s]=wj("interaction",o),l=e.node().nameInteraction,c=LB(n).find(([e])=>e===t),u=l.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!c[1])return;const f=yB(r,t,c[1],s),d={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},h=f(d,[],i.emitter);l.set(t,{destroy:h})}function vB(t,e){return Fe(this,void 0,void 0,function*(){const{library:n}=e,r=yield function(t,e){return Fe(this,void 0,void 0,function*(){const{library:n}=e,[r,i]=wj("mark",n),a=new Set(Object.keys(n).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(Za)),{marks:o}=t,s=[],l=[],c=[...o],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:l=16,marginLeft:c=l,marginRight:u=l,marginTop:f=l,marginBottom:d=l,inset:h=0,insetLeft:p=h,insetRight:g=h,insetTop:v=h,insetBottom:m=h}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(a)-c-u-p-g,height:e-y(o)-y(s)-f-d-v-m}}(t),d={options:t,width:u,height:f};for(;c.length;){const[t]=c.splice(0,1),n=yield jB(t,e),{type:o=Ua("G2Mark type is required."),key:u}=n;if(a.has(o))l.push(n);else{const{props:t={}}=i(o),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,d),a=Array.isArray(i)?i:[i];c.unshift(...a.map((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`})))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:l})})}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=De(t,["coordinate","interaction","style","marks"]),o=i.map(t=>t.coordinate||{}),s=i.map(t=>t.interaction||{}),l=i.map(t=>t.viewStyle||{}),c=[...o,e].reduceRight((t,e)=>tt(t,e),{}),u=[n,...s].reduce((t,e)=>tt(t,e),{}),f=[...l,r].reduce((t,e)=>tt(t,e),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:c,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const a=Mj(i,n);return bB(yield mB(a,e),a,n)})}function mB(t,e){return Fe(this,void 0,void 0,function*(){const{library:n}=e,[r]=wj("theme",n),[,i]=wj("mark",n),{theme:a,marks:o,coordinates:s=[]}=t,l=r(CB(a)),c=new Map;for(const t of o){const{type:n}=t,{props:r={}}=i(n),a=yield fB(t,r,e);if(a){const[t,e]=a;c.set(t,e)}}const u=rr(Array.from(c.values()).flatMap(t=>t.channels),({scaleKey:t})=>t);for(const t of u.values()){const e=t.reduce((t,{scale:e})=>tt(t,e),{}),{scaleKey:r}=t[0],{values:i}=t[0],a=Array.from(new Set(i.map(t=>t.field).filter(Za))),o=tt({guide:{title:0===a.length?void 0:a},field:a[0]},e),{name:c}=t[0],u=t.flatMap(({values:t})=>t.map(t=>t.value)),f=Object.assign(Object.assign({},rD(c,u,o,s,l,n)),{uid:Symbol("scale"),key:r});t.forEach(t=>t.scale=f)}return c})}function yB(t,e,n,r){const i=t.theme,a="string"==typeof e&&i[e]||{};return r(tt(a,Object.assign({type:e},n)))}function bB(t,e,n){var r;const[i]=wj("mark",n),[a]=wj("theme",n),[o]=wj("labelTransform",n),{key:s,frame:l=!1,theme:c,clip:u,style:f={},labelTransform:d=[]}=e,h=a(CB(c)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),o=new Map(a.map(t=>[t.name,t]));for(const t of r){const e=lD(t);for(const r of e){const e=o.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:l=!1}=s;if(e&&!l){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=tt({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:ct(t,i)});a.push(e)}}}return a}(p,e),v=function(t){return t.map(t=>{const e=tt(t,t.style);return delete e.style,e})}(OD(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},o=(null===(r=t.find(t=>"color"===t.name))||void 0===r?void 0:r.field)||null,s={field:o,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=qD(v,e,h,n),y=function(t,e,n){const[r]=wj("coordinate",n),{innerHeight:i,innerWidth:a,insetLeft:o,insetTop:s,insetRight:l,insetBottom:c}=t,{coordinates:u=[]}=e,f=(d=u).find(t=>"cartesian"===t.type||"cartesian3D"===t.type)?d:[...d,{type:"cartesian"}];var d;const h="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:o,y:s,width:a-o-l,height:i-c-s,transformations:f.flatMap(r)});return h?new DL(p):new LL(p)}(m,e,n),b=l?tt({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=rr(t,t=>`${t.plane||"xy"}-${t.position}`),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,w={xy:UD({width:b,height:y,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:UD({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:UD({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),a=w[r][i],[o,s]=uo(n,t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i))));o.length&&KD(o,e,a,i),s.length&&ZD(n,0,a)}}(SD(v),y,m),function(t){const e=t.find(({type:t})=>"axisX"===t),n=t.find(({type:t})=>"axisY"===t),r=t.find(({type:t})=>"axisZ"===t);e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap(t=>{const{channels:e}=t;return e.map(({scale:t})=>[t.uid,oD(t,n)])}));!function(t,e){const n=Array.from(t.values()).flatMap(t=>t.channels),r=or(n,t=>t.map(t=>e.get(t.scale.uid)),t=>t.name).filter(([,t])=>t.some(t=>"function"==typeof t.getOptions().groupTransform)&&t.every(t=>t.getTicks)).map(t=>t[1]);r.forEach(t=>{const e=t.map(t=>t.getOptions().groupTransform)[0];e(t)})}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:a}=t,o=null!==(r=x.get(a))&&void 0!==r?r:oD(t,n);i.push(o),"y"===e&&o.update(Object.assign(Object.assign({},o.getOptions()),{xScale:w.x})),aD(w,{[e]:o})}t.scaleInstances=i}const k=[],M=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:a,key:o,data:l}=e;M.set(o,l);const{index:c,channels:u,tooltip:f}=n,d=Object.fromEntries(u.map(({name:t,scale:e})=>[t,e])),h=oo(d,({uid:t})=>x.get(t));aD(w,h);const p=iD(u,h),g=i(e),[v,b,O]=wB(g(c,h,p,y)),E=r||v.length,S=a?a(b,E,m):[],A=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},_=t=>f.items.map(e=>e[t]),T=v.map((t,e)=>{const n=Object.assign({points:b[e],transform:S[e],index:t,markKey:o,viewKey:s,data:l[t]},f&&{title:A(t),items:_(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],O&&(n[`series${G(r)}`]=O[e].map(t=>i[t]));return O&&(n.seriesIndex=O[e]),O&&f&&(n.seriesItems=O[e].map(t=>_(t)),n.seriesTitle=O[e].map(t=>A(t))),n});n.data=T,n.index=v;const N=null==t?void 0:t(T,h,m);k.push(...N||[])}return[{layout:m,theme:h,coordinate:y,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:M,options:e,labelTransform:qa(d.map(o))},k]}function xB(t,e,n,r){return Fe(this,void 0,void 0,function*(){const{library:i}=r,{components:a,theme:o,layout:s,markState:l,coordinate:c,key:u,style:f,clip:d,scale:h}=t,{x:p,y:g,width:v,height:m}=s,y=De(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((t,e)=>e),w=b.map(t=>to(Object.assign({},o.view,f),t)),k=["a","margin","padding","inset"].map(t=>Ja(y,t)),M=t=>t.style("x",t=>_[t].x).style("y",t=>_[t].y).style("width",t=>_[t].width).style("height",t=>_[t].height).each(function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Am(n),w[t])});let O=0,E=0,S=v,A=m;const _=x.map(t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:a=0}=e;return O+=n,E+=r,S-=n+a,A-=r+i,{x:O,y:E,width:S,height:A}});e.selectAll(BB(vE)).data(x.filter(t=>Za(w[t])),t=>b[t]).join(t=>t.append("rect").attr("className",vE).style("zIndex",-2).call(M),t=>t.call(M),t=>t.remove());const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:a}=i,{enter:o={},update:s={},exit:l={}}=t,{type:c,duration:u=300,delay:f=0}=s,{type:d,duration:h=300,delay:p=0}=o,{type:g,duration:v=300,delay:m=0}=l;for(const t of a){const{updateType:r=c,updateDuration:i=u,updateDelay:a=f,enterType:o=d,enterDuration:s=h,enterDelay:l=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+a),n=Math.min(n,a)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===o||o)&&(e=Math.max(e,s+l),n=Math.min(n,l))}}return e===-1/0?null:[n,e-n]}(l),N=!!T&&{duration:T[1]};for(const[,t]of ir(a,t=>`${t.type}-${t.position}`))t.forEach((t,e)=>t.index=e);const P=e.selectAll(BB(pE)).data(a,t=>`${t.type}-${t.position}-${t.index}`).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",pE).append(t=>ED(tt({animate:N,scale:h},t),c,o,i,l)),t=>t.transition(function(t,e,n){const{preserve:r=!1}=t;if(r)return;const a=ED(tt({animate:N,scale:h},t),c,o,i,l),{attributes:s}=a,[u]=n.childNodes;return u.update(s,!1)})).transitions();n.push(...P.flat().filter(Za));const C=e.selectAll(BB(hE)).data([s],()=>u).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",hE).call(RB).call(DB,Array.from(l.keys())).call(FB,d),t=>t.call(DB,Array.from(l.keys())).call(RB).call(FB,d)).transitions();n.push(...C.flat());for(const[a,o]of l.entries()){const{data:s}=o,{key:l,class:c,type:u}=a,f=e.select(`#${l}`),d=EB(a,o,t,r),h=_B(a,o,t,i),p=NB(a,o,t,i),g=PB(a,o,t,i),v=MB(e,f,c,"element"),m=f.selectAll(BB(fE)).selectFacetAll(v).data(s,t=>t.key,t=>t.groupKey).join(t=>t.append(d).attr("className",fE).attr("markType",u).transition(function(t,e,n){return h(t,[n])}),t=>t.call(t=>{const e=t.parent(),n=Qa(t=>{const[e,n]=t.getBounds().min;return[e,n]});t.transition(function(t,r,i){OB(i,e,n);const a=d(t,r),o=p(t,[i],[a]);return(null==o?void 0:o.length)||(i.nodeName===a.nodeName&&"g"!==a.nodeName?Ka(i,a):(i.parentNode.replaceChild(a,i),a.className=fE,a.markType=u,a.__data__=i.__data__)),o}).each(function(t,e,n){n.__removed__&&(n.__removed__=!1)}).attr("markType",u).attr("className",fE)}),t=>t.each(function(t,e,n){n.__removed__=!0}).transition(function(t,e,n){return g(t,[n])}).remove(),t=>t.append(d).attr("className",fE).attr("markType",u).transition(function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new _m(r,null,n.parentNode).transition(i).remove(),i}),t=>t.transition(function(t,e,n){const r=new _m([],n.__toData__,n.parentNode).append(d).attr("className",fE).attr("markType",u).nodes();return p(t,[n],r)}).remove()).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[a]=wj("labelTransform",r),{markState:o,labelTransform:s}=t,l=e.select(BB(uE)).node(),c=new Map,u=new Map,f=Array.from(o.entries()).flatMap(([n,a])=>{const{labels:o=[],key:s}=n,l=function(t,e,n,r,i){const[a]=wj("shape",r),{data:o,encode:s}=t,{data:l,defaultLabelShape:c}=e,u=l.map(t=>t.points),f=oo(s,t=>t.value),{theme:d,coordinate:h}=n,p=Object.assign(Object.assign({},i),{document:kj(i),theme:d,coordinate:h});return t=>{const{index:e,points:n}=t,r=o[e],{formatter:i=t=>`${t}`,transform:s,style:l,render:h,selector:g,element:v}=t,m=De(t,["formatter","transform","style","render","selector","element"]),y=oo(Object.assign(Object.assign({},m),l),t=>kB(t,r,e,o,{channel:f,element:v})),{shape:b=c,text:x}=y,w=De(y,["shape","text"]),k="string"==typeof i?w_(i):i,M=Object.assign(Object.assign({},w),{text:k(x,r,e,o),datum:r}),O=Object.assign({type:`label.${b}`,render:h},w);return a(O,p)(n,M,SB(d,"label",b,"label"),u)}}(n,a,t,r,i),f=e.select(`#${s}`).selectAll(BB(fE)).nodes().filter(t=>{var e;if(t.__removed__)return!1;return!("hidden"===(null===(e=t.style)||void 0===e?void 0:e.visibility)||t.children&&t.children.some(t=>{var e;return"hidden"===(null===(e=t.style)||void 0===e?void 0:e.visibility)}))});return o.flatMap((t,e)=>{const n=De(t,["transform"]);return f.flatMap(r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,l=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach(t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:l,index:s,points:a,dependentElement:n})];const c=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map((r,o)=>Object.assign(Object.assign({},t),{key:`${i[o]}-${e}`,bounds:[a[o]],index:r,points:a,dependentElement:n}));return c?c(u):u}(n,e,r);return i.forEach(e=>{c.set(e,t=>l(Object.assign(Object.assign({},t),{element:r}))),u.set(e,t)}),i})})}),d=Am(l).selectAll(BB(gE)).data(f,t=>t.key).join(t=>t.append(t=>c.get(t)(t)).attr("className",gE),t=>t.each(function(t,e,n){Ka(n,c.get(t)(t))}),t=>t.remove()).nodes(),h=rr(d,t=>u.get(t.__data__)),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of h){const{transform:n=[]}=t;qa(n.map(a))(e,v)}s&&s(d,v)}(t,e,0,i,r),function(t,e,n,r){const i=t.scale,a=at(i,"y.options.breaks",[]),{document:o}=r.canvas;if([mE,yE].forEach(t=>{o.getElementsByClassName(t).forEach(t=>{t.remove()})}),!a.length)return;const s=e.select(BB(hE)).node(),[l]=wj("shape",n),c=new Map;a.forEach((n,i)=>{c.set(n,l({type:"break"},{view:t,selection:e,context:r}))}),Am(s).selectAll(BB(mE)).data(a,t=>t.key).join(t=>t.append((t,e)=>c.get(t)(t,e)).attr("className",mE),t=>t.each(function(t,e,n){Ka(n,c.get(t)(t,e))}),t=>t.remove()).nodes()}(t,e,i,r)})}function wB([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const a=t[n],o=e[n];o.every(([t,e])=>Za(t)&&Za(e))&&(r.push(a),i.push(o))}return[r,i]}function kB(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:ro(e)&&void 0!==e[t]?e[t]:t}function MB(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r)):[]}function OB(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,l]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${a-s}, ${o-l})`),e.append(t)}function EB(t,e,n,r){const{library:i}=r,[a]=wj("shape",i),{data:o,encode:s}=t,{defaultShape:l,data:c,shape:u}=e,f=oo(s,t=>t.value),d=c.map(t=>t.points),{theme:h,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:kj(r),coordinate:p,theme:h});return e=>{const{shape:n=l}=v,{shape:r=n,points:i,seriesIndex:s,index:c}=e,p=De(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:c}),b=s?s.map(t=>o[t]):o[c],x=s||c,w=oo(v,t=>kB(t,b,x,o,{channel:f}));return(u[r]?u[r](w,m):a(Object.assign(Object.assign({},w),{type:IB(t,r)}),m))(i,y,SB(h,g,r,l),d)}}function SB(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function AB(t,e,n,r,i){var a,o;const[,s]=wj("shape",i),[l]=wj("animation",i),{defaultShape:c,shape:u}=n,{theme:f,coordinate:d}=r,h=`default${G(t)}Animation`,{[h]:p}=(null===(a=u[c])||void 0===a?void 0:a.props)||s(IB(e,c)).props,{[t]:g={}}=f,v=(null===(o=e.animate)||void 0===o?void 0:o[t])||{},m={coordinate:d};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:a,[`${t}Duration`]:o,[`${t}Easing`]:s}=e,c=Object.assign({type:i||p},v);if(!c.type)return null;const u=l(c,m)(n,r,tt(g,{delay:a,duration:o,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function _B(t,e,n,r){return AB("enter",t,e,n,r)}function TB(t){return t.finished.then(()=>{t.cancel()}),t}function NB(t,e,n,r){return AB("update",t,e,n,r)}function PB(t,e,n,r){return AB("exit",t,e,n,r)}function CB(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=De(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function LB(t){const{interaction:e={}}=t;return Object.entries(tt({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function jB(t,e){return Fe(this,void 0,void 0,function*(){const{data:n}=t,r=De(t,["data"]);if(null==n)return t;const[,{data:i}]=yield tB(0,{data:n},e);return Object.assign({data:i},r)})}function RB(t){t.style("transform",t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function IB(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function DB(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(BB(cE)).data(e,t=>t.key).join(t=>t.append("g").attr("className",cE).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.remove());t.select(BB(uE)).node()||t.append("g").attr("className",uE).style("zIndex",0)}function BB(...t){return t.map(t=>`.${t}`).join("")}function FB(t,e){t.node()&&t.style("clipPath",t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:a,innerWidth:o,innerHeight:s}=t;return new fv({style:{x:r+i,y:n+a,width:o,height:s}})})}function zB(t){const{style:e,scale:n,type:r}=t,i={},a=at(e,"columnWidthRatio");return a&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-a})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}const WB=t=>{if(!t||"string"!=typeof t)return t;const e=t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t);if(isNaN(e)||e<0||e>1)throw new Error(`Invalid gap value: ${t}. It should be between 0 and 1.`);return e};function $B(t){const{axis:e}=t,n=at(e,"y.breaks");return n&&ot(t,"scale.y.breaks",n.map(t=>Object.assign(Object.assign({key:`break-${t.start}-${t.end}`},t),{gap:WB(t.gap)}))),t}function GB(t){const e=function(t){return function(...t){return e=>t.reduce((t,e)=>e(t),e)}(zB,$B)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map(t=>GB(t))),e}function YB(t){const e=tt({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),a=null===e?"0":`${e.key}-${i}`;t.key=a}const{children:e=[]}=t;if(Array.isArray(e))for(let a=0;a<e.length;a++){const o=tt({},e[a]);e[a]=o,n.set(o,t),r.set(o,a),i.push(o)}}return e}function HB(t,e){const n=new cP;return n.registerPlugin(new fP),new _v({width:t,height:e,container:document.createElement("div"),renderer:n})}function VB(t,e={},n=()=>{},r=t=>{throw t}){const i=DP(t),{width:a=640,height:o=480,depth:s=0}=i,l=YB(GB(i)),{canvas:c=HB(a,o),emitter:u=new hP,library:f}=e;e.canvas=c,e.emitter=u,e.externals={};const{width:d,height:h}=c.getConfig();d===a&&h===o||c.resize(a,o),u.emit(pP.BEFORE_RENDER);const p=Am(c.document.documentElement);return c.ready.then(()=>hB(Object.assign(Object.assign({},l),{width:a,height:o,depth:s}),p,e)).then(()=>{if(s){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-s/2)}c.requestAnimationFrame(()=>{c.requestAnimationFrame(()=>{u.emit(pP.AFTER_RENDER),null==n||n()})})}).catch(t=>{null==r||r(t)}),"string"==typeof(g=c.getConfig().container)?document.getElementById(g):g;var g}function qB(t,e={},n=!1,r=!0){const{canvas:i,emitter:a}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${dE}`);null==e||e.forEach(t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach(t=>{null==t||t.destroy()})})}(i),n?i.destroy():i.destroyChildren()),r&&a.off()}function XB(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(XB(t,e))return!0}return!1}const UB={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function KB(t,e){let n;return XB(t,t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)}),null!=n?n:UB[e]}function ZB(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>ZB(t,e,n,r))}function QB(t){ZB(t,"visibility","hidden",!0)}function JB(t){ZB(t,"visibility","visible",!0)}function tF(t){return Am(t).selectAll(`.${fE}`).nodes().filter(t=>!t.__removed__)}function eF(t,e){return nF(t,e).flatMap(({container:t})=>tF(t))}function nF(t,e){return e.filter(e=>e!==t&&e.options.parentKey===t.options.key)}function rF(t){return Am(t).select(`.${hE}`).node()}function iF(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new xu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function aF(t,e){const{offsetX:n,offsetY:r}=e,i=iF(t),{min:[a,o],max:[s,l]}=i;return n<a||n>s||(r<o||r>l)?null:[n-a,r-o]}function oF(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function sF(t){return t=>t.__data__.color}function lF(t){return t=>t.__data__.x}function cF(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(t=>Array.from(t.markState.keys()).map(e=>[gF(t.key,e.key),e.data])));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(gF(i,r))[e]}}const uF={selected:3,unselected:3,active:2,inactive:2,default:1},fF={selection:["selected","unselected"],highlight:["active","inactive"]},dF=(t,e,n)=>{XB(t,t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)})};function hF(t,e){return e.forEach(e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t}),(t=(t,e)=>t,e=dF)=>pF(void 0,t,e)}function pF(t,e=(t,e)=>t,n=dF){const r="__states__",i="__ordinal__",a=t=>uF[t]||uF.default,o=t=>{var e;return null===(e=Object.entries(fF).find(([e,n])=>n.includes(t)))||void 0===e?void 0:e[0]},s=o=>{var s;const{[r]:l=[],[i]:c={}}=o,u=[...l].sort((t,e)=>a(e)-a(t)),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:o.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const d=Object.assign({},c);for(const[t,e]of f.entries())d[t]=e;if(0!==Object.keys(d).length){for(const[t,r]of Object.entries(d)){const i=KB(o,t),a=e(r,o);n(o,t,a),t in c||(c[t]=i)}o[i]=c}},l=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{l(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{l(t);const n=t[r],i=new Set(e.map(t=>o(t)).filter(t=>void 0!==t)),a=n.filter(t=>!i.has(o(t)));t[r]=[...a,...e],s(t)},removeState:(t,...e)=>{l(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(l(t),-1!==t[r].indexOf(e))}}function gF(t,e){return`${t},${e}`}function vF(t,e){const n=(Array.isArray(t)?t:[t]).flatMap(t=>t.marks.map(e=>[gF(t.key,e.key),e.state])),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce((t,n)=>{const[r,a={}]=n,o=void 0===(s=a[e])||"object"==typeof s&&0===Object.keys(s).length?i:a[e];var s;for(const[e,n]of Object.entries(o)){const i=t[e],a=(t,e,a,o)=>{const s=gF(o.__data__.viewKey,o.__data__.markKey);return r!==s?null==i?void 0:i(t,e,a,o):"function"!=typeof n?n:n(t,e,a,o)};t[e]=a}return t},{})}return r}function mF(t,e){const n=new Map(t.map((t,e)=>[t,e])),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const a=n.get(i);return t(e?e(i):i,a,r,i)}}function yF(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=De(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,o=(t,e)=>{const[,n,r]=t,[i,,,a]=e;return[n,i,a,r]};return[t=>{var e;if(t.length<=1)return;const r=lr(t,(t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r});for(let t=1;t<r.length;t++){const s=ul(),l=r[t-1],c=r[t],[u,f,d,h]=o(a(l),a(c));s.moveTo(...u),s.lineTo(...f),s.lineTo(...d),s.lineTo(...h),s.closePath();const p=oo(i,t=>n(t,l)),{fill:g=l.getAttribute("fill")}=p,v=De(p,["fill"]),m=new ov({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=l.link)||void 0===e||e.remove(),l.parentNode.appendChild(m),l.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function bF(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(tc(n)){const{points:i}=t.__data__,[a,o]=Jl(n)?jm(i):i,s=n.getCenter(),l=_s(a,s),c=_s(o,s),u=Ps(l)+Ls(l,c)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Jl(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function xF(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=De(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const l=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,a=t.getStep(r)/2,o=a*n;return[i-a+o,i+a-o]},c=(t,n)=>{const{padding:a}=n,[o,s]=((t,e)=>{const{x:n}=r;if(!fT(n))return[0,1];const{__data__:i}=t,{x:a}=i,[o,s]=l(n,a,e);return[o,s]})(t,a),[c,u]=((t,e)=>{const{y:n}=r;if(!fT(n))return[0,1];const{__data__:i}=t,{y:a}=i,[o,s]=l(n,a,e);return[o,s]})(t,a),f=[[o,c],[s,c],[s,u],[o,u]].map(t=>i.map(t)),{__data__:d}=t,{y:h,y1:p}=d;return Fm(e,f,{y:h,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=De(e,["transform","transformOrigin","stroke"]),o=Object.assign({transform:n,transformOrigin:r,stroke:i},a),s=t.cloneNode(!0);for(const[t,e]of Object.entries(o))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=oo(o,e=>a(e,t)),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:l=-2,padding:f=.001,lineWidth:d=0}=e,h=De(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},h),{fill:n,fillOpacity:i,zIndex:l,padding:f,lineWidth:d}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(fT)})()?c:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function wF(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function kF(t){wF(t,t.cursor)}function MF(t,e,n){return t.find(t=>Object.entries(e).every(([e,r])=>n(t)[e]===r))}function OF(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function EF(t,e=!1){const n=m(t,t=>!!t).map((t,e)=>[0===e?"M":"L",...t]);return e&&n.push(["Z"]),n}function SF(t){return t.querySelectorAll(".element")}function AF(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const _F=["interval","point","density"];function TF({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=_F}){var a,o;let s=t(e);const l=t=>i.includes(t.markType);if(s.find(l)){s=s.filter(l);const t=r.x,i=r.series,c=null!==(o=null===(a=null==t?void 0:t.getBandWidth)||void 0===a?void 0:a.call(t))&&void 0!==o?o:0,u=i?t=>{var e,n;const r=Math.round(1/(null!==(e=i.valueBandWidth)&&void 0!==e?e:1));return t.__data__.x+(null!==(n=t.__data__.series)&&void 0!==n?n:0)*c+c/(2*r)}:t=>t.__data__.x+c/2;return s.sort((t,e)=>u(t)-u(e)),t=>{const r=aF(e,t);if(!r)return;const[i]=n.invert(r),a=(0,$n(u).center)(s,i);return s[a]}}return t=>{const{target:e}=t;return AF(e,t=>!!t.classList&&t.classList.includes("element"))}}function NF(t){const e=.01/Math.max(t,1e-4);return Math.max(.1,Math.min(100,e))}function PF(t){return!1===t||null==t}function CF(t,e){const n=new Set;for(const r of e){const{scale:e}=r,i=null==e?void 0:e[t];if(!i)continue;if(i.independent)return!0;const a=i.key||"default";if(n.add(a),n.size>1)return!0}return!1}function LF(t){var e,n,r,i,a,o,s,l;const c=Array.from(t.markState.keys()),u=CF("x",c),f=CF("y",c),d=[],h=[],p=[],g=[],v=new Map,m=new Map,y=new Map,b=new Map;let x=1,w=1;for(const[c]of t.markState.entries()){const t=c.key,k=(null===(n=null===(e=null==c?void 0:c.scale)||void 0===e?void 0:e.x)||void 0===n?void 0:n.key)||"x";if(!!(null===(i=null===(r=null==c?void 0:c.scale)||void 0===r?void 0:r.x)||void 0===i?void 0:i.independent)||u&&"x"!==k){h.push(t),y.has(k)||y.set(k,x++);const e=y.get(k);v.set(t,`x${e}`)}else d.push(t),v.set(t,"x");const M=(null===(o=null===(a=null==c?void 0:c.scale)||void 0===a?void 0:a.y)||void 0===o?void 0:o.key)||"y";if(!!(null===(l=null===(s=null==c?void 0:c.scale)||void 0===s?void 0:s.y)||void 0===l?void 0:l.independent)||f&&"y"!==M){g.push(t),b.has(M)||b.set(M,w++);const e=b.get(M);m.set(t,`y${e}`)}else p.push(t),m.set(t,"y")}return{hasIndependentX:u,hasIndependentY:f,marksWithSharedX:d,marksWithIndependentX:h,marksWithSharedY:p,marksWithIndependentY:g,markToXScaleMap:v,markToYScaleMap:m}}function jF(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:a=!1}=t,o=De(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,l)=>{const{container:c,view:u,options:f}=t,{scale:d,coordinate:h}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,background:o=!1,delay:s=60,scale:l,coordinate:c,emitter:u,state:f={},region:d=!1,regionEleFilter:h=t=>_F.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],m=d?v.filter(h):v,y=new Set(m),b=d?i:r,x=rr(m,b),w=TF({elementsof:e,root:t,coordinate:c,scale:l}),k=mF(m,n),[M,O]=yF(Object.assign({elements:m,valueof:k,link:a,coordinate:c},Ja(f.active,"link"))),[E,S,A]=xF(Object.assign({document:t.ownerDocument,scale:l,coordinate:c,background:o,valueof:k},Ja(f.active,"background"))),_=tt(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return bF(m[n],e,c)}})}),T=hF(_,m),{updateState:N,removeState:P,hasState:C}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(d&&(r=w(t)),!y.has(r))return;L&&clearTimeout(L);const i=b(r),a=x.get(i),o=new Set(a);for(const t of m)o.has(t)?C(t,"active")||N(t,"active"):(N(t,"inactive"),O(t)),t!==r&&S(t);E(r),M(a),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:a.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout(()=>{I(),L=null},s)},I=(t=!0)=>{for(const t of m)P(t,"active","inactive"),S(t),O(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;d&&(e=w(t)),e?o&&!A(e)||(o||y.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=MF(m,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of m)S(t),O(t)}}(rF(c),Object.assign({elements:tF,datum:cF(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:h,scale:d,state:vF(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:a,delay:e,emitter:l},o))}}function RF(t){return jF(Object.assign(Object.assign({},t),{createGroup:lF}))}function IF(t){return jF(Object.assign(Object.assign({},t),{createGroup:sF}))}function DF(t,{elements:e,datum:n,groupKey:r=t=>t,scaleFactor:i=1.04,scaleOrigin:a="center center",shadow:o=!0,shadowColor:s="rgba(0, 0, 0, 0.4)",shadowBlur:l=10,shadowOffsetX:c=0,shadowOffsetY:u=2,zIndex:f=10,delay:d=60,emitter:h,state:p={}}){const g=()=>{var n;return null!==(n=e(t))&&void 0!==n?n:[]},v=g(),m=mF(v,n),y=hF(tt(p,{active:{}}),v),{updateState:b,removeState:x,hasState:w}=y(m),k=new Map,M=new Set;let O;const E=t=>{if(M.has(t))return;const e=t.style.transform||"",n=t.style.transformOrigin||"";k.set(t,{transform:e,transformOrigin:n,zIndex:t.style.zIndex||0,shadowColor:t.style.shadowColor||"",shadowBlur:t.style.shadowBlur||0,shadowOffsetX:t.style.shadowOffsetX||0,shadowOffsetY:t.style.shadowOffsetY||0});const r=e&&"none"!==e?e:"",d=`scale(${i})`;let h;h=r&&!r.includes("scale")?`${r} ${d}`.trimStart():r&&r.includes("scale")?r.replace(/scale\([^)]+\)/g,d).trimStart():d,t.style.transformOrigin=a,t.style.transform=h,t.style.zIndex=f,o&&(t.style.shadowColor=s,t.style.shadowBlur=l,t.style.shadowOffsetX=c,t.style.shadowOffsetY=u),M.add(t)},S=t=>{const e=k.get(t);e&&(t.style.transform=e.transform,t.style.transformOrigin=e.transformOrigin,t.style.zIndex=e.zIndex,t.style.shadowColor=e.shadowColor,t.style.shadowBlur=e.shadowBlur,t.style.shadowOffsetX=e.shadowOffsetX,t.style.shadowOffsetY=e.shadowOffsetY,M.delete(t),k.delete(t))},A=t=>{const{nativeEvent:e=!0}=t,i=t.target,a=g();if(!new Set(a).has(i))return;O&&clearTimeout(O);const o=rr(a,r),s=r(i),l=o.get(s);if(!l)return;const c=new Set(l);for(const t of a)c.has(t)||(x(t,"active"),S(t));for(const t of l)w(t,"active")||b(t,"active"),E(t);e&&h.emit("element:hoverscale",{nativeEvent:e,data:{data:n(i),group:l.map(n)}})},_=(t=!0)=>{const e=g();for(const t of e)x(t,"active"),S(t);M.clear(),t&&h.emit("element:unhoverscale",{nativeEvent:t})},T=t=>{d>0?(O&&clearTimeout(O),O=setTimeout(()=>{_(),O=null},d)):_()},N=()=>{_()};t.addEventListener("pointerover",A),t.addEventListener("pointermove",A),t.addEventListener("pointerout",T),t.addEventListener("pointerleave",N);const P=t=>{const{nativeEvent:e}=t;e||_(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=MF(g(),r,n);i&&A({target:i,nativeEvent:!1})};return h.on("element:hoverscale",C),h.on("element:unhoverscale",P),()=>{t.removeEventListener("pointerover",A),t.removeEventListener("pointermove",A),t.removeEventListener("pointerout",T),t.removeEventListener("pointerleave",N),h.off("element:hoverscale",C),h.off("element:unhoverscale",P);const e=g();for(const t of e)S(t);k.clear(),M.clear()}}function BF(t){var{delay:e,createGroup:n,scale:r,scaleOrigin:i,shadow:a,shadowColor:o,shadowBlur:s,shadowOffsetX:l,shadowOffsetY:c,zIndex:u}=t,f=De(t,["delay","createGroup","scale","scaleOrigin","shadow","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","zIndex"]);return(t,d,h)=>{const{container:p,view:g,options:v}=t,m=rF(p),y=cF(g);return DF(m,Object.assign({elements:tF,datum:y,groupKey:n?t=>n(g)(y(t)):void 0,state:vF(v,["active"]),scaleFactor:r,scaleOrigin:i,shadow:a,shadowColor:o,shadowBlur:s,shadowOffsetX:l,shadowOffsetY:c,zIndex:u,delay:e,emitter:h},f))}}function FF(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,single:o=!1,multipleSelectHotkey:s,coordinate:l,background:c=!1,scale:u,emitter:f,state:d={},region:h=!1,regionEleFilter:p=t=>_F.includes(t.markType)}){var g;const v=e(t),m=new Set(v),y=TF({elementsof:e,root:t,coordinate:l,scale:u}),b=rr(v,r),x=rr(v,i),w=mF(v,n),[k,M]=yF(Object.assign({link:a,elements:v,valueof:w,coordinate:l},Ja(d.selected,"link"))),[O,E]=xF(Object.assign({document:t.ownerDocument,background:c,coordinate:l,scale:u,valueof:w},Ja(d.selected,"background"))),S=tt(d,{selected:Object.assign({},(null===(g=d.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=d.selected.offset(...t),[,n]=t;return bF(v[n],e,l)}})}),A=hF(S,v),{updateState:_,removeState:T,hasState:N}=A(w);let P=!o,C=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),M(t),E(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:o=r,groupMap:s=b})=>{const l=v.filter(a);if(N(e,"selected"))L();else{const r=o(e),a=s.get(r),c=new Set(a);for(const t of l)c.has(t)?_(t,"selected"):(_(t,"unselected"),M(t)),t!==e&&E(t);if(k(a),O(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:s=r,groupMap:l=b})=>{const c=s(e),u=l.get(c),d=new Set(u),h=v.filter(o);if(N(e,"selected")){const t=v.some(t=>!d.has(t)&&N(t,"selected"));if(!t)return L();for(const t of u)_(t,"unselected"),M(t),E(t)}else{const t=u.some(t=>N(t,"selected"));for(const t of h)d.has(t)?_(t,"selected"):N(t,"selected")||_(t,"unselected");!t&&a&&k(u),O(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter(t=>N(t,"selected")).map(n)}}))},I=t=>{if(m.has(t))return t;for(const e of m){let n=null;if(XB(e,r=>{r===t&&(n=e)}),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,a=P?R:j;let o=e;const s=(t=>{if(m.has(t))return!0;for(const e of m)if(XB(e,e=>e===t))return!0;return!1})(e);return!h||s?s?a({event:t,element:I(o),nativeEvent:n,groupBy:r}):L():(o=y(t),m.has(o)?a({event:t,element:o,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!C&&(C=t.code,P=!0)},z=t=>{t.code===C&&(C=null,P=!1)};t.addEventListener("click",D),s&&(P=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const W=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=P?r.data:r.data.slice(0,1);for(const t of i){const e=MF(v,t,n);D({target:e,nativeEvent:!1})}},$=()=>{L(!1)};return f.on("element:select",W),f.on("element:unselect",$),()=>{for(const t of v)M(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",W),f.off("element:unselect",$)}}function zF(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,a=De(t,["createGroup","createRegionGroup","background","link"]);return(t,o,s)=>{const{container:l,view:c,options:u}=t,{coordinate:f,scale:d}=c;return FF(rF(l),Object.assign({elements:tF,datum:cF(c),groupKey:e?e(c):void 0,regionGroupKey:n?n(c):t=>t.__data__.x,coordinate:f,scale:d,state:vF(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},a))}}function WF(t){return zF(Object.assign(Object.assign({},t),{createGroup:lF}))}function $F(t){return zF(Object.assign(Object.assign({},t),{createGroup:sF}))}function GF(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,a=De(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:s,update:l,setState:c}=t,{markState:u,scale:f,coordinate:d}=o,h=function(t,e,n){const[r]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const{encode:e}=t;return Object.fromEntries(n.map(t=>{const n=e[t];return[t,n?n.value:void 0]}))});return r}(u,"line",["x","y","series"]);if(!h)return;const{y:p,x:g,series:v=[]}=h,m=p.map((t,e)=>e),y=lr(m.map(t=>g[t])),b=rF(s),x=s.getElementsByClassName(fE),w=rr(s.getElementsByClassName(gE),t=>t.__data__.key.split("-")[0]),k=new iv({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Ja(a,"rule"))}),M=new hv({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Ja(a,"label"))});k.append(M),b.appendChild(k);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[Xn(y,i)]},E=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const A=ut(t=>{const e=aF(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,a=O(n,r,t);E(t,a);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,o=e[$n(t=>g[+t]).center(e,a)],s=[0,i.map(1)],l=[0,i.map(p[o]/p[e[0]])],[,c]=n.map(s),[,u]=n.map(l),f=c-u;t.setAttribute("transform",`translate(0, ${f})`);const d=w.get(r)||[];for(const t of d)t.setAttribute("dy",f)}})(e)},e,{leading:n,trailing:r});return(t=>{Fe(this,void 0,void 0,function*(){const{x:e}=f,n=O(d,e,t);E(t,n),c("chartIndex",t=>{const e=tt({},t),r=e.marks.find(t=>"line"===t.type),i=xr(ar(m,t=>xr(t,t=>+p[t])/kr(t,t=>+p[t]),t=>v[t]).values());tt(r,{scale:{y:{domain:[1/i,i]}}});const a=function(t){const{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);a.groupBy="color",a.basis=(t,e)=>e[t[$n(t=>g[+t]).center(t,n)]];for(const t of e.marks)t.animate=!1;return e});const r=yield l("chartIndex");S=r.view})})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{k.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function YF({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,l=rF(s),c=ut(t=>{const e=aF(l,t);if(!e)return o("fisheye"),void a();o("fisheye",t=>{const n=tt({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return a.focusX=r,a.focusY=i,a.visual=!0,n}),a()},t,{leading:e,trailing:n});return l.addEventListener("pointerenter",c),l.addEventListener("pointermove",c),l.addEventListener("pointerleave",c),()=>{l.removeEventListener("pointerenter",c),l.removeEventListener("pointermove",c),l.removeEventListener("pointerleave",c)}}}jF.props={reapplyWhenUpdate:!0},RF.props={reapplyWhenUpdate:!0},IF.props={reapplyWhenUpdate:!0},BF.props={reapplyWhenUpdate:!0},zF.props={reapplyWhenUpdate:!0},WF.props={reapplyWhenUpdate:!0},$F.props={reapplyWhenUpdate:!0},GF.props={reapplyWhenUpdate:!0};const HF="tooltipLocked";function VF(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function qF(t,e,n,r,i,a,o,s={},l=[10,10]){const c={[t_("tooltip")]:{},[t_("tooltip-title")]:{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},u=new qM({className:"tooltip",style:{x:e,y:n,container:o,data:[],bounding:a,position:r,enterable:i,title:"",offset:l,template:{prefixCls:JA},style:tt(c,s)}});return t.appendChild(u.HTMLTooltipElement),u}function XF({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,css:c,mount:u,bounding:f,offset:d}){const h=VF(t,u),p=VF(t),g=o?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return{x:n,y:r,width:i-n,height:a-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,h),{tooltipElement:y=qF(h,n,r,s,l,v,m,c,d)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b.map(t=>Object.assign(Object.assign({},t),{value:t.value||0===t.value?t.value:""})),title:x,position:s,enterable:l,container:m},void 0!==i&&{content:i(a,{items:b,title:x})})),g.tooltipElement=y}function UF({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const a=VF(t),o=e?a:t,{tooltipElement:s}=o;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),iz(t),az(t),oz(t)}function KF({root:t,single:e}){const n=VF(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),iz(t),az(t),oz(t)}function ZF(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function QF(t){const{__data__:e}=t;if(Ga(t))return function(t){var e,n,r,i,a,o,s;const{__data__:l}=t,{title:c,items:u=[]}=l;if(u.some(t=>QD in t)){const e=u.filter(Za).map(e=>{var{color:n=JF(t)}=e,r=De(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(ZF);return Object.assign(Object.assign({},c&&{title:c}),{items:e})}const f=null!==(n=null===(e=null==l?void 0:l.normalized)||void 0===e?void 0:e.x)&&void 0!==n?n:0,d=null===(r=t.parentNode)||void 0===r?void 0:r.__data__,h=null!==(i=null==d?void 0:d.encode)&&void 0!==i?i:{},{x:p={},y:g={},color:v={}}=h,{value:m=[]}=p,{value:y=[]}=g,{value:b=[]}=v,x=Math.min(Math.round(m.length*f),m.length-1);return{title:`${m[x]}, ${y[x]}`,items:[{name:null!==(a=v.field)&&void 0!==a?a:"value",value:b[x],color:(null===(o=t.style)||void 0===o?void 0:o.fill)||(null===(s=t.getAttribute)||void 0===s?void 0:s.call(t,"color"))||"#000"}]}}(t);const{title:n,items:r=[]}=e,i=r.filter(Za).map(e=>{var{color:n=JF(t)}=e,r=De(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(ZF);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function JF(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function tz(t,e=t=>t){const n=new Map(t.map(t=>[e(t),t]));return Array.from(n.values())}function ez(t,e,n,r=t.map(t=>t.__data__),i={}){const a=t=>t instanceof Date?+t:t,o=tz(r.map(t=>t.title),a).filter(Za),s=r.flatMap((r,a)=>{const o=r.element||t[a],{items:s=[],title:l}=r,c=s.filter(Za),u=void 0!==n?n:s.length<=1;return c.map(t=>{var{color:n=JF(o)||i.color,name:a}=t,s=De(t,["color","name"]);const c=Ha(e,r),f=u&&!(QD in s)?c||a:a||c;return Object.assign(Object.assign({},s),{color:n,name:f||l})})}).map(ZF);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:tz(s,t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`)})}function nz(t,e,n,r){var{plotWidth:i,plotHeight:a,mainWidth:o,mainHeight:s,startX:l,startY:c,transposed:u,polar:f,insetLeft:d,insetTop:h}=r,p=De(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map(e=>Ns(e,t)),r=Mr(n,t=>t);return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=l+d+o/2,e=c+h+s/2;return[t,e,Ns([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Ug({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,o]=u?[l+v[0],l+v[0],c,c+a]:[l,l+i,v[1]+c,v[1]+c],s=t.ruleX||((e,n,r,i)=>{const a=new iv({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(a),a})(e,n,r,o);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=o,t.ruleX=s}}function rz(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:f,insetTop:d}=n,h=De(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},h),g=e.map(t=>t[1]),v=e.map(t=>t[0]),m=Ar(g),y=Ar(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(a,o)/2,e=s+f+a/2,n=l+d+o/2,r=Ps(_s([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return c?[s,s+r,m+l,m+l]:[y+s,y+s,l,l+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new iv({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function iz(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function az(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function oz(t){t.markers&&(t.markers.forEach(t=>t.remove()),t.markers=[])}function sz(t,e){return Array.from(t.values()).some(t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]})}function lz(t,e){return void 0===t?e:t}function cz(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function uz({root:t,event:e,elements:n=[],coordinate:r,scale:i,shared:a}){var o,s;const l=n.every(t=>"interval"===t.markType)&&!tc(r),c=i.x,u=function(t){const{x:e}=t;if(!e||!e.valueBandWidth)return!0;const{valueBandWidth:n}=e;return!!I(n)||1===new Set(n.values()).size}(i),f=i.series,d=null!==(s=null===(o=null==c?void 0:c.getBandWidth)||void 0===o?void 0:o.call(c))&&void 0!==s?s:0,h=f&&f.valueBandWidth?t=>{const e=Math.round(1/f.valueBandWidth);return t.__data__.x+t.__data__.series*d+d/(2*e)}:t=>t.__data__.x+d/2;l&&n.sort((t,e)=>h(t)-h(e));const p=t=>{const{target:e=j(n)}=t;return AF(e,e=>!!e.classList&&(Ga(e)&&ot(e,"__data__.normalized",function(t,e){const{innerWidth:n,innerHeight:r,marginLeft:i,paddingLeft:a,insetLeft:o,marginTop:s,paddingTop:l,insetTop:c}=t.getOptions();return{x:(e.x-i-a-o)/n,y:(e.y-s-l-c)/r}}(r,{x:t.offsetX,y:t.offsetY})),e.classList.includes("element")))},g=l?e=>{const i=aF(t,e);if(!i)return;const[o]=r.invert(i),s=$n(h).center,l=u?s(n,o):function(t,e){const{adjustedRange:n,valueBandWidth:r,valueStep:i}=t,a=Array.from(r.values()),o=Array.from(i.values()),s=n.map((t,e)=>{const n=(o[e]-a[e])/2;return[t-n,t+a[e]+n]}),l=s.findIndex(([t,n])=>t<=e&&e<=n);return-1!==l?l:e>.5?n.length-1:0}(c,o),f=n[l];if(!a){const t=n.find(t=>t!==f&&h(t)===h(f));if(t)return p(e)||t}return f}:p;return g(e)}function fz({root:t,event:e,elements:n,coordinate:r,scale:i,startX:a,startY:o}){const s=Jl(r),l=[],c=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?l.push(t):(r||i)&&c.push(t)}const u=c.length&&c.every(t=>"interval"===t.markType)&&!tc(r),f=t=>t.__data__.x,d=!!i.x.getBandWidth&&c.length>0;l.sort((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)});const h=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return lr([n[e],r[e]])};u?n.sort((t,e)=>f(t)-f(e)):c.sort((t,e)=>{const[n,r]=h(t),[i,a]=h(e),o=(n+r)/2,l=(i+a)/2;return s?l-o:o-l});const p=new Map(l.map(t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map((t,e)=>e),i=lr(r,t=>n[+t]);return[t,[i,n]]})),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,m=t=>{const[e]=r.invert(t);return e-v},y=(t,e,n,r)=>{const{_x:i}=t,a=void 0!==i?g.map(i):m(e),o=r.filter(Za),[s,l]=lr([o[0],o[o.length-1]]);if(!d&&(a<s||a>l)&&!(s===l))return null;const c=$n(t=>r[+t]).center;return n[c(n,a)]},b=u?(t,e)=>{const n=e[(0,$n(f).center)(e,m(t))];return rr(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter(t=>{const[e,r]=h(t);return n>=e&&n<=r});if(!d||r.length>0)return r;const i=$n(t=>{const[e,n]=h(t);return(e+n)/2}).center;return[e[i(e,n)]].filter(Za)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,n])=>{const r=n[e];return[$(t.replace("series","")),r]}))},w=aF(t,e);if(!w)return;const k=[w[0]-a,w[1]-o];if(!k)return;const M=b(k,c),O=[],E=[];for(const t of l){const[n,i]=p.get(t),a=y(e,k,n,i);if(null!==a){O.push(t);const e=x(t,a),{x:n,y:i}=e,o=r.map([(n||0)+v,i||0]);E.push([Object.assign(Object.assign({},e),{element:t}),o])}}const S=Array.from(new Set(E.map(t=>t[0].x))),A=S[Mr(S,t=>Math.abs(t-m(k)))],_=E.filter(t=>t[0].x===A),T=[..._.map(t=>t[0]),...M.map(t=>t.__data__)];return{selectedElements:[...O,...M],selectedData:T,filteredSeriesData:_,abstractX:m}}function dz(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,crosshairsX:l,crosshairsY:c,render:u,groupName:f,emitter:d,wait:h=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:M,theme:O,offset:E,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:N={},clickLock:P=!1,disableAutoHide:C=!1}=e,L=De(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css","clickLock","disableAutoHide"]);const j=n(t),R=tt(T,L),I=tc(o),D=Jl(o),{innerWidth:B,innerHeight:F,width:z,height:W,insetLeft:$,insetTop:G}=o.getOptions(),Y=ut(e=>{var n;if(P&&t.getAttribute(HF))return;const h=aF(t,e);if(!h)return;const p=iF(t),g=p.min[0],S=p.min[1],{selectedElements:_,selectedData:T,filteredSeriesData:C,abstractX:L}=fz({root:t,event:e,elements:j,coordinate:o,scale:a,startX:v,startY:m}),Y=ez(_,a,f,T,O);if(r&&Y.items.sort((t,e)=>r(t)-r(e)),i&&(Y.items=Y.items.filter(i)),0===_.length||cz(Y))return void H(e);if(y&&XF({root:t,data:Y,x:h[0]+g,y:h[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:M,css:N,offset:E}),s||l||c){const e=Ja(R,"crosshairs"),n=Object.assign(Object.assign({},e),Ja(R,"crosshairsX")),r=Object.assign(Object.assign({},e),Ja(R,"crosshairsY")),i=C.map(t=>t[1]);l&&nz(t,i,h,Object.assign(Object.assign({},n),{plotWidth:B,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:$,insetTop:G,startX:v,startY:m,transposed:D,polar:I})),c&&rz(t,i,Object.assign(Object.assign({},r),{plotWidth:B,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:$,insetTop:G,startX:v,startY:m,transposed:D,polar:I}))}if(A){const e=Ja(R,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(t=>t.remove());const{type:i=""}=n,a=e.filter(t=>{const[{x:e,y:n}]=t;return Za(e)&&Za(n)}).map(t=>{const[{color:e,element:a},o]=t,s=e||a.style.fill||a.style.stroke||r.color,l="hollow"===i?"transparent":s,c="hollow"===i?s:"#fff";return new Ug({className:`${JA}tooltip-marker`,style:Object.assign({cx:o[0],cy:o[1],fill:l,r:4,stroke:c,lineWidth:2,pointerEvents:"none"},n)})});for(const e of a)t.appendChild(e);t.markers=a}(t,{data:C,style:e,theme:O})}const V=null===(n=C[0])||void 0===n?void 0:n[0].x,q=null!=V?V:L(focus);d.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},Y),{data:{x:dT(a.x,q,!0)}})}))},h,{leading:p,trailing:g}),H=e=>{P&&t.getAttribute(HF)||C||UF({root:t,single:b,emitter:d,event:e})},V=()=>{KF({root:t,single:b})},q=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:l}=e,c=De(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=a.x.map(u),[d,h]=o.map([f,.5]),p=iF(t),g=p.min[0],v=p.min[1];Y(Object.assign(Object.assign({},c),{offsetX:void 0!==s?s:g+d,offsetY:void 0!==l?l:v+h,_x:u}))},X=()=>{UF({root:t,single:b,emitter:d,nativeEvent:!1})},U=()=>{et(),V()},K=e=>{aF(t,e)||H(e)},Z=()=>{J()},Q=e=>{P&&t.setAttribute(HF,!t.getAttribute(HF)),Y(e)},J=()=>{S||(t.addEventListener("pointerdown",Q),t.addEventListener("pointerenter",Y),t.addEventListener("pointermove",Y),t.addEventListener("pointerleave",K),t.addEventListener("pointerup",H))},et=()=>{S||(t.removeEventListener("pointerdown",Q),t.removeEventListener("pointerenter",Y),t.removeEventListener("pointermove",Y),t.removeEventListener("pointerleave",K),t.removeEventListener("pointerup",H))};return J(),d.on("tooltip:show",q),d.on("tooltip:hide",X),d.on("tooltip:disable",U),d.on("tooltip:enable",Z),()=>{et(),d.off("tooltip:show",q),d.off("tooltip:hide",X),d.off("tooltip:disable",U),d.off("tooltip:enable",Z),_?UF({root:t,single:b,emitter:d,nativeEvent:!1}):V()}}function hz(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:a,name:o,item:s=()=>({}),facet:l=!1}=t,c=De(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,o,u)=>{const{container:f,view:d}=t,{scale:h,markState:p,coordinate:g,theme:v}=d,m=sz(p,"seriesTooltip"),y=sz(p,"crosshairs"),b=rF(f),x=lz(a,m),w=lz(n,y);if(c.clickLock&&!l&&b.setAttribute(HF,!1),x&&function(t){return Array.from(t.values()).some(t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip})}(p)&&!l)return dz(b,Object.assign(Object.assign({},c),{theme:v,elements:tF,scale:h,coordinate:g,crosshairs:w,crosshairsX:lz(lz(r,n),!1),crosshairsY:lz(i,w),item:s,emitter:u}));if(x&&l){const e=o.filter(e=>e!==t&&e.options.parentKey===t.options.key),a=eF(t,o),l=e[0].view.scale,f=b.getBounds(),d=f.min[0],h=f.min[1];Object.assign(l,{facet:!0});const p=b.parentNode.parentNode;return c.clickLock&&p.setAttribute(HF,!1),dz(p,Object.assign(Object.assign({},c),{theme:v,elements:()=>a,scale:l,coordinate:g,crosshairs:lz(n,y),crosshairsX:lz(lz(r,n),!1),crosshairsY:lz(i,w),item:s,startX:d,startY:h,emitter:u}))}return function(t,{elements:e,coordinate:n,scale:r,render:i,groupName:a,sort:o,filter:s,emitter:l,wait:c=50,leading:u=!0,trailing:f=!1,groupKey:d=t=>t,single:h=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:w,shared:k=!1,body:M=!0,disableNative:O=!1,preserve:E=!1,css:S={},clickLock:A=!1,disableAutoHide:_=!1}){const T=e(t),N=rr(T,d),P=ut(e=>{if(A&&t.getAttribute(HF))return;const c=uz({root:t,event:e,elements:T,coordinate:n,scale:r,shared:k});if(!c)return void(_||UF({root:t,single:h,emitter:l,event:e}));const u=d(c),f=N.get(u);if(!f)return;const v=1!==f.length||k?ez(f,r,a,void 0,x):QF(f[0]);if(o&&v.items.sort((t,e)=>o(t)-o(e)),s&&(v.items=v.items.filter(s)),cz(v))return void(_||UF({root:t,single:h,emitter:l,event:e}));const{offsetX:O,offsetY:E}=e;M&&XF({root:t,data:v,x:O,y:E,render:i,event:e,single:h,position:p,enterable:g,mount:y,bounding:b,css:S,offset:w}),l.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Ya(c,m)})}))},c,{leading:u,trailing:f}),C=e=>{_||UF({root:t,single:h,emitter:l,event:e})},L=e=>{A&&t.setAttribute(HF,!t.getAttribute(HF)),P(e)},j=()=>{O||(t.addEventListener("pointerdown",L),t.addEventListener("pointermove",P),t.addEventListener("pointerleave",C),t.addEventListener("pointerup",C))},R=()=>{O||(t.removeEventListener("pointerdown",L),t.removeEventListener("pointermove",P),t.removeEventListener("pointerleave",C),t.removeEventListener("pointerup",C))},I=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:a}=i,o=MF(T,a,v);if(!o)return;const s=o.getBBox(),{x:l,y:c,width:u,height:f}=s,d=t.getBBox();P({target:o,offsetX:void 0!==n?n+d.x:l+u/2,offsetY:void 0!==r?r+d.y:c+f/2})},D=({nativeEvent:e}={})=>{e||UF({root:t,single:h,emitter:l,nativeEvent:!1})},B=()=>{R(),KF({root:t,single:h})},F=()=>{j()};return l.on("tooltip:show",I),l.on("tooltip:hide",D),l.on("tooltip:enable",F),l.on("tooltip:disable",B),j(),()=>{R(),l.off("tooltip:show",I),l.off("tooltip:hide",D),l.off("tooltip:enable",F),l.off("tooltip:disable",B),E?UF({root:t,single:h,emitter:l,nativeEvent:!1}):KF({root:t,single:h})}}(b,Object.assign(Object.assign({},c),{datum:cF(d),elements:tF,scale:h,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:d,theme:v,shared:e}))}}hz.props={reapplyWhenUpdate:!0};const pz="legend-category",gz="legend-html";function vz(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function mz(t){return t.getElementsByClassName("legend-category-item-label")[0]}function yz(t){return t.getElementsByClassName("legend-category-item-focus-group")[0]}function bz(t){return t.getElementsByClassName("items-item")}function xz(t){return t.getElementsByClassName(pz)}function wz(t){return t.getElementsByClassName(gz)}function kz(t){return t.getElementsByClassName("legend-continuous")}function Mz(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Oz(t,e){return Fe(this,arguments,void 0,function*(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){const{view:l,update:c,setState:u}=t;u(e,t=>{var c,u;const{marks:f}=t,d=null===(u=null===(c=e.attributes)||void 0===c?void 0:c.scales)||void 0===u?void 0:u.find(t=>t.name===n),h=f.map(e=>{var c,u;if((null!==(c=e.scale[n].key)&&void 0!==c?c:n)!==(null!==(u=null==d?void 0:d.key)&&void 0!==u?u:null==d?void 0:d.name))return e;if("legends"===e.type)return e;if(n_.includes(e.type))return e;const{transform:f=[],data:h=[]}=e,p=f.findIndex(({type:t})=>t.startsWith("group")||t.startsWith("bin")),g=[...f];h.length&&g.splice(p+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const v=Object.fromEntries(a.map(e=>{const n=function(t,e,n){var r;const i=Object.keys(t).find(r=>{if(r.startsWith(n)){const i=t[r].getOptions();return i.name===n&&i.markKey===e}});return null!==(r=t[i])&&void 0!==r?r:t[n]}(l.scale,t.key,e);return[e,{domain:n.getOptions().domain}]}));return tt({},e,Object.assign(Object.assign({transform:g,scale:v},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(o.map(t=>[t,{preserve:!0}]))}))});return Object.assign(Object.assign({},t),{marks:h})}),yield c()})}function Ez(t,e){for(const n of t)Oz(n,Object.assign(Object.assign({},e),{facet:!0}))}function Sz(){return(t,e,n)=>{const{container:r}=t,i=e.filter(e=>e!==t),a=i.length>0,o=t=>Mz(t).scales.map(t=>t.name),s=[...xz(r),...wz(r),...kz(r)],l=s.flatMap(o),c=ut(a?Ez:Oz,50,{trailing:!0}),u=s.map(e=>{const{name:s,domain:u}=Mz(e).scales[0],f={legend:e,channel:s,channels:o(e),allChannels:l};return e.className===pz?function(t,{legends:e,marker:n,label:r,datum:i,filter:a,defaultSelect:o,emitter:s,channel:l,state:c={}}){const u=new Map,f=new Map,d=new Map,h=new Map,{unselected:p={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,g={unselected:Ja(p,"marker")},v={unselected:Ja(p,"label")},{setState:m,removeState:y}=pF(g,void 0),{setState:b,removeState:x}=pF(v,void 0),w=Array.from(e(t));let k=w.map(i);const M=()=>{for(const t of w){const e=i(t),a=n(t),o=r(t);k.includes(e)?(y(a,"unselected"),x(o,"unselected")):(m(a,"unselected"),b(o,"unselected"))}};for(const e of w){const n=()=>{wF(t,"pointer")},r=()=>{kF(t)},o=t=>Fe(this,void 0,void 0,function*(){const n=i(e),r=k.indexOf(n);-1===r?k.push(n):k.splice(r,1),yield a(k),M();const{nativeEvent:o=!0}=t;o&&(k.length===w.length?s.emit("legend:reset",{nativeEvent:o}):s.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:o,data:{channel:l,values:k}})))});e.addEventListener("click",o),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),u.set(e,o),f.set(e,n),d.set(e,r);const c=yz(e);if(c){const t=t=>Fe(this,void 0,void 0,function*(){t.stopPropagation();const n=i(e),r=k.indexOf(n),{nativeEvent:o=!0}=t;if(-1!==r&&1===k.length){if(!o)return;k=w.map(i),yield a(k),M(),s.emit("legend:reset",{nativeEvent:o})}else{if(k=[n],yield a(k),M(),!o)return;s.emit("legend:focus",Object.assign(Object.assign({},t),{nativeEvent:o,data:{channel:l,value:n}}))}});c.addEventListener("click",t),h.set(e,t)}}const O=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,value:i}=n;r===l&&(k=[i],yield a(k),M())}),E=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===l&&(k=i,yield a(k),M())}),S=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;e||(k=w.map(i),yield a(k),M())});return s.on("legend:filter",E),s.on("legend:focus",O),s.on("legend:reset",S),o&&s.emit("legend:filter",{data:{channel:l,values:o}}),()=>{for(const t of w){t.removeEventListener("click",u.get(t)),t.removeEventListener("pointerenter",f.get(t)),t.removeEventListener("pointerout",d.get(t));const e=yz(t);e&&e.removeEventListener("click",h.get(t))}s.off("legend:focus",O),s.off("legend:filter",E),s.off("legend:reset",S)}}(e,{legends:bz,marker:vz,label:mz,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});c(a?i:t,n)},state:e.attributes.state,defaultSelect:e.attributes.defaultSelect,channel:s,emitter:n}):e.className===gz?function(t,{domain:e,filter:n,defaultSelect:r,emitter:i,channel:a}){const o=new Map,s=new Map,l=new Map;let c=[...e];const u=()=>{var e;const n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;return n&&n.getContextService().getDomElement().parentElement||document.body},f=()=>{u().querySelectorAll("[legend-value]").forEach(t=>{const n=t.getAttribute("legend-value");if(!n)return;if(!e.includes(n))return;const r=t;c.includes(n)?(r.style.opacity="1",r.classList.remove("legend-item-inactive")):(r.style.opacity="0.4",r.classList.add("legend-item-inactive"))})};(()=>{const t=u().querySelector(".legend-html"),r=r=>Fe(this,void 0,void 0,function*(){let o=r.target;for(;o&&!o.hasAttribute("legend-value")&&(o=o.parentElement,o!==t););if(!o||!o.hasAttribute("legend-value"))return;r.preventDefault(),r.stopPropagation();const s=o.getAttribute("legend-value");if(!s)return;const l=c.indexOf(s);-1===l?c.push(s):c.splice(l,1),yield n(c),f(),c.length===e.length?i.emit("legend:reset",{nativeEvent:!0}):i.emit("legend:filter",{nativeEvent:!0,data:{channel:a,values:c}})});t.addEventListener("click",r),o.set(t,r)})();const d=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:r}=t,{channel:i,value:o}=r;i===a&&(c=[o],yield n(c),f())}),h=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:r}=t,{channel:i,values:o}=r;i===a&&(c=o,yield n(c),f())}),p=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:r}=t;r||(c=[...e],yield n(c),f())});return i.on("legend:filter",h),i.on("legend:focus",d),i.on("legend:reset",p),r&&i.emit("legend:filter",{data:{channel:a,values:r}}),()=>{u().querySelectorAll("[legend-value]").forEach(t=>{const n=t.getAttribute("legend-value");if(!n)return;if(!e.includes(n))return;const r=o.get(t),i=s.get(t),a=l.get(t);r&&t.removeEventListener("click",r),i&&t.removeEventListener("pointerenter",i),a&&t.removeEventListener("pointerout",a)}),o.clear(),s.clear(),l.clear(),i.off("legend:filter",h),i.off("legend:focus",d),i.off("legend:reset",p)}}(r,{domain:u,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});c(a?i:t,n)},defaultSelect:e.attributes.defaultSelect,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const{attributes:a}=e,o=t=>{const{value:e}=t.detail,o=e.map(t=>{var e,n;const r=null===(e=a.data)||void 0===e?void 0:e.find(e=>e.value===t);return r&&null!==(n=r.domainValue)&&void 0!==n?n:t});n(o),r.emit({nativeEvent:!0,data:{channel:i,values:o}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});c(a?i:t,n)},emitter:n,channel:s})});return()=>{u.forEach(t=>t())}}}function Az(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=xz(r),s=tF(r),l=t=>Mz(t).scales[0].name,c=t=>{const{scale:{[t]:e}}=i;return e},u=vF(a,["active","inactive"]),f=mF(s,cF(i)),d=[];for(const t of o){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=l(t),i=bz(t),a=c(r),o=rr(s,t=>a.invert(t.__data__[r])),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:g,removeState:v}=pF(u,f),m={inactive:Ja(p,"marker")},y={inactive:Ja(p,"label")},{setState:b,removeState:x}=pF(m),{setState:w,removeState:k}=pF(y),M=t=>{for(const e of i){const n=vz(e),r=mz(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},O=(t,i)=>{const a=e(i),l=new Set(o.get(a));for(const t of s)l.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:c=!0}=t;c&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:r,value:a}}))},E=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),E.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:a}=t;if(n)return;const{channel:o,value:s}=a;if(o!==r)return;const l=i.find(t=>e(t)===s);l&&O({nativeEvent:!1},l)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of E)t.removeEventListener(e)};d.push(T)}return()=>d.forEach(t=>t())}}function _z(t,e){const[n,r,i,a]=t,[o,s,l,c]=e;return!(o>i||l<n||s>a||c<r)}function Tz(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function Nz(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const Pz=qm(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:l=10,document:c}=e,u=De(e,["x","y","width","height","class","renders","handleSize","document"]);if(!c||void 0===i||void 0===a||void 0===n||void 0===r)return;const f=l/2,d=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},h=Ja(eo(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,g=De(h,["render"]),v=Ja(u,"handleE"),{render:m=d}=v,y=De(v,["render"]),b=Ja(eo(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=De(b,["render"]),k=Ja(u,"handleW"),{render:M=d}=k,O=De(k,["render"]),E=Ja(u,"handleNW"),{render:S=d}=E,A=De(E,["render"]),_=Ja(u,"handleNE"),{render:T=d}=_,N=De(_,["render"]),P=Ja(u,"handleSE"),{render:C=d}=P,L=De(P,["render"]),j=Ja(u,"handleSW"),{render:R=d}=j,I=De(j,["render"]),D=t=>()=>{const e=qm(e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,c);r.id=n,r.style.draggable=!0})(e,t));return new e({})},B=Am(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(Nz,Object.assign(Object.assign({width:i,height:a},eo(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-l).style("height",l).style("fill","transparent").call(Nz,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",l).style("height",a-l).style("fill","transparent").call(Nz,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",a-f).style("width",i-l).style("height",l).style("fill","transparent").call(Nz,w),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",l).style("height",a-l).style("fill","transparent").call(Nz,O),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(Nz,A),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(Nz,N),B.maybeAppend("handle-se",D(C)).style("x",i-f).style("y",a-f).style("width",l).style("height",l).style("fill","transparent").call(Nz,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",a-f).style("width",l).style("height",l).style("fill","transparent").call(Nz,I)});function Cz(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=Tz(t),brushRegion:l=(t,e,n,r,i)=>[t,e,n,r],reverse:c=!1,fill:u="#777",fillOpacity:f="0.3",stroke:d="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=De(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[w,k,M,O]=s;wF(t,"crosshair"),t.style.draggable=!0;const E=(t,e,n)=>{if(a(n),y&&y.remove(),b&&b.remove(),g=[t,e],c)return S();A()},S=()=>{b=new ov({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),y=new Pz({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},A=()=>{y=new Pz({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:d,draggable:!0}),className:"mask"}),t.appendChild(y)},_=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,a,o,u]=function(t,e,n,r,i){const[a,o,s,l]=i;return[Math.max(a,Math.min(t,n)),Math.max(o,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(l,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,d,h,p]=l(i,a,o,u,s);return c?P(f,d,h,p):N(f,d,h,p),n(f,d,h,p,r),[f,d,h,p]},N=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},P=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${M},${k}L${M},${O}L${w},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==h.indexOf(e)&&new Set(Object.keys(C)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=oF(t,e);if(!y||!L(n))return E(r,i,e),void(x=!0);L(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=oF(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],w,M),a=e(r,g[1],v[1],k,O),o=[g[0]+i,g[1]+a],s=[v[0]+i,v[1]+a];T(o,s)})(r);const[i,a]=[r[0]-m[0],r[1]-m[1]],{id:o}=n;if(C[o]){const[t,e,n,r]=C[o].vector;return T([g[0]+i*t,g[1]+a*e],[v[0]+i*n,v[1]+a*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void o(t,n,t+r,n+i,e)}v=oF(t,e);const[n,r,a,s]=T(g,v);x=!1,i(n,r,a,s,e)},F=t=>{const{target:e}=t;y&&!L(e)&&_()},z=e=>{const{target:n}=e;y&&L(n)&&!x?R(n)?wF(t,"move"):j(n)&&wF(t,C[n.id].cursor):wF(t,"crosshair")},W=()=>{wF(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",W),{mask:y,move(t,e,n,r,i=!0){y||E(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&_(t)},destroy(){y&&_(!1),wF(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",W)}}}function Lz(t,e,n){return e.filter(e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find(t=>t.brushKey===n)})}function jz(t,e,n){return Lz(t,e,n).map(t=>t.options)}function Rz(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:f=!1,key:d=t=>t,bboxOf:h=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=De(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=mF(m,a),w=Ja(v,"mask"),{setState:k,removeState:M}=pF(p,x),O=new Map,{width:E,height:S,x:A=0,y:_=0}=h(t),T=s||[0,0,E,S],N=()=>{for(const t of[...m,...b])M(t,"active","inactive")},P=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const a=new Set;for(const i of m){const{min:o,max:s}=i.getLocalBounds(),[l,c]=o,[u,f]=s;_z([l,c,u,f],[t,e,n,r])?(k(i,"active"),a.add(d(i))):k(i,"inactive")}for(const t of b)a.has(d(t))?k(t,"active"):k(t,"inactive")},C=()=>{for(const t of m)M(t,"inactive");for(const t of O.values())t.remove();O.clear()},L=(e,n,r,i)=>{const a=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e},o=new fv({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(o);for(const t of m){const e=O.get(t)||a(t);e.style.clipPath=o,k(t,"inactive"),k(e,"active")}},j=Cz(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{const e=f?C:N;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const a=pT(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}});(f?L:P)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const a=pT(t,e,n,r,c,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushupdated:(t,e,n,r,i)=>{const a=pT(t,e,n,r,c,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,a,o]=function(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=gT(a,r),l=gT(o,i),c=[s[0],l[0]],u=[s[1],l[1]],[f,d]=n.map(c),[h,p]=n.map(u);return[f,d,h,p]}(n,c,u);j.move(r,i,a,o,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function Iz(t){var{facet:e,brushKey:n}=t,r=De(t,["facet","brushKey"]);return(t,i,a)=>{const{container:o,view:s,options:l}=t,c=rF(o),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:d,coordinate:h}=s;if(e){const e=c.getBounds(),n=e.min[0],o=e.min[1],s=e.max[0],l=e.max[1];return Rz(c.parentNode.parentNode,Object.assign(Object.assign({elements:()=>eF(t,i),datum:cF(nF(t,i).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,o,s,l],state:vF(nF(t,i).map(t=>t.options),f),emitter:a,scale:d,coordinate:h,selectedHandles:void 0},u),r))}const p=Rz(c,Object.assign(Object.assign({elements:tF,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return Lz(t,e,n).map(t=>rF(t.container))}(t,i,n),datum:cF([s,...Lz(t,i,n).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:vF([l,...jz(t,i,n)],f),emitter:a,scale:d,coordinate:h,selectedHandles:void 0},u),r));return c.brush=p,()=>p.destroy()}}function Dz(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function Bz(t){return Iz(Object.assign(Object.assign({},t),{brushRegion:Dz,selectedHandles:["handle-e","handle-w"]}))}function Fz(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function zz(t){return Iz(Object.assign(Object.assign({},t),{brushRegion:Fz,selectedHandles:["handle-n","handle-s"]}))}Iz.props={reapplyWhenUpdate:!0};const Wz="axis-hot-area";function $z(t){return t.getElementsByClassName("axis")}function Gz(t){return t.getElementsByClassName("axis-line")[0]}function Yz(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function Hz(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=De(e,["cross","offsetX","offsetY"]);const o=Yz(t),s=Gz(t),[l]=s.getLocalBounds().min,[c,u]=o.min,[f,d]=o.max,h=2*(f-c);return{brushRegion:Fz,hotZone:new fv({className:Wz,style:Object.assign({width:n?h/2:h,transform:`translate(${(n?c:l-h/2).toFixed(2)}, ${u})`,height:d-u},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(c-r),e,Math.ceil(f-r),i]}}function Vz(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=De(e,["offsetY","offsetX","cross"]);const o=Yz(t),s=Gz(t),[,l]=s.getLocalBounds().min,[c,u]=o.min,[f,d]=o.max,h=d-u;return{brushRegion:Dz,hotZone:new fv({className:Wz,style:Object.assign({width:f-c,height:i?h:2*h,transform:`translate(${c}, ${i?u:l-h})`},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(d-n)]}}function qz(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=rF(i),{x:l,y:c}=s.getBBox(),{coordinate:u}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:l,reverse:c=!1,state:u={},emitter:f,coordinate:d}=e,h=De(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=mF(p,o),{setState:m,removeState:y}=pF(u,v),b=new Map,x=Ja(h,"mask"),w=t=>Array.from(b.values()).every(([e,n,r,i])=>t.some(([t,a])=>t>=e&&t<=r&&a>=n&&a<=i)),k=g.map(t=>t.attributes.scale),M=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,E=()=>{O.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();O.set(t,M(n))}};E();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}O.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)y(t,"active","inactive");E(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return M(hT(n,i))},T=g.some(a)&&g.some(t=>!a(t)),N=[];for(let t=0;t<g.length;t++){const e=g[t],n=a(e)?Vz:Hz,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:s,offsetX:l,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=Cz(r,Object.assign(Object.assign({},x),{reverse:c,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),S(t,s)}}));N.push(u)}const P=(t={})=>{const{nativeEvent:e}=t;e||N.forEach(t=>t.remove(!1))},C=(t,e,n)=>{const[r,i]=t,o=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=d.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<N.length;t++){const e=n[t],r=N[t],i=g[t];if(e){const n=k[t];r.move(...C(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",P),f.on("brushAxis:highlight",j),()=>{N.forEach(t=>t.destroy()),f.off("brushAxis:remove",P),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:tF,axes:$z,offsetY:c,offsetX:l,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:cF(a),state:vF(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function Xz(t){var{hideX:e=!0,hideY:n=!0}=t,r=De(t,["hideX","hideY"]);return(t,i,a)=>{const{container:o,view:s,options:l,update:c,setState:u}=t,f=rF(o);let d=!1,h=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:o,emitter:s,scale:l,coordinate:c,selection:u,series:f=!1}=e;const d=Ja(De(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:h,height:p}=t.getBBox(),g=a||[0,0,h,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=Cz(t,Object.assign(Object.assign({},d),{extent:g,brushRegion:i,reverse:o,brushcreated:function(t,e,r,i,a){t===r&&e===i||(a.nativeEvent=!0,n(u(t,e,r,i),a),m.remove())}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:a}=p;return pT(t,e,n,r,i,a)},filter:(t,r)=>Fe(this,void 0,void 0,function*(){if(h)return;h=!0;const[i,o]=t;u("brushFilter",t=>{const{marks:r}=t,a=r.map(t=>tt({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}}));return Object.assign(Object.assign({},l),{marks:a,clip:!0})}),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield c();p=s.view,h=!1,d=!0}),reset:t=>{if(h||!d)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),d=!1,p=s,u("brushFilter"),c()},extent:void 0,emitter:a,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function Uz(t){return Xz(Object.assign(Object.assign({hideX:!0},t),{brushRegion:Dz}))}function Kz(t){return Xz(Object.assign(Object.assign({hideY:!0},t),{brushRegion:Fz}))}function Zz(t,e,n){const r=t?n:e,i=t?e:n,a=fT(r),o=fT(i),s=i.getOptions().domain;return{currentScale:r,targetScale:i,isSourceDiscrete:a,isTargetDiscrete:o,shouldPreserveZeroBaseline:!o&&s&&s.length>=2&&0===s[0]}}function Qz({isTargetDiscrete:t,filteredValues:e,shouldPreserveZeroBaseline:n}){if(t)return r=e,Array.from(new Set(r)).sort((t,e)=>t-e);{const t=Math.min(...e),r=Math.max(...e);return n?[0,r]:[t,r]}var r}function Jz(t){return t instanceof Date?t.getTime():"string"==typeof t?parseFloat(t):Number(t)}function tW(t,e,n,r,i,a="filter",o=!1){if(PF(a))return[];const s=o?"y":"x",l=o?"x":"y",c=[];for(const r of t){const{channelData:t}=r,i=t[s]||[],o=t[l]||[],u=Array.isArray(i[0])?i[0]:i,f=Array.isArray(o[0]);if(0===u.length)continue;const d=u.length;for(let t=0;t<d;t++){const r=u[t];let i=!1;if(n)i=e.includes(r);else if(e.length>=2){const t=Jz(r),n=Jz(e[0]),a=Jz(e[e.length-1]);isNaN(t)||isNaN(n)||isNaN(a)||(i=t>=n&&t<=a)}if("filter"===a&&i)if(f){const e=o.length;for(let n=0;n<e;n++){const e=o[n];if(Array.isArray(e)&&t<e.length){const n=Jz(e[t]);isNaN(n)||c.push(n)}}}else if(t<o.length){const e=Jz(o[t]);isNaN(e)||c.push(e)}}}return c.length>0?Qz({isTargetDiscrete:r,filteredValues:c,shouldPreserveZeroBaseline:i}):[]}function eW(t,e,n,r){r&&e instanceof Map?e.forEach((e,n)=>{e&&Array.isArray(e)&&e.length>0&&(t[n]=e)}):!r&&Array.isArray(e)&&e.length>0&&(t[n?"x":"y"]=e)}const nW="slider";function rW(t){var e,n,r,i;if(!(null==t?void 0:t.markState))return 0;let a=0;for(const[o,s]of t.markState.entries()){if("point"!==o.type||!(null==s?void 0:s.channels))continue;const t=null===(e=s.channels)||void 0===e?void 0:e.find(t=>"size"===t.name);if(t){if((null===(r=null===(n=t.scale)||void 0===n?void 0:n.range)||void 0===r?void 0:r.length)>0){const e=Math.max(...t.scale.range.filter(t=>"number"==typeof t));a=Math.max(a,e);continue}if((null===(i=t.values)||void 0===i?void 0:i.length)>0){const e=t.values.filter(t=>void 0!==t.value).flatMap(t=>Array.isArray(t.value)?t.value:[t.value]).filter(t=>"number"==typeof t&&!isNaN(t));e.length>0&&(a=Math.max(a,...e))}}}return a}function iW(t,e,n,r,i,a,o){if(o){const s=a?r:i.x,l=a?i.y:r;t.emit(e,Object.assign(Object.assign({},n),{nativeEvent:o,data:{selection:[sW(s),sW(l)]}}))}}function aW(t,e,n,r){const{domain0:i,filteredDomain:a,channel0:o,channel1:s,prefix:l,hasState:c,isMultiAxis:u,markToScaleMap:f,enableAdaptiveFiltering:d}=r;u&&a instanceof Map?t(e,t=>Object.assign({},function(t,e,n,r,i=!1,a="x",o="y",s=new Map,l=new Map){const{marks:c}=t,u=rW(e),f=c.map(t=>{var e,c;const u="string"==typeof(null==t?void 0:t.key)?t.key:String((null==t?void 0:t.key)||""),f=s.get(u),d=l.get(f),h=d&&{y:Object.assign({domain:d,nice:!0},"y"!==f?{independent:!0}:void 0)};return tt({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:Object.assign(Object.assign({},n),h),[r]:Object.assign(Object.assign({},(null===(e=t[r])||void 0===e?void 0:e[a])&&{[a]:Object.assign({preserve:!0},i&&{ratio:null})}),(null===(c=t[r])||void 0===c?void 0:c[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:f,insetLeft:u,insetRight:u,insetTop:u,insetBottom:u,clip:!0,animate:!1})}(t,n,{[o]:{domain:i,nice:!1}},l,c,o,s,f||new Map,a))):t(e,t=>Object.assign({},function(t,e,n,r,i=!1,a="x",o="y"){const{marks:s}=t,l=rW(e),c=s.map(t=>{var e,s;return tt({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:n,[r]:Object.assign(Object.assign({},(null===(e=t[r])||void 0===e?void 0:e[a])&&{[a]:Object.assign({preserve:!0},i&&{ratio:null})}),(null===(s=t[r])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:c,insetLeft:l,insetRight:l,insetTop:l,insetBottom:l,clip:!0,animate:!1})}(t,n,Object.assign({[o]:{domain:i,nice:!1}},d&&Array.isArray(a)?{[s]:{domain:a,nice:!0}}:{}),l,c,o,s)))}function oW(t,e,n){const[r,i]=t,a=n?t=>1-t:t=>t;return hT(e,[dT(e,a(r),!0),dT(e,a(i),!1)])}function sW(t){return[t[0],t[t.length-1]]}function lW({initDomain:t={},className:e=nW,prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,adaptiveMode:l="filter",getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(u,f,d)=>{const{container:h,view:p,update:g,setState:v}=u,m=h.getElementsByClassName(e);if(!m.length)return()=>{};const{scale:y,coordinate:b}=p,{x:x,y:w}=y,k=Jl(b),M=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return k?[n,e]:[e,n]},O=new Map,E=new Set,S=LF(p),A=function(t,e,n,r,i){var a,o,s,l;const c={x:e.x||n.getOptions().domain||[],y:e.y||r.getOptions().domain||[]},u=i||LF(t),{hasIndependentX:f,hasIndependentY:d}=u;if(f||d){let e=1,n=1;for(const[r,i]of t.markState.entries())if(null==i?void 0:i.channels){if(f){const t=i.channels.find(t=>"x"===t.name);(null===(o=null===(a=null==r?void 0:r.scale)||void 0===a?void 0:a.x)||void 0===o?void 0:o.independent)&&(c[`x${e}`]=t.scale.domain,e++)}if(d){const t=i.channels.find(t=>"y"===t.name);(null===(l=null===(s=null==r?void 0:r.scale)||void 0===s?void 0:s.y)||void 0===l?void 0:l.independent)&&(c[`y${n}`]=t.scale.domain,n++)}}}return c}(p,t,x,w,S),_=Array.from(m),T=t=>_.some(e=>{const{orientation:n}=e.attributes,[r]=M(n);return r===t}),N=T("x")&&!T("y"),P=T("y")&&!T("x"),C=!PF(l)&&(N||P);for(const t of m){const{orientation:e}=t.attributes,[u,f]=M(e),h=`${n}${G(u)}:filter`,m="x"===u,{ratio:b}=x.getOptions(),{ratio:_}=w.getOptions(),T=t=>{if(t.data){const{selection:e}=t.data,[n=sW(A.x),r=sW(A.y)]=e;return m?[hT(x,n,b),hT(w,r,_)]:[hT(w,r,_),hT(x,n,b)]}const{value:n}=t.detail;return[oW(n,y[u],k&&"horizontal"===e),A[f]]};let L=!1;const j=fW({getFiltering:()=>L,setFiltering:t=>{L=t},domainsOf:T,view:p,independentScaleInfo:S,enableAdaptiveFiltering:C,hasOnlyXSlider:N,hasOnlyYSlider:P,adaptiveMode:l,scaleX:x,scaleY:w,scale:y,channelDomain:A,channel0:u,channel1:f,isX:m,emitter:d,eventName:h,setState:v,slider:t,prefix:n,hasState:i,update:g,wait:a,leading:o,trailing:s}),R=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:a}=i,[o,s]=a;t.dispatchEvent(new Up("valuechange",{data:i,nativeEvent:!1}));const l=m?vT(o,x):vT(s,w);r(t,l)};d.on(h,R),t.addEventListener("valuechange",j),O.set(t,j),E.add([h,R]);const I=c(t);I&&t.dispatchEvent(new Up("valuechange",{detail:{value:I},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of O)t.removeEventListener("valuechange",e);for(const[t,e]of E)d.off(t,e)}}}function cW({view:t,domain0:e,shouldFilterXAxis:n,enableAdaptiveFiltering:r,markDataPairs:i,adaptiveMode:a,scaleX:o,scaleY:s,scale:l,channelDomain:c,independentScaleInfo:u,channel0:f}){const d=new Map,h=new Map;if(!r||0===i.length||!(null==e?void 0:e.length))return{filteredDomain:d,markToScaleMap:h};const p=at(t,"options.slider");if(Object.keys(p).length>0&&Object.prototype.hasOwnProperty.call(p,f)){const t=function(t,e,n,r,i){const a=t?r:n,o=t=>{const e={};return Object.keys(i).forEach(n=>{(n===t||n.match(new RegExp(`^${t}\\d+$`)))&&(e[n]=i[n])}),e},s=o(t?"x":"y"),l=Object.keys(s),c=l.map(t=>e[t]),u=fT(a),f=c.map(t=>fT(t)),d=c.map((t,e)=>{const n=t.getOptions().domain;return!f[e]&&n&&n.length>=2&&0===n[0]});return{currentScale:a,targetScales:c,isSourceDiscrete:u,isTargetDiscrete:f,shouldPreserveZeroBaseline:d,targetScaleKeys:l}}(n,l,o,s,c);(n?u.markToXScaleMap:u.markToYScaleMap).forEach((t,e)=>{h.set(e,t)});const r=function({markDataPairs:t,domain:e,scaleInfo:n,markToScaleMap:r,adaptiveMode:i,shouldFilterXAxis:a=!1}){const o=new Map,{isSourceDiscrete:s,isTargetDiscrete:l,shouldPreserveZeroBaseline:c,targetScaleKeys:u}=n;return t.forEach(t=>{const n=r.get(t.markKey);if(!n)return;const f=u.indexOf(n);if(-1===f)return;const d=l[f],h=c[f],p=tW([t],e,s,d,h,i,a);o.set(n,p)}),o}({markDataPairs:i,domain:e,scaleInfo:t,markToScaleMap:h,adaptiveMode:a,isViewSlider:!0,shouldFilterXAxis:n});return eW(c,r,n,!0),{filteredDomain:r,markToScaleMap:h}}{const r=function(t,e){for(const[n]of t.markState.entries()){const t=at(n,"slider");if(Object.keys(t||{}).length>0&&Object.prototype.hasOwnProperty.call(t,e))return String(n.key||"")}return null}(t,f);if(r){const t=Zz(n,o,s),l=n?u.markToXScaleMap:u.markToYScaleMap,c=l.get(r)||"";if(c){h.set(r,c);const o=function(t,e,n,r,i,a,o=!1,s){const l=new Map;if(0===t.length||0===e.length)return l;const{isSourceDiscrete:c,isTargetDiscrete:u,shouldPreserveZeroBaseline:f}=n,d=s?t.filter(t=>s.get(t.markKey)===i):t.filter(t=>t.markKey===r);if(0===d.length)return l;const h=tW(d,e,c,u,f,a,o);return l.set(i,h),l}(i,e,t,r,c,a,n,l);return{filteredDomain:o,markToScaleMap:h}}}}return{filteredDomain:d,markToScaleMap:h}}function uW({domain0:t,domain1:e,shouldFilterXAxis:n,enableAdaptiveFiltering:r,markDataPairs:i,adaptiveMode:a,scaleX:o,scaleY:s,channelDomain:l,hasOnlyXSlider:c,hasOnlyYSlider:u,isX:f}){let d=e;if(r&&i.length>0&&(c&&f||u&&!f)&&(null==t?void 0:t.length)>0){d=function({markDataPairs:t,domain:e,scaleInfo:n,adaptiveMode:r,shouldFilterXAxis:i=!1}){const{isSourceDiscrete:a,isTargetDiscrete:o,shouldPreserveZeroBaseline:s}=n;return tW(t,e,a,o,s,r,i)}({markDataPairs:i,domain:t,scaleInfo:Zz(n,o,s),adaptiveMode:a,shouldFilterXAxis:n}),eW(l,d,n,!1)}return d}function fW({getFiltering:t,setFiltering:e,domainsOf:n,view:r,independentScaleInfo:i,enableAdaptiveFiltering:a,hasOnlyXSlider:o,hasOnlyYSlider:s,adaptiveMode:l,scaleX:c,scaleY:u,scale:f,channelDomain:d,channel0:h,channel1:p,isX:g,emitter:v,eventName:m,setState:y,slider:b,prefix:x,hasState:w,update:k,wait:M,leading:O,trailing:E}){return ut(M=>Fe(this,void 0,void 0,function*(){const{initValue:O=!1}=M;if(t()&&!O)return;e(!0);const{nativeEvent:E=!0}=M,{markDataPairs:S}=function(t){var e,n;const r=[],i=[],a=[],o=t.markState;if(o)for(const[t,s]of o.entries())if(null==s?void 0:s.channels){const o={};for(const t of s.channels)if("x"===(null==t?void 0:t.name)&&(null===(e=t.values)||void 0===e?void 0:e.length)>0){let e=[];for(const n of t.values)(null==n?void 0:n.value)&&(e=e.concat(n.value),r.push(n.value));o.x=e}else if(t&&("y"===t.name||t.name.startsWith("y"))&&(null===(n=t.values)||void 0===n?void 0:n.length)>0){const e=t.name,n=[];for(const r of t.values)if(null==r?void 0:r.value){const t=r.value;n.push(t),"y"!==e&&"y1"!==e||(Array.isArray(t)?i.push(t.flat()):i.push([t]))}o[e]=n}const l=o.x||[],c=o.y||[];l.length>0&&c.length>0&&a.push({markKey:t.key||`mark_${a.length}`,channelData:o})}return{xChannelValues:r.flat(),yChannelValues:i.flat(),markDataPairs:a}}(r);if(i[`hasIndependent${p.toUpperCase()}`]){const[t]=n(M),e=s&&!g,{filteredDomain:k,markToScaleMap:O}=cW({view:r,domain0:t,shouldFilterXAxis:e,enableAdaptiveFiltering:a&&(o&&g||s&&!g),markDataPairs:S,adaptiveMode:l,scaleX:c,scaleY:u,scale:f,channelDomain:d,independentScaleInfo:i,channel0:h});d[h]=t,iW(v,m,M,t,d,g,E),aW(y,b,r,{domain0:t,filteredDomain:k,channel0:h,channel1:p,prefix:x,hasState:w,isMultiAxis:!0,markToScaleMap:O,enableAdaptiveFiltering:a})}else{const[t,e]=n(M),i=uW({domain0:t,domain1:e,shouldFilterXAxis:s&&!g,enableAdaptiveFiltering:a,markDataPairs:S,adaptiveMode:l,scaleX:c,scaleY:u,channelDomain:d,hasOnlyXSlider:o,hasOnlyYSlider:s,isX:g});d[h]=t,iW(v,m,M,t,d,g,E),aW(y,b,r,{domain0:t,filteredDomain:i,channel0:h,channel1:p,prefix:x,hasState:w,isMultiAxis:!1,markToScaleMap:void 0,enableAdaptiveFiltering:a})}yield k(),e(!1)}),M,{leading:O,trailing:E})}function dW({className:t=nW,setValue:e=(t,e)=>t.setValues(e),minRange:n=.01,wheelSensitivity:r=.05,x:i=!0,y:a=!0}={}){return o=>{const{container:s,view:l}=o,{coordinate:c}=l,u=Jl(c),f=function(t){var e;try{const n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n||"function"!=typeof n.getContextService)return null;const r=n.getContextService().getDomElement();return r instanceof HTMLElement?r:null}catch(t){return null}}(s),d=Math.max(1e-6,Math.min(1,n)),h=s.getElementsByClassName(t);if(!h.length)return()=>{};const p=(t,e)=>!0===t||!1!==t&&("shift"===t?e.shiftKey&&!e.ctrlKey&&!e.altKey:"ctrl"===t?e.ctrlKey&&!e.shiftKey&&!e.altKey:"alt"===t&&(e.altKey&&!e.shiftKey&&!e.ctrlKey)),g=(t,n)=>{e(t,n),t.dispatchEvent(new Up("valuechange",{detail:{value:n},nativeEvent:!0}))},v=(t,e,n,r,i)=>{const a=(t-e)/n,o=Math.max(0,Math.min(1,a));return Math.max(r,Math.min(i,o))},m=t=>{if(!f)return;const e=t.target;if(!f.contains(e))return;const n=f.getBoundingClientRect(),o=t.clientX-n.left,s=t.clientY-n.top,l=[];for(const e of h){const{values:n,orientation:r}=e.attributes;if(!n)continue;const o="horizontal"===r;p("x"===(u?o?"y":"x":o?"x":"y")?i:a,t)&&l.push(e)}if(0!==l.length){t.preventDefault(),t.stopPropagation();for(const e of l){const{values:n,orientation:i,x:a,y:l,trackLength:c}=e.attributes,[u,f]=n,h=f-u,p="horizontal"===i?v(o,a,c,u,f):v(s,l,c,u,f),m=r*NF(h),y=1+t.deltaY*m,b=Math.max(d,Math.min(1,h*y));let x=p-b*((p-u)/h),w=p+b*((f-p)/h);x<0?(x=0,w=Math.min(1,b)):w>1&&(w=1,x=Math.max(0,1-b)),g(e,[x,w])}}};return f&&f.addEventListener("wheel",m,{passive:!1,capture:!0}),()=>{f&&f.removeEventListener("wheel",m,{capture:!0})}}}dW.props={reapplyWhenUpdate:!0};const hW=`${JA}scrollbar`;function pW(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(hW).length)return()=>{};const{scale:o}=i,{x:s,y:l}=o,c={x:[...s.getOptions().domain],y:[...l.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),l.update({domain:l.getOptions().expectedDomain});return lW(Object.assign({initDomain:c,className:hW,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0]||1!==e[1])return e}},t))(e,n,r)}}function gW(t,e,n){return`<${t} style="${Object.entries(n).map(([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`).join(";")}">${e}</${t}>`}const vW={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function mW(t){return"text"===t.nodeName&&!!t.isOverflowing()}function yW(t){var{offsetX:e=8,offsetY:n=8}=t,r=De(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[a,o]=i.getBounds().min,s=Ja(r,"tip"),l=new Set,c=t=>{const{target:r}=t;if(!mW(r))return void t.stopPropagation();const{offsetX:c,offsetY:u}=t,f=c+e-a,d=u+n-o;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=d);const{text:h}=r.style,p=new ev({className:"poptip",style:{innerHTML:gW("div",h,Object.assign(Object.assign({},vW),s)),x:f,y:d}});i.appendChild(p),r.tip=p,l.add(p)},u=t=>{const{target:e}=t;mW(e)?e.tip&&(e.tip.remove(),e.tip=null,l.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",c),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",c),i.removeEventListener("pointerout",u),l.forEach(t=>t.remove())}}}yW.props={reapplyWhenUpdate:!0};const bW={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function xW(t={}){const{originData:e=[],layout:n}=t,r=De(t,["originData","layout"]),i=tt({},bW,r),a=Ja(i,"breadCrumb"),o=Ja(i,"active");return t=>{const{update:r,setState:i,container:s,options:l}=t,c=function(t){return Am(t).select(`.${hE}`).node()}(s),u=l.marks[0],{state:f}=u,d=new Jg;c.appendChild(d);const h=(t,l)=>Fe(this,void 0,void 0,function*(){if(d.removeChildren(),l){let e="",n=a.y,r=0;const i=[],s=c.getBBox().width,l=t.map((o,l)=>{e=`${e}${o}/`,i.push(o);const c=new hv({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:o,x:r,path:[...i],depth:l},a),{y:n})});d.appendChild(c),r+=c.getBBox().width;const u=new hv({style:Object.assign(Object.assign({x:r,text:" / "},a),{y:n})});return d.appendChild(u),r+=u.getBBox().width,r>s&&(n=d.getBBox().height+a.y,r=0,c.attr({x:r,y:n}),r+=c.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),l===ht(t)-1&&u.remove(),c});l.forEach((t,e)=>{if(e===ht(l)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",()=>{t.attr(o)}),t.addEventListener("mouseleave",()=>{t.attr(n)}),t.addEventListener("click",()=>{h(at(t,["style","path"]),at(t,["style","depth"]))})})}!function(t,e){[...xz(t),...kz(t)].forEach(t=>{e(t,t=>t)})}(s,i),i("treemapDrillDown",r=>{const{marks:i}=r,a=t.join("/"),o=i.map(t=>{if("rect"!==t.type)return t;let r=e;if(l){const t=e.filter(t=>{const e=at(t,["id"]);return e&&(e.match(`${a}/`)||a.match(e))}).map(t=>({value:0===t.height?at(t,["value"]):void 0,name:at(t,["id"])})),{paddingLeft:i,paddingBottom:o,paddingRight:s}=n,c=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||d.getBBox().height+10)/(l+1),paddingLeft:i/(l+1),paddingBottom:o/(l+1),paddingRight:s/(l+1),path:t=>t.name,layer:t=>t.depth===l+1});r=$S(t,c,{value:"value"})[0]}else r=e.filter(t=>1===t.depth);const i=[];return r.forEach(({path:t})=>{i.push(j(t))}),tt({},t,{data:r,scale:{color:{domain:i}}})});return Object.assign(Object.assign({},r),{marks:o})}),yield r(void 0,["legendFilter"])}),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:a}=n||{};if("rect"!==r&&i!==uu.TEXT)return;const o=i===uu.TEXT&&!0===at(a,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>at(t,["__data__","key"]))(n),s=_(e,t=>t.id===o);at(s,"height")&&h(at(s,"path"),at(s,"depth"))};c.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{SF(c).forEach(t=>{const n=at(t,["style","cursor"]),r=_(e,e=>e.id===at(t,["__data__","key"]));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=lt(t.attributes,g);t.addEventListener("mouseenter",()=>{t.attr(f.active)}),t.addEventListener("mouseleave",()=>{t.attr(tt(e,f.inactive))})}})};return v(),c.addEventListener("mousemove",v),()=>{d.remove(),c.removeEventListener("click",p),c.removeEventListener("mousemove",v)}}}const wW={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.6)",fontSize:11},y:4,active:{fill:"rgba(0, 0, 0, 0.4)"}};function kW(t={}){const{breadCrumb:e={}}=t,n=tt({},wW,e);return t=>{const{update:e,setState:r,container:i,view:a,options:o}=t,s=i.ownerDocument,l=function(t){return Am(t).select(`.${hE}`).node()}(i),c=o.marks.find(({id:t})=>t===jA);if(!c)return;const{state:u}=c,f=s.createElement("g");f.style.transform=`translate(${n.x||0}px, ${n.y||0}px)`,f.setAttribute("x","drilldown-breadcrumb"),l.appendChild(f);const d=t=>Fe(this,void 0,void 0,function*(){if(f.removeChildren(),t&&t.length>0){const e=s.createElement("text",{style:Object.assign({text:n.rootText},n.style)});f.appendChild(e);let r="";const i=t;let a=n.style.y,o=e.getBBox().width;const c=l.getBBox().width,u=i.map((t,e)=>{const i=s.createElement("text",{style:Object.assign(Object.assign({x:o,text:" / "},n.style),{y:a})});f.appendChild(i),o+=i.getBBox().width,r=`${r}${t} / `;const l=s.createElement("text",{name:r.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:t,x:o},n.style),{y:a})});return f.appendChild(l),o+=l.getBBox().width,o>c&&(a=f.getBBox().height,o=0,i.attr({x:o,y:a}),o+=i.getBBox().width,l.attr({x:o,y:a}),o+=l.getBBox().width),l});[e,...u].forEach((e,r)=>{if(r===u.length)return;const i=Object.assign({},e.attributes);e.attr("cursor","pointer"),e.addEventListener("mouseenter",()=>{e.attr(n.active)}),e.addEventListener("mouseleave",()=>{e.attr(i)}),e.addEventListener("click",()=>{d(t.slice(0,r))})})}r("drillDown",e=>{const{marks:n}=e,r=n.map(e=>{if(e.id!==jA&&"rect"!==e.type)return e;const{data:n}=e,r=n.filter(e=>{var n;const r=null!==(n=e.path)&&void 0!==n?n:[];if(0===t.length)return!0;if(!Array.isArray(r)||r.length<t.length)return!1;for(let e=0;e<t.length;e++)if(r[e]!==t[e])return!1;return!0});return tt({},e,{data:r})});return Object.assign(Object.assign({},e),{marks:r})}),yield e()}),h=t=>{var e,n;const r=t.target,i=r.markType,a=r.style||{},o=a[RA],s=a[IA],l=r.__data__;if("rect"!==i||o!==jA||!s)return;const c=null!==(n=null===(e=null==l?void 0:l.data)||void 0===e?void 0:e.path)&&void 0!==n?n:[];d(c)};l.addEventListener("click",h);const p=M(Object.assign(Object.assign({},u.active),u.inactive)),g=()=>{const t=(t=>t.querySelectorAll(".element").filter(t=>(t.style||{})[RA]===jA))(l);t.forEach(t=>{const e=at(t,["style",IA]);if("pointer"!==at(t,["style","cursor"])&&e){t.style.cursor="pointer";const e=lt(t.attributes,p);t.addEventListener("mouseenter",()=>{t.attr(u.active)}),t.addEventListener("mouseleave",()=>{t.attr(tt(e,u.inactive))})}})};return l.addEventListener("mousemove",g),()=>{f.remove(),l.removeEventListener("click",h),l.removeEventListener("mousemove",g)}}}const MW={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},OW="movePoint",EW=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},SW=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},AW=(t,e,n)=>{t.forEach((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)})},_W=(t,e,n,r)=>{const i=new ov({style:n}),a=new hv({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},TW=(t,e)=>{if(!at(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},NW=(t,e,n)=>{const r=OF(t,e),i=OF(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function PW(t={}){const{selection:e=[],precision:n=2}=t,r=De(t,["selection","precision"]),i=Object.assign(Object.assign({},MW),r||{}),a=Ja(i,"path"),o=Ja(i,"label"),s=Ja(i,"point");return(t,r,i)=>{const{update:l,setState:c,container:u,view:f,options:{marks:d,coordinate:h}}=t,p=rF(u);let g,v=SF(p),m=e;const{transform:y=[],type:b}=h,x=!!_(y,({type:t})=>"transpose"===t),w="polar"===b,k="theta"===b,M=!!_(v,({markType:t})=>"area"===t);M&&(v=v.filter(({markType:t})=>"area"===t));const O=new Jg({style:{zIndex:2}});p.appendChild(O);const E=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],E(),T(e)},A=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=at(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:h}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:A,y1:N}=h;if(x&&"interval"!==r)return;const{scale:P,coordinate:C}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=P,I=C.getCenter();let D;O.removeChildren();const B=(t,e,n,r)=>Fe(this,void 0,void 0,function*(){return c("elementPointMove",a=>{var o;const s=((null===(o=null==g?void 0:g.options)||void 0===o?void 0:o.marks)||d).map(a=>{if(!r.includes(a.type))return a;const{data:o,encode:s}=a,l=Object.keys(s).reduce((r,i)=>{const a=s[i];return"x"===i&&(r[a]=t),"y"===i&&(r[a]=e),"color"===i&&(r[a]=n),r},{}),c=((t,e,n)=>e.map(e=>{const r=["x","color"].reduce((r,i)=>{const a=n[i];return a?e[a]===t[a]&&r:r},!0);return r?Object.assign(Object.assign({},e),t):e}))(l,o,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(l,c),tt({},a,{data:c,animate:!1})});return Object.assign(Object.assign({},a),{marks:s})}),yield l("elementPointMove")});if(["line","area"].includes(r))v.forEach((e,r)=>{const i=R.invert(A[r]);if(!i)return;const l=new Ug({name:OW,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),c=((t,e)=>{const n=at(t,["__data__","seriesItems",e,"0","value"]),r=at(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=_(o,({type:t})=>"normalizeY"===t),l=at(a,["y","field"]),c=i[r][l];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*c:t})(t,r);l.addEventListener("mousedown",f=>{const d=C.output([A[r],0]),h=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,E()),AW(O.childNodes,m,s);const[p,x]=_W(O,l,a,o),k=t=>{const i=e[1]+t.clientY-D[1];if(M)if(w){const a=e[0]+t.clientX-D[0],[o,s]=NW(I,d,[a,i]),[,u]=C.output([1,j.output(0)]),[,f]=C.invert([o,u-(v[r+h][1]-s)]),g=(r+1)%h,m=EF([v[(r-1+h)%h],[o,s],y[g]&&v[g]]);x.attr("text",c(j.invert(f)).toFixed(n)),p.attr("d",m),l.attr("cx",o),l.attr("cy",s)}else{const[,t]=C.output([1,j.output(0)]),[,a]=C.invert([e[0],t-(v[r+h][1]-i)]),o=EF([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",c(j.invert(a)).toFixed(n)),p.attr("d",o),l.attr("cy",i)}else{const[,t]=C.invert([e[0],i]),a=EF([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",a),l.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const S=()=>Fe(this,void 0,void 0,function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",S),V(x.attr("text")))return;const e=Number(x.attr("text")),n=TW(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)});u.addEventListener("mouseup",S)}),O.appendChild(l)}),AW(O.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=at(t,["__data__","y"]),n=at(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:a},childNodes:o}=t.parentNode,s=_(a,({type:t})=>"normalizeY"===t),l=at(i,["y","field"]),c=r[o.indexOf(t)][l];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*c:t})(t),l=new Ug({name:OW,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});l.addEventListener("mousedown",s=>{u.attr("cursor","move");const c=TW(L,b),[f,d]=_W(O,l,a,o),h=t=>{if(x){const r=e[0]+t.clientX-D[0],[a]=C.output([j.output(0),j.output(0)]),[,o]=C.invert([a+(r-v[2][0]),e[1]]),s=EF([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);d.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),l.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],a=e[0]+t.clientX-D[0],[o,s]=NW(I,[a,r],e),[c,u]=NW(I,[a,r],v[1]),h=C.invert([o,s])[1],p=N-h;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=OF(t,e[1]),a=OF(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}(I,[[o,s],[c,u],v[2],v[3]],p>.5?1:0);d.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),l.attr("cx",o),l.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,a]=C.output([1,j.output(0)]),[,o]=C.invert([e[0],a-(v[2][1]-r)]),s=EF([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);d.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),l.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",h);const p=()=>Fe(this,void 0,void 0,function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",h),V(d.attr("text")))return;const e=Number(d.attr("text"));g=yield B(S,e,c,[r]),d.remove(),f.remove(),T(t)});u.addEventListener("mouseup",p)}),O.appendChild(l)}};v.forEach((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",EW),t.addEventListener("mouseleave",SW)});const N=t=>{const e=null==t?void 0:t.target;e&&(e.name===OW||v.includes(e))||(m=[],E(),O.removeChildren())};return i.on("element-point:select",A),i.on("element-point:unselect",N),u.addEventListener("mousedown",N),()=>{O.remove(),i.off("element-point:select",A),i.off("element-point:unselect",N),u.removeEventListener("mousedown",N),v.forEach(t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",EW),t.removeEventListener("mouseleave",SW)})}}}var CW={},LW={};function jW(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function RW(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}function IW(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function DW(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+IW(-t,6):t>9999?"+"+IW(t,6):IW(t,4)}(t.getUTCFullYear())+"-"+IW(t.getUTCMonth()+1,2)+"-"+IW(t.getUTCDate(),2)+(i?"T"+IW(e,2)+":"+IW(n,2)+":"+IW(r,2)+"."+IW(i,3)+"Z":r?"T"+IW(e,2)+":"+IW(n,2)+":"+IW(r,2)+"Z":n||e?"T"+IW(e,2)+":"+IW(n,2)+"Z":"")}function BW(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,l=a<=0,c=!1;function u(){if(l)return LW;if(c)return c=!1,CW;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?l=!0:10===(r=t.charCodeAt(o++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return l=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==LW;){for(var f=[];r!==CW&&r!==LW;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map(function(e){return n.map(function(t){return o(e[t])}).join(t)})}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?DW(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=jW(t);return function(r,i){return e(n(r),i,t)}}(t,e):jW(t)});return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=RW(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=RW(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function FW(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;zW&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const zW=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),WW=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Fe(void 0,void 0,void 0,function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return BW(r).parse(e,i?FW:Va)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)})};WW.props={};const $W=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap(t=>e.map(e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))):t;var i}};function GW(t){return null!=t&&!Number.isNaN(t)}$W.props={};const YW=t=>{const{callback:e=GW}=t;return t=>t.filter(e)};YW.props={};const HW=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};HW.props={};const VW=t=>{const{fields:e}=t;return t=>t.map(t=>function(t,e=[]){return e.reduce((e,n)=>(n in t&&(e[n]=t[n]),e),{})}(t,e))};VW.props={};const qW=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map(e=>Object.entries(e).reduce((e,[n,r])=>(e[t[n]||n]=r,e),{}))};qW.props={};const XW=t=>{const{fields:e=[]}=t,n=(r=!0,e.map(t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]}));var r;return t=>[...t].sort((t,e)=>n.reduce((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r]),0))};XW.props={};const UW=t=>{const{value:e}=t;return()=>e};UW.props={};const KW=t=>{const{callback:e=Va}=t;return t=>e(t)};KW.props={};const ZW=t=>{const{callback:e=Va}=t;return t=>Array.isArray(t)?t.map(e):t};ZW.props={};const QW=Math.PI/180,JW=2048;function t$(t){return t.text}function e$(){return"serif"}function n$(){return"normal"}function r$(t){return t.value}function i$(){return 90*~~(2*Math.random())}function a$(){return 1}function o$(){}function s$(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,JW/a);let o=0,s=0,l=0;const c=n.length;for(--r;++r<c;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=i.measureText(e.text+"m").width*a,c=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*QW),r=Math.cos(e.rotate*QW),i=t*r,a=t*n,o=c*r,s=c*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,c=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else t=t+31>>5<<5;if(c>l&&(l=c),o+t>=2048&&(o=0,s+=l,l=0),s+c>=JW)break;i.translate((o+(t>>1))/a,(s+(c>>1))/a),e.rotate&&i.rotate(e.rotate*QW),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=c,e.xoff=o,e.yoff=s,e.x1=t>>1,e.y1=c>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=t}const u=i.getImageData(0,0,2048/a,JW/a).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let a=e.y1-e.y0;for(let t=0;t<a*i;t++)f[t]=0;if(o=e.xoff,null==o)return;s=e.yoff;let l=0,c=-1;for(let n=0;n<a;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(o+e)<<2]?1<<31-e%32:0;f[t]|=r,l|=r}l?c=n:(e.y0++,a--,n--,s++)}e.y1=e.y0+c,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function l$(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=127&a,s=32-o,l=t.y1-t.y0;let c,u=(t.y+t.y0)*n+(a>>5);for(let t=0;t<l;t++){c=0;for(let n=0;n<=i;n++)if((c<<s|(n<i?(c=r[t*i+n])>>>o:0))&e[u+n])return!0;u+=n}return!1}function c$(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function u$(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function f$(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function d$(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function h$(){return document.createElement("canvas")}function p$(t){return"function"==typeof t?t:function(){return t}}const g$={archimedean:f$,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function v$(){let t=[256,256],e=t$,n=e$,r=r$,i=n$,a=i$,o=a$,s=f$,l=Math.random,c=o$,u=[],f=null,d=1/0,h=h$;const p=n$,g={};function v(e,n,r){const i=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),c=s(t),u=l()<.5?1:-1;let f,d,h,p=-u;for(;(f=c(p+=u))&&(d=~~f[0],h=~~f[1],!(Math.min(Math.abs(d),Math.abs(h))>=o));)if(n.x=i+d,n.y=a+h,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!l$(n,e,t[0]))&&(!r||u$(n,r))){const r=n.sprite,i=n.width>>5,a=t[0]>>5,o=n.x-(i<<4),s=127&o,l=32-s,c=n.y1-n.y0;let u,f=(n.y+n.y0)*a+(o>>5);for(let t=0;t<c;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<l|(n<i?(u=r[t*i+n])>>>s:0);f+=a}return delete n.sprite,!0}return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=JW/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(h()),b=g.board?g.board:d$((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map(function(t,s,l){return t.text=e.call(this,t,s,l),t.font=n.call(this,t,s,l),t.style=p.call(this,t,s,l),t.weight=i.call(this,t,s,l),t.rotate=a.call(this,t,s,l),t.size=~~r.call(this,t,s,l),t.padding=o.call(this,t,s,l),t}).sort(function(t,e){return e.size-t.size});let M=-1,O=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function E(){const e=Date.now();for(;Date.now()-e<d&&++M<x;){const e=k[M];e.x=s*(l()+.5)>>1,e.y=m*(l()+.5)>>1,s$(y,e,k,M),e.hasText&&v(b,e,O)&&(c.call(null,"word",{cloud:g,word:e}),w.push(e),O?g.hasImage||c$(O,e):O=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=O,M>=x&&(g.stop(),c.call(null,"end",{cloud:g,words:w,bounds:O}))}return f&&clearInterval(f),f=setInterval(E,0),E(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const a=r>>5,o=d$((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const l=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=a*t+(e>>5),i=t*r+e<<2,s=l[i]>=250&&l[i+1]>=250&&l[i+2]>=250?1<<31-e%32:0;o[n]|=s}g.board=o,g.hasImage=!0},g.timeInterval=function(t){d=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=p$(t)},g.font=function(t){n=p$(t)},g.fontWeight=function(t){i=p$(t)},g.rotate=function(t){a=p$(t)},g.canvas=function(t){h=p$(t)},g.spiral=function(t){s=g$[t]||t},g.fontSize=function(t){r=p$(t)},g.padding=function(t){o=p$(t)},g.random=function(t){l=p$(t)},g.on=function(t){c=p$(t)},g}const m$={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function y$(t){return new Promise((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}})}const b$=(t,e)=>n=>Fe(void 0,void 0,void 0,function*(){const r=Object.assign({},m$,t,{canvas:e.createCanvas}),i=v$();var a,o;yield(a=i,o=r,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this},setAsync(t,e,n){return Fe(this,void 0,void 0,function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this})}}).set("fontSize",t=>{const e=n.map(t=>t.value);return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:t})=>(r-n)/(a-i)*(t-i)+n}return()=>t}(t,[kr(e),xr(e)])}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",y$,i.createMask),i.words([...n]);const s=i.start(),[l,c]=r.size,u=[{x:0,y:0},{x:l,y:c}],{_bounds:f=u,_tags:d,hasImage:h}=s,p=d.map(t=>{var{x:e,y:n,font:r}=t,i=De(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+l/2,y:n+c/2,fontFamily:r})}),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:h?0:g,y:h?0:v}),Object.assign(Object.assign({},b),{x:h?l:m,y:h?c:y})),p});function x$(t){return"string"==typeof t?e=>e[t]:t}b$.props={};const w$=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,l=x$(s),c=x$(o),u=ar(e,([t])=>t,t=>l(t));return t=>t.map(t=>{const e=u.get(c(t));return Object.assign(Object.assign({},t),r.reduce((t,n,r)=>(t[i[r]]=e?e[n]:a,t),{}))})};w$.props={};const k$=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};k$.props={};var M$={exports:{}},O$={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(O$),function(t){var e=Math.log(2),n=t.exports,r=O$.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,a=r.isNumber(e.width)?e.width:2,o=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),l=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),c=(l-s)/(o-1);return n&&(s-=2*a*c),i&&(l+=2*a*c),{min:s,max:l}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var a=r.isNumber(e.size)?e.size:50,o=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:a,width:o,min:e.min,max:e.max}),l=s.min,c=s.max-l,u=c/(a-1);if(0===c)return[{x:l,y:1}];for(var f=[],d=0;d<a;d++)f.push({x:l+d*u,y:0});var h=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,o),p=h[o],g=h[o-1]-h[o-2],v=0;t.forEach(function(t){var e=function(t){return Math.floor((t-l)/u)}(t);if(!(e+o<0||e-o>=f.length)){var n=Math.max(e-o,0),i=e,a=Math.min(e+o,f.length-1),s=n-(e-o),c=e+o-a,d=h[-o-1+s]||0,m=h[-o-1+c]||0,y=p/(p-d-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-o+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*y*g)}});var m=v,y=0,b=0;return f.forEach(function(t){y+=t.y,m+=y,t.y=m,b+=m}),b>0&&f.forEach(function(t){t.y/=b}),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach(function(t){e+=t.x*t.y}),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/e,Math.pow(2,n)}}}(M$);var E$=M$.exports;const S$=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=r;return t=>{const r=Array.from(rr(t,t=>n.map(e=>t[e]).join("-")).values());return r.map(t=>{const n=E$.create(t.map(t=>t[e]),{min:i,max:a,size:o,width:s}),r=n.map(t=>t.x),u=n.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:r,[c]:u})})}};S$.props={};const A$=()=>t=>(console.log("G2 data section:",t),t);A$.props={};const _$=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map(t=>t[e]),a=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const a=n*e+(1-e)*i;r.push(a),n=a}return r}(i,n);return t.map((t,e)=>Object.assign(Object.assign({},t),{[r]:a[e]}))}};_$.props={};function T$(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function N$(t,e,n=.01){const[r,i]=t,[a,o]=e;return r>=a[0]-n&&r<=o[0]+n&&i>=a[1]-n&&i<=o[1]+n}function P$(t,e,n=.01){const[r,i]=t;return!(N$(r,e,n)&&N$(i,e,n))}const C$=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach(t=>{JB(t);const e=t.getLocalBounds(),r=n.some(t=>function(t,e){const[n,r]=t,[i,a]=e;return n[0]<a[0]&&r[0]>i[0]&&n[1]<a[1]&&r[1]>i[1]}(T$(e),T$(t.getLocalBounds())));r?QB(t):n.push(t)}),t}};function L$([t,e],[n,r]){return r>t&&e>n}function j$(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function R$(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const I$=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[a,o]=j$(),[s,l]=j$(),[c,u]=j$(),[f,d]=j$();for(const e of t){const{min:t,max:n}=R$(e),[r,i]=t,[a,s]=n;o(e,i),l(e,i),u(e,s-i),d(e,[r,a])}for(let a=0;a<e;a++){t.sort((t,e)=>zn(s(t),s(e)));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let a,o=n+1;for(;(a=t[o])&&!L$(f(i),f(a));)o+=1;if(a){const t=s(i),n=c(i),o=s(a),u=o-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),l(i,t-n),l(a,o+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-a(e);return t}};function D$(t){return"object"==typeof t?t:Md(t)}function B$(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function F$(t,e,n){return.2126*B$(t)+.7152*B$(e)+.0722*B$(n)}function z$(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,l=F$(n,r,i),c=F$(a,o,s);return(Math.max(l,c)+.05)/(Math.min(l,c)+.05)}function W$(t,e){const n=wr(e,e=>z$(t,D$(e)));return e[n]}const $$=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach(t=>{const r=t.attr("dependentElement").parsedStyle.fill;z$(t.parsedStyle.fill,r)<e&&t.attr("fill",W$(r,n))}),t)},G$=()=>t=>(t.forEach(t=>{JB(t);const e=t.attr("bounds");P$(T$(t.getLocalBounds()),e)&&QB(t)}),t),Y$=(t={})=>(e,{canvas:n,layout:r})=>{const{bounds:i="view",offsetX:a=0,offsetY:o=0}=t,s=(()=>{if("main"===i){const{x:t=0,y:e=0,width:n=0,height:i=0,marginLeft:s=0,marginRight:l=0,marginTop:c=0,marginBottom:u=0,paddingLeft:f=0,paddingRight:d=0,paddingTop:h=0,paddingBottom:p=0}=r;return[[t+s+f+a,e+c+h+o],[t+n-l-d-a,e+i-u-p-o]]}{const{x:t=0,y:e=0,width:n=0,height:i=0}=r;return[[t+a,e+o],[t+n-a,e+i-o]]}})();return e.forEach(t=>{JB(t);const{max:e,min:n}=((t,e)=>t&&t.min&&t.max?e&&e.min&&e.max?{min:[Math.min(t.min[0],e.min[0]),Math.min(t.min[1],e.min[1])],max:[Math.max(t.max[0],e.max[0]),Math.max(t.max[1],e.max[1])]}:t:e&&e.min&&e.max?e:{min:[0,0],max:[0,0]})(t.getRenderBounds(),t.getBounds());if(!e||!n||0===e[0]&&0===e[1]&&0===n[0]&&0===n[1])return;const[r,i]=e,[a,o]=n,l=((t,e)=>{const[[n,r],[i,a]]=e,[[o,s],[l,c]]=t;let u=0,f=0;return o<n?u=n-o:l>i&&(u=i-l),s<r?f=r-s:c>a&&(f=a-c),[u,f]})([[a,o],[r,i]],s);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=l[0],t.style.connectorPoints[0][1]-=l[1]),t.style.x+=l[0],t.style.y+=l[1]}),e};function H$(t){var e;const n=t.getAnimations();if(!n||0===n.length)return iF(t);const r=t.cloneNode(!0);r.style.visibility="hidden",n.forEach(t=>{const e=t.effect.getKeyframes();e&&e.length>0&&r.attr(e[e.length-1])}),null===(e=t.parentNode)||void 0===e||e.appendChild(r);const i=iF(r);return r.destroy(),i}const V$=t=>{const{palette:e=["#000","#fff"],threshold:n=2}=t;return t=>(t.forEach(t=>{var r,i;const a=t.attr("dependentElement"),o=null!==(i=null!==(r=t.attributes.fill)&&void 0!==r?r:t.parsedStyle.fill)&&void 0!==i?i:"#fff";if(P$(T$(H$(t)),T$(H$(a)),n)){const n=W$(D$(o),e);t.attr("stroke",n)}else t.removeAttribute("stroke")}),t)};function q$(){return{"data.fetch":WW,"data.inline":UW,"data.sortBy":XW,"data.sort":HW,"data.filter":YW,"data.pick":VW,"data.rename":qW,"data.fold":$W,"data.slice":k$,"data.custom":KW,"data.map":ZW,"data.join":w$,"data.kde":S$,"data.log":A$,"data.wordCloud":b$,"data.ema":_$,"transform.stackY":ko,"transform.binX":Ws,"transform.bin":zs,"transform.dodgeX":Vo,"transform.jitter":Zo,"transform.jitterX":Qo,"transform.jitterY":Jo,"transform.symmetryY":ts,"transform.diffY":es,"transform.stackEnter":qo,"transform.normalizeY":Xo,"transform.select":os,"transform.selectX":ss,"transform.selectY":ls,"transform.groupX":xs,"transform.groupY":ws,"transform.groupColor":ks,"transform.group":bs,"transform.sortX":Os,"transform.sortY":Ss,"transform.sortColor":Es,"transform.flexX":As,"transform.pack":Ds,"transform.sample":Gs,"transform.filter":Ys,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":a,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":u,"coordinate.radial":l,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":d,"encode.field":p,"encode.transform":h,"encode.column":g,"mark.interval":EE,"mark.rect":AE,"mark.line":PE,"mark.point":LE,"mark.text":RE,"mark.cell":DE,"mark.area":FE,"mark.link":WE,"mark.image":GE,"mark.polygon":HE,"mark.box":qE,"mark.vector":UE,"mark.lineX":JE,"mark.lineY":ZE,"mark.connector":eS,"mark.range":aS,"mark.rangeX":sS,"mark.rangeY":cS,"mark.path":fS,"mark.shape":GS,"mark.density":TA,"mark.heatmap":PA,"mark.wordCloud":AA,"mark.beeswarm":LA,"palette.category10":DA,"palette.category20":BA,"scale.linear":zA,"scale.ordinal":WA,"scale.band":FA,"scale.identity":$A,"scale.point":GA,"scale.time":YA,"scale.log":HA,"scale.pow":VA,"scale.sqrt":KA,"scale.threshold":qA,"scale.quantile":XA,"scale.quantize":UA,"scale.sequential":ZA,"scale.constant":QA,"theme.classic":o_,"theme.classicDark":c_,"theme.academy":f_,"theme.light":a_,"theme.dark":l_,"component.axisX":G_,"component.axisY":Y_,"component.legendCategory":Q_,"component.legendContinuous":rT,"component.legends":OT,"component.title":uT,"component.sliderX":bT,"component.sliderY":xT,"component.scrollbarX":kT,"component.scrollbarY":MT,"animation.scaleInX":ET,"animation.scaleOutX":ST,"animation.scaleInY":AT,"animation.scaleOutY":_T,"animation.waveIn":YT,"animation.fadeIn":TT,"animation.fadeOut":NT,"animation.zoomIn":HT,"animation.zoomOut":VT,"animation.pathIn":qT,"animation.morphing":GT,"animation.growInX":XT,"animation.growInY":UT,"interaction.elementHighlight":jF,"interaction.elementHighlightByX":RF,"interaction.elementHighlightByColor":IF,"interaction.elementHoverScale":BF,"interaction.elementSelect":zF,"interaction.elementSelectByX":WF,"interaction.elementSelectByColor":$F,"interaction.fisheye":YF,"interaction.chartIndex":GF,"interaction.tooltip":hz,"interaction.legendFilter":Sz,"interaction.legendHighlight":Az,"interaction.brushHighlight":Iz,"interaction.brushXHighlight":Bz,"interaction.brushYHighlight":zz,"interaction.brushAxisHighlight":qz,"interaction.brushFilter":Xz,"interaction.brushXFilter":Uz,"interaction.brushYFilter":Kz,"interaction.sliderFilter":lW,"interaction.sliderWheel":dW,"interaction.scrollbarFilter":pW,"interaction.poptip":yW,"interaction.treemapDrillDown":xW,"interaction.drillDown":kW,"interaction.elementPointMove":PW,"composition.spaceLayer":WL,"composition.spaceFlex":$L,"composition.facetRect":ij,"composition.repeatMatrix":uj,"composition.facetCircle":vj,"composition.timingKeyframe":yj,"labelTransform.overlapHide":C$,"labelTransform.overlapDodgeY":I$,"labelTransform.overflowHide":G$,"labelTransform.contrastReverse":$$,"labelTransform.overflowStroke":V$,"labelTransform.exceedAdjust":Y$}}function X$(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const U$={};const K$=t=>t?parseInt(t):0;function Z$(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class Q${constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map(n=>(n[t]=e,n))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex(t=>t===this);e.splice(n,1)}return this}getNodeByKey(t){let e=null;return Z$(this,n=>{t===n.attr("key")&&(e=n)}),e}getNodesByType(t){const e=[];return Z$(this,n=>{t===n.type&&e.push(n)}),e}getNodeByType(t){let e=null;return Z$(this,n=>{e||t===n.type&&(e=n)}),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const J$=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],tG="__remove__",eG="__callback__";function nG(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function rG(t,e){const{width:n,height:r,autoFit:i,depth:a=0}=t;let o=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||K$(e.width),r=t.clientHeight||K$(e.height);return{width:n-(K$(e.paddingLeft)+K$(e.paddingRight)),height:r-(K$(e.paddingTop)+K$(e.paddingBottom))}}(e);o=t||o,s=n||s}return o=n||o,s=r||s,{width:Math.max(I(o)?o:1,1),height:Math.max(I(s)?s:1,1),depth:a}}function iG(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of J$)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,nG(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===eG)e.children=t.value;else{const i=nG(t),{children:a=[]}=e;a.push(i),n.push(t),r.set(t,i),e.children=a}}return r.get(e)}function aG(t,e,n,r,i){const{type:a}=t,{type:o=n||a}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(o,i)){for(const n of J$)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r)){const t={type:"view"},n=Object.assign({},e);for(const e of J$)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function oG(t,e,n){if("function"==typeof t){const e=new Q$;return e.value=t,e.type=eG,e}const{type:r,children:i}=t,a=De(t,["type","children"]),o=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new o;return s.value=a,s.type=r,s}function sG(t,e){const{type:n,children:r}=e,i=De(e,["type","children"]);t.type===n||void 0===n?ao(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function lG(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),a=oG(e,n,r);Array.isArray(t.children)&&t.push(a);const{children:o}=e;if(Array.isArray(o))for(const t of o)i.push([a,t]);else"function"==typeof o&&i.push([a,o])}}function cG(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function uG(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function fG(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function dG(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(ro(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function hG(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function pG(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function gG(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?cG(e,n,r):"array"===t?uG(e,n,r):"object"===t?fG(e,n,r):"node"===t?hG(e,n,r):"container"===t?pG(e,n,r):"mix"===t&&dG(e,n)}return e}}function vG(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{type:"node",ctor:e}]))}const mG={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},yG=Object.assign(Object.assign({},mG),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),bG=Object.assign(Object.assign({},mG),{labelTransform:{type:"array"}});let xG=class extends Q${changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach(e=>{e.attr("data",t)}),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find(t=>t.key===this._key)}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&JB(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&QB(t)}};xG=Be([gG(bG)],xG);let wG=class extends Q${changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find(t=>t.key===this.attr("key"));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};wG=Be([gG(yG)],wG);const kG="G2_CHART_KEY";class MG extends xG{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a,createCanvas:o}=t;super(De(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=K(()=>{this.forceFit()},300),this._renderer=r||new cP,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[tG]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new hP,this._context={library:Object.assign(Object.assign({},a),U$),emitter:this._emitter,canvas:n,createCanvas:o},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise((t,e)=>VB(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let t,e;return[new Promise((n,r)=>{e=n,t=r}),e,t]}();return t.then(n).then(()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}}).catch(r).then(()=>{this._trailingClear=null,this._renderTrailing()}),e}options(t){if(0===arguments.length)return iG(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const a=[[null,t,aG(t,e,n,r,i)]];for(;a.length;){const[t,e,n]=a.shift();if(e)if(n){sG(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],o=r[i];a.push([e,o,n])}}else"function"==typeof t&&a.push([e,null,t])}else e.remove();else lG(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(t=!0){if(this._rendering)return this._trailingClear=()=>{this.clear(t)},void this._reset();this.options();this.emit(pP.BEFORE_CLEAR),this._reset(),qB(0,this._context,!1,t),this.emit(pP.AFTER_CLEAR)}destroy(){this.options();this.emit(pP.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),qB(0,this._context,!0),this._container[tG]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(pP.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=rG(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pP.BEFORE_CHANGE_SIZE);const n=this.render();return n.then(()=>{this.emit(pP.AFTER_CHANGE_SIZE)}),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pP.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then(()=>{this.emit(pP.AFTER_CHANGE_SIZE)}),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:a=0,startY:o=0}=e,{canvas:s,views:l}=this._context,{document:c}=s,{x:u,y:f}=t,{coordinate:d,scale:h,markState:p,data:g,key:v}=l[0],m=c.getElementsByClassName(fE),y=n?t=>t.__data__.x:t=>t,b=rr(m,y),x=rF(c.getElementsByClassName(dE)[0]),w=t=>Array.from(t.values()).some(t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some(t=>"series"===t.name&&void 0!==t.values))}),k=lz(r,w(p)),M=t=>at(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=fz({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:d,scale:h,startX:a,startY:o}),e=g.get(`${v}-0`);return t.map(({index:t})=>e[t])}const t=uz({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:d,scale:h,shared:n});if(Ga(t))return Ya(t,g.get(v));const e=y(t),r=b.get(e);return r?r.map(M):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?M(e):[]}}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter(t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t)];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends wG{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter(t=>t.startsWith("composition.")&&"composition.mark"!==t)];this._compositions=Object.fromEntries(n.map(t=>{const e=t.split(".").pop();let n=class extends xG{constructor(){super({},e)}};return n=Be([gG(vG(this._marks))],n),[e,n]}));for(const t of Object.values(this._compositions))gG(vG(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=kG}=t,{width:n,height:r,depth:i}=rG(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){var t,e;const{width:n,height:r}=rG(this.options(),this._container);this._plugins.push(new fP),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new _v({container:this._container,width:n,height:r,renderer:this._renderer});const i=null===(e=null===(t=this._context.canvas)||void 0===t?void 0:t.getContextService())||void 0===e?void 0:e.getDomElement();i&&(i.style.display="block")}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e})}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const OG=X$(MG,Object.assign({},q$()));t.AREA_CLASS_NAME=vE,t.Academy=f_,t.Bin=zs,t.BinX=Ws,t.COMPONENT_CLASS_NAME=pE,t.Chart=OG,t.ChartEvent=pP,t.Classic=o_,t.ClassicDark=c_,t.Dark=l_,t.DiffY=es,t.DodgeX=Vo,t.ELEMENT_CLASS_NAME=fE,t.Filter=Ys,t.FlexX=As,t.Group=bs,t.GroupColor=ks,t.GroupX=xs,t.GroupY=ws,t.Jitter=Zo,t.JitterX=Qo,t.JitterY=Jo,t.LABEL_CLASS_NAME=gE,t.LABEL_LAYER_CLASS_NAME=uE,t.Light=a_,t.LinearAxis=W_,t.MAIN_LAYER_CLASS_NAME=cE,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Bo,t.MaybeDefaultY=Fo,t.MaybeFunctionAttribute=Go,t.MaybeGradient=Ho,t.MaybeIdentityX=Do,t.MaybeIdentityY=Io,t.MaybeKey=Co,t.MaybeSeries=Lo,t.MaybeSize=Po,t.MaybeStackY=Oo,t.MaybeTitle=Ao,t.MaybeTooltip=zo,t.MaybeTuple=Yo,t.MaybeTupleX=Ro,t.MaybeTupleY=jo,t.MaybeVisualPosition=$o,t.MaybeZeroPadding=Wo,t.MaybeZeroX=_o,t.MaybeZeroY=To,t.MaybeZeroY1=Fn,t.MaybeZeroZ=No,t.NormalizeY=Xo,t.PLOT_CLASS_NAME=hE,t.Pack=Ds,t.Runtime=MG,t.Sample=Gs,t.Select=os,t.SelectX=ss,t.SelectY=ls,t.Selection=_m,t.SortColor=Es,t.SortX=Os,t.SortY=Ss,t.StackEnter=qo,t.StackY=ko,t.SymmetryY=ts,t.VIEW_CLASS_NAME=dE,t.corelib=q$,t.dataOf=Ya,t.extend=X$,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,Ny.set(n,r)):Object.assign(U$,{[t]:e})},t.render=VB,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:a=640,height:o=480}=t,s=YB(t),{group:l=new Jg,emitter:c=new hP,library:u}=e;(null==l?void 0:l.parentElement)||Ua("renderToMountedElement can't render chart to unmounted group.");const f=Am(l);return e.group=l,e.emitter=c,e.externals={},e.canvas=e.canvas||(null===(i=null==l?void 0:l.ownerDocument)||void 0===i?void 0:i.defaultView),c.emit(pP.BEFORE_RENDER),hB(Object.assign(Object.assign({},s),{width:a,height:o}),f,e).then(()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame(()=>{c.emit(pP.AFTER_RENDER),null==n||n()})}).catch(t=>{null==r||r(t)}),l},t.select=Am,t.selectG2Elements=tF,t.selectPlotArea=rF,t.seriesOf=function(t){const e=$a(t).__data__,{scale:n}=e;return Ha(n,t.__data__)},Object.defineProperty(t,"__esModule",{value:!0})});
77
+ */uN.tag="Dragndrop";var fN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pc(this,e),(t=Mc(this,e)).name="dragndrop",t.options=n,t}return Ec(e,t),vc(e,[{key:"init",value:function(){this.addRenderingPlugin(new uN(hc({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(lu),dN=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;a<i;a++)if(r[a]){var o=r[a],s=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),s.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),hN=dN;const pN={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},gN={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class vN extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var mN;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(mN||(mN={}));const yN=new Set([32,9,10,13]),bN=new Set([43,45,42,47,37,33,38,124,61,60,62]),xN=new Map([["true",mN.BOOLEAN],["false",mN.BOOLEAN],["null",mN.NULL]]),wN=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),kN=new Map([[46,mN.DOT],[91,mN.BRACKET_LEFT],[93,mN.BRACKET_RIGHT],[40,mN.PAREN_LEFT],[41,mN.PAREN_RIGHT],[44,mN.COMMA],[63,mN.QUESTION],[58,mN.COLON],[36,mN.DOLLAR]]),MN=new Map;for(const[t,e]of kN.entries())MN.set(t,{type:e,value:String.fromCharCode(t)});function ON(t){return t>=48&&t<=57}function EN(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function SN(t){return EN(t)||ON(t)}function AN(t){return bN.has(t)}var _N;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(_N||(_N={}));const TN=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),NN={type:_N.Literal,value:null},PN={type:_N.Literal,value:!0},CN={type:_N.Literal,value:!1},LN=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],a=t=>{const e=r();return null!==e&&e.type===t},o=t=>t.type===mN.OPERATOR?TN.get(t.value)||-1:t.type===mN.DOT||t.type===mN.BRACKET_LEFT?9:t.type===mN.QUESTION?1:-1,s=t=>{let n,o;if(i().type===mN.DOT){if(!a(mN.IDENTIFIER)){const t=r();throw new vN("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:_N.Identifier,name:t.value},o=!1}else{if(n=c(0),!a(mN.BRACKET_RIGHT)){const t=r();throw new vN("Expected closing bracket",e,t?t.value:"<end of input>")}i(),o=!0}return{type:_N.MemberExpression,object:t,property:n,computed:o}},l=()=>{const t=r();if(!t)throw new vN("Unexpected end of input",e,"<end of input>");if(t.type===mN.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=l();return{type:_N.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case mN.NUMBER:return i(),{type:_N.Literal,value:Number(t.value)};case mN.STRING:return i(),{type:_N.Literal,value:t.value};case mN.BOOLEAN:return i(),"true"===t.value?PN:CN;case mN.NULL:return i(),NN;case mN.IDENTIFIER:return i(),{type:_N.Identifier,name:t.value};case mN.FUNCTION:return(()=>{const t=i(),n=[];if(!a(mN.PAREN_LEFT)){const t=r();throw new vN("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(a(mN.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new vN("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!a(mN.COMMA)){const t=r();throw new vN("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=c(0);n.push(t)}return{type:_N.CallExpression,callee:{type:_N.Identifier,name:t.value},arguments:n}})();case mN.PAREN_LEFT:{i();const t=c(0);if(!a(mN.PAREN_RIGHT)){const t=r();throw new vN("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new vN(`Unexpected token: ${t.type}`,e,t.value)}},c=(u=0)=>{let f=l();for(;e<n;){const n=t[e],l=o(n);if(l<=u)break;if(n.type!==mN.QUESTION)if(n.type!==mN.OPERATOR){if(n.type!==mN.DOT&&n.type!==mN.BRACKET_LEFT)break;f=s(f)}else{i();const t=c(l);f={type:_N.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=c(0);if(!a(mN.COLON)){const t=r();throw new vN("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=c(0);f={type:_N.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=c();return{type:_N.Program,body:u}},jN=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case _N.Literal:return(t=>t.value)(t);case _N.Identifier:return(t=>{if(!(t.name in r.context))throw new vN(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case _N.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new vN("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case _N.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new vN(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map(t=>i(t)))})(t);case _N.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new vN(`Unknown operator: ${t.operator}`)}})(t);case _N.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new vN(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new vN(`Unknown operator: ${t.operator}`)}throw new vN(`Postfix operators are not supported: ${t.operator}`)})(t);case _N.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new vN(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const RN=["style","encode","labels","children"],IN=JO(t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,a=0;function o(t){const r=a+1;a++;let i="",o=!1;for(;a<n;){const n=e.charCodeAt(a);if(n===t)return o||(i=e.substring(r,a)),a++,{type:mN.STRING,value:i};92===n?(o||(i=e.substring(r,a),o=!0),a++,i+=e[a]):o&&(i+=e[a]),a++}throw new vN(`Unterminated string starting with ${String.fromCharCode(t)}`,a,e.substring(Math.max(0,a-10),a))}function s(){const t=a;for(45===e.charCodeAt(a)&&a++;a<n&&ON(e.charCodeAt(a));)a++;if(a<n&&46===e.charCodeAt(a))for(a++;a<n&&ON(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:mN.NUMBER,value:r}}function l(){a++;const t=a;if(a<n&&EN(e.charCodeAt(a)))for(a++;a<n&&SN(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:mN.FUNCTION,value:r}}function c(){const t=a++;for(;a<n&&SN(e.charCodeAt(a));)a++;const r=e.slice(t,a),i=xN.get(r);return i?{type:i,value:r}:{type:mN.IDENTIFIER,value:r}}function u(){if(a+2<n){const t=e.substring(a,a+3);if(wN.has(t))return a+=3,{type:mN.OPERATOR,value:t}}if(a+1<n){const t=e.substring(a,a+2);if(wN.has(t))return a+=2,{type:mN.OPERATOR,value:t}}const t=e[a];if(wN.has(t))return a++,{type:mN.OPERATOR,value:t};throw new vN(`Unknown operator at position ${a}: ${e.substring(a,a+1)}`,a,e.substring(Math.max(0,a-10),a))}for(;a<n;){const t=e.charCodeAt(a);if(f=t,yN.has(f)){a++;continue}const d=MN.get(t);if(d)r[i++]=d,a++;else if(34!==t&&39!==t)if(ON(t)||45===t&&a+1<n&&ON(e.charCodeAt(a+1)))r[i++]=s();else if(64!==t)if(EN(t))r[i++]=c();else{if(!AN(t))throw new vN(`Unexpected character: ${e[a]}`,a,e.substring(Math.max(0,a-10),a));r[i++]=u()}else r[i++]=l();else r[i++]=o(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=LN(e),r=((t={},e={})=>({context:t,functions:e}))({},gN);return(t={})=>jN(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},(t,e)=>String.fromCharCode(97+e)),r=Object.fromEntries(t.map((t,e)=>[n[e],t]));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}},t=>t,128);function DN(t,e=!0){if(Array.isArray(t))return t.map((n,r)=>DN(t[r],e));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=it);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach(function(r){n[r]=e(t[r],r)}),n}(t,(t,n)=>e&&RN.includes(n)?DN(t,"children"===n):e?t:DN(t,!1));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return IN(e.slice(1,-1))}return t}var BN={}.toString,FN=function(t,e){return BN.call(t)==="[object "+e+"]"},zN=function(t){return Array.isArray?Array.isArray(t):FN(t,"Array")},WN=function(t){return"object"==typeof t&&null!==t},$N=function(t){if(!WN(t)||!FN(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function GN(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&$N(a)?($N(t[i])||(t[i]={}),n<r?GN(t[i],a,n+1,r):t[i]=e[i]):zN(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var YN=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)GN(t,e[r]);return t},HN=function(t){return t};function VN(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(t,e){return function(n){return e(t(n))}},t):HN}function qN(t){return t instanceof Float32Array||t instanceof Array}var XN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},UN=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function KN(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var ZN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},QN=function(t,e,n,r,i){var a,o,s=ZN(t,2),l=s[0],c=s[1],u=vt();return o=[l,c],(a=u)[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=o[0],a[7]=o[1],a[8]=1,a};function JN(t,...e){return e.reduce((t,e)=>n=>t(e(n)),t)}function tP(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}const eP=Math.sqrt(50),nP=Math.sqrt(10),rP=Math.sqrt(2);function iP(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=eP?10:a>=nP?5:a>=rP?2:1)*10**i:-(10**-i)/(a>=eP?10:a>=nP?5:a>=rP?2:1)}const aP=(t,e,n=5)=>{const r=[t,e];let i,a=0,o=r.length-1,s=r[a],l=r[o];return l<s&&([s,l]=[l,s],[a,o]=[o,a]),i=iP(s,l,n),i>0?(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,i=iP(s,l,n)):i<0&&(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,i=iP(s,l,n)),i>0?(r[a]=Math.floor(s/i)*i,r[o]=Math.ceil(l/i)*i):i<0&&(r[a]=Math.ceil(s*i)/i,r[o]=Math.floor(l*i)/i),r};function oP(t){return Array.isArray(t)}var sP=function(t){return"object"==typeof t&&null!==t},lP={}.toString,cP=function(t,e){return lP.call(t)==="[object "+e+"]"},uP=function(t){if(!sP(t)||!cP(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var fP=function(t){return void 0===t};function dP(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function hP(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(dP(e,i)){var a=e[i];null!==a&&uP(a)?(uP(t[i])||(t[i]={}),n<r?hP(t[i],a,n+1,r):t[i]=e[i]):oP(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var pP=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)hP(t,e[r]);return t},gP=function(t){return t};function vP(t){return!(fP(t)||(e=t,null===e)||Number.isNaN(t));var e}function mP(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function yP(t){const e=Ci.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a;return[255*mP(o,a,e+1/3),255*mP(o,a,e),255*mP(o,a,e-1/3),i]}(r):null}const bP=(t,e)=>n=>t*(1-n)+e*n,xP=(t,e)=>"number"==typeof t&&"number"==typeof e?bP(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=yP(t),r=yP(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const a=n[i],o=r[i];e[i]=a*(1-t)+o*t}const[i,a,o,s]=e;return`rgba(${Math.round(i)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,wP=(t,e)=>{const n=bP(t,e);return t=>Math.round(n(t))};function kP({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function MP(t){return"object"==typeof t?t.valueOf():t}class OP extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=MP,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(kP({map:this.map,initKey:this.initKey},t))}has(t){return super.has(kP({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class EP{constructor(t){this.options=pP({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=pP({},this.options,t),this.rescale(t)}rescale(t){}}const SP=Symbol("defaultUnknown");function AP(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function _P(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:a}=t;let o=i.get(e);if(void 0===o){if(a!==SP)return a;o=n.push(e)-1,i.set(e,o)}return r[o%r.length]}function TP(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class NP extends EP{getDefaultOptions(){return{domain:[],range:[],unknown:SP}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&AP(this.domainIndexMap,this.getDomain(),this.domainKey),_P({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&AP(this.rangeIndexMap,this.getRange(),this.rangeKey),_P({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=TP(e),this.rangeKey=TP(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new NP(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function PP(t){return Math.round(1e12*t)/1e12}function CP(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,l),[u,f]=n,d=f-u,h=d/(2/l*r+1-1/l*i),p=h*i/l,g=h-l*p,v=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),m=v.reduce((t,e)=>t+e),y=g/m,b=new OP(e.map((t,e)=>{const n=v[e]*y;return[t,o?Math.floor(n):n]})),x=new OP(e.map((t,e)=>{const n=v[e]*y+p;return[t,o?Math.floor(n):n]})),w=Array.from(x.values()).reduce((t,e)=>t+e),k=u+(d-(w-w/l*i))*s;let M=o?Math.round(k):k;const O=new Array(l);for(let t=0;t<l;t+=1){O[t]=PP(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class LP extends NP{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:SP,flex:[]}}constructor(t){super(t)}clone(){return new LP(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return CP(t);const{range:i,paddingOuter:a,paddingInner:o,round:s,align:l}=t;let c,u,f=i[0];const d=i[1]-f,h=2*a,p=r-o;c=d/Math.max(1,h+p),s&&(c=Math.floor(c)),f+=(d-c*(r-o))*l,u=c*(1-o),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map((t,e)=>f+e*c);return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}const jP=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=iP(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i},RP=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,l;return r<i?(s=tP(r,i),l=n(a,o)):(s=tP(i,r),l=n(o,a)),JN(l,s)},IP=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,l=o?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=tP(s[t],s[t+1]),a[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}(t,e,1,r)-1,o=i[n];return JN(a[n],o)(e)}},DP=(t,e,n,r)=>(Math.min(t.length,e.length)>2?IP:RP)(t,e,r?wP:n);class BP extends EP{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:bP,tickCount:5}}map(t){return vP(t)?this.output(t):this.options.unknown}invert(t){return vP(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return aP}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):gP}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:a}=this.options,o=DP(n.map(t),r,a,i);this.output=JN(o,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,a=DP(i,r.map(t),bP);this.input=JN(e,n,a)}}class FP extends BP{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:xP,tickMethod:jP,tickCount:5}}chooseTransforms(){return[gP,gP]}clone(){return new FP(this.options)}}class zP extends LP{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:SP,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new zP(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}var WP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$P=function(t,e,n,r,i){var a=new FP({range:[e,e+r]}),o=new FP({range:[n,n+i]});return{transform:function(t){var e=WP(t,2),n=e[0],r=e[1];return[a.map(n),o.map(r)]},untransform:function(t){var e=WP(t,2),n=e[0],r=e[1];return[a.invert(n),o.invert(r)]}}},GP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},YP=function(t,e,n,r,i){return(0,GP(t,1)[0])(e,n,r,i)},HP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},VP=function(t,e,n,r,i){return HP(t,1)[0]},qP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},XP=function(t,e,n,r,i){var a=qP(t,4),o=a[0],s=a[1],l=a[2],c=a[3],u=new FP({range:[l,c]}),f=new FP({range:[o,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(t){var e=qP(t,2),n=e[0],r=e[1],i=f.map(n),a=u.map(r);return[.5*(a*Math.cos(i)*h)+.5,.5*(a*Math.sin(i)*p)+.5]},untransform:function(t){var e=qP(t,2),n=e[0],r=e[1],i=2*(n-.5)/h,a=2*(r-.5)/p,l=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),c=KN(Math.atan2(a,i),o,s);return[f.invert(c),u.invert(l)]}}},UP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},KP=function(t,e,n,r,i){return{transform:function(t){var e=UP(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=UP(t,2),n=e[0];return[e[1],n]}}},ZP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},QP=function(t,e,n,r,i){var a,o,s=ZP(t,2),l=s[0],c=s[1],u=vt();return o=[l,c],(a=u)[0]=o[0],a[1]=0,a[2]=0,a[3]=0,a[4]=o[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},JP=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},tC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},eC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return QP.apply(void 0,tC([[-1,-1]],JP(e),!1))},nC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return QP.apply(void 0,tC([[-1,1]],JP(e),!1))},rC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return QP.apply(void 0,tC([[1,-1]],JP(e),!1))},iC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},aC=function(t,e,n,r,i){var a=iC(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(vt(),a)},oC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},sC=function(t,e,n,r,i){var a=oC(t,4),o=a[0],s=a[1],l=a[2],c=(a[3]-l)/((s-0)/(2*Math.PI)+1),u=c/(2*Math.PI),f=new FP({range:[l,l+.99*c]}),d=new FP({range:[o,s]}),h=i/r,p=h>1?1:h,g=h>1?1/h:1;return{transform:function(t){var e=oC(t,2),n=e[0],r=e[1],i=d.map(n),a=f.map(r);return[.5*(Math.cos(i)*(u*i+a)*p)+.5,.5*(Math.sin(i)*(u*i+a)*g)+.5]},untransform:function(t){var e=oC(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,a=2*(r-.5)/g,l=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),h=KN(Math.atan2(a,i)+Math.floor(l/c)*Math.PI*2,o,s),v=l-u*h;return[d.invert(h),f.invert(v)]}}},lC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},cC=function(t,e,n,r,i){var a=lC(t,4),o=a[0],s=a[1],l=a[2],c=a[3],u=new FP({range:[l,c]});return{transform:function(t){for(var e=[],n=t.length,r=new zP({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[o,s]}),i=0;i<n;i++){var a=t[i],l=r.map(i),c=u.map(a);e.push(l,c)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},uC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function fC(t){return 1/Math.tan(t)}var dC=function(t,e,n,r,i){var a=fC(uC(t,1)[0]);return{transform:function(t){var e=uC(t,2),n=e[0],r=e[1];return[n+r*a,r]},untransform:function(t){var e=uC(t,2),n=e[0],r=e[1];return[n-r*a,r]}}},hC=function(t,e,n,r,i){var a=fC(uC(t,1)[0]);return{transform:function(t){var e=uC(t,2),n=e[0];return[n,e[1]+n*a]},untransform:function(t){var e=uC(t,2),n=e[0];return[n,e[1]-n*a]}}},pC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function gC(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r,s=a?-1:1;return s*o*(n+1)/(n+o/((t-e)*s))+e}function vC(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r;return o/(o*(n+1)/(t-e)-n*(a?-1:1))+e}function mC(t,e,n){return n?new FP({range:[0,1],domain:[0,e]}).map(t):t}var yC=function(t,e,n,r,i){var a=pC(t,3),o=a[0],s=a[1],l=a[2],c=mC(o,r,void 0!==l&&l);return{transform:function(t){var e=pC(t,2),n=e[0],r=e[1];return[gC(n,c,s,0,1),r]},untransform:function(t){var e=pC(t,2),n=e[0],r=e[1];return[vC(n,c,s,0,1),r]}}},bC=function(t,e,n,r,i){var a=pC(t,3),o=a[0],s=a[1],l=a[2],c=mC(o,i,void 0!==l&&l);return{transform:function(t){var e=pC(t,2);return[e[0],gC(e[1],c,s,0,1)]},untransform:function(t){var e=pC(t,2);return[e[0],vC(e[1],c,s,0,1)]}}},xC=function(t,e,n,r,i){var a=pC(t,5),o=a[0],s=a[1],l=a[2],c=a[3],u=a[4],f=void 0!==u&&u,d=mC(o,r,f),h=mC(s,i,f);return{transform:function(t){var e=pC(t,2),n=e[0],r=e[1];return[gC(n,d,l,0,1),gC(r,h,c,0,1)]},untransform:function(t){var e=pC(t,2),n=e[0],r=e[1];return[vC(n,d,l,0,1),vC(r,h,c,0,1)]}}},wC=function(t,e,n,r,i){var a=pC(t,5),o=a[0],s=a[1],l=a[2],c=a[3],u=a[4],f=void 0!==u&&u,d=new FP({range:[0,r]}),h=new FP({range:[0,i]}),p=f?o:d.map(o),g=f?s:h.map(s);return{transform:function(t){var e=pC(t,2),n=e[0],r=e[1],i=d.map(n)-p,a=h.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>l)return[n,r];var s=gC(o,0,c,0,l),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[d.invert(f),h.invert(v)]},untransform:function(t){var e=pC(t,2),n=e[0],r=e[1],i=d.map(n)-p,a=h.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>l)return[n,r];var s=vC(o,0,c,0,l),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[d.invert(f),h.invert(v)]}}},kC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},MC=function(t,e,n,r,i,a,o){var s=new FP({range:[e,e+i]}),l=new FP({range:[n,n+a]}),c=new FP({range:[r,r+o]});return{transform:function(t){var e=kC(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),l.map(r),c.map(i)]},untransform:function(t){var e=kC(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),l.invert(r),c.invert(i)]}}},OC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},EC=function(t,e,n,r,i,a,o){var s=OC(t,3),l=s[0],c=s[1],u=s[2];return Ct(yt(),[l,c,u])},SC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},AC=function(t,e,n,r,i,a,o){return{transform:function(t){var e=SC(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=SC(t,3),n=e[0];return[e[1],n,e[2]]}}},_C=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},TC=function(t,e,n,r,i,a,o){var s=_C(t,3),l=s[0],c=s[1],u=s[2];return Lt(yt(),[l,c,u])},NC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},PC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},CC=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},LC=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:$P,translate:QN,custom:YP,matrix:VP,polar:XP,transpose:KP,scale:QP,"shear.x":dC,"shear.y":hC,reflect:eC,"reflect.x":nC,"reflect.y":rC,rotate:aC,helix:sC,parallel:cC,fisheye:xC,"fisheye.x":yC,"fisheye.y":bC,"fisheye.circular":wC},this.update(t)}return t.prototype.update=function(t){this.options=YN({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:PC(PC([],NC(n),!1),[PC([],NC(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?PC([],NC(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],a=t(i);n.push.apply(n,UN([],XN(a),!1))}return n}}(t):t)};try{for(var l=CC(r),c=l.next();!c.done;c=l.next()){var u=NC(c.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=h(PC([],NC(d),!1),g,v,m,y);if(qN(b))a.push(b);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(b)||HN,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return VN.apply(void 0,PC([],NC(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=vt();return e&&t.reverse(),t.forEach(function(t){return mt(n,n,t)}),e&&function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*o-s*c,d=-u*a+s*l,h=c*a-o*l,p=n*f+r*d+i*h;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*c)*p,t[2]=(s*r-i*o)*p,t[3]=d*p,t[4]=(u*n-i*l)*p,t[5]=(-s*n+i*a)*p,t[6]=h*p,t[7]=(-c*n+r*l)*p,t[8]=(o*n-r*a)*p)}(n,function(t){var e=new gt(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return ge(e,e,n),[e[0],e[1]]}},t}(),jC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},RC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},IC=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},DC=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:MC,translate3D:EC,scale3D:TC,transpose3D:AC},this.update(t)}return t.prototype.update=function(t){this.options=YN({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:RC(RC([],jC(n),!1),[RC([],jC(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?RC([],jC(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],a=t(i);n.push.apply(n,UN([],XN(a),!1))}return n}}(t):t)};try{for(var l=IC(r),c=l.next();!c.done;c=l.next()){var u=jC(c.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,w=h(RC([],jC(d),!1),g,v,m,y,b,x);if(qN(w))a.push(w);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(w)||HN,!0)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return VN.apply(void 0,RC([],jC(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=yt();return e&&t.reverse(),t.forEach(function(t){return Qt(n,n,t)}),e&&Et(n,bt(n)),function(t){var e=[t[0],t[1],t[2],1];return ke(e,e,n),[e[0],e[1],e[2]]}},t}();function BC(t){return(e,...n)=>tt({},t(e,...n),e)}function FC(t){return(e,...n)=>tt({},e,t(e,...n))}function zC(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=De(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const WC=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map(t=>{var{data:e,x:s,y:l,width:c,height:u}=t,f=De(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:zC(e,o),x:null!=s?s:n,y:null!=l?l:r,width:null!=c?c:i,height:null!=u?u:a})})};WC.props={};const $C=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:a}=t,[o,s,l,c]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((t,e)=>t+e),f=t[s]-i*(e.length-1),d=r.map(t=>f*(t/u)),h=[];let p=t[o]||0;for(let n=0;n<d.length;n+=1){const r=e[n],{data:u}=r,f=De(r,["data"]),g=zC(u,a);h.push(Object.assign({[o]:p,[s]:d[n],[c]:t[c]||0,[l]:t[l],data:g},f)),p+=d[n]+i}return h};$C.props={};const GC=()=>t=>{const{children:e}=t,n=De(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:l=[],slider:c={}}=n,u=De(n,["data","scale","axis","legend","encode","transform","slider"]),f=e.map(t=>{var{data:e,scale:n={},axis:u={},legend:f={},encode:d={},transform:h=[],slider:p={}}=t,g=De(t,["data","scale","axis","legend","encode","transform","slider"]);return Object.assign({data:zC(e,r),scale:tt({},i,n),encode:tt({},s,d),transform:[...l,...h],axis:!(!u||!a)&&tt({},a,u),legend:!(!f||!o)&&tt({},o,f),slider:tt({},c,p)},g)});return[Object.assign(Object.assign({},u),{marks:f,type:"standardView",slider:c})]};GC.props={};const YC=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:l,padding:c,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:w,theme:k,component:M,interaction:O,x:E,y:S,z:A,key:_,frame:T,labelTransform:N,parentKey:P,clip:C,viewStyle:L,title:j}=e,R=De(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:S,z:A,key:_,width:n,height:r,depth:i,padding:c,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,paddingBottom:l,theme:k,coordinate:w,component:M,interaction:O,frame:T,labelTransform:N,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:P,clip:C,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};YC.props={};class HC{constructor(t){this.$value=t}static of(t){return new HC(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const VC=BC(t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(t,e)=>{var a;if(void 0===t||!i)return{};const o=rr(n,e=>e[t]),s=(null===(a=null==r?void 0:r[e])||void 0===a?void 0:a.domain)||Array.from(o.keys()),l=s.map(t=>o.has(t)?o.get(t).length:1);return{domain:s,flex:l}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"top"}},void 0===a&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"right"}},void 0===o&&{paddingInner:0}),s(o,"y"))}}}),qC=FC(t=>{const{data:e,scale:n,legend:r}=t,i=[t];let a,o,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:l={}}=t,{color:c}=n,{color:u}=r,{color:f}=l;void 0!==c&&(a=c),void 0!==u&&(o=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const l="string"==typeof a?a:"",[c,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===a)return[void 0];const i="function"==typeof a?a:t=>t[a],o=e.map(i);return o.some(t=>"number"==typeof t)?[Qn(o)]:[Array.from(new Set(o)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=c?c:[]}},scale:{color:tt({},o,{domain:c,type:u})}},void 0===r&&{legend:{color:tt({title:l},s)}})}),XC=BC(()=>({animate:{enterType:"fadeIn"}})),UC=FC(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),KC=FC(()=>({type:"cell"})),ZC=FC(t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,a=r?Array.from(new Set(e.map(t=>t[r]))):[],o=i?Array.from(new Set(e.map(t=>t[i]))):[];return(()=>{if(a.length&&o.length){const t=[];for(const e of a)for(const n of o)t.push({[r]:e,[i]:n});return t}return a.length?a.map(t=>({[r]:t})):o.length?o.map(t=>({[i]:t})):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}}),QC=FC((t,e=JC,n=eL,r=nL,i={})=>{const{data:a,encode:o,children:s,scale:l,x:c=0,y:u=0,shareData:f=!1,key:d}=t,{value:h}=a,{x:p,y:g}=o,{color:v}=l,{domain:m}=v;return{children:(t,a,o)=>{const{x:l,y:v}=a,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:w}=o,{domain:k}=l.getOptions(),{domain:M}=v.getOptions(),O=so(t),E=t.map(e),S=t.map(({x:t,y:e})=>[l.invert(t),v.invert(e)]),A=S.map(([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)}),_=A.map(t=>h.filter(t)),T=f?xr(_,t=>t.length):void 0,N=S.map(([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length})),P=N.map(t=>Array.isArray(s)?s:[s(t)].flat(1));return O.flatMap(t=>{const[e,a,o,s]=E[t],l=N[t],f=_[t];return P[t].map(v=>{var k,M,{scale:O,key:E,facet:S=!0,axis:A={},legend:_={}}=v,N=De(v,["scale","key","facet","axis","legend"]);const P=(null===(k=null==O?void 0:O.y)||void 0===k?void 0:k.guide)||A.y,C=(null===(M=null==O?void 0:O.x)||void 0===M?void 0:M.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:h,R={color:{domain:m}},I={x:rL(C,n)(l,j),y:rL(P,r)(l,j)};return Object.assign(Object.assign({key:`${E}-${t}`,data:j,margin:0,x:e+y+c+x,y:a+b+u+w,parentKey:d,width:o,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:tt(L,O,R),axis:tt({},A,I),legend:!1},N),i)})})}}});function JC(t){const{points:e}=t;return js(e)}function tL(t,e){return e.length?tt({title:!1,tick:null,label:null},t):tt({title:!1,tick:null,label:null,grid:null},t)}function eL(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return tL(t,n);const s=a===o-1&&void 0,l=n.length?void 0:null;return tt({title:s,grid:l},t)}}function nL(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return tL(t,n);const a=0===r&&void 0,o=n.length?void 0:null;return tt({title:a,grid:o},t)}}function rL(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const iL=()=>t=>[HC.of(t).call(KC).call(qC).call(XC).call(VC).call(UC).call(ZC).call(QC).value()];iL.props={};const aL=BC(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),oL=FC(t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,o,s)=>{const{x:l,y:c}=o,{paddingLeft:u,paddingTop:f,marginLeft:d,marginTop:h}=s,{domain:p}=l.getOptions(),{domain:g}=c.getOptions(),v=so(t),m=t.map(({points:t})=>js(t)),y=t.map(({x:t,y:e})=>[l.invert(t),c.invert(e)]),b=y.map(([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length})),x=b.map(t=>Array.isArray(n)?n:[n(t)].flat(1));return v.flatMap(t=>{const[n,o,s,l]=m[t],[c,p]=y[t],g=b[t];return x[t].map(v=>{var m,y;const{scale:b,key:x,encode:w,axis:k,interaction:M}=v,O=De(v,["scale","key","encode","axis","interaction"]),E=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:lL(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:cL(E)(g,e)};return Object.assign({data:e,parentKey:a,key:`${x}-${t}`,x:n+u+r+d,y:o+f+i+h,width:s,height:l,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:tt({x:{facet:!1},y:{facet:!1}},b),axis:tt({x:{tickCount:5},y:{tickCount:5}},k,S),legend:!1,encode:tt({},w,{x:c,y:p}),interaction:tt({},M,{legendFilter:!1})},O)})})}}}),sL=FC(t=>{const{encode:e}=t,n=De(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=De(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[a].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})});function lL(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return tL(t,n)}}function cL(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return tL(t,n)}}const uL=()=>t=>[HC.of(t).call(KC).call(qC).call(oL).call(sL).call(XC).call(UC).call(aL).value()],fL=BC(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),dL=BC(t=>({coordinate:{type:"polar"}})),hL=t=>{const{encode:e}=t,n=De(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function pL(t){return t=>null}function gL(t){const{points:e}=t,[n,r,i,a]=e,o=Ns(n,a),s=_s(n,a),l=Ls(s,_s(r,i)),c=1/Math.sin(l/2),u=o/(1+c),f=u*Math.sqrt(2),[d,h]=i,p=Cs(s)+l/2,g=u*c;return[d+g*Math.sin(p)-f/2,h-g*Math.cos(p)-f/2,f,f]}const vL=()=>t=>[HC.of(t).call(KC).call(hL).call(qC).call(dL).call(ZC).call(QC,gL,pL,pL,{frame:!1}).call(XC).call(UC).call(fL).value()];function mL(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const yL=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||0===o)return[];const{key:s}=e[0],l=e.map(t=>Object.assign(Object.assign({},t),{key:s})).map(t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=tt({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,a));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=mL(i,e,o);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield l[n]),t=n}e++}}};function bL(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if("plot"===o)return;const s=LB(a,t=>"element"===t.className);const l=function(t){return LB(t,t=>"component"===t.className)}(a),c=function(t){return LB(t,t=>"label"===t.className)}(a),u=s||l||c;if(!u)return;const{className:f,markType:d}=u,h=Object.assign(Object.assign({},i),{nativeEvent:!0});if("element"===f)h.data={data:Ya(u,e)},n.emit(`element:${t}`,h),n.emit(`${d}:${t}`,h);else if("label"===f){h.data={data:u.attributes.datum},n.emit(`label:${t}`,h);o.split(/\s+/).filter(Boolean).forEach(e=>{n.emit(`${e}:${t}`,h)})}else{n.emit(`component:${t}`,h);o.split(/\s+/).filter(Boolean).forEach(e=>{n.emit(`${e}:${t}`,h)})}}}function xL(){return(t,e,n)=>{const{container:r,view:i}=t,a=bL(pN.CLICK,i,n,t=>1===t.detail),o=bL(pN.DBLCLICK,i,n,t=>2===t.detail),s=bL(pN.POINTER_TAP,i,n),l=bL(pN.POINTER_DOWN,i,n),c=bL(pN.POINTER_UP,i,n),u=bL(pN.POINTER_OVER,i,n),f=bL(pN.POINTER_OUT,i,n),d=bL(pN.POINTER_MOVE,i,n),h=bL(pN.POINTER_ENTER,i,n),p=bL(pN.POINTER_LEAVE,i,n),g=bL(pN.POINTER_UPOUTSIDE,i,n),v=bL(pN.DRAG_START,i,n),m=bL(pN.DRAG,i,n),y=bL(pN.DRAG_END,i,n),b=bL(pN.DRAG_ENTER,i,n),x=bL(pN.DRAG_LEAVE,i,n),w=bL(pN.DRAG_OVER,i,n),k=bL(pN.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",d),r.addEventListener("pointerenter",h),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",d),r.removeEventListener("pointerenter",h),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function wL(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":$_,"component.axisLinear":D_,"component.axisArc":B_,"component.legendContinuousBlock":uF,"component.legendContinuousBlockSize":dF,"component.legendContinuousSize":fF,"interaction.event":xL,"composition.mark":YC,"composition.view":GC,"shape.label.label":qO,"shape.break":yE}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Ua(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=De(t,["type"]);n||Ua("Plot type is required!");const a=r(n);return null==a?void 0:a(i,e)},r]}function kL(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Ua("Cannot find library document")}function ML(t,e){const{coordinate:n={},coordinates:r}=t,i=De(t,["coordinate","coordinates"]);if(r)return t;const{type:a,transform:o=[]}=n,s=De(n,["type","transform"]);if(!a)return Object.assign(Object.assign({},i),{coordinates:o});const[,l]=wL("coordinate",e),{transform:c=!1}=l(a).props||{};if(c)throw new Error(`Unknown coordinate: ${a}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:a},s),...o]})}function OL(t,e){return t.filter(t=>t.type===e)}function EL(t){return OL(t,"polar").length>0}function SL(t){return OL(t,"transpose").length%2==1}function AL(t){return OL(t,"theta").length>0}function _L(t){return OL(t,"radial").length>0}function TL(t){return OL(t,"radar").length>0}function NL(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}yL.props={},xL.props={reapplyWhenUpdate:!0};var PL=NL("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),CL=NL("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),LL=NL("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),jL=NL("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),RL=NL("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),IL=NL("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),DL=NL("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),BL=NL("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),FL=NL("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),zL=NL("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),WL=NL("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function $L(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function GL(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function YL(){}var HL=.7,VL=1/HL,qL="\\s*([+-]?\\d+)\\s*",XL="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",UL="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",KL=/^#([0-9a-f]{3,8})$/,ZL=new RegExp(`^rgb\\(${qL},${qL},${qL}\\)$`),QL=new RegExp(`^rgb\\(${UL},${UL},${UL}\\)$`),JL=new RegExp(`^rgba\\(${qL},${qL},${qL},${XL}\\)$`),tj=new RegExp(`^rgba\\(${UL},${UL},${UL},${XL}\\)$`),ej=new RegExp(`^hsl\\(${XL},${UL},${UL}\\)$`),nj=new RegExp(`^hsla\\(${XL},${UL},${UL},${XL}\\)$`),rj={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 ij(){return this.rgb().formatHex()}function aj(){return this.rgb().formatRgb()}function oj(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=KL.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?sj(e):3===n?new fj(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?lj(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?lj(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ZL.exec(t))?new fj(e[1],e[2],e[3],1):(e=QL.exec(t))?new fj(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=JL.exec(t))?lj(e[1],e[2],e[3],e[4]):(e=tj.exec(t))?lj(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ej.exec(t))?mj(e[1],e[2]/100,e[3]/100,1):(e=nj.exec(t))?mj(e[1],e[2]/100,e[3]/100,e[4]):rj.hasOwnProperty(t)?sj(rj[t]):"transparent"===t?new fj(NaN,NaN,NaN,0):null}function sj(t){return new fj(t>>16&255,t>>8&255,255&t,1)}function lj(t,e,n,r){return r<=0&&(t=e=n=NaN),new fj(t,e,n,r)}function cj(t){return t instanceof YL||(t=oj(t)),t?new fj((t=t.rgb()).r,t.g,t.b,t.opacity):new fj}function uj(t,e,n,r){return 1===arguments.length?cj(t):new fj(t,e,n,null==r?1:r)}function fj(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function dj(){return`#${vj(this.r)}${vj(this.g)}${vj(this.b)}`}function hj(){const t=pj(this.opacity);return`${1===t?"rgb(":"rgba("}${gj(this.r)}, ${gj(this.g)}, ${gj(this.b)}${1===t?")":`, ${t})`}`}function pj(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function gj(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vj(t){return((t=gj(t))<16?"0":"")+t.toString(16)}function mj(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bj(t,e,n,r)}function yj(t){if(t instanceof bj)return new bj(t.h,t.s,t.l,t.opacity);if(t instanceof YL||(t=oj(t)),!t)return new bj;if(t instanceof bj)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new bj(o,s,l,t.opacity)}function bj(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function xj(t){return(t=(t||0)%360)<0?t+360:t}function wj(t){return Math.max(0,Math.min(1,t||0))}function kj(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}$L(YL,oj,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ij,formatHex:ij,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yj(this).formatHsl()},formatRgb:aj,toString:aj}),$L(fj,uj,GL(YL,{brighter(t){return t=null==t?VL:Math.pow(VL,t),new fj(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?HL:Math.pow(HL,t),new fj(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new fj(gj(this.r),gj(this.g),gj(this.b),pj(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:dj,formatHex:dj,formatHex8:function(){return`#${vj(this.r)}${vj(this.g)}${vj(this.b)}${vj(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hj,toString:hj})),$L(bj,function(t,e,n,r){return 1===arguments.length?yj(t):new bj(t,e,n,null==r?1:r)},GL(YL,{brighter(t){return t=null==t?VL:Math.pow(VL,t),new bj(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?HL:Math.pow(HL,t),new bj(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new fj(kj(t>=240?t-240:t+120,i,r),kj(t,i,r),kj(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bj(xj(this.h),wj(this.s),wj(this.l),pj(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=pj(this.opacity);return`${1===t?"hsl(":"hsla("}${xj(this.h)}, ${100*wj(this.s)}%, ${100*wj(this.l)}%${1===t?")":`, ${t})`}`}}));const Mj=Math.PI/180,Oj=180/Math.PI;var Ej=-.14861,Sj=1.78277,Aj=-.29227,_j=-.90649,Tj=1.97294,Nj=Tj*_j,Pj=Tj*Sj,Cj=Sj*Aj-_j*Ej;function Lj(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof jj)return new jj(t.h,t.s,t.l,t.opacity);t instanceof fj||(t=cj(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Cj*r+Nj*e-Pj*n)/(Cj+Nj-Pj),a=r-i,o=(Tj*(n-i)-Aj*a)/_j,s=Math.sqrt(o*o+a*a)/(Tj*i*(1-i)),l=s?Math.atan2(o,a)*Oj-120:NaN;return new jj(l<0?l+360:l,s,i,t.opacity)}(t):new jj(t,e,n,null==r?1:r)}function jj(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}$L(jj,Lj,GL(YL,{brighter(t){return t=null==t?VL:Math.pow(VL,t),new jj(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?HL:Math.pow(HL,t),new jj(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Mj,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new fj(255*(e+n*(Ej*r+Sj*i)),255*(e+n*(Aj*r+_j*i)),255*(e+n*(Tj*r)),this.opacity)}}));var Rj=t=>()=>t;function Ij(t,e){return function(n){return t+n*e}}function Dj(t){return 1===(t=+t)?Bj:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Rj(isNaN(e)?n:e)}}function Bj(t,e){var n=e-t;return n?Ij(t,n):Rj(isNaN(t)?e:t)}!function t(e){var n=Dj(e);function r(t,e){var r=n((t=uj(t)).r,(e=uj(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Bj(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);var Fj,zj=(Fj=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}((n-r/e)*e,o,i,a,s)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),o=new Array(r);for(e=0;e<r;++e)n=uj(t[e]),i[e]=n.r||0,a[e]=n.g||0,o[e]=n.b||0;return i=Fj(i),a=Fj(a),o=Fj(o),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=o(t),n+""}});function Wj(t){return function e(n){function r(e,r){var i=t((e=Lj(e)).h,(r=Lj(r)).h),a=Bj(e.s,r.s),o=Bj(e.l,r.l),s=Bj(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}Wj(function(t,e){var n=e-t;return n?Ij(t,n>180||n<-180?n-360*Math.round(n/360):n):Rj(isNaN(t)?e:t)});var $j=Wj(Bj),Gj=t=>zj(t[t.length-1]),Yj=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(NL),Hj=Gj(Yj),Vj=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(NL),qj=Gj(Vj),Xj=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(NL),Uj=Gj(Xj),Kj=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(NL),Zj=Gj(Kj),Qj=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(NL),Jj=Gj(Qj),tR=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(NL),eR=Gj(tR),nR=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(NL),rR=Gj(nR),iR=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(NL),aR=Gj(iR),oR=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(NL),sR=Gj(oR),lR=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(NL),cR=Gj(lR),uR=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(NL),fR=Gj(uR),dR=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(NL),hR=Gj(dR),pR=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(NL),gR=Gj(pR),vR=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(NL),mR=Gj(vR),yR=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(NL),bR=Gj(yR),xR=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(NL),wR=Gj(xR),kR=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(NL),MR=Gj(kR),OR=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(NL),ER=Gj(OR),SR=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(NL),AR=Gj(SR),_R=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(NL),TR=Gj(_R),NR=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(NL),PR=Gj(NR),CR=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(NL),LR=Gj(CR),jR=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(NL),RR=Gj(jR),IR=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(NL),DR=Gj(IR),BR=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(NL),FR=Gj(BR),zR=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(NL),WR=Gj(zR),$R=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(NL),GR=Gj($R);var YR=$j(Lj(300,.5,0),Lj(-240,.5,1)),HR=$j(Lj(-100,.75,.35),Lj(80,1.5,.8)),VR=$j(Lj(260,.75,.35),Lj(80,1.5,.8)),qR=Lj();var XR=uj(),UR=Math.PI/3,KR=2*Math.PI/3;function ZR(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var QR=ZR(NL("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),JR=ZR(NL("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),tI=ZR(NL("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eI=ZR(NL("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),nI=Object.freeze({__proto__:null,schemeCategory10:PL,schemeAccent:CL,schemeDark2:LL,schemeObservable10:jL,schemePaired:RL,schemePastel1:IL,schemePastel2:DL,schemeSet1:BL,schemeSet2:FL,schemeSet3:zL,schemeTableau10:WL,interpolateBrBG:Hj,schemeBrBG:Yj,interpolatePRGn:qj,schemePRGn:Vj,interpolatePiYG:Uj,schemePiYG:Xj,interpolatePuOr:Zj,schemePuOr:Kj,interpolateRdBu:Jj,schemeRdBu:Qj,interpolateRdGy:eR,schemeRdGy:tR,interpolateRdYlBu:rR,schemeRdYlBu:nR,interpolateRdYlGn:aR,schemeRdYlGn:iR,interpolateSpectral:sR,schemeSpectral:oR,interpolateBuGn:cR,schemeBuGn:lR,interpolateBuPu:fR,schemeBuPu:uR,interpolateGnBu:hR,schemeGnBu:dR,interpolateOrRd:gR,schemeOrRd:pR,interpolatePuBuGn:mR,schemePuBuGn:vR,interpolatePuBu:bR,schemePuBu:yR,interpolatePuRd:wR,schemePuRd:xR,interpolateRdPu:MR,schemeRdPu:kR,interpolateYlGnBu:ER,schemeYlGnBu:OR,interpolateYlGn:AR,schemeYlGn:SR,interpolateYlOrBr:TR,schemeYlOrBr:_R,interpolateYlOrRd:PR,schemeYlOrRd:NR,interpolateBlues:LR,schemeBlues:CR,interpolateGreens:RR,schemeGreens:jR,interpolateGreys:DR,schemeGreys:IR,interpolatePurples:FR,schemePurples:BR,interpolateReds:WR,schemeReds:zR,interpolateOranges:GR,schemeOranges:$R,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:YR,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return qR.h=360*t-100,qR.s=1.5-1.5*e,qR.l=.8-.9*e,qR+""},interpolateWarm:HR,interpolateCool:VR,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,XR.r=255*(e=Math.sin(t))*e,XR.g=255*(e=Math.sin(t+UR))*e,XR.b=255*(e=Math.sin(t+KR))*e,XR+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:QR,interpolateMagma:JR,interpolateInferno:tI,interpolatePlasma:eI});function rI(t,e,n,r,i,a){const{guide:o={}}=n,s=function(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return bI(t,ro)}(e))return"identity";if("string"==typeof a)return"linear";if((i||a||[]).length>2)return pI(t,s);if(void 0!==i)return mI([i])?pI(t,s):yI(e)?"time":gI(t,a,o);return mI(e)?pI(t,s):yI(e)?"time":gI(t,a,o)}(t,e,n);if("string"!=typeof s)return n;const l=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return vI(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Za(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return vI(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Za(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),c=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(uI({type:t}))return function(t,e,n){const r=t.map(Number),i=new pa({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map(t=>new Date(i.map(t))):t.map(t=>i.map(t))}(e,r,t);return fI({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,l,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ii,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?AL(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=G(e),i=nI[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:c,range:dI(s,t,e,n,c,i,a),expectedDomain:l,guide:o,name:t,type:s})}function iI(t,e){const n={};for(const r of t){const{values:t,name:i}=r,a=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map(t=>a.map(t))}}return n}function aI(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter(t=>t.startsWith(e)).map(t=>+(t.replace(e,"")||0)),a=xr(i)+1,o=`${e}${a}`;t[o]=r,r.getOptions().key=o}else t[e]=r}return t}function oI(t,e){const[n]=wL("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Va,Va];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const a=t.filter(([t])=>"function"==typeof t),o=t.filter(([t])=>"function"!=typeof t),s=new Map(o);if(r.map=t=>{for(const[e,n]of a)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const l=new Map(o.map(([t,e])=>[e,t])),c=new Map(a.map(([t,e])=>[e,t]));return r.invert=t=>c.has(t)?t:l.has(t)?l.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function sI(t){const e=t.flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale));cI(e,"x"),cI(e,"y")}function lI(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter(t=>i.includes(t)):[]}function cI(t,e){const n=t.filter(({name:t,facet:n=!0})=>n&&t===e),r=n.flatMap(t=>t.domain),i=n.every(uI)?Qn(r):n.every(fI)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function uI(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function fI(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function dI(t,e,n,r,i,a,o){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=hI(n,r,i,a,o),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[lo(e),co(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=l?l:s,null!=c?c:u]}case"band":case"point":return[null!=l?l:"size"===e?5:0,null!=c?c:"size"===e?10:1];case"ordinal":return hI(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function hI(t,e,n,r,i){const[a]=wL("palette",i),{category10:o,category20:s}=r,l=function(t){return Array.from(new Set(t))}(n).length<=o.length?o:s,{palette:c=l,offset:u}=e;if(Array.isArray(c))return c;try{return a({type:c})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=nI[`scheme${r}`],a=nI[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map((t,r)=>a(n(r/e.length)))}(c,n,u);if(e)return e;throw new Error(`Unknown Component: ${c} `)}}function pI(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function gI(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function vI(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[null!=n?n:i,null!=r?r:a]}function mI(t){return bI(t,t=>{const e=typeof t;return"string"===e||"boolean"===e})}function yI(t){return bI(t,t=>t instanceof Date)}function bI(t,e){for(const n of t)if(n.some(e))return!0;return!1}const xI={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},wI={threshold:"threshold",quantize:"quantize",quantile:"quantile"},kI={ordinal:"ordinal",band:"band",point:"point"},MI={constant:"constant"};function OI(t,e,n){const{coordinates:r=[],title:i}=e,[,a]=wL("component",n),o=t.filter(({guide:t})=>null!==t),s=[],l=function(t,e,n){const[,r]=wL("component",n),{coordinates:i}=t;function a(t,e,n,a){const o=function(t,e,n=[]){return"x"===t?SL(n)?`${e}Y`:`${e}X`:"y"===t?SL(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!a||!o)return;const{props:s}=r(o),{defaultPosition:l,defaultSize:c,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:l,defaultSize:c,order:u,type:o,crossPadding:f},a),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{const{slider:e,scrollbar:n,name:r}=t;return[a("slider",r,t,e),a("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);if(s.push(...l),i){const{props:t}=a("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:o,defaultCrossPadding:l}=t,c="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:l[0],defaultSize:o},c))}const c=function(t,e){const n=t.filter(t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o)||!(!["sequential"].includes(e)||!a||!o&&!i)||!(!["constant","identity"].includes(e)||!o)}(t));return[...AI(n),...TI(n,e)]}(o,r);return c.forEach(([t,e])=>{const{props:n}=a(t),{defaultPosition:i,defaultPlane:l="xy",defaultOrientation:c,defaultSize:u,defaultOrder:f,defaultLength:d,defaultPadding:h=[0,0],defaultCrossPadding:p=[0,0]}=n,g=tt({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[a,g]=CI(t,i,c,n,e,o,r);if(!a&&!g)continue;const v="left"===a||"right"===a,y=v?h[1]:h[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=d,padding:M=y,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:k,position:a,plane:l,orientation:g,padding:M,order:w,crossPadding:O,size:x,type:t,scales:e}))}}),s}function EI(t,e,n,r,i){const[a]=wL("component",r),{scaleInstances:o,scale:s,bbox:l}=t,c={bbox:l,library:r};return a(De(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:c,scale:s})}function SI(t,e){const n=["left","right","bottom","top"],r=ir(t,({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent"));return r.flatMap(([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=Tr(n);if(r>e)return t.forEach(t=>t.group=Symbol("independent")),t;const i=(e-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=i)})}const n=xr(t,t=>t.size),r=xr(t,t=>t.order),i=xr(t,t=>t.crossPadding);return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}})}function AI(t,e){const n=["shape","size","color","opacity"],r=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e)),i=r.filter(({type:t})=>"constant"===t),a=ir(r.filter(({type:t})=>"constant"!==t),t=>t.field?t.field:Symbol("independent")).map(([t,e])=>[t,[...e,...i]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort(([t],[e])=>t.localeCompare(e)),l=Array.from(o).map(([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...fo(t,n));return e}(t).sort((t,e)=>e.length-t.length),n=e.map(t=>({combination:t,option:t.map(t=>[t.name,_I(t)])}));for(const{option:t,combination:e}of n)if(!t.every(t=>"constant"===t[1])&&t.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",e];for(const[t,e]of ZA)for(const{option:r,combination:i}of n)if(e.some(t=>rt(s(t),s(r))))return[t,i];return null}).filter(Za);return l}function _I(t){const{type:e}=t;return"string"!=typeof e?null:e in xI?"continuous":e in kI?"discrete":e in wI?"distribution":e in MI?"constant":null}function TI(t,e){return t.map(t=>{const{name:n}=t;if(function(t){return OL(t,"helix").length>0}(e)||AL(e))return null;if(SL(e)&&(EL(e)||_L(e)))return null;if(n.startsWith("x"))return EL(e)?["axisArc",[t]]:_L(e)?["axisLinear",[t]]:[SL(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return EL(e)?["axisLinear",[t]]:_L(e)?["axisArc",[t]]:[SL(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(TL(e))return["axisRadar",[t]];if(!EL(e))return["axisY",[t]]}return null}).filter(Za)}function NI(t){const e=OL(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=OL(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function PI(t,e,n,r,i){const{name:a}=n[0];if("axisRadar"===t){const t=r.filter(t=>t.name.startsWith("position")),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(a);if(null===e)return[null,null];const[n,o]=NI(i);return["center",(o-n)/(TL(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return OL(t,"parallel").length>0}(i))return SL(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=NI(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:EL(i)||_L(i)?["center",null]:"axisX"===t&&function(t){return OL(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return OL(t,"reflectY").length>0}(i)?["top",null]:e}function CI(t,e,n,r,i,a,o){const[s]=NI(o),l=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?PI(t,l,i,a,o):"string"==typeof t&&t.startsWith("legend")&&EL(o)&&"center"===r.position?["center","vertical"]:l}function LI(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof o)return;const s=o;return(s.startsWith("axis")?BI:s.startsWith("group")?jI:s.startsWith("legendContinuous")?FI:"legendCategory"===s?zI:s.startsWith("slider")?DI:"title"===s?II:s.startsWith("scrollbar")?RI:()=>{})(t,e,n,r,i,a)}function jI(t,e,n,r,i,a){const{children:o}=t,s=xr(o,t=>t.crossPadding);o.forEach(t=>t.crossPadding=s),o.forEach(t=>LI(t,e,n,r,i,a));const l=xr(o,t=>t.size);t.size=l,o.forEach(t=>t.size=l)}function RI(t,e,n,r,i,a){const{trackSize:o=6}=tt({},i.scrollbar,t);t.size=o}function II(t,e,n,r,i,a){const o=tt({},i.title,t),{title:s,subtitle:l,spacing:c=0}=o,u=De(o,["title","subtitle","spacing"]);if(s){const e=VI(s,Ja(u,"title"));t.size=e.height}if(l){const e=VI(l,Ja(u,"subtitle"));t.size+=c+e.height}}function DI(t,e,n,r,i,a){const{trackSize:o,handleIconSize:s}=(()=>{const{slider:e}=i;return tt({},e,t)})(),l=Math.max(o,2.4*s);t.size=l}function BI(t,e,n,r,i,a){var o,s;t.transform=t.transform||[{type:"hide"}];const l="left"===r||"right"===r,c=YI(t,r,i),{tickLength:u=0,labelSpacing:f=0,titleSpacing:d=0,labelAutoRotate:h}=c,p=De(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),g=WI(t,a),v=$I(p,g);let m=u;if("function"==typeof t.tickLength){const e=((null===(o=g.getTicks)||void 0===o?void 0:o.call(g))||g.getOptions().domain).map((e,n,r)=>t.tickLength(e,n,r));m=Math.max(...e,0)}const y=m+f;if(v&&v.length){const r=xr(v,t=>t.width),i=xr(v,t=>t.height);if(l)t.size=r+y;else{const{tickFilter:a,labelTransform:o}=t;!function(t,e,n,r,i){const a=Tr(e,t=>t.width);if(a>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=HI(t,i),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(o,t)),c=s.map((t,e)=>e),u=-r[0],f=n+r[1],d=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<c.length;t++){const n=l[t],[r,i]=d(n,e[t]);if(r<u||i>f)return!0;const a=l[t+1];if(a){const[n]=d(a,e[t+1]);if(i>n)return!0}}return!1}(g,v,e,n,a)||o||!1===h||null===h?(t.labelTransform=null!==(s=t.labelTransform)&&void 0!==s?s:"rotate(0)",t.size=i+y):(t.labelTransform="rotate(90)",t.size=r+y)}}else t.size=m;const b=GI(p);b&&(t.size+=l?d+b.width:d+b.height)}function FI(t,e,n,r,i,a){const o=(()=>{const{legendContinuous:e}=i;return tt({},e,t)})(),{labelSpacing:s=0,titleSpacing:l=0}=o,c=De(o,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Ja(c,"ribbon"),{size:d}=f,h=Ja(c,"handleIcon"),{size:p}=h,g=Math.max(d,2.4*p);t.size=g;const v=$I(c,WI(t,a));if(v){const e=u?"width":"height",n=xr(v,t=>t[e]);t.size+=n+s}const m=GI(c);m&&(u?t.size=Math.max(t.size,m.width):t.size+=l+m.height)}function zI(t,e,n,r,i,a){const o=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,a]=Array.isArray(n)?[n,void 0]:[void 0,n];return tt({title:r},e,Object.assign(Object.assign({},t),{title:a}))})(),{focus:s,itemSpacing:l,focusMarkerSize:c,itemMarkerSize:u,titleSpacing:f,rowPadding:d,colPadding:h,maxCols:p=1/0,maxRows:g=1/0}=o,v=De(o,["focus","itemSpacing","focusMarkerSize","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:m,length:y}=t,b=t=>Math.min(t,g),x=t=>Math.min(t,p),w="left"===r||"right"===r,k=void 0===y?e+(w?0:n[0]+n[1]):y,M=GI(v),O=$I(v,WI(t,a),"itemLabel"),E=Math.max(O[0].height,u)+d,S=(t,e=0)=>u+t+l[0]+e+(s?c+l[2]:0);w?(()=>{let e=-1/0,n=0,r=1,i=0,a=-1/0,o=-1/0;const s=M?M.height:0,l=k-s;for(const{width:t}of O){const s=S(t,h);e=Math.max(e,s),n+E>l?(r++,a=Math.max(a,i),o=Math.max(o,n),i=1,n=E):(n+=E,i++)}r<=1&&(a=i,o=n),t.size=e*x(r),t.length=o+s,tt(t,{cols:x(r),gridRow:a})})():"number"==typeof m?(()=>{const e=Math.ceil(O.length/m),n=xr(O,t=>S(t.width))*m;t.size=E*b(e)-d,t.length=Math.min(n,k)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of O){const i=S(t,h);n+i>k?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*b(e)-d,t.length=r})(),M&&(w?t.size=Math.max(t.size,M.width):t.size+=f+M.height)}function WI(t,e){const[n]=wL("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==i&&(o.tickCount=i),void 0!==a&&(o.tickMethod=a),n(o)}function $I(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=De(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){const r=HI(t,n),i=r.map(t=>"number"==typeof t?Sm(t):t),a=e?"string"==typeof e?m_(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(a)}(e,r,i),l=Ja(o,n),c=s.map((t,e)=>Object.fromEntries(Object.entries(l).map(([n,r])=>[n,"function"==typeof r?r(t,e):r]))),u=s.map((t,e)=>VI(t,c[e])),f=c.some(t=>t.transform);if(!f){const e=s.map((t,e)=>e);t.indexBBox=new Map(e.map(t=>[t,[s[t],u[t]]]))}return u}function GI(t){const{title:e}=t,n=De(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Ja(n,"title"),{direction:i,transform:a}=r,o=Array.isArray(e)?e.join(","):e;if("string"!=typeof o)return null;return VI(o,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function YI(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${Xa(e)}`]:s}=n;return tt({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function HI(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function VI(t,e){const n=function(t){return t instanceof Yg?t:new cv({style:{text:`${t}`}})}(t),r=De(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function qI(t,e,n,r){var i,a,o,s;const{width:l,height:c,depth:u,x:f=0,y:d=0,z:h=0,inset:p=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:g=p,insetTop:m=p,insetBottom:y=p,insetRight:b=p,margin:x=(null!==(a=n.margin)&&void 0!==a?a:0),marginLeft:w=x,marginBottom:k=x,marginTop:M=x,marginRight:O=x,padding:E=n.padding,paddingBottom:S=E,paddingLeft:A=E,paddingRight:_=E,paddingTop:T=E}=function(t,e,n,r){const{coordinates:i}=e;if(!EL(i)&&!_L(i))return e;const a=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===a.length)return e;const o=a.map(t=>YI(t,"axisArc"===t.type?"arc":"linear",n)),s=xr(o,t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0}),l=a.flatMap((t,e)=>$I(o[e],WI(t,r))).filter(Za),c=xr(l,t=>t.height)+s,u=a.flatMap((t,e)=>GI(o[e])).filter(t=>null!==t),f=0===u.length?0:xr(u,t=>t.height),{inset:d=c,insetLeft:h=d,insetBottom:p=d,insetTop:g=d+f,insetRight:v=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),N=16===w&&"auto"===A,P=16===O&&"auto"===_,C=at(e,"coordinates",[]).some(t=>"transpose"===t.type),L=t.find(({type:t})=>"axisX"===t),{size:R,labelTransform:I}=L||{},D=(t,n,r,i,a)=>{const{marks:o}=e;if(0===o.length)return[i,a];if(t-i-a-.25*t>0)return[i,a];const s=.75*t;return["auto"===n?s*i/(i+a):i,"auto"===r?s*a/(i+a):a]},B=t=>"auto"===t?20:null!=t?t:20,F=B(T),z=B(S),W=XI(t,c-F-z,[F+M,z+k],["left","right"],e,n,r),{paddingLeft:$,paddingRight:G}=W,Y=l-w-O;let[H,V]=D(Y,A,_,$,G),q=Y-H-V;const X=XI(t,q,[H+w,V+O],["bottom","top"],e,n,r),{paddingTop:U,paddingBottom:K}=X,Z=c-k-M,[Q,J]=D(Z,S,T,K,U),tt=Z-Q-J;if(R&&!C&&!I){const{fontSize:t=12,fontFamily:e="sans-serif",scales:n=[]}=L,r=null!==(s=null===(o=null==n?void 0:n[0])||void 0===o?void 0:o.domain)&&void 0!==s?s:[];if(!r.length)return;const i=(n,r,i,a)=>{const o=yb(r,{fontSize:t,fontFamily:e}),s=o/2-i-a;s>0&&(q-=s,"left"===n?H+=o/2-i:V+=o/2-i)};N&&i("left",function(t){if(v(t))return t[0]}(r),w,H),P&&i("right",j(r),O,V)}return{width:l,height:c,depth:u,insetLeft:g,insetTop:m,insetBottom:y,insetRight:b,innerWidth:q,innerHeight:tt,paddingLeft:H,paddingRight:V,paddingTop:J,paddingBottom:Q,marginLeft:w,marginBottom:k,marginTop:M,marginRight:O,x:f,y:d,z:h}}function XI(t,e,n,r,i,a,o){const s=rr(t,t=>t.position),{padding:l=a.padding,paddingLeft:c=l,paddingRight:u=l,paddingBottom:f=l,paddingTop:d=l}=i,h={paddingBottom:f,paddingLeft:c,paddingTop:d,paddingRight:u};for(const t of r){const r=`padding${Xa(Ay(t))}`,i=s.get(t)||[],l=h[r],c=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(c),t.size=xr(t.children,t=>t.size)):t.size=t.defaultSize},f=r=>{r.size||("auto"!==l?u(r):(LI(r,e,n,t,a,o),c(r)))},d=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=kr(i,t=>t.order),v=i.filter(t=>t.type.startsWith("axis")&&t.order==g);if(v.length&&(v[0].crossPadding=0),"number"==typeof l)i.forEach(c),i.forEach(d);else if(0===i.length)h[r]=0;else{const t=SI(i,p?e+n[0]+n[1]:e);t.forEach(f);const a=t.reduce((t,{size:e,crossPadding:n=12})=>t+e+n,0);h[r]=a}}return h}function UI({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:l,marginRight:c,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:g}){const v=n+o,m=i+s,y=r+c,b=a+l,x=t-o-c,w=[v+h,m+g,f-h-p,u-g-d,"center",null,null];return{top:[v,0,f,m,"vertical",!0,zn,o,x],right:[t-y,m,y,u,"horizontal",!1,zn],bottom:[v,e-b,f,b,"vertical",!1,zn,o,x],left:[0,m,v,u,"horizontal",!0,zn],"top-left":[v,0,f,m,"vertical",!0,zn],"top-right":[v,0,f,m,"vertical",!0,zn],"bottom-left":[v,e-b,f,b,"vertical",!1,zn],"bottom-right":[v,e-b,f,b,"vertical",!1,zn],center:w,inner:w,outer:w}}function KI(t,e,n,r){const[i,a]=uo(t,t=>!("string"!=typeof t.type||!t.type.startsWith("axis")));!function(t,e,n,r){"center"===r?function(t){return rc(t)&&tc(t)}(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):tc(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n):rc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,a]=n,o=new Array(t.length).fill(0),s=e.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let e=0;e<t.length;e++){const n=t[e],i=l[e],o=l[e+1]-i;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,a]=n,o=new Array(t.length).fill(0),s=e.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let e=0;e<t.length;e++){const n=t[e],r=l[e],o=l[e+1]-r;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[l]=oc(e),c=a/2,u=l*c,f=o-u,d=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+d,width:2*u,height:2*u}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,a,o]=n,[s]=oc(e),l=o/2*s/Math.sqrt(2),c=r+a/2,u=i+o/2;for(let e=0;e<t.length;e++){t[e].bbox={x:c-l,y:u-l,width:2*l,height:2*l}}}(a,e,n)}function ZI(t,e,n){const[r,i,a,o,s,l,c,u,f]=n,[d,h,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",o,"width",a]:["x",r,"y",i,"width",a,"height",o];t.sort((t,e)=>null==c?void 0:c(t.order,e.order));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=l?h+m:h;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:a}=r,{size:o}=r;r.bbox={[d]:l?n-o-i:n+i,[p]:k(a,g,u),[v]:o,[y]:w(a,b,f)},n+=(o+i)*(l?-1:1)}const M=t.filter(t=>"group"===t.type);for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,a=n.reduce((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t},"flex-start"),o=n.map((t,e)=>{const{length:r=i,padding:a=0}=t;return r+(e===n.length-1?0:a)}),s=r-Tr(o),l="flex-start"===a?0:"center"===a?s/2:s;for(let t=0,r=e[p]+l;t<n.length;t++){const i=n[t],{padding:s=0}=i,l=t===n.length-1?0:s;i.bbox={[v]:e[v],[d]:e[d],[p]:r,[y]:o[t]-l},tt(i,{layout:{justifyContent:a}}),r+=o[t]}}}const QI=Symbol("CALLBACK_ITEM");function JI(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,o=De(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},o),{encode:r,scale:i,transform:a})]}function tD(t,e,n){return Fe(this,void 0,void 0,function*(){const{library:t}=n,{data:r}=e,[i]=wL("data",t),a=function(t){if(I(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=De(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:o=[]}=a,s=[De(a,["transform"]),...o].map(t=>i(t,n)),l=yield function(t){return t.reduce((t,e)=>n=>Fe(this,void 0,void 0,function*(){const r=yield t(n);return e(r)}),Va)}(s)(r),c=!r||Array.isArray(r)||Array.isArray(l)?l:{value:l};return[Array.isArray(l)?so(l):[],Object.assign(Object.assign({},e),{data:c})]})}function eD(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function nD(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const a=oo(r,t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Za(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some(t=>void 0!==t[e])}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}});return[t,Object.assign(Object.assign({},e),{encode:a})]}function rD(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=oo(r,(t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function iD(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=function(t){const[e]=wL("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:dD(n)})}(a),s=oo(r,t=>o(i,t));return[t,Object.assign(Object.assign({},e),{encode:s})]}function aD(t,e,n){const{tooltip:r={}}=e;return io(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:ro(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function oD(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(io(a))return[t,e];const o=e=>{if(!e)return e;if("string"==typeof e)return t.map(t=>({name:e,value:r[t][e]}));if(ro(e)){const{field:n,channel:a,color:o,name:s=n,valueFormatter:l=t=>t}=e,c="string"==typeof l?m_(l):l,u=a&&i[a],f=u&&i[a].field,d=s||f||a,h=[];for(const e of t){const t=n?r[e][n]:u?i[a].value[e]:null;h[e]={name:d,color:o,value:c(t)}}return h}if("function"==typeof e){const n=[];for(const a of t){const t=e(r[a],a,r,i);ro(t)?n[a]=Object.assign(Object.assign({},t),{[QI]:!0}):n[a]={value:t}}return n}return e},{title:s,items:l=[]}=a,c=De(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(l)?l.map(o):[]},c);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function sD(t,e,n){const{encode:r}=e,i=De(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter(([,t])=>{const{value:e}=t;return Array.isArray(e[0])}).flatMap(([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=De(n,["value"]);for(let n=0;n<i.length;n++){const a=i[n];if(Array.isArray(a))for(let i=0;i<a.length;i++){const o=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];o[1][n]=a[i],r[i]=o}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function lD(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},l="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return tt(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{const e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function cD(t,e,n){const{animate:r}=e;return r||void 0===r||tt(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function uD(t,e,n){var r,i;return tt(e,{scale:{series:Object.assign({key:`DEFAULT_${e.type}_SERIES_KEY`},null!==(i=null===(r=null==e?void 0:e.scale)||void 0===r?void 0:r.series)&&void 0!==i?i:{})}}),[t,e]}function fD(t,e,n){return Fe(this,void 0,void 0,function*(){const[r,i]=yield function(t,e,n){return Fe(this,void 0,void 0,function*(){const{library:r}=n,[i]=wL("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,l=[JI,tD,eD,nD,rD,iD,sD,cD,lD,aD,uD,...a.map(i),...s.map(i),...o.map(i),oD];let c=[],u=t;for(const t of l)[c,u]=yield t(c,u,n);return[c,u]})}(t,e,n),{encode:a,scale:o,data:s,tooltip:l,key:c}=i;if(!1===Array.isArray(s))return null;const{channels:u}=e,f=or(Object.entries(a).filter(([,t])=>Za(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find(t=>t.name===n);return(null==r?void 0:r.independent)?t:n}),d=u.filter(t=>{const{name:e,required:n}=t;if(f.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return f.filter(([t])=>t.startsWith(e)).map(([t,e],l)=>{const u=e.some(t=>t.visual),f=e.some(t=>t.constant),d=o[t]||{},{independent:h=!1,key:p=r||t,type:g=(f?"constant":u?"identity":n)}=d,v=De(d,["independent","key","type"]),m="constant"===g,y=m?void 0:i;return{name:t,values:e,scaleKey:h||m?Symbol("independent"):p,scale:Object.assign(Object.assign({type:g,markKey:c,range:y},v),{quantitative:a,ordinal:s})}})});return[i,Object.assign(Object.assign({},e),{index:r,channels:d,tooltip:l})]})}function dD(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function hD(t,e,n){return Fe(this,void 0,void 0,function*(){var r;const{library:i}=n,[a]=wL("composition",i),[o]=wL("interaction",i),s=new Set(Object.keys(i).map(t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(Za)),l=new Set(Object.keys(i).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(Za)),c=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||l.has(e)?"mark":e},u=t=>"mark"===c(t),f=t=>"standardView"===c(t),d=t=>{const{type:e}=t;return"string"==typeof e&&!!l.has(e)},h=t=>{if(f(t))return[t];const e=c(t);return a({type:e,static:d(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,a]=e?bD(e,t,i):yield vD(t,n);g.set(r,t),p.push(r);const o=a.flatMap(h).map(t=>ML(t,i));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map(t=>mD(t,n)));sI(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];v.set(n,r)}}}else{const e=h(u(t)?t:yield jD(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(pN.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(BD(lE)).data(p,t=>t.key).join(t=>t.append("g").attr("className",lE).attr("id",t=>t.key).call(pD).each(function(t,e,r){xD(t,Mm(r),k,n),b.set(t,r)}),t=>t.call(pD).each(function(t,e,r){xD(t,Mm(r),k,n),w.set(t,r)}),t=>t.each(function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()}).remove());const M=(t,e,r)=>Array.from(t.entries()).map(([i,a])=>{const o=r||new Map,s=(t,e=t=>t)=>o.set(t,e),l=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=wL("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),a=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,o=LD(e),s=o.map(i).filter(a).map(t=>t[0]);return(e,r,i)=>Fe(this,void 0,void 0,function*(){const a=[],[o,l]=yield vD(e,n);xD(o,t,a,n);for(const i of s.filter(t=>t!==r))gD(i,t,e,o,n);for(const e of l)hD(e,t,n);return i(),{options:e,view:o}})}(Mm(a),l,n),u={view:i,container:a,options:l,setState:s,update:(n,r)=>Fe(this,void 0,void 0,function*(){const i=qa(Array.from(o.values()))(l);return yield c(i,n,()=>{x(r)&&e(t,r,o)})})};return n.externals.update=u.update,n.externals.setState=s,u}),O=(t=w,e,r)=>{var i;const a=M(t,O,r);for(const t of a){const{options:r,container:s}=t,l=s.nameInteraction;let c=LD(r);e&&(c=c.filter(t=>e.includes(t[0])));for(const e of c){const[r,s]=e,c=l.get(r);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),s){const e=yD(t.view,r,s,o)(t,a,n.emitter);l.set(r,{destroy:e})}}}},E=M(b,O);for(const t of E){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of LD(e)){const[e,a]=i;if(a){const i=yD(t.view,e,a,o)(t,E,n.emitter);r.set(e,{destroy:i})}}}O();const{width:S,height:A}=t,_=[];for(const t of y){const r=new Promise(r=>Fe(this,void 0,void 0,function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield hD(t,e,n)}r()}));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach(t=>null==t?void 0:t.cancel()),n.animations=k,n.emitter.emit(pN.AFTER_PAINT);const T=k.filter(Za).map(TD).map(t=>t.finished);return Promise.all([...T,..._])})}function pD(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function gD(t,e,n,r,i){var a;const{library:o}=i,[s]=wL("interaction",o),l=e.node().nameInteraction,c=LD(n).find(([e])=>e===t),u=l.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!c[1])return;const f=yD(r,t,c[1],s),d={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},h=f(d,[],i.emitter);l.set(t,{destroy:h})}function vD(t,e){return Fe(this,void 0,void 0,function*(){const{library:n}=e,r=yield function(t,e){return Fe(this,void 0,void 0,function*(){const{library:n}=e,[r,i]=wL("mark",n),a=new Set(Object.keys(n).map(t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]}).filter(Za)),{marks:o}=t,s=[],l=[],c=[...o],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:l=16,marginLeft:c=l,marginRight:u=l,marginTop:f=l,marginBottom:d=l,inset:h=0,insetLeft:p=h,insetRight:g=h,insetTop:v=h,insetBottom:m=h}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(a)-c-u-p-g,height:e-y(o)-y(s)-f-d-v-m}}(t),d={options:t,width:u,height:f};for(;c.length;){const[t]=c.splice(0,1),n=yield jD(t,e),{type:o=Ua("G2Mark type is required."),key:u}=n;if(a.has(o))l.push(n);else{const{props:t={}}=i(o),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,d),a=Array.isArray(i)?i:[i];c.unshift(...a.map((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`})))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:l})})}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=De(t,["coordinate","interaction","style","marks"]),o=i.map(t=>t.coordinate||{}),s=i.map(t=>t.interaction||{}),l=i.map(t=>t.viewStyle||{}),c=[...o,e].reduceRight((t,e)=>tt(t,e),{}),u=[n,...s].reduce((t,e)=>tt(t,e),{}),f=[...l,r].reduce((t,e)=>tt(t,e),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:c,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const a=ML(i,n);return bD(yield mD(a,e),a,n)})}function mD(t,e){return Fe(this,void 0,void 0,function*(){const{library:n}=e,[r]=wL("theme",n),[,i]=wL("mark",n),{theme:a,marks:o,coordinates:s=[]}=t,l=r(CD(a)),c=new Map;for(const t of o){const{type:n}=t,{props:r={}}=i(n),a=yield fD(t,r,e);if(a){const[t,e]=a;c.set(t,e)}}const u=rr(Array.from(c.values()).flatMap(t=>t.channels),({scaleKey:t})=>t);for(const t of u.values()){const e=t.reduce((t,{scale:e})=>tt(t,e),{}),{scaleKey:r}=t[0],{values:i}=t[0],a=Array.from(new Set(i.map(t=>t.field).filter(Za))),o=tt({guide:{title:0===a.length?void 0:a},field:a[0]},e),{name:c}=t[0],u=t.flatMap(({values:t})=>t.map(t=>t.value)),f=Object.assign(Object.assign({},rI(c,u,o,s,l,n)),{uid:Symbol("scale"),key:r});t.forEach(t=>t.scale=f)}return c})}function yD(t,e,n,r){const i=t.theme,a="string"==typeof e&&i[e]||{};return r(tt(a,Object.assign({type:e},n)))}function bD(t,e,n){var r;const[i]=wL("mark",n),[a]=wL("theme",n),[o]=wL("labelTransform",n),{key:s,frame:l=!1,theme:c,clip:u,style:f={},labelTransform:d=[]}=e,h=a(CD(c)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),o=new Map(a.map(t=>[t.name,t]));for(const t of r){const e=lI(t);for(const r of e){const e=o.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:l=!1}=s;if(e&&!l){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=tt({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:ct(t,i)});a.push(e)}}}return a}(p,e),v=function(t){return t.map(t=>{const e=tt(t,t.style);return delete e.style,e})}(OI(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},o=(null===(r=t.find(t=>"color"===t.name))||void 0===r?void 0:r.field)||null,s={field:o,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=qI(v,e,h,n),y=function(t,e,n){const[r]=wL("coordinate",n),{innerHeight:i,innerWidth:a,insetLeft:o,insetTop:s,insetRight:l,insetBottom:c}=t,{coordinates:u=[]}=e,f=(d=u).find(t=>"cartesian"===t.type||"cartesian3D"===t.type)?d:[...d,{type:"cartesian"}];var d;const h="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:o,y:s,width:a-o-l,height:i-c-s,transformations:f.flatMap(r)});return h?new DC(p):new LC(p)}(m,e,n),b=l?tt({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=rr(t,t=>`${t.plane||"xy"}-${t.position}`),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,w={xy:UI({width:b,height:y,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:UI({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:UI({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),a=w[r][i],[o,s]=uo(n,t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i))));o.length&&KI(o,e,a,i),s.length&&ZI(n,0,a)}}(SI(v),y,m),function(t){const e=t.find(({type:t})=>"axisX"===t),n=t.find(({type:t})=>"axisY"===t),r=t.find(({type:t})=>"axisZ"===t);e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap(t=>{const{channels:e}=t;return e.map(({scale:t})=>[t.uid,oI(t,n)])}));!function(t,e){const n=Array.from(t.values()).flatMap(t=>t.channels),r=or(n,t=>t.map(t=>e.get(t.scale.uid)),t=>t.name).filter(([,t])=>t.some(t=>"function"==typeof t.getOptions().groupTransform)&&t.every(t=>t.getTicks)).map(t=>t[1]);r.forEach(t=>{const e=t.map(t=>t.getOptions().groupTransform)[0];e(t)})}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:a}=t,o=null!==(r=x.get(a))&&void 0!==r?r:oI(t,n);i.push(o),"y"===e&&o.update(Object.assign(Object.assign({},o.getOptions()),{xScale:w.x})),aI(w,{[e]:o})}t.scaleInstances=i}const k=[],M=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:a,key:o,data:l}=e;M.set(o,l);const{index:c,channels:u,tooltip:f}=n,d=Object.fromEntries(u.map(({name:t,scale:e})=>[t,e])),h=oo(d,({uid:t})=>x.get(t));aI(w,h);const p=iI(u,h),g=i(e),[v,b,O]=wD(g(c,h,p,y)),E=r||v.length,S=a?a(b,E,m):[],A=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},_=t=>f.items.map(e=>e[t]),T=v.map((t,e)=>{const n=Object.assign({points:b[e],transform:S[e],index:t,markKey:o,viewKey:s,data:l[t]},f&&{title:A(t),items:_(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],O&&(n[`series${G(r)}`]=O[e].map(t=>i[t]));return O&&(n.seriesIndex=O[e]),O&&f&&(n.seriesItems=O[e].map(t=>_(t)),n.seriesTitle=O[e].map(t=>A(t))),n});n.data=T,n.index=v;const N=null==t?void 0:t(T,h,m);k.push(...N||[])}return[{layout:m,theme:h,coordinate:y,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:M,options:e,labelTransform:qa(d.map(o))},k]}function xD(t,e,n,r){return Fe(this,void 0,void 0,function*(){const{library:i}=r,{components:a,theme:o,layout:s,markState:l,coordinate:c,key:u,style:f,clip:d,scale:h}=t,{x:p,y:g,width:v,height:m}=s,y=De(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((t,e)=>e),w=b.map(t=>to(Object.assign({},o.view,f),t)),k=["a","margin","padding","inset"].map(t=>Ja(y,t)),M=t=>t.style("x",t=>_[t].x).style("y",t=>_[t].y).style("width",t=>_[t].width).style("height",t=>_[t].height).each(function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Mm(n),w[t])});let O=0,E=0,S=v,A=m;const _=x.map(t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:a=0}=e;return O+=n,E+=r,S-=n+a,A-=r+i,{x:O,y:E,width:S,height:A}});e.selectAll(BD(dE)).data(x.filter(t=>Za(w[t])),t=>b[t]).join(t=>t.append("rect").attr("className",dE).style("zIndex",-2).call(M),t=>t.call(M),t=>t.remove());const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:a}=i,{enter:o={},update:s={},exit:l={}}=t,{type:c,duration:u=300,delay:f=0}=s,{type:d,duration:h=300,delay:p=0}=o,{type:g,duration:v=300,delay:m=0}=l;for(const t of a){const{updateType:r=c,updateDuration:i=u,updateDelay:a=f,enterType:o=d,enterDuration:s=h,enterDelay:l=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+a),n=Math.min(n,a)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===o||o)&&(e=Math.max(e,s+l),n=Math.min(n,l))}}return e===-1/0?null:[n,e-n]}(l),N=!!T&&{duration:T[1]};for(const[,t]of ir(a,t=>`${t.type}-${t.position}`))t.forEach((t,e)=>t.index=e);const P=e.selectAll(BD(uE)).data(a,t=>`${t.type}-${t.position}-${t.index}`).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",uE).append(t=>EI(tt({animate:N,scale:h},t),c,o,i,l)),t=>t.transition(function(t,e,n){const{preserve:r=!1}=t;if(r)return;const a=EI(tt({animate:N,scale:h},t),c,o,i,l),{attributes:s}=a,[u]=n.childNodes;return u.update(s,!1)})).transitions();n.push(...P.flat().filter(Za));const C=e.selectAll(BD(cE)).data([s],()=>u).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",cE).call(RD).call(DD,Array.from(l.keys())).call(FD,d),t=>t.call(DD,Array.from(l.keys())).call(RD).call(FD,d)).transitions();n.push(...C.flat());for(const[a,o]of l.entries()){const{data:s}=o,{key:l,class:c,type:u}=a,f=e.select(`#${l}`),d=ED(a,o,t,r),h=_D(a,o,t,i),p=ND(a,o,t,i),g=PD(a,o,t,i),v=MD(e,f,c,"element"),m=f.selectAll(BD(sE)).selectFacetAll(v).data(s,t=>t.key,t=>t.groupKey).join(t=>t.append(d).attr("className",sE).attr("markType",u).transition(function(t,e,n){return h(t,[n])}),t=>t.call(t=>{const e=t.parent(),n=Qa(t=>{const[e,n]=t.getBounds().min;return[e,n]});t.transition(function(t,r,i){OD(i,e,n);const a=d(t,r),o=p(t,[i],[a]);return(null==o?void 0:o.length)||(i.nodeName===a.nodeName&&"g"!==a.nodeName?Ka(i,a):(i.parentNode.replaceChild(a,i),a.className=sE,a.markType=u,a.__data__=i.__data__)),o}).each(function(t,e,n){n.__removed__&&(n.__removed__=!1)}).attr("markType",u).attr("className",sE)}),t=>t.each(function(t,e,n){n.__removed__=!0}).transition(function(t,e,n){return g(t,[n])}).remove(),t=>t.append(d).attr("className",sE).attr("markType",u).transition(function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Om(r,null,n.parentNode).transition(i).remove(),i}),t=>t.transition(function(t,e,n){const r=new Om([],n.__toData__,n.parentNode).append(d).attr("className",sE).attr("markType",u).nodes();return p(t,[n],r)}).remove()).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[a]=wL("labelTransform",r),{markState:o,labelTransform:s}=t,l=e.select(BD(oE)).node(),c=new Map,u=new Map,f=Array.from(o.entries()).flatMap(([n,a])=>{const{labels:o=[],key:s}=n,l=function(t,e,n,r,i){const[a]=wL("shape",r),{data:o,encode:s}=t,{data:l,defaultLabelShape:c}=e,u=l.map(t=>t.points),f=oo(s,t=>t.value),{theme:d,coordinate:h}=n,p=Object.assign(Object.assign({},i),{document:kL(i),theme:d,coordinate:h});return t=>{const{index:e,points:n}=t,r=o[e],{formatter:i=t=>`${t}`,transform:s,style:l,render:h,selector:g,element:v}=t,m=De(t,["formatter","transform","style","render","selector","element"]),y=oo(Object.assign(Object.assign({},m),l),t=>kD(t,r,e,o,{channel:f,element:v})),{shape:b=c,text:x}=y,w=De(y,["shape","text"]),k="string"==typeof i?m_(i):i,M=Object.assign(Object.assign({},w),{text:k(x,r,e,o),datum:r}),O=Object.assign({type:`label.${b}`,render:h},w);return a(O,p)(n,M,SD(d,"label",b,"label"),u)}}(n,a,t,r,i),f=e.select(`#${s}`).selectAll(BD(sE)).nodes().filter(t=>{var e;if(t.__removed__)return!1;return!("hidden"===(null===(e=t.style)||void 0===e?void 0:e.visibility)||t.children&&t.children.some(t=>{var e;return"hidden"===(null===(e=t.style)||void 0===e?void 0:e.visibility)}))});return o.flatMap((t,e)=>{const n=De(t,["transform"]);return f.flatMap(r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,l=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach(t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:l,index:s,points:a,dependentElement:n})];const c=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map((r,o)=>Object.assign(Object.assign({},t),{key:`${i[o]}-${e}`,bounds:[a[o]],index:r,points:a,dependentElement:n}));return c?c(u):u}(n,e,r);return i.forEach(e=>{c.set(e,t=>l(Object.assign(Object.assign({},t),{element:r}))),u.set(e,t)}),i})})}),d=Mm(l).selectAll(BD(fE)).data(f,t=>t.key).join(t=>t.append(t=>c.get(t)(t)).attr("className",fE),t=>t.each(function(t,e,n){Ka(n,c.get(t)(t))}),t=>t.remove()).nodes(),h=rr(d,t=>u.get(t.__data__)),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of h){const{transform:n=[]}=t;qa(n.map(a))(e,v)}s&&s(d,v)}(t,e,0,i,r),function(t,e,n,r){const i=t.scale,a=at(i,"y.options.breaks",[]),{document:o}=r.canvas;if([hE,pE].forEach(t=>{o.getElementsByClassName(t).forEach(t=>{t.remove()})}),!a.length)return;const s=e.select(BD(cE)).node(),[l]=wL("shape",n),c=new Map;a.forEach((n,i)=>{c.set(n,l({type:"break"},{view:t,selection:e,context:r}))}),Mm(s).selectAll(BD(hE)).data(a,t=>t.key).join(t=>t.append((t,e)=>c.get(t)(t,e)).attr("className",hE),t=>t.each(function(t,e,n){Ka(n,c.get(t)(t,e))}),t=>t.remove()).nodes()}(t,e,i,r)})}function wD([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const a=t[n],o=e[n];o.every(([t,e])=>Za(t)&&Za(e))&&(r.push(a),i.push(o))}return[r,i]}function kD(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:ro(e)&&void 0!==e[t]?e[t]:t}function MD(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r)):[]}function OD(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,l]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${a-s}, ${o-l})`),e.append(t)}function ED(t,e,n,r){const{library:i}=r,[a]=wL("shape",i),{data:o,encode:s}=t,{defaultShape:l,data:c,shape:u}=e,f=oo(s,t=>t.value),d=c.map(t=>t.points),{theme:h,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:kL(r),coordinate:p,theme:h});return e=>{const{shape:n=l}=v,{shape:r=n,points:i,seriesIndex:s,index:c}=e,p=De(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:c}),b=s?s.map(t=>o[t]):o[c],x=s||c,w=oo(v,t=>kD(t,b,x,o,{channel:f}));return(u[r]?u[r](w,m):a(Object.assign(Object.assign({},w),{type:ID(t,r)}),m))(i,y,SD(h,g,r,l),d)}}function SD(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function AD(t,e,n,r,i){var a,o;const[,s]=wL("shape",i),[l]=wL("animation",i),{defaultShape:c,shape:u}=n,{theme:f,coordinate:d}=r,h=`default${G(t)}Animation`,{[h]:p}=(null===(a=u[c])||void 0===a?void 0:a.props)||s(ID(e,c)).props,{[t]:g={}}=f,v=(null===(o=e.animate)||void 0===o?void 0:o[t])||{},m={coordinate:d};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:a,[`${t}Duration`]:o,[`${t}Easing`]:s}=e,c=Object.assign({type:i||p},v);if(!c.type)return null;const u=l(c,m)(n,r,tt(g,{delay:a,duration:o,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function _D(t,e,n,r){return AD("enter",t,e,n,r)}function TD(t){return t.finished.then(()=>{t.cancel()}),t}function ND(t,e,n,r){return AD("update",t,e,n,r)}function PD(t,e,n,r){return AD("exit",t,e,n,r)}function CD(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=De(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function LD(t){const{interaction:e={}}=t;return Object.entries(tt({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function jD(t,e){return Fe(this,void 0,void 0,function*(){const{data:n}=t,r=De(t,["data"]);if(null==n)return t;const[,{data:i}]=yield tD(0,{data:n},e);return Object.assign({data:i},r)})}function RD(t){t.style("transform",t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function ID(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function DD(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(BD(aE)).data(e,t=>t.key).join(t=>t.append("g").attr("className",aE).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}),t=>t.remove());t.select(BD(oE)).node()||t.append("g").attr("className",oE).style("zIndex",0)}function BD(...t){return t.map(t=>`.${t}`).join("")}function FD(t,e){t.node()&&t.style("clipPath",t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:a,innerWidth:o,innerHeight:s}=t;return new sv({style:{x:r+i,y:n+a,width:o,height:s}})})}function zD(t){const{style:e,scale:n,type:r}=t,i={},a=at(e,"columnWidthRatio");return a&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-a})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}const WD=t=>{if(!t||"string"!=typeof t)return t;const e=t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t);if(isNaN(e)||e<0||e>1)throw new Error(`Invalid gap value: ${t}. It should be between 0 and 1.`);return e};function $D(t){const{axis:e}=t,n=at(e,"y.breaks");return n&&ot(t,"scale.y.breaks",n.map(t=>Object.assign(Object.assign({key:`break-${t.start}-${t.end}`},t),{gap:WD(t.gap)}))),t}function GD(t){const e=function(t){return function(...t){return e=>t.reduce((t,e)=>e(t),e)}(zD,$D)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map(t=>GD(t))),e}function YD(t){const e=tt({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),a=null===e?"0":`${e.key}-${i}`;t.key=a}const{children:e=[]}=t;if(Array.isArray(e))for(let a=0;a<e.length;a++){const o=tt({},e[a]);e[a]=o,n.set(o,t),r.set(o,a),i.push(o)}}return e}function HD(t,e){const n=new cN;return n.registerPlugin(new fN),new Ov({width:t,height:e,container:document.createElement("div"),renderer:n})}function VD(t,e={},n=()=>{},r=t=>{throw t}){const i=DN(t),{width:a=640,height:o=480,depth:s=0}=i,l=YD(GD(i)),{canvas:c=HD(a,o),emitter:u=new hN,library:f}=e;e.canvas=c,e.emitter=u,e.externals={};const{width:d,height:h}=c.getConfig();d===a&&h===o||c.resize(a,o),u.emit(pN.BEFORE_RENDER);const p=Mm(c.document.documentElement);return c.ready.then(()=>hD(Object.assign(Object.assign({},l),{width:a,height:o,depth:s}),p,e)).then(()=>{if(s){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-s/2)}c.requestAnimationFrame(()=>{c.requestAnimationFrame(()=>{u.emit(pN.AFTER_RENDER),null==n||n()})})}).catch(t=>{null==r||r(t)}),"string"==typeof(g=c.getConfig().container)?document.getElementById(g):g;var g}function qD(t,e={},n=!1,r=!0){const{canvas:i,emitter:a}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${lE}`);null==e||e.forEach(t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach(t=>{null==t||t.destroy()})})}(i),n?i.destroy():i.destroyChildren()),r&&a.off()}function XD(t){return!!t.getBandWidth}function UD(t,e,n){if(!XD(t))return t.invert(e);const{adjustedRange:r}=t;if(r.includes(e))return t.invert(e);const{domain:i}=t.getOptions(),a=n?-1:0,o=t.getStep(),s=n?r:r.map(t=>t+o),l=function(t,e,n){return Math.min(n,Math.max(e,t))}(qn(s,e)+a,0,i.length-1);return i[l]}function KD(t,e,n){if(!e)return t.getOptions().domain;if(!XD(t)){const r=lr(e);if(!n)return r;const[i]=r,{range:a}=t.getOptions(),[o,s]=a,l=o>s?-1:1;return[i,t.invert(t.map(i)+l*n)]}const{domain:r}=t.getOptions(),i=e[0],a=r.indexOf(i);if(n){const t=a+Math.round(r.length*n);return r.slice(a,t)}const o=e[e.length-1],s=r.indexOf(o);return r.slice(a,s+1)}function ZD(t,e,n,r,i,a){const{x:o,y:s}=i,l=(t,e)=>{const[n,r]=a.invert(t);return[UD(o,n,e),UD(s,r,e)]},c=l([t,e],!0),u=l([n,r],!1);return[KD(o,[c[0],u[0]]),KD(s,[c[1],u[1]])]}function QD(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}const JD=(t,e)=>{var n,r;const[i,a]=t,o=(null===(r=null===(n=e.getOptions)||void 0===n?void 0:n.call(e))||void 0===r?void 0:r.domain)||[],s=o.indexOf(i),l=o.indexOf(a);if(-1===s||-1===l)return[e.map(i),e.map(a)];const c=o.length;return c<=1?[0,1]:[s/(c-1),l/(c-1)]};function tB(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(tB(t,e))return!0}return!1}const eB={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function nB(t,e){let n;return tB(t,t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)}),null!=n?n:eB[e]}function rB(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>rB(t,e,n,r))}function iB(t){rB(t,"visibility","hidden",!0)}function aB(t){rB(t,"visibility","visible",!0)}function oB(t){return Mm(t).selectAll(`.${sE}`).nodes().filter(t=>!t.__removed__)}function sB(t,e){return lB(t,e).flatMap(({container:t})=>oB(t))}function lB(t,e){return e.filter(e=>e!==t&&e.options.parentKey===t.options.key)}function cB(t){return Mm(t).select(`.${cE}`).node()}function uB(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new vu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function fB(t,e){const{offsetX:n,offsetY:r}=e,i=uB(t),{min:[a,o],max:[s,l]}=i;return n<a||n>s||(r<o||r>l)?null:[n-a,r-o]}function dB(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function hB(t){return t=>t.__data__.color}function pB(t){return t=>t.__data__.x}function gB(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(t=>Array.from(t.markState.keys()).map(e=>[wB(t.key,e.key),e.data])));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(wB(i,r))[e]}}const vB={selected:3,unselected:3,active:2,inactive:2,default:1},mB={selection:["selected","unselected"],highlight:["active","inactive"]},yB=(t,e,n)=>{tB(t,t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)})};function bB(t,e){return e.forEach(e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t}),(t=(t,e)=>t,e=yB)=>xB(void 0,t,e)}function xB(t,e=(t,e)=>t,n=yB){const r="__states__",i="__ordinal__",a=t=>vB[t]||vB.default,o=t=>{var e;return null===(e=Object.entries(mB).find(([e,n])=>n.includes(t)))||void 0===e?void 0:e[0]},s=o=>{var s;const{[r]:l=[],[i]:c={}}=o,u=[...l].sort((t,e)=>a(e)-a(t)),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:o.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const d=Object.assign({},c);for(const[t,e]of f.entries())d[t]=e;if(0!==Object.keys(d).length){for(const[t,r]of Object.entries(d)){const i=nB(o,t),a=e(r,o);n(o,t,a),t in c||(c[t]=i)}o[i]=c}},l=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{l(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{l(t);const n=t[r],i=new Set(e.map(t=>o(t)).filter(t=>void 0!==t)),a=n.filter(t=>!i.has(o(t)));t[r]=[...a,...e],s(t)},removeState:(t,...e)=>{l(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(l(t),-1!==t[r].indexOf(e))}}function wB(t,e){return`${t},${e}`}function kB(t,e){const n=(Array.isArray(t)?t:[t]).flatMap(t=>t.marks.map(e=>[wB(t.key,e.key),e.state])),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce((t,n)=>{const[r,a={}]=n,o=void 0===(s=a[e])||"object"==typeof s&&0===Object.keys(s).length?i:a[e];var s;for(const[e,n]of Object.entries(o)){const i=t[e],a=(t,e,a,o)=>{const s=wB(o.__data__.viewKey,o.__data__.markKey);return r!==s?null==i?void 0:i(t,e,a,o):"function"!=typeof n?n:n(t,e,a,o)};t[e]=a}return t},{})}return r}function MB(t,e){const n=new Map(t.map((t,e)=>[t,e])),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const a=n.get(i);return t(e?e(i):i,a,r,i)}}function OB(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=De(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,o=(t,e)=>{const[,n,r]=t,[i,,,a]=e;return[n,i,a,r]};return[t=>{var e;if(t.length<=1)return;const r=lr(t,(t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r});for(let t=1;t<r.length;t++){const s=ul(),l=r[t-1],c=r[t],[u,f,d,h]=o(a(l),a(c));s.moveTo(...u),s.lineTo(...f),s.lineTo(...d),s.lineTo(...h),s.closePath();const p=oo(i,t=>n(t,l)),{fill:g=l.getAttribute("fill")}=p,v=De(p,["fill"]),m=new nv({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=l.link)||void 0===e||e.remove(),l.parentNode.appendChild(m),l.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function EB(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(tc(n)){const{points:i}=t.__data__,[a,o]=Jl(n)?Nm(i):i,s=n.getCenter(),l=_s(a,s),c=_s(o,s),u=Ps(l)+Ls(l,c)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Jl(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function SB(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=De(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const l=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,a=t.getStep(r)/2,o=a*n;return[i-a+o,i+a-o]},c=(t,n)=>{const{padding:a}=n,[o,s]=((t,e)=>{const{x:n}=r;if(!XD(n))return[0,1];const{__data__:i}=t,{x:a}=i,[o,s]=l(n,a,e);return[o,s]})(t,a),[c,u]=((t,e)=>{const{y:n}=r;if(!XD(n))return[0,1];const{__data__:i}=t,{y:a}=i,[o,s]=l(n,a,e);return[o,s]})(t,a),f=[[o,c],[s,c],[s,u],[o,u]].map(t=>i.map(t)),{__data__:d}=t,{y:h,y1:p}=d;return Rm(e,f,{y:h,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=De(e,["transform","transformOrigin","stroke"]),o=Object.assign({transform:n,transformOrigin:r,stroke:i},a),s=t.cloneNode(!0);for(const[t,e]of Object.entries(o))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=oo(o,e=>a(e,t)),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:l=-2,padding:f=.001,lineWidth:d=0}=e,h=De(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},h),{fill:n,fillOpacity:i,zIndex:l,padding:f,lineWidth:d}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(XD)})()?c:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function AB(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function _B(t){AB(t,t.cursor)}function TB(t,e,n){return t.find(t=>Object.entries(e).every(([e,r])=>n(t)[e]===r))}function NB(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function PB(t,e=!1){const n=m(t,t=>!!t).map((t,e)=>[0===e?"M":"L",...t]);return e&&n.push(["Z"]),n}function CB(t){return t.querySelectorAll(".element")}function LB(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const jB=["interval","point","density"];function RB({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=jB}){var a,o;let s=t(e);const l=t=>i.includes(t.markType);if(s.find(l)){s=s.filter(l);const t=r.x,i=r.series,c=null!==(o=null===(a=null==t?void 0:t.getBandWidth)||void 0===a?void 0:a.call(t))&&void 0!==o?o:0,u=i?t=>{var e,n;const r=Math.round(1/(null!==(e=i.valueBandWidth)&&void 0!==e?e:1));return t.__data__.x+(null!==(n=t.__data__.series)&&void 0!==n?n:0)*c+c/(2*r)}:t=>t.__data__.x+c/2;return s.sort((t,e)=>u(t)-u(e)),t=>{const r=fB(e,t);if(!r)return;const[i]=n.invert(r),a=(0,$n(u).center)(s,i);return s[a]}}return t=>{const{target:e}=t;return LB(e,t=>!!t.classList&&t.classList.includes("element"))}}function IB(t){const e=.01/Math.max(t,1e-4);return Math.max(.1,Math.min(100,e))}function DB(t){return!1===t||null==t}function BB(t,e){const n=new Set;for(const r of e){const{scale:e}=r,i=null==e?void 0:e[t];if(!i)continue;if(i.independent)return!0;const a=i.key||"default";if(n.add(a),n.size>1)return!0}return!1}function FB(t){var e,n,r,i,a,o,s,l;const c=Array.from(t.markState.keys()),u=BB("x",c),f=BB("y",c),d=[],h=[],p=[],g=[],v=new Map,m=new Map,y=new Map,b=new Map;let x=1,w=1;for(const[c]of t.markState.entries()){const t=c.key,k=(null===(n=null===(e=null==c?void 0:c.scale)||void 0===e?void 0:e.x)||void 0===n?void 0:n.key)||"x";if(!!(null===(i=null===(r=null==c?void 0:c.scale)||void 0===r?void 0:r.x)||void 0===i?void 0:i.independent)||u&&"x"!==k){h.push(t),y.has(k)||y.set(k,x++);const e=y.get(k);v.set(t,`x${e}`)}else d.push(t),v.set(t,"x");const M=(null===(o=null===(a=null==c?void 0:c.scale)||void 0===a?void 0:a.y)||void 0===o?void 0:o.key)||"y";if(!!(null===(l=null===(s=null==c?void 0:c.scale)||void 0===s?void 0:s.y)||void 0===l?void 0:l.independent)||f&&"y"!==M){g.push(t),b.has(M)||b.set(M,w++);const e=b.get(M);m.set(t,`y${e}`)}else p.push(t),m.set(t,"y")}return{hasIndependentX:u,hasIndependentY:f,marksWithSharedX:d,marksWithIndependentX:h,marksWithSharedY:p,marksWithIndependentY:g,markToXScaleMap:v,markToYScaleMap:m}}const zB="legend-category",WB="legend-html-category";function $B(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function GB(t){return t.getElementsByClassName("legend-category-item-label")[0]}function YB(t){return t.getElementsByClassName("legend-category-item-focus-group")[0]}function HB(t){return t.getElementsByClassName("items-item")}function VB(t){return t.getElementsByClassName(zB)}function qB(t){return t.getElementsByClassName(WB)}function XB(t){return t.getElementsByClassName("legend-continuous")}function UB(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function KB(t,e){return Fe(this,arguments,void 0,function*(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){const{view:l,update:c,setState:u}=t;u(e,t=>{var c,u;const{marks:f}=t,d=null===(u=null===(c=e.attributes)||void 0===c?void 0:c.scales)||void 0===u?void 0:u.find(t=>t.name===n),h=f.map(e=>{var c,u;if((null!==(c=e.scale[n].key)&&void 0!==c?c:n)!==(null!==(u=null==d?void 0:d.key)&&void 0!==u?u:null==d?void 0:d.name))return e;if("legends"===e.type)return e;if(QA.includes(e.type))return e;const{transform:f=[],data:h=[]}=e,p=f.findIndex(({type:t})=>t.startsWith("group")||t.startsWith("bin")),g=[...f];h.length&&g.splice(p+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const v=Object.fromEntries(a.map(e=>{const n=function(t,e,n){var r;const i=Object.keys(t).find(r=>{if(r.startsWith(n)){const i=t[r].getOptions();return i.name===n&&i.markKey===e}});return null!==(r=t[i])&&void 0!==r?r:t[n]}(l.scale,t.key,e);return[e,{domain:n.getOptions().domain}]}));return tt({},e,Object.assign(Object.assign({transform:g,scale:v},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(o.map(t=>[t,{preserve:!0}]))}))});return Object.assign(Object.assign({},t),{marks:h})}),yield c()})}function ZB(t,e){for(const n of t)KB(n,Object.assign(Object.assign({},e),{facet:!0}))}function QB(){return(t,e,n)=>{const{container:r}=t,i=e.filter(e=>e!==t),a=i.length>0,o=t=>UB(t).scales.map(t=>t.name),s=[...VB(r),...qB(r),...XB(r)],l=s.flatMap(o),c=ut(a?ZB:KB,50,{trailing:!0}),u=s.map(e=>{const{name:s,domain:u}=UB(e).scales[0],f={legend:e,channel:s,channels:o(e),allChannels:l};return e.className===zB?function(t,{legends:e,marker:n,label:r,datum:i,filter:a,defaultSelect:o,emitter:s,channel:l,state:c={}}){const u=new Map,f=new Map,d=new Map,h=new Map,{unselected:p={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,g={unselected:Ja(p,"marker")},v={unselected:Ja(p,"label")},{setState:m,removeState:y}=xB(g,void 0),{setState:b,removeState:x}=xB(v,void 0),w=Array.from(e(t));let k=w.map(i);const M=()=>{for(const t of w){const e=i(t),a=n(t),o=r(t);k.includes(e)?(y(a,"unselected"),x(o,"unselected")):(m(a,"unselected"),b(o,"unselected"))}};for(const e of w){const n=()=>{AB(t,"pointer")},r=()=>{_B(t)},o=t=>Fe(this,void 0,void 0,function*(){const n=i(e),r=k.indexOf(n);-1===r?k.push(n):k.splice(r,1),yield a(k),M();const{nativeEvent:o=!0}=t;o&&(k.length===w.length?s.emit("legend:reset",{nativeEvent:o}):s.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:o,data:{channel:l,values:k}})))});e.addEventListener("click",o),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),u.set(e,o),f.set(e,n),d.set(e,r);const c=YB(e);if(c){const t=t=>Fe(this,void 0,void 0,function*(){t.stopPropagation();const n=i(e),r=k.indexOf(n),{nativeEvent:o=!0}=t;if(-1!==r&&1===k.length){if(!o)return;k=w.map(i),yield a(k),M(),s.emit("legend:reset",{nativeEvent:o})}else{if(k=[n],yield a(k),M(),!o)return;s.emit("legend:focus",Object.assign(Object.assign({},t),{nativeEvent:o,data:{channel:l,value:n}}))}});c.addEventListener("click",t),h.set(e,t)}}const O=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,value:i}=n;r===l&&(k=[i],yield a(k),M())}),E=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===l&&(k=i,yield a(k),M())}),S=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;e||(k=w.map(i),yield a(k),M())});return s.on("legend:filter",E),s.on("legend:focus",O),s.on("legend:reset",S),o&&s.emit("legend:filter",{data:{channel:l,values:o}}),()=>{for(const t of w){t.removeEventListener("click",u.get(t)),t.removeEventListener("pointerenter",f.get(t)),t.removeEventListener("pointerout",d.get(t));const e=YB(t);e&&e.removeEventListener("click",h.get(t))}s.off("legend:focus",O),s.off("legend:filter",E),s.off("legend:reset",S)}}(e,{legends:HB,marker:$B,label:GB,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});c(a?i:t,n)},state:e.attributes.state,defaultSelect:e.attributes.defaultSelect,channel:s,emitter:n}):e.className===WB?function(t,{domain:e,filter:n,defaultSelect:r,emitter:i,channel:a}){const o=new Map,s=new Map,l=new Map;let c=[...e];const u=()=>{var e;const n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;return n&&n.getContextService().getDomElement().parentElement||document.body},f=()=>{u().querySelectorAll("[legend-value]").forEach(t=>{const n=t.getAttribute("legend-value");if(!n)return;if(!e.includes(n))return;const r=t;c.includes(n)?(r.style.opacity="1",r.classList.remove("legend-item-inactive")):(r.style.opacity="0.4",r.classList.add("legend-item-inactive"))})};(()=>{const t=u().querySelector(".legend-html"),r=r=>Fe(this,void 0,void 0,function*(){let o=r.target;for(;o&&!o.hasAttribute("legend-value")&&(o=o.parentElement,o!==t););if(!o||!o.hasAttribute("legend-value"))return;r.preventDefault(),r.stopPropagation();const s=o.getAttribute("legend-value");if(!s)return;const l=c.indexOf(s);-1===l?c.push(s):c.splice(l,1),yield n(c),f(),c.length===e.length?i.emit("legend:reset",{nativeEvent:!0}):i.emit("legend:filter",{nativeEvent:!0,data:{channel:a,values:c}})});t.addEventListener("click",r),o.set(t,r)})();const d=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:r}=t,{channel:i,value:o}=r;i===a&&(c=[o],yield n(c),f())}),h=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:e}=t;if(e)return;const{data:r}=t,{channel:i,values:o}=r;i===a&&(c=o,yield n(c),f())}),p=t=>Fe(this,void 0,void 0,function*(){const{nativeEvent:r}=t;r||(c=[...e],yield n(c),f())});return i.on("legend:filter",h),i.on("legend:focus",d),i.on("legend:reset",p),r&&i.emit("legend:filter",{data:{channel:a,values:r}}),()=>{u().querySelectorAll("[legend-value]").forEach(t=>{const n=t.getAttribute("legend-value");if(!n)return;if(!e.includes(n))return;const r=o.get(t),i=s.get(t),a=l.get(t);r&&t.removeEventListener("click",r),i&&t.removeEventListener("pointerenter",i),a&&t.removeEventListener("pointerout",a)}),o.clear(),s.clear(),l.clear(),i.off("legend:filter",h),i.off("legend:focus",d),i.off("legend:reset",p)}}(r,{domain:u,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});c(a?i:t,n)},defaultSelect:e.attributes.defaultSelect,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const{attributes:a}=e,o=t=>{const{value:e}=t.detail,o=e.map(t=>{var e,n;const r=null===(e=a.data)||void 0===e?void 0:e.find(e=>e.value===t);return r&&null!==(n=r.domainValue)&&void 0!==n?n:t});n(o),r.emit({nativeEvent:!0,data:{channel:i,values:o}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});c(a?i:t,n)},emitter:n,channel:s})});return()=>{u.forEach(t=>t())}}}function JB(t,e){const n=S_(t,"shape"),r=S_(t,"color"),i=n?n.clone():null,a=[];for(const[t,n]of e){const e=t.type,o=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map((e,r)=>{var a;return i?i.map(e||"point"):(null===(a=null==t?void 0:t.style)||void 0===a?void 0:a.shape)||n.defaultShape||"point"});"string"==typeof e&&a.push([e,o])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const{range:o}=n.getOptions();return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){const r=o[t%o.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}function tF(t,e){const{scales:n,library:r,markState:i}=e,[a,o]=JB(n,i),{itemMarker:s,itemMarkerSize:l}=t,c=(t,e)=>{var n,i,o;const s=(null===(o=null===(i=null===(n=r[`mark.${a}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===o?void 0:o.props.defaultMarker)||j(t.split(".")),c="function"==typeof l?l(e):l;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:a,stroke:o,color:s}=e,l=De(e,["d","fill","lineWidth","path","stroke","color"]);const c=Sy.get(t)||Sy.get("point");return(...t)=>new nv({style:Object.assign(Object.assign({},l),{d:c(...t),stroke:c.style.includes("stroke")?s||o:"",fill:c.style.includes("fill")?s||r:"",lineWidth:c.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,c)},u=t=>`${o[t]}`;return S_(n,"shape")&&!s?(t,e)=>c(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?c(n,t):n}:(t,e)=>c(s||u(e),t)}function eF(t){const e=S_(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function nF(t,e){const{scales:n,markState:r}=e,[i,a]=JB(n,r),{itemMarker:o,itemMarkerLineWidth:s}=t;if(void 0!==s)return s;const l=["line","hyphen","dash","smooth","hv","hvh","vh","vhv"];if("string"==typeof o&&l.includes(o))return 4;if("function"==typeof o)return(t,e)=>{const n=o(t.id,e);if("string"==typeof n&&l.includes(n))return 4};const c=(Array.isArray(a)?a:[a]).some(t=>l.includes(t));return c?4:void 0}function rF(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,a=function(t,e){const n=S_(t,"size");return n instanceof ca?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),o={itemMarker:tF(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:eF(r),itemMarkerLineWidth:nF(t,e)},s="string"==typeof n?m_(n):n,l=S_(r,"color"),c=function(t){return t.find(t=>t.getOptions().domain.length>0).getOptions().domain}(r),u=l?t=>l.map(t):()=>e.theme.color;return Object.assign(Object.assign({},o),{data:c.map(t=>({id:t,label:s(t),color:u(t)}))})}const iF=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,cols:l,itemMarker:c,render:u}=t,f=De(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker","render"]),{gridRow:d}=f;return e=>{const{value:r,theme:i}=e,{bbox:o}=r,{width:c,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:a}=__(t,e,n);return{width:i,height:a}}(r,t,iF),p=M_(a,n),g=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(a)?"vertical":"horizontal",width:c,height:h,layout:void 0!==l?"grid":"flex"},void 0!==l&&{gridCol:l}),void 0!==d&&{gridRow:d}),{titleText:k_(s)}),rF(t,e)),{legendCategory:v={}}=i,m=T_(Object.assign({},v,function(t){return Object.assign(Object.assign({},t),{data:(null==t?void 0:t.data.filter(t=>""!==t.id))||[]})}(g),f,{classNamePrefix:UA}));if(u)return new AM({className:WB,style:Object.assign(Object.assign({},m),{x:o.x,y:o.y,render:u})});const y=new E_({style:Object.assign(Object.assign({x:o.x,y:o.y,width:o.width,height:o.height},p),{subOptions:m})});return y.appendChild(new AM({className:"legend-category",style:m})),y}};function aF(t,e,n,r,i){const a=e.thresholds,o=function(t){return e=>({value:e/t,label:String(e),domainValue:e})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...a,r].map(o)})}function oF(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],co(e)];return[n,r]}function sF(t,e,n,r,i,a){const{length:o}=t,s=n||r,l=i.color?a.legendContinuous.ribbonFill||"black":a.color,c=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[bd(e).toString()]})),r}(s,l),[u,f]=oF(c),[d,h]=oF([e,n,r].filter(t=>void 0!==t).find(t=>!(t instanceof Zi)));return Object.assign(Object.assign({},t),{domain:[d,h],data:c.getTicks().map(t=>({value:t})),color:new Array(Math.floor(o)).fill(0).map((t,e)=>{const n=(f-u)/(o-1)*e+u,i=c.map(n)||l,a=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${a})`)})})}function lF(t,e,n,r,i,a){const o=S_(t,"color"),s=function(t,e,n){const{size:r}=e,i=__(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(o instanceof ba){const{range:t}=o.getOptions(),[e,n]=oF(o);return o instanceof ka||o instanceof Oa?aF(s,o,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map((t,e)=>({value:e,domainValue:t,label:t}));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,o,t)}return sF(s,o,S_(t,"size"),S_(t,"opacity"),e,a)}iF.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const cF=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,style:l,crossPadding:c,padding:u}=t,f=De(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:o,scale:c})=>{const{bbox:u}=i,{x:d,y:h,width:p,height:g}=u,v=M_(a,n),{legendContinuous:m={}}=o,y=T_(Object.assign({},m,Object.assign(Object.assign(Object.assign({titleText:k_(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>m_(e)(t.label):e},lF(r,c,i,t,cF,o)),l),{classNamePrefix:UA}),f)),b=new O_({style:Object.assign(Object.assign({x:d,y:h,width:p,height:g},v),{subOptions:y})});return b.appendChild(new FM({className:"legend-continuous",style:y})),b}};cF.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const uF=t=>(...e)=>cF(Object.assign({},{block:!0},t))(...e);uF.props=Object.assign(Object.assign({},cF.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const fF=t=>e=>{const{scales:n}=e,r=S_(n,"size");return cF(Object.assign({},{type:"size",data:r.getTicks().map((t,e)=>({value:t,label:String(t)}))},t))(e)};fF.props=Object.assign(Object.assign({},cF.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const dF=t=>fF(Object.assign({},{block:!0},t));function hF(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}dF.props=Object.assign(Object.assign({},cF.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const pF=(gF={render(t,e){const{width:n,title:r,subtitle:i,spacing:a=2,align:o="left",x:s,y:l}=t,c=De(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${l})`;const u=Ja(c,"title"),f=Ja(c,"subtitle"),d=w_(e,".title","text").attr("className","title").call(Am,Object.assign(Object.assign(Object.assign({},hF(0,0,n,o)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();w_(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},hF(0,d.max[1]+a,n,o)),{fontSize:12,textBaseline:"top",text:i}),f))})}},class extends qg{constructor(t){super(t),this.descriptor=gF}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(tt({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var gF;const vF=t=>({value:e,theme:n})=>{const{x:r,y:i,width:a,height:o}=e.bbox;return new pF({style:tt({},n.title,Object.assign({x:r,y:i,width:a,height:o},t))})};vF.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const mF=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:a}=t,o=De(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[l],value:c,theme:u,coordinate:f}=r,{bbox:d}=c,{width:h,height:p}=d,{slider:g={}}=u,v=(null===(s=l.getFormatter)||void 0===s?void 0:s.call(l))||(t=>t+""),m="string"==typeof n?m_(n):n,y="horizontal"===e,b=Jl(f)&&y,{trackSize:x=g.trackSize}=i,[w,k]=function(t,e,n){const{x:r,y:i,width:a,height:o}=t;return"left"===e?[r+a-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+o-n]:void 0}(d,a,x);return new pw({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:k,trackLength:y?h:p,orientation:e,formatter:t=>(m||v)(UD(l,b?1-t:t,!0)),sparklineData:yF(t,r)},i),o))})}};function yF(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter(([t])=>"line"===t.type||"area"===t.type||"interval"===t.type).filter(([t])=>t.slider).map(([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}});if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t),{});return Object.values(r)}(n,["y","series"])}mF.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const bF=t=>mF(Object.assign(Object.assign({},t),{orientation:"horizontal"}));bF.props=Object.assign(Object.assign({},mF.props),{defaultPosition:"bottom"});const xF=t=>mF(Object.assign(Object.assign({},t),{orientation:"vertical"}));xF.props=Object.assign(Object.assign({},mF.props),{defaultPosition:"left"});const wF=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=De(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:a})=>{const{bbox:o}=n,{x:s,y:l,width:c,height:u}=o,{scrollbar:f={}}=a,{ratio:d,range:h}=t.getOptions(),p="horizontal"===e?c:u,g=p/d,[v,m]=h,y=m>v?0:1;return new gw({className:`${UA}scrollbar`,style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:l,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};wF.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const kF=t=>wF(Object.assign(Object.assign({},t),{orientation:"horizontal"}));kF.props=Object.assign(Object.assign({},wF.props),{defaultPosition:"bottom"});const MF=t=>wF(Object.assign(Object.assign({},t),{orientation:"vertical"}));MF.props=Object.assign(Object.assign({},wF.props),{defaultPosition:"left"});const OF=t=>()=>new Ug;OF.props={};const EF=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[u,f]=Jl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],d=[{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c}];return a.animate(d,Object.assign(Object.assign({},i),t))}},SF=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[u,f]=Jl(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],d=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(d,Object.assign(Object.assign({},i),t))}},AF=(t,e)=>{const n=1e-4,{coordinate:r}=e;return fv({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:tf.NUMBER}),(e,i,a)=>{const[o]=e;return tc(r)?(e=>{const{__data__:i,style:o}=e,{fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=o,{points:u,y:f,y1:d}=i,h=Pm(r,u,[f,d]),{innerRadius:p,outerRadius:g}=h,v=[{scaleInYRadius:p+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:p+n,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{scaleInYRadius:g,fillOpacity:s,strokeOpacity:l,opacity:c}];return e.animate(v,Object.assign(Object.assign({},a),t))})(o):(e=>{const{style:n}=e,{transform:i="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=n,[c,u]=Jl(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:c,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l}];return e.animate(f,Object.assign(Object.assign({},a),t))})(o)}},_F=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[u,f]=Jl(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],d=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(d,Object.assign(Object.assign({},i),t))}},TF=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,l=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}];return i.animate(l,Object.assign(Object.assign({},r),t))};TF.props={};const NF=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,l=[{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(l,Object.assign(Object.assign({},r),t))};NF.props={};const PF={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},CF={[ou.CIRCLE]:["cx","cy","r"],[ou.ELLIPSE]:["cx","cy","rx","ry"],[ou.RECT]:["x","y","width","height"],[ou.IMAGE]:["x","y","width","height"],[ou.LINE]:["x1","y1","x2","y2"],[ou.POLYLINE]:["points"],[ou.POLYGON]:["points"]};function LF(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=PF[i])}return r}const jF=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function RF(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[a,o]=n;return[r,i,a-r,o-i]}function IF(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function DF(t,e){const[n,r,i,a]=RF(t),o=a/i,s=Math.ceil(Math.sqrt(e/o)),l=[],c=a/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,a=r+u*c;l.push(IF([t,a,e,c]))}f-=t,u+=1}return l}function BF(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function FF(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function zF(t){const e=Zd(t);if(e&&!function(t){return!FF(t,"m")||!FF(t,"M")}(e))return e}function WF(t){const{nodeName:e}=t;if("path"===e){const e=at(t,"attributes");return e.markerEnd||e.markerStart}return!1}function $F(t,e,n,r){const{nodeName:i}=e,{nodeName:a}=n,o=zF(e),s=zF(n),{opacity:l=1,strokeOpacity:c=1,fillOpacity:u=1}=e.style,{opacity:f=1,strokeOpacity:d=1,fillOpacity:h=1}=n.style,p=i===a&&"path"!==i,g=void 0===o||void 0===s,v=WF(e)||WF(n);if(p||g||v)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;BF(e,t);let a=jF;if(t.nodeName===ou.GROUP){const[n,i,a,o]=RF(t),[s,l,c,u]=RF(e);r=`translate(${n-s}, ${i-l}) scale(${a/c}, ${o/u})`}else a=a.concat(CF[t.nodeName]||[]);const o=[Object.assign({transform:null!=r?r:"none"},LF(t,a,!0)),Object.assign({transform:null!=i?i:"none"},LF(e,a,!0))];return e.animate(o,n)}(e,n,r);const m=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new nv({style:Object.assign(Object.assign({},LF(t,jF)),{d:e})});return BF(r,t),r}(t,o),y=Object.assign(Object.assign({},LF(e,jF)),{opacity:l,strokeOpacity:c,fillOpacity:u}),b=Object.assign(Object.assign({},LF(n,jF)),{opacity:f,strokeOpacity:d,fillOpacity:h}),x=[y,b];if(o!==s){x[0].d=o,x[1].d=s;const t=m.animate(x,r);return t.onfinish=()=>{Ka(m,n),m.style.d=s,m.style.transform="none"},m.style.transform="none",t}return rt(y,b)?null:m.animate(x,r)}const GF=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:DF}(t.split),a=Object.assign(Object.assign({},r),t),{length:o}=e,{length:s}=n;if(1===o&&1===s||o>1&&s>1){const[t]=e,[r]=n;return $F(t,t,r,a)}if(1===o&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((e,r)=>$F(e,new nv({style:Object.assign({d:i[r]},LF(t,jF))}),e,n))}(t,n,a,i)}if(o>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=e.style,l=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:a,strokeOpacity:o,opacity:s}],c=e.animate(l,n),u=t.map((t,r)=>$F(t,t,new nv({style:{d:i[r],fill:e.style.fill}}),n));return[...u,c]}(e,t,a,i)}return null};GF.props={};const YF=(t,e)=>{const n=1e-4;fv({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:tf.NUMBER});const{coordinate:r}=e;return(i,a,o)=>{const[s]=i;if(!tc(r))return EF(t,e)(i,a,o);const{__data__:l,style:c}=s,{radius:u=0,inset:f=0,fillOpacity:d=1,strokeOpacity:h=1,opacity:p=1}=c,{points:g,y:v,y1:m}=l,y=yl().cornerRadius(u).padAngle(f*Math.PI/180),b=Pm(r,g,[v,m]),{startAngle:x,endAngle:w}=b,k=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:d,strokeOpacity:h,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:d,strokeOpacity:h,opacity:p}],M=s.animate(k,Object.assign(Object.assign({},o),t));return M.onframe=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:w}))},M}};YF.props={};const HF=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=i.style,c="center center",u=[{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:`${a} scale(1)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l}];return i.animate(u,Object.assign(Object.assign({},r),t))},VF=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=i.style,c="center center",u=[{transform:`${a} scale(1)`.trimStart(),transformOrigin:c},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.99},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:c,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},qF=t=>(e,n,r)=>{var i,a;const[o]=e,s=(null===(a=(i=o).getTotalLength)||void 0===a?void 0:a.call(i))||0,l=[{lineDash:[0,s]},{lineDash:[s,0]}];return o.animate(l,Object.assign(Object.assign({},r),t))};qF.props={};const XF=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:l}=a.getLocalBounds(),c=2*l[0],u=2*l[1],f=new nv({style:{d:`M${o},${s}L${o+c},${s}L${o+c},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return EF(t,e)([f],r,i)};XF.props={};const UF=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:l}=a.getLocalBounds(),c=2*l[0],u=2*l[1],f=new nv({style:{d:`M${o},${s}L${o+c},${s}L${o+c},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return AF(t,e)([f],r,i)};function KF(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:a=!1}=t,o=De(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,l)=>{const{container:c,view:u,options:f}=t,{scale:d,coordinate:h}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,background:o=!1,delay:s=60,scale:l,coordinate:c,emitter:u,state:f={},region:d=!1,regionEleFilter:h=t=>jB.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],m=d?v.filter(h):v,y=new Set(m),b=d?i:r,x=rr(m,b),w=RB({elementsof:e,root:t,coordinate:c,scale:l}),k=MB(m,n),[M,O]=OB(Object.assign({elements:m,valueof:k,link:a,coordinate:c},Ja(f.active,"link"))),[E,S,A]=SB(Object.assign({document:t.ownerDocument,scale:l,coordinate:c,background:o,valueof:k},Ja(f.active,"background"))),_=tt(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return EB(m[n],e,c)}})}),T=bB(_,m),{updateState:N,removeState:P,hasState:C}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(d&&(r=w(t)),!y.has(r))return;L&&clearTimeout(L);const i=b(r),a=x.get(i),o=new Set(a);for(const t of m)o.has(t)?C(t,"active")||N(t,"active"):(N(t,"inactive"),O(t)),t!==r&&S(t);E(r),M(a),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:a.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout(()=>{I(),L=null},s)},I=(t=!0)=>{for(const t of m)P(t,"active","inactive"),S(t),O(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;d&&(e=w(t)),e?o&&!A(e)||(o||y.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=TB(m,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of m)S(t),O(t)}}(cB(c),Object.assign({elements:oB,datum:gB(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:h,scale:d,state:kB(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:a,delay:e,emitter:l},o))}}function ZF(t){return KF(Object.assign(Object.assign({},t),{createGroup:pB}))}function QF(t){return KF(Object.assign(Object.assign({},t),{createGroup:hB}))}function JF(t,{elements:e,datum:n,groupKey:r=t=>t,scaleFactor:i=1.04,scaleOrigin:a="center center",shadow:o=!0,shadowColor:s="rgba(0, 0, 0, 0.4)",shadowBlur:l=10,shadowOffsetX:c=0,shadowOffsetY:u=2,zIndex:f=10,delay:d=60,emitter:h,state:p={}}){const g=()=>{var n;return null!==(n=e(t))&&void 0!==n?n:[]},v=g(),m=MB(v,n),y=bB(tt(p,{active:{}}),v),{updateState:b,removeState:x,hasState:w}=y(m),k=new Map,M=new Set;let O;const E=t=>{if(M.has(t))return;const e=t.style.transform||"",n=t.style.transformOrigin||"";k.set(t,{transform:e,transformOrigin:n,zIndex:t.style.zIndex||0,shadowColor:t.style.shadowColor||"",shadowBlur:t.style.shadowBlur||0,shadowOffsetX:t.style.shadowOffsetX||0,shadowOffsetY:t.style.shadowOffsetY||0});const r=e&&"none"!==e?e:"",d=`scale(${i})`;let h;h=r&&!r.includes("scale")?`${r} ${d}`.trimStart():r&&r.includes("scale")?r.replace(/scale\([^)]+\)/g,d).trimStart():d,t.style.transformOrigin=a,t.style.transform=h,t.style.zIndex=f,o&&(t.style.shadowColor=s,t.style.shadowBlur=l,t.style.shadowOffsetX=c,t.style.shadowOffsetY=u),M.add(t)},S=t=>{const e=k.get(t);e&&(t.style.transform=e.transform,t.style.transformOrigin=e.transformOrigin,t.style.zIndex=e.zIndex,t.style.shadowColor=e.shadowColor,t.style.shadowBlur=e.shadowBlur,t.style.shadowOffsetX=e.shadowOffsetX,t.style.shadowOffsetY=e.shadowOffsetY,M.delete(t),k.delete(t))},A=t=>{const{nativeEvent:e=!0}=t,i=t.target,a=g();if(!new Set(a).has(i))return;O&&clearTimeout(O);const o=rr(a,r),s=r(i),l=o.get(s);if(!l)return;const c=new Set(l);for(const t of a)c.has(t)||(x(t,"active"),S(t));for(const t of l)w(t,"active")||b(t,"active"),E(t);e&&h.emit("element:hoverscale",{nativeEvent:e,data:{data:n(i),group:l.map(n)}})},_=(t=!0)=>{const e=g();for(const t of e)x(t,"active"),S(t);M.clear(),t&&h.emit("element:unhoverscale",{nativeEvent:t})},T=t=>{d>0?(O&&clearTimeout(O),O=setTimeout(()=>{_(),O=null},d)):_()},N=()=>{_()};t.addEventListener("pointerover",A),t.addEventListener("pointermove",A),t.addEventListener("pointerout",T),t.addEventListener("pointerleave",N);const P=t=>{const{nativeEvent:e}=t;e||_(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=TB(g(),r,n);i&&A({target:i,nativeEvent:!1})};return h.on("element:hoverscale",C),h.on("element:unhoverscale",P),()=>{t.removeEventListener("pointerover",A),t.removeEventListener("pointermove",A),t.removeEventListener("pointerout",T),t.removeEventListener("pointerleave",N),h.off("element:hoverscale",C),h.off("element:unhoverscale",P);const e=g();for(const t of e)S(t);k.clear(),M.clear()}}function tz(t){var{delay:e,createGroup:n,scale:r,scaleOrigin:i,shadow:a,shadowColor:o,shadowBlur:s,shadowOffsetX:l,shadowOffsetY:c,zIndex:u}=t,f=De(t,["delay","createGroup","scale","scaleOrigin","shadow","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","zIndex"]);return(t,d,h)=>{const{container:p,view:g,options:v}=t,m=cB(p),y=gB(g);return JF(m,Object.assign({elements:oB,datum:y,groupKey:n?t=>n(g)(y(t)):void 0,state:kB(v,["active"]),scaleFactor:r,scaleOrigin:i,shadow:a,shadowColor:o,shadowBlur:s,shadowOffsetX:l,shadowOffsetY:c,zIndex:u,delay:e,emitter:h},f))}}function ez(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,single:o=!1,multipleSelectHotkey:s,coordinate:l,background:c=!1,scale:u,emitter:f,state:d={},region:h=!1,regionEleFilter:p=t=>jB.includes(t.markType)}){var g;const v=e(t),m=new Set(v),y=RB({elementsof:e,root:t,coordinate:l,scale:u}),b=rr(v,r),x=rr(v,i),w=MB(v,n),[k,M]=OB(Object.assign({link:a,elements:v,valueof:w,coordinate:l},Ja(d.selected,"link"))),[O,E]=SB(Object.assign({document:t.ownerDocument,background:c,coordinate:l,scale:u,valueof:w},Ja(d.selected,"background"))),S=tt(d,{selected:Object.assign({},(null===(g=d.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=d.selected.offset(...t),[,n]=t;return EB(v[n],e,l)}})}),A=bB(S,v),{updateState:_,removeState:T,hasState:N}=A(w);let P=!o,C=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),M(t),E(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:o=r,groupMap:s=b})=>{const l=v.filter(a);if(N(e,"selected"))L();else{const r=o(e),a=s.get(r),c=new Set(a);for(const t of l)c.has(t)?_(t,"selected"):(_(t,"unselected"),M(t)),t!==e&&E(t);if(k(a),O(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:s=r,groupMap:l=b})=>{const c=s(e),u=l.get(c),d=new Set(u),h=v.filter(o);if(N(e,"selected")){const t=v.some(t=>!d.has(t)&&N(t,"selected"));if(!t)return L();for(const t of u)_(t,"unselected"),M(t),E(t)}else{const t=u.some(t=>N(t,"selected"));for(const t of h)d.has(t)?_(t,"selected"):N(t,"selected")||_(t,"unselected");!t&&a&&k(u),O(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter(t=>N(t,"selected")).map(n)}}))},I=t=>{if(m.has(t))return t;for(const e of m){let n=null;if(tB(e,r=>{r===t&&(n=e)}),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,a=P?R:j;let o=e;const s=(t=>{if(m.has(t))return!0;for(const e of m)if(tB(e,e=>e===t))return!0;return!1})(e);return!h||s?s?a({event:t,element:I(o),nativeEvent:n,groupBy:r}):L():(o=y(t),m.has(o)?a({event:t,element:o,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!C&&(C=t.code,P=!0)},z=t=>{t.code===C&&(C=null,P=!1)};t.addEventListener("click",D),s&&(P=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const W=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=P?r.data:r.data.slice(0,1);for(const t of i){const e=TB(v,t,n);D({target:e,nativeEvent:!1})}},$=()=>{L(!1)};return f.on("element:select",W),f.on("element:unselect",$),()=>{for(const t of v)M(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",W),f.off("element:unselect",$)}}function nz(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,a=De(t,["createGroup","createRegionGroup","background","link"]);return(t,o,s)=>{const{container:l,view:c,options:u}=t,{coordinate:f,scale:d}=c;return ez(cB(l),Object.assign({elements:oB,datum:gB(c),groupKey:e?e(c):void 0,regionGroupKey:n?n(c):t=>t.__data__.x,coordinate:f,scale:d,state:kB(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},a))}}function rz(t){return nz(Object.assign(Object.assign({},t),{createGroup:pB}))}function iz(t){return nz(Object.assign(Object.assign({},t),{createGroup:hB}))}function az(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,a=De(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:s,update:l,setState:c}=t,{markState:u,scale:f,coordinate:d}=o,h=function(t,e,n){const[r]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const{encode:e}=t;return Object.fromEntries(n.map(t=>{const n=e[t];return[t,n?n.value:void 0]}))});return r}(u,"line",["x","y","series"]);if(!h)return;const{y:p,x:g,series:v=[]}=h,m=p.map((t,e)=>e),y=lr(m.map(t=>g[t])),b=cB(s),x=s.getElementsByClassName(sE),w=rr(s.getElementsByClassName(fE),t=>t.__data__.key.split("-")[0]),k=new tv({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Ja(a,"rule"))}),M=new cv({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Ja(a,"label"))});k.append(M),b.appendChild(k);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[Xn(y,i)]},E=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const A=ut(t=>{const e=fB(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,a=O(n,r,t);E(t,a);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,o=e[$n(t=>g[+t]).center(e,a)],s=[0,i.map(1)],l=[0,i.map(p[o]/p[e[0]])],[,c]=n.map(s),[,u]=n.map(l),f=c-u;t.setAttribute("transform",`translate(0, ${f})`);const d=w.get(r)||[];for(const t of d)t.setAttribute("dy",f)}})(e)},e,{leading:n,trailing:r});return(t=>{Fe(this,void 0,void 0,function*(){const{x:e}=f,n=O(d,e,t);E(t,n),c("chartIndex",t=>{const e=tt({},t),r=e.marks.find(t=>"line"===t.type),i=xr(ar(m,t=>xr(t,t=>+p[t])/kr(t,t=>+p[t]),t=>v[t]).values());tt(r,{scale:{y:{domain:[1/i,i]}}});const a=function(t){const{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);a.groupBy="color",a.basis=(t,e)=>e[t[$n(t=>g[+t]).center(t,n)]];for(const t of e.marks)t.animate=!1;return e});const r=yield l("chartIndex");S=r.view})})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{k.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function oz({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,l=cB(s),c=ut(t=>{const e=fB(l,t);if(!e)return o("fisheye"),void a();o("fisheye",t=>{const n=tt({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return a.focusX=r,a.focusY=i,a.visual=!0,n}),a()},t,{leading:e,trailing:n});return l.addEventListener("pointerenter",c),l.addEventListener("pointermove",c),l.addEventListener("pointerleave",c),()=>{l.removeEventListener("pointerenter",c),l.removeEventListener("pointermove",c),l.removeEventListener("pointerleave",c)}}}UF.props={},KF.props={reapplyWhenUpdate:!0},ZF.props={reapplyWhenUpdate:!0},QF.props={reapplyWhenUpdate:!0},tz.props={reapplyWhenUpdate:!0},nz.props={reapplyWhenUpdate:!0},rz.props={reapplyWhenUpdate:!0},iz.props={reapplyWhenUpdate:!0},az.props={reapplyWhenUpdate:!0};const sz="tooltipLocked";function lz(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function cz(t,e,n,r,i,a,o,s={},l=[10,10]){const c={[KA("tooltip")]:{},[KA("tooltip-title")]:{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},u=new GM({className:"tooltip",style:{x:e,y:n,container:o,data:[],bounding:a,position:r,enterable:i,title:"",offset:l,template:{prefixCls:UA},style:tt(c,s)}});return t.appendChild(u.HTMLTooltipElement),u}function uz({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,css:c,mount:u,bounding:f,offset:d}){const h=lz(t,u),p=lz(t),g=o?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return{x:n,y:r,width:i-n,height:a-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,h),{tooltipElement:y=cz(h,n,r,s,l,v,m,c,d)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b.map(t=>Object.assign(Object.assign({},t),{value:t.value||0===t.value?t.value:""})),title:x,position:s,enterable:l,container:m},void 0!==i&&{content:i(a,{items:b,title:x})})),g.tooltipElement=y}function fz({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const a=lz(t),o=e?a:t,{tooltipElement:s}=o;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),xz(t),wz(t),kz(t)}function dz({root:t,single:e}){const n=lz(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),xz(t),wz(t),kz(t)}function hz(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function pz(t){const{__data__:e}=t;if(Ga(t))return function(t){var e,n,r,i,a,o,s;const{__data__:l}=t,{title:c,items:u=[]}=l;if(u.some(t=>QI in t)){const e=u.filter(Za).map(e=>{var{color:n=gz(t)}=e,r=De(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(hz);return Object.assign(Object.assign({},c&&{title:c}),{items:e})}const f=null!==(n=null===(e=null==l?void 0:l.normalized)||void 0===e?void 0:e.x)&&void 0!==n?n:0,d=null===(r=t.parentNode)||void 0===r?void 0:r.__data__,h=null!==(i=null==d?void 0:d.encode)&&void 0!==i?i:{},{x:p={},y:g={},color:v={}}=h,{value:m=[]}=p,{value:y=[]}=g,{value:b=[]}=v,x=Math.min(Math.round(m.length*f),m.length-1);return{title:`${m[x]}, ${y[x]}`,items:[{name:null!==(a=v.field)&&void 0!==a?a:"value",value:b[x],color:(null===(o=t.style)||void 0===o?void 0:o.fill)||(null===(s=t.getAttribute)||void 0===s?void 0:s.call(t,"color"))||"#000"}]}}(t);const{title:n,items:r=[]}=e,i=r.filter(Za).map(e=>{var{color:n=gz(t)}=e,r=De(e,["color"]);return Object.assign(Object.assign({},r),{color:n})}).map(hz);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function gz(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function vz(t,e=t=>t){const n=new Map(t.map(t=>[e(t),t]));return Array.from(n.values())}function mz(t,e,n,r=t.map(t=>t.__data__),i={}){const a=t=>t instanceof Date?+t:t,o=vz(r.map(t=>t.title),a).filter(Za),s=r.flatMap((r,a)=>{const o=r.element||t[a],{items:s=[],title:l}=r,c=s.filter(Za),u=void 0!==n?n:s.length<=1;return c.map(t=>{var{color:n=gz(o)||i.color,name:a}=t,s=De(t,["color","name"]);const c=Ha(e,r),f=u&&!(QI in s)?c||a:a||c;return Object.assign(Object.assign({},s),{color:n,name:f||l})})}).map(hz);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:vz(s,t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`)})}function yz(t,e,n,r){var{plotWidth:i,plotHeight:a,mainWidth:o,mainHeight:s,startX:l,startY:c,transposed:u,polar:f,insetLeft:d,insetTop:h}=r,p=De(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map(e=>Ns(e,t)),r=Mr(n,t=>t);return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=l+d+o/2,e=c+h+s/2;return[t,e,Ns([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Hg({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,o]=u?[l+v[0],l+v[0],c,c+a]:[l,l+i,v[1]+c,v[1]+c],s=t.ruleX||((e,n,r,i)=>{const a=new tv({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(a),a})(e,n,r,o);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=o,t.ruleX=s}}function bz(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:f,insetTop:d}=n,h=De(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},h),g=e.map(t=>t[1]),v=e.map(t=>t[0]),m=Ar(g),y=Ar(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(a,o)/2,e=s+f+a/2,n=l+d+o/2,r=Ps(_s([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return c?[s,s+r,m+l,m+l]:[y+s,y+s,l,l+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new tv({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function xz(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function wz(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function kz(t){t.markers&&(t.markers.forEach(t=>t.remove()),t.markers=[])}function Mz(t,e){return Array.from(t.values()).some(t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]})}function Oz(t,e){return void 0===t?e:t}function Ez(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function Sz({root:t,event:e,elements:n=[],coordinate:r,scale:i,shared:a}){var o,s;const l=n.every(t=>"interval"===t.markType)&&!tc(r),c=i.x,u=function(t){const{x:e}=t;if(!e||!e.valueBandWidth)return!0;const{valueBandWidth:n}=e;return!!I(n)||1===new Set(n.values()).size}(i),f=i.series,d=null!==(s=null===(o=null==c?void 0:c.getBandWidth)||void 0===o?void 0:o.call(c))&&void 0!==s?s:0,h=f&&f.valueBandWidth?t=>{const e=Math.round(1/f.valueBandWidth);return t.__data__.x+t.__data__.series*d+d/(2*e)}:t=>t.__data__.x+d/2;l&&n.sort((t,e)=>h(t)-h(e));const p=t=>{const{target:e=j(n)}=t;return LB(e,e=>!!e.classList&&(Ga(e)&&ot(e,"__data__.normalized",function(t,e){const{innerWidth:n,innerHeight:r,marginLeft:i,paddingLeft:a,insetLeft:o,marginTop:s,paddingTop:l,insetTop:c}=t.getOptions();return{x:(e.x-i-a-o)/n,y:(e.y-s-l-c)/r}}(r,{x:t.offsetX,y:t.offsetY})),e.classList.includes("element")))},g=l?e=>{const i=fB(t,e);if(!i)return;const[o]=r.invert(i),s=$n(h).center,l=u?s(n,o):function(t,e){const{adjustedRange:n,valueBandWidth:r,valueStep:i}=t,a=Array.from(r.values()),o=Array.from(i.values()),s=n.map((t,e)=>{const n=(o[e]-a[e])/2;return[t-n,t+a[e]+n]}),l=s.findIndex(([t,n])=>t<=e&&e<=n);return-1!==l?l:e>.5?n.length-1:0}(c,o),f=n[l];if(!a){const t=n.find(t=>t!==f&&h(t)===h(f));if(t)return p(e)||t}return f}:p;return g(e)}function Az({root:t,event:e,elements:n,coordinate:r,scale:i,startX:a,startY:o}){const s=Jl(r),l=[],c=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?l.push(t):(r||i)&&c.push(t)}const u=c.length&&c.every(t=>"interval"===t.markType)&&!tc(r),f=t=>t.__data__.x,d=!!i.x.getBandWidth&&c.length>0;l.sort((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)});const h=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return lr([n[e],r[e]])};u?n.sort((t,e)=>f(t)-f(e)):c.sort((t,e)=>{const[n,r]=h(t),[i,a]=h(e),o=(n+r)/2,l=(i+a)/2;return s?l-o:o-l});const p=new Map(l.map(t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map((t,e)=>e),i=lr(r,t=>n[+t]);return[t,[i,n]]})),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,m=t=>{const[e]=r.invert(t);return e-v},y=(t,e,n,r)=>{const{_x:i}=t,a=void 0!==i?g.map(i):m(e),o=r.filter(Za),[s,l]=lr([o[0],o[o.length-1]]);if(!d&&(a<s||a>l)&&!(s===l))return null;const c=$n(t=>r[+t]).center;return n[c(n,a)]},b=u?(t,e)=>{const n=e[(0,$n(f).center)(e,m(t))];return rr(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter(t=>{const[e,r]=h(t);return n>=e&&n<=r});if(!d||r.length>0)return r;const i=$n(t=>{const[e,n]=h(t);return(e+n)/2}).center;return[e[i(e,n)]].filter(Za)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,n])=>{const r=n[e];return[$(t.replace("series","")),r]}))},w=fB(t,e);if(!w)return;const k=[w[0]-a,w[1]-o];if(!k)return;const M=b(k,c),O=[],E=[];for(const t of l){const[n,i]=p.get(t),a=y(e,k,n,i);if(null!==a){O.push(t);const e=x(t,a),{x:n,y:i}=e,o=r.map([(n||0)+v,i||0]);E.push([Object.assign(Object.assign({},e),{element:t}),o])}}const S=Array.from(new Set(E.map(t=>t[0].x))),A=S[Mr(S,t=>Math.abs(t-m(k)))],_=E.filter(t=>t[0].x===A),T=[..._.map(t=>t[0]),...M.map(t=>t.__data__)];return{selectedElements:[...O,...M],selectedData:T,filteredSeriesData:_,abstractX:m}}function _z(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,crosshairsX:l,crosshairsY:c,render:u,groupName:f,emitter:d,wait:h=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:M,theme:O,offset:E,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:N={},clickLock:P=!1,disableAutoHide:C=!1}=e,L=De(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css","clickLock","disableAutoHide"]);const j=n(t),R=tt(T,L),I=tc(o),D=Jl(o),{innerWidth:B,innerHeight:F,width:z,height:W,insetLeft:$,insetTop:G}=o.getOptions(),Y=ut(e=>{var n;if(P&&t.getAttribute(sz))return;const h=fB(t,e);if(!h)return;const p=uB(t),g=p.min[0],S=p.min[1],{selectedElements:_,selectedData:T,filteredSeriesData:C,abstractX:L}=Az({root:t,event:e,elements:j,coordinate:o,scale:a,startX:v,startY:m}),Y=mz(_,a,f,T,O);if(r&&Y.items.sort((t,e)=>r(t)-r(e)),i&&(Y.items=Y.items.filter(i)),0===_.length||Ez(Y))return void H(e);if(y&&uz({root:t,data:Y,x:h[0]+g,y:h[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:M,css:N,offset:E}),s||l||c){const e=Ja(R,"crosshairs"),n=Object.assign(Object.assign({},e),Ja(R,"crosshairsX")),r=Object.assign(Object.assign({},e),Ja(R,"crosshairsY")),i=C.map(t=>t[1]);l&&yz(t,i,h,Object.assign(Object.assign({},n),{plotWidth:B,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:$,insetTop:G,startX:v,startY:m,transposed:D,polar:I})),c&&bz(t,i,Object.assign(Object.assign({},r),{plotWidth:B,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:$,insetTop:G,startX:v,startY:m,transposed:D,polar:I}))}if(A){const e=Ja(R,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(t=>t.remove());const{type:i=""}=n,a=e.filter(t=>{const[{x:e,y:n}]=t;return Za(e)&&Za(n)}).map(t=>{const[{color:e,element:a},o]=t,s=e||a.style.fill||a.style.stroke||r.color,l="hollow"===i?"transparent":s,c="hollow"===i?s:"#fff";return new Hg({className:`${UA}tooltip-marker`,style:Object.assign({cx:o[0],cy:o[1],fill:l,r:4,stroke:c,lineWidth:2,pointerEvents:"none"},n)})});for(const e of a)t.appendChild(e);t.markers=a}(t,{data:C,style:e,theme:O})}const V=null===(n=C[0])||void 0===n?void 0:n[0].x,q=null!=V?V:L(focus);d.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},Y),{data:{x:UD(a.x,q,!0)}})}))},h,{leading:p,trailing:g}),H=e=>{P&&t.getAttribute(sz)||C||fz({root:t,single:b,emitter:d,event:e})},V=()=>{dz({root:t,single:b})},q=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:l}=e,c=De(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=a.x.map(u),[d,h]=o.map([f,.5]),p=uB(t),g=p.min[0],v=p.min[1];Y(Object.assign(Object.assign({},c),{offsetX:void 0!==s?s:g+d,offsetY:void 0!==l?l:v+h,_x:u}))},X=()=>{fz({root:t,single:b,emitter:d,nativeEvent:!1})},U=()=>{et(),V()},K=e=>{fB(t,e)||H(e)},Z=()=>{J()},Q=e=>{P&&t.setAttribute(sz,!t.getAttribute(sz)),Y(e)},J=()=>{S||(t.addEventListener("pointerdown",Q),t.addEventListener("pointerenter",Y),t.addEventListener("pointermove",Y),t.addEventListener("pointerleave",K),t.addEventListener("pointerup",H))},et=()=>{S||(t.removeEventListener("pointerdown",Q),t.removeEventListener("pointerenter",Y),t.removeEventListener("pointermove",Y),t.removeEventListener("pointerleave",K),t.removeEventListener("pointerup",H))};return J(),d.on("tooltip:show",q),d.on("tooltip:hide",X),d.on("tooltip:disable",U),d.on("tooltip:enable",Z),()=>{et(),d.off("tooltip:show",q),d.off("tooltip:hide",X),d.off("tooltip:disable",U),d.off("tooltip:enable",Z),_?fz({root:t,single:b,emitter:d,nativeEvent:!1}):V()}}function Tz(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:a,name:o,item:s=()=>({}),facet:l=!1}=t,c=De(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,o,u)=>{const{container:f,view:d}=t,{scale:h,markState:p,coordinate:g,theme:v}=d,m=Mz(p,"seriesTooltip"),y=Mz(p,"crosshairs"),b=cB(f),x=Oz(a,m),w=Oz(n,y);if(c.clickLock&&!l&&b.setAttribute(sz,!1),x&&function(t){return Array.from(t.values()).some(t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip})}(p)&&!l)return _z(b,Object.assign(Object.assign({},c),{theme:v,elements:oB,scale:h,coordinate:g,crosshairs:w,crosshairsX:Oz(Oz(r,n),!1),crosshairsY:Oz(i,w),item:s,emitter:u}));if(x&&l){const e=o.filter(e=>e!==t&&e.options.parentKey===t.options.key),a=sB(t,o),l=e[0].view.scale,f=b.getBounds(),d=f.min[0],h=f.min[1];Object.assign(l,{facet:!0});const p=b.parentNode.parentNode;return c.clickLock&&p.setAttribute(sz,!1),_z(p,Object.assign(Object.assign({},c),{theme:v,elements:()=>a,scale:l,coordinate:g,crosshairs:Oz(n,y),crosshairsX:Oz(Oz(r,n),!1),crosshairsY:Oz(i,w),item:s,startX:d,startY:h,emitter:u}))}return function(t,{elements:e,coordinate:n,scale:r,render:i,groupName:a,sort:o,filter:s,emitter:l,wait:c=50,leading:u=!0,trailing:f=!1,groupKey:d=t=>t,single:h=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:w,shared:k=!1,body:M=!0,disableNative:O=!1,preserve:E=!1,css:S={},clickLock:A=!1,disableAutoHide:_=!1}){const T=e(t),N=rr(T,d),P=ut(e=>{if(A&&t.getAttribute(sz))return;const c=Sz({root:t,event:e,elements:T,coordinate:n,scale:r,shared:k});if(!c)return void(_||fz({root:t,single:h,emitter:l,event:e}));const u=d(c),f=N.get(u);if(!f)return;const v=1!==f.length||k?mz(f,r,a,void 0,x):pz(f[0]);if(o&&v.items.sort((t,e)=>o(t)-o(e)),s&&(v.items=v.items.filter(s)),Ez(v))return void(_||fz({root:t,single:h,emitter:l,event:e}));const{offsetX:O,offsetY:E}=e;M&&uz({root:t,data:v,x:O,y:E,render:i,event:e,single:h,position:p,enterable:g,mount:y,bounding:b,css:S,offset:w}),l.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Ya(c,m)})}))},c,{leading:u,trailing:f}),C=e=>{_||fz({root:t,single:h,emitter:l,event:e})},L=e=>{A&&t.setAttribute(sz,!t.getAttribute(sz)),P(e)},j=()=>{O||(t.addEventListener("pointerdown",L),t.addEventListener("pointermove",P),t.addEventListener("pointerleave",C),t.addEventListener("pointerup",C))},R=()=>{O||(t.removeEventListener("pointerdown",L),t.removeEventListener("pointermove",P),t.removeEventListener("pointerleave",C),t.removeEventListener("pointerup",C))},I=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:a}=i,o=TB(T,a,v);if(!o)return;const s=o.getBBox(),{x:l,y:c,width:u,height:f}=s,d=t.getBBox();P({target:o,offsetX:void 0!==n?n+d.x:l+u/2,offsetY:void 0!==r?r+d.y:c+f/2})},D=({nativeEvent:e}={})=>{e||fz({root:t,single:h,emitter:l,nativeEvent:!1})},B=()=>{R(),dz({root:t,single:h})},F=()=>{j()};return l.on("tooltip:show",I),l.on("tooltip:hide",D),l.on("tooltip:enable",F),l.on("tooltip:disable",B),j(),()=>{R(),l.off("tooltip:show",I),l.off("tooltip:hide",D),l.off("tooltip:enable",F),l.off("tooltip:disable",B),E?fz({root:t,single:h,emitter:l,nativeEvent:!1}):dz({root:t,single:h})}}(b,Object.assign(Object.assign({},c),{datum:gB(d),elements:oB,scale:h,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:d,theme:v,shared:e}))}}function Nz(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=VB(r),s=oB(r),l=t=>UB(t).scales[0].name,c=t=>{const{scale:{[t]:e}}=i;return e},u=kB(a,["active","inactive"]),f=MB(s,gB(i)),d=[];for(const t of o){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=l(t),i=HB(t),a=c(r),o=rr(s,t=>a.invert(t.__data__[r])),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:g,removeState:v}=xB(u,f),m={inactive:Ja(p,"marker")},y={inactive:Ja(p,"label")},{setState:b,removeState:x}=xB(m),{setState:w,removeState:k}=xB(y),M=t=>{for(const e of i){const n=$B(e),r=GB(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},O=(t,i)=>{const a=e(i),l=new Set(o.get(a));for(const t of s)l.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:c=!0}=t;c&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:r,value:a}}))},E=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),E.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:a}=t;if(n)return;const{channel:o,value:s}=a;if(o!==r)return;const l=i.find(t=>e(t)===s);l&&O({nativeEvent:!1},l)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of E)t.removeEventListener(e)};d.push(T)}return()=>d.forEach(t=>t())}}function Pz(t,e){const[n,r,i,a]=t,[o,s,l,c]=e;return!(o>i||l<n||s>a||c<r)}function Cz(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function Lz(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}Tz.props={reapplyWhenUpdate:!0};const jz=Gm(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:l=10,document:c}=e,u=De(e,["x","y","width","height","class","renders","handleSize","document"]);if(!c||void 0===i||void 0===a||void 0===n||void 0===r)return;const f=l/2,d=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},h=Ja(eo(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,g=De(h,["render"]),v=Ja(u,"handleE"),{render:m=d}=v,y=De(v,["render"]),b=Ja(eo(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=De(b,["render"]),k=Ja(u,"handleW"),{render:M=d}=k,O=De(k,["render"]),E=Ja(u,"handleNW"),{render:S=d}=E,A=De(E,["render"]),_=Ja(u,"handleNE"),{render:T=d}=_,N=De(_,["render"]),P=Ja(u,"handleSE"),{render:C=d}=P,L=De(P,["render"]),j=Ja(u,"handleSW"),{render:R=d}=j,I=De(j,["render"]),D=t=>()=>{const e=Gm(e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,c);r.id=n,r.style.draggable=!0})(e,t));return new e({})},B=Mm(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(Lz,Object.assign(Object.assign({width:i,height:a},eo(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-l).style("height",l).style("fill","transparent").call(Lz,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",l).style("height",a-l).style("fill","transparent").call(Lz,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",a-f).style("width",i-l).style("height",l).style("fill","transparent").call(Lz,w),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",l).style("height",a-l).style("fill","transparent").call(Lz,O),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(Lz,A),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(Lz,N),B.maybeAppend("handle-se",D(C)).style("x",i-f).style("y",a-f).style("width",l).style("height",l).style("fill","transparent").call(Lz,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",a-f).style("width",l).style("height",l).style("fill","transparent").call(Lz,I)});function Rz(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=Cz(t),brushRegion:l=(t,e,n,r,i)=>[t,e,n,r],reverse:c=!1,fill:u="#777",fillOpacity:f="0.3",stroke:d="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=De(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[w,k,M,O]=s;AB(t,"crosshair"),t.style.draggable=!0;const E=(t,e,n)=>{if(a(n),y&&y.remove(),b&&b.remove(),g=[t,e],c)return S();A()},S=()=>{b=new nv({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),y=new jz({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},A=()=>{y=new jz({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:d,draggable:!0}),className:"mask"}),t.appendChild(y)},_=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,a,o,u]=function(t,e,n,r,i){const[a,o,s,l]=i;return[Math.max(a,Math.min(t,n)),Math.max(o,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(l,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,d,h,p]=l(i,a,o,u,s);return c?P(f,d,h,p):N(f,d,h,p),n(f,d,h,p,r),[f,d,h,p]},N=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},P=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${M},${k}L${M},${O}L${w},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==h.indexOf(e)&&new Set(Object.keys(C)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=dB(t,e);if(!y||!L(n))return E(r,i,e),void(x=!0);L(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=dB(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],w,M),a=e(r,g[1],v[1],k,O),o=[g[0]+i,g[1]+a],s=[v[0]+i,v[1]+a];T(o,s)})(r);const[i,a]=[r[0]-m[0],r[1]-m[1]],{id:o}=n;if(C[o]){const[t,e,n,r]=C[o].vector;return T([g[0]+i*t,g[1]+a*e],[v[0]+i*n,v[1]+a*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void o(t,n,t+r,n+i,e)}v=dB(t,e);const[n,r,a,s]=T(g,v);x=!1,i(n,r,a,s,e)},F=t=>{const{target:e}=t;y&&!L(e)&&_()},z=e=>{const{target:n}=e;y&&L(n)&&!x?R(n)?AB(t,"move"):j(n)&&AB(t,C[n.id].cursor):AB(t,"crosshair")},W=()=>{AB(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",W),{mask:y,move(t,e,n,r,i=!0){y||E(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&_(t)},destroy(){y&&_(!1),AB(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",W)}}}function Iz(t,e,n){return e.filter(e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find(t=>t.brushKey===n)})}function Dz(t,e,n){return Iz(t,e,n).map(t=>t.options)}function Bz(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:f=!1,key:d=t=>t,bboxOf:h=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=De(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=MB(m,a),w=Ja(v,"mask"),{setState:k,removeState:M}=xB(p,x),O=new Map,{width:E,height:S,x:A=0,y:_=0}=h(t),T=s||[0,0,E,S],N=()=>{for(const t of[...m,...b])M(t,"active","inactive")},P=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const a=new Set;for(const i of m){const{min:o,max:s}=i.getLocalBounds(),[l,c]=o,[u,f]=s;Pz([l,c,u,f],[t,e,n,r])?(k(i,"active"),a.add(d(i))):k(i,"inactive")}for(const t of b)a.has(d(t))?k(t,"active"):k(t,"inactive")},C=()=>{for(const t of m)M(t,"inactive");for(const t of O.values())t.remove();O.clear()},L=(e,n,r,i)=>{const a=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e},o=new sv({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(o);for(const t of m){const e=O.get(t)||a(t);e.style.clipPath=o,k(t,"inactive"),k(e,"active")}},j=Rz(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{const e=f?C:N;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const a=ZD(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}});(f?L:P)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const a=ZD(t,e,n,r,c,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushupdated:(t,e,n,r,i)=>{const a=ZD(t,e,n,r,c,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,a,o]=function(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=QD(a,r),l=QD(o,i),c=[s[0],l[0]],u=[s[1],l[1]],[f,d]=n.map(c),[h,p]=n.map(u);return[f,d,h,p]}(n,c,u);j.move(r,i,a,o,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function Fz(t){var{facet:e,brushKey:n}=t,r=De(t,["facet","brushKey"]);return(t,i,a)=>{const{container:o,view:s,options:l}=t,c=cB(o),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:d,coordinate:h}=s;if(e){const e=c.getBounds(),n=e.min[0],o=e.min[1],s=e.max[0],l=e.max[1];return Bz(c.parentNode.parentNode,Object.assign(Object.assign({elements:()=>sB(t,i),datum:gB(lB(t,i).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,o,s,l],state:kB(lB(t,i).map(t=>t.options),f),emitter:a,scale:d,coordinate:h,selectedHandles:void 0},u),r))}const p=Bz(c,Object.assign(Object.assign({elements:oB,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return Iz(t,e,n).map(t=>cB(t.container))}(t,i,n),datum:gB([s,...Iz(t,i,n).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:kB([l,...Dz(t,i,n)],f),emitter:a,scale:d,coordinate:h,selectedHandles:void 0},u),r));return c.brush=p,()=>p.destroy()}}function zz(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function Wz(t){return Fz(Object.assign(Object.assign({},t),{brushRegion:zz,selectedHandles:["handle-e","handle-w"]}))}function $z(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function Gz(t){return Fz(Object.assign(Object.assign({},t),{brushRegion:$z,selectedHandles:["handle-n","handle-s"]}))}Fz.props={reapplyWhenUpdate:!0};const Yz="axis-hot-area";function Hz(t){return t.getElementsByClassName("axis")}function Vz(t){return t.getElementsByClassName("axis-line")[0]}function qz(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function Xz(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=De(e,["cross","offsetX","offsetY"]);const o=qz(t),s=Vz(t),[l]=s.getLocalBounds().min,[c,u]=o.min,[f,d]=o.max,h=2*(f-c);return{brushRegion:$z,hotZone:new sv({className:Yz,style:Object.assign({width:n?h/2:h,transform:`translate(${(n?c:l-h/2).toFixed(2)}, ${u})`,height:d-u},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(c-r),e,Math.ceil(f-r),i]}}function Uz(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=De(e,["offsetY","offsetX","cross"]);const o=qz(t),s=Vz(t),[,l]=s.getLocalBounds().min,[c,u]=o.min,[f,d]=o.max,h=d-u;return{brushRegion:zz,hotZone:new sv({className:Yz,style:Object.assign({width:f-c,height:i?h:2*h,transform:`translate(${c}, ${i?u:l-h})`},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(d-n)]}}function Kz(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=cB(i),{x:l,y:c}=s.getBBox(),{coordinate:u}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:l,reverse:c=!1,state:u={},emitter:f,coordinate:d}=e,h=De(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=MB(p,o),{setState:m,removeState:y}=xB(u,v),b=new Map,x=Ja(h,"mask"),w=t=>Array.from(b.values()).every(([e,n,r,i])=>t.some(([t,a])=>t>=e&&t<=r&&a>=n&&a<=i)),k=g.map(t=>t.attributes.scale),M=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,E=()=>{O.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();O.set(t,M(n))}};E();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}O.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)y(t,"active","inactive");E(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return M(KD(n,i))},T=g.some(a)&&g.some(t=>!a(t)),N=[];for(let t=0;t<g.length;t++){const e=g[t],n=a(e)?Uz:Xz,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:s,offsetX:l,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=Rz(r,Object.assign(Object.assign({},x),{reverse:c,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),S(t,s)}}));N.push(u)}const P=(t={})=>{const{nativeEvent:e}=t;e||N.forEach(t=>t.remove(!1))},C=(t,e,n)=>{const[r,i]=t,o=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=d.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<N.length;t++){const e=n[t],r=N[t],i=g[t];if(e){const n=k[t];r.move(...C(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",P),f.on("brushAxis:highlight",j),()=>{N.forEach(t=>t.destroy()),f.off("brushAxis:remove",P),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:oB,axes:Hz,offsetY:c,offsetX:l,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:gB(a),state:kB(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function Zz(t){var{hideX:e=!0,hideY:n=!0}=t,r=De(t,["hideX","hideY"]);return(t,i,a)=>{const{container:o,view:s,options:l,update:c,setState:u}=t,f=cB(o);let d=!1,h=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:o,emitter:s,scale:l,coordinate:c,selection:u,series:f=!1}=e;const d=Ja(De(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:h,height:p}=t.getBBox(),g=a||[0,0,h,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=Rz(t,Object.assign(Object.assign({},d),{extent:g,brushRegion:i,reverse:o,brushcreated:function(t,e,r,i,a){t===r&&e===i||(a.nativeEvent=!0,n(u(t,e,r,i),a),m.remove())}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:a}=p;return ZD(t,e,n,r,i,a)},filter:(t,r)=>Fe(this,void 0,void 0,function*(){if(h)return;h=!0;const[i,o]=t;u("brushFilter",t=>{const{marks:r}=t,a=r.map(t=>tt({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}}));return Object.assign(Object.assign({},l),{marks:a,clip:!0})}),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield c();p=s.view,h=!1,d=!0}),reset:t=>{if(h||!d)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),d=!1,p=s,u("brushFilter"),c()},extent:void 0,emitter:a,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function Qz(t){return Zz(Object.assign(Object.assign({hideX:!0},t),{brushRegion:zz}))}function Jz(t){return Zz(Object.assign(Object.assign({hideY:!0},t),{brushRegion:$z}))}function tW(t,e,n){const r=t?n:e,i=t?e:n,a=XD(r),o=XD(i),s=i.getOptions().domain;return{currentScale:r,targetScale:i,isSourceDiscrete:a,isTargetDiscrete:o,shouldPreserveZeroBaseline:!o&&s&&s.length>=2&&0===s[0]}}function eW({isTargetDiscrete:t,filteredValues:e,shouldPreserveZeroBaseline:n}){if(t)return r=e,Array.from(new Set(r)).sort((t,e)=>t-e);{const t=Math.min(...e),r=Math.max(...e);return n?[0,r]:[t,r]}var r}function nW(t){return t instanceof Date?t.getTime():"string"==typeof t?parseFloat(t):Number(t)}function rW(t,e,n,r,i,a="filter",o=!1){if(DB(a))return[];const s=o?"y":"x",l=o?"x":"y",c=[];for(const r of t){const{channelData:t}=r,i=t[s]||[],o=t[l]||[],u=Array.isArray(i[0])?i[0]:i,f=Array.isArray(o[0]);if(0===u.length)continue;const d=u.length;for(let t=0;t<d;t++){const r=u[t];let i=!1;if(n)i=e.includes(r);else if(e.length>=2){const t=nW(r),n=nW(e[0]),a=nW(e[e.length-1]);isNaN(t)||isNaN(n)||isNaN(a)||(i=t>=n&&t<=a)}if("filter"===a&&i)if(f){const e=o.length;for(let n=0;n<e;n++){const e=o[n];if(Array.isArray(e)&&t<e.length){const n=nW(e[t]);isNaN(n)||c.push(n)}}}else if(t<o.length){const e=nW(o[t]);isNaN(e)||c.push(e)}}}return c.length>0?eW({isTargetDiscrete:r,filteredValues:c,shouldPreserveZeroBaseline:i}):[]}function iW(t,e,n,r){r&&e instanceof Map?e.forEach((e,n)=>{e&&Array.isArray(e)&&e.length>0&&(t[n]=e)}):!r&&Array.isArray(e)&&e.length>0&&(t[n?"x":"y"]=e)}const aW="slider";function oW(t){var e,n,r,i;if(!(null==t?void 0:t.markState))return 0;let a=0;for(const[o,s]of t.markState.entries()){if("point"!==o.type||!(null==s?void 0:s.channels))continue;const t=null===(e=s.channels)||void 0===e?void 0:e.find(t=>"size"===t.name);if(t){if((null===(r=null===(n=t.scale)||void 0===n?void 0:n.range)||void 0===r?void 0:r.length)>0){const e=Math.max(...t.scale.range.filter(t=>"number"==typeof t));a=Math.max(a,e);continue}if((null===(i=t.values)||void 0===i?void 0:i.length)>0){const e=t.values.filter(t=>void 0!==t.value).flatMap(t=>Array.isArray(t.value)?t.value:[t.value]).filter(t=>"number"==typeof t&&!isNaN(t));e.length>0&&(a=Math.max(a,...e))}}}return a}function sW(t,e,n,r,i,a,o){if(o){const s=a?r:i.x,l=a?i.y:r;t.emit(e,Object.assign(Object.assign({},n),{nativeEvent:o,data:{selection:[uW(s),uW(l)]}}))}}function lW(t,e,n,r){const{domain0:i,filteredDomain:a,channel0:o,channel1:s,prefix:l,hasState:c,isMultiAxis:u,markToScaleMap:f,enableAdaptiveFiltering:d}=r;u&&a instanceof Map?t(e,t=>Object.assign({},function(t,e,n,r,i=!1,a="x",o="y",s=new Map,l=new Map){const{marks:c}=t,u=oW(e),f=c.map(t=>{var e,c;const u="string"==typeof(null==t?void 0:t.key)?t.key:String((null==t?void 0:t.key)||""),f=s.get(u),d=l.get(f),h=d&&{y:Object.assign({domain:d,nice:!0},"y"!==f?{independent:!0}:void 0)};return tt({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:Object.assign(Object.assign({},n),h),[r]:Object.assign(Object.assign({},(null===(e=t[r])||void 0===e?void 0:e[a])&&{[a]:Object.assign({preserve:!0},i&&{ratio:null})}),(null===(c=t[r])||void 0===c?void 0:c[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:f,insetLeft:u,insetRight:u,insetTop:u,insetBottom:u,clip:!0,animate:!1})}(t,n,{[o]:{domain:i,nice:!1}},l,c,o,s,f||new Map,a))):t(e,t=>Object.assign({},function(t,e,n,r,i=!1,a="x",o="y"){const{marks:s}=t,l=oW(e),c=s.map(t=>{var e,s;return tt({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:n,[r]:Object.assign(Object.assign({},(null===(e=t[r])||void 0===e?void 0:e[a])&&{[a]:Object.assign({preserve:!0},i&&{ratio:null})}),(null===(s=t[r])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:c,insetLeft:l,insetRight:l,insetTop:l,insetBottom:l,clip:!0,animate:!1})}(t,n,Object.assign({[o]:{domain:i,nice:!1}},d&&Array.isArray(a)?{[s]:{domain:a,nice:!0}}:{}),l,c,o,s)))}function cW(t,e,n){const[r,i]=t,a=n?t=>1-t:t=>t;return KD(e,[UD(e,a(r),!0),UD(e,a(i),!1)])}function uW(t){return[t[0],t[t.length-1]]}function fW({initDomain:t={},className:e=aW,prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,adaptiveMode:l="filter",getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(u,f,d)=>{const{container:h,view:p,update:g,setState:v}=u,m=h.getElementsByClassName(e);if(!m.length)return()=>{};const{scale:y,coordinate:b}=p,{x:x,y:w}=y,k=Jl(b),M=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return k?[n,e]:[e,n]},O=new Map,E=new Set,S=FB(p),A=function(t,e,n,r,i){var a,o,s,l;const c={x:e.x||n.getOptions().domain||[],y:e.y||r.getOptions().domain||[]},u=i||FB(t),{hasIndependentX:f,hasIndependentY:d}=u;if(f||d){let e=1,n=1;for(const[r,i]of t.markState.entries())if(null==i?void 0:i.channels){if(f){const t=i.channels.find(t=>"x"===t.name);(null===(o=null===(a=null==r?void 0:r.scale)||void 0===a?void 0:a.x)||void 0===o?void 0:o.independent)&&(c[`x${e}`]=t.scale.domain,e++)}if(d){const t=i.channels.find(t=>"y"===t.name);(null===(l=null===(s=null==r?void 0:r.scale)||void 0===s?void 0:s.y)||void 0===l?void 0:l.independent)&&(c[`y${n}`]=t.scale.domain,n++)}}}return c}(p,t,x,w,S),_=Array.from(m),T=t=>_.some(e=>{const{orientation:n}=e.attributes,[r]=M(n);return r===t}),N=T("x")&&!T("y"),P=T("y")&&!T("x"),C=!DB(l)&&(N||P);for(const t of m){const{orientation:e}=t.attributes,[u,f]=M(e),h=`${n}${G(u)}:filter`,m="x"===u,{ratio:b}=x.getOptions(),{ratio:_}=w.getOptions(),T=t=>{if(t.data){const{selection:e}=t.data,[n=uW(A.x),r=uW(A.y)]=e;return m?[KD(x,n,b),KD(w,r,_)]:[KD(w,r,_),KD(x,n,b)]}const{value:n}=t.detail;return[cW(n,y[u],k&&"horizontal"===e),A[f]]};let L=!1;const j=pW({getFiltering:()=>L,setFiltering:t=>{L=t},domainsOf:T,view:p,independentScaleInfo:S,enableAdaptiveFiltering:C,hasOnlyXSlider:N,hasOnlyYSlider:P,adaptiveMode:l,scaleX:x,scaleY:w,scale:y,channelDomain:A,channel0:u,channel1:f,isX:m,emitter:d,eventName:h,setState:v,slider:t,prefix:n,hasState:i,update:g,wait:a,leading:o,trailing:s}),R=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:a}=i,[o,s]=a;t.dispatchEvent(new Hp("valuechange",{data:i,nativeEvent:!1}));const l=m?JD(o,x):JD(s,w);r(t,l)};d.on(h,R),t.addEventListener("valuechange",j),O.set(t,j),E.add([h,R]);const I=c(t);I&&t.dispatchEvent(new Hp("valuechange",{detail:{value:I},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of O)t.removeEventListener("valuechange",e);for(const[t,e]of E)d.off(t,e)}}}function dW({view:t,domain0:e,shouldFilterXAxis:n,enableAdaptiveFiltering:r,markDataPairs:i,adaptiveMode:a,scaleX:o,scaleY:s,scale:l,channelDomain:c,independentScaleInfo:u,channel0:f}){const d=new Map,h=new Map;if(!r||0===i.length||!(null==e?void 0:e.length))return{filteredDomain:d,markToScaleMap:h};const p=at(t,"options.slider");if(Object.keys(p).length>0&&Object.prototype.hasOwnProperty.call(p,f)){const t=function(t,e,n,r,i){const a=t?r:n,o=t=>{const e={};return Object.keys(i).forEach(n=>{(n===t||n.match(new RegExp(`^${t}\\d+$`)))&&(e[n]=i[n])}),e},s=o(t?"x":"y"),l=Object.keys(s),c=l.map(t=>e[t]),u=XD(a),f=c.map(t=>XD(t)),d=c.map((t,e)=>{const n=t.getOptions().domain;return!f[e]&&n&&n.length>=2&&0===n[0]});return{currentScale:a,targetScales:c,isSourceDiscrete:u,isTargetDiscrete:f,shouldPreserveZeroBaseline:d,targetScaleKeys:l}}(n,l,o,s,c);(n?u.markToXScaleMap:u.markToYScaleMap).forEach((t,e)=>{h.set(e,t)});const r=function({markDataPairs:t,domain:e,scaleInfo:n,markToScaleMap:r,adaptiveMode:i,shouldFilterXAxis:a=!1}){const o=new Map,{isSourceDiscrete:s,isTargetDiscrete:l,shouldPreserveZeroBaseline:c,targetScaleKeys:u}=n;return t.forEach(t=>{const n=r.get(t.markKey);if(!n)return;const f=u.indexOf(n);if(-1===f)return;const d=l[f],h=c[f],p=rW([t],e,s,d,h,i,a);o.set(n,p)}),o}({markDataPairs:i,domain:e,scaleInfo:t,markToScaleMap:h,adaptiveMode:a,isViewSlider:!0,shouldFilterXAxis:n});return iW(c,r,n,!0),{filteredDomain:r,markToScaleMap:h}}{const r=function(t,e){for(const[n]of t.markState.entries()){const t=at(n,"slider");if(Object.keys(t||{}).length>0&&Object.prototype.hasOwnProperty.call(t,e))return String(n.key||"")}return null}(t,f);if(r){const t=tW(n,o,s),l=n?u.markToXScaleMap:u.markToYScaleMap,c=l.get(r)||"";if(c){h.set(r,c);const o=function(t,e,n,r,i,a,o=!1,s){const l=new Map;if(0===t.length||0===e.length)return l;const{isSourceDiscrete:c,isTargetDiscrete:u,shouldPreserveZeroBaseline:f}=n,d=s?t.filter(t=>s.get(t.markKey)===i):t.filter(t=>t.markKey===r);if(0===d.length)return l;const h=rW(d,e,c,u,f,a,o);return l.set(i,h),l}(i,e,t,r,c,a,n,l);return{filteredDomain:o,markToScaleMap:h}}}}return{filteredDomain:d,markToScaleMap:h}}function hW({domain0:t,domain1:e,shouldFilterXAxis:n,enableAdaptiveFiltering:r,markDataPairs:i,adaptiveMode:a,scaleX:o,scaleY:s,channelDomain:l,hasOnlyXSlider:c,hasOnlyYSlider:u,isX:f}){let d=e;if(r&&i.length>0&&(c&&f||u&&!f)&&(null==t?void 0:t.length)>0){d=function({markDataPairs:t,domain:e,scaleInfo:n,adaptiveMode:r,shouldFilterXAxis:i=!1}){const{isSourceDiscrete:a,isTargetDiscrete:o,shouldPreserveZeroBaseline:s}=n;return rW(t,e,a,o,s,r,i)}({markDataPairs:i,domain:t,scaleInfo:tW(n,o,s),adaptiveMode:a,shouldFilterXAxis:n}),iW(l,d,n,!1)}return d}function pW({getFiltering:t,setFiltering:e,domainsOf:n,view:r,independentScaleInfo:i,enableAdaptiveFiltering:a,hasOnlyXSlider:o,hasOnlyYSlider:s,adaptiveMode:l,scaleX:c,scaleY:u,scale:f,channelDomain:d,channel0:h,channel1:p,isX:g,emitter:v,eventName:m,setState:y,slider:b,prefix:x,hasState:w,update:k,wait:M,leading:O,trailing:E}){return ut(M=>Fe(this,void 0,void 0,function*(){const{initValue:O=!1}=M;if(t()&&!O)return;e(!0);const{nativeEvent:E=!0}=M,{markDataPairs:S}=function(t){var e,n;const r=[],i=[],a=[],o=t.markState;if(o)for(const[t,s]of o.entries())if(null==s?void 0:s.channels){const o={};for(const t of s.channels)if("x"===(null==t?void 0:t.name)&&(null===(e=t.values)||void 0===e?void 0:e.length)>0){let e=[];for(const n of t.values)(null==n?void 0:n.value)&&(e=e.concat(n.value),r.push(n.value));o.x=e}else if(t&&("y"===t.name||t.name.startsWith("y"))&&(null===(n=t.values)||void 0===n?void 0:n.length)>0){const e=t.name,n=[];for(const r of t.values)if(null==r?void 0:r.value){const t=r.value;n.push(t),"y"!==e&&"y1"!==e||(Array.isArray(t)?i.push(t.flat()):i.push([t]))}o[e]=n}const l=o.x||[],c=o.y||[];l.length>0&&c.length>0&&a.push({markKey:t.key||`mark_${a.length}`,channelData:o})}return{xChannelValues:r.flat(),yChannelValues:i.flat(),markDataPairs:a}}(r);if(i[`hasIndependent${p.toUpperCase()}`]){const[t]=n(M),e=s&&!g,{filteredDomain:k,markToScaleMap:O}=dW({view:r,domain0:t,shouldFilterXAxis:e,enableAdaptiveFiltering:a&&(o&&g||s&&!g),markDataPairs:S,adaptiveMode:l,scaleX:c,scaleY:u,scale:f,channelDomain:d,independentScaleInfo:i,channel0:h});d[h]=t,sW(v,m,M,t,d,g,E),lW(y,b,r,{domain0:t,filteredDomain:k,channel0:h,channel1:p,prefix:x,hasState:w,isMultiAxis:!0,markToScaleMap:O,enableAdaptiveFiltering:a})}else{const[t,e]=n(M),i=hW({domain0:t,domain1:e,shouldFilterXAxis:s&&!g,enableAdaptiveFiltering:a,markDataPairs:S,adaptiveMode:l,scaleX:c,scaleY:u,channelDomain:d,hasOnlyXSlider:o,hasOnlyYSlider:s,isX:g});d[h]=t,sW(v,m,M,t,d,g,E),lW(y,b,r,{domain0:t,filteredDomain:i,channel0:h,channel1:p,prefix:x,hasState:w,isMultiAxis:!1,markToScaleMap:void 0,enableAdaptiveFiltering:a})}yield k(),e(!1)}),M,{leading:O,trailing:E})}function gW({className:t=aW,setValue:e=(t,e)=>t.setValues(e),minRange:n=.01,wheelSensitivity:r=.05,x:i=!0,y:a=!0}={}){return o=>{const{container:s,view:l}=o,{coordinate:c}=l,u=Jl(c),f=function(t){var e;try{const n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n||"function"!=typeof n.getContextService)return null;const r=n.getContextService().getDomElement();return r instanceof HTMLElement?r:null}catch(t){return null}}(s),d=Math.max(1e-6,Math.min(1,n)),h=s.getElementsByClassName(t);if(!h.length)return()=>{};const p=(t,e)=>!0===t||!1!==t&&("shift"===t?e.shiftKey&&!e.ctrlKey&&!e.altKey:"ctrl"===t?e.ctrlKey&&!e.shiftKey&&!e.altKey:"alt"===t&&(e.altKey&&!e.shiftKey&&!e.ctrlKey)),g=(t,n)=>{e(t,n),t.dispatchEvent(new Hp("valuechange",{detail:{value:n},nativeEvent:!0}))},v=(t,e,n,r,i)=>{const a=(t-e)/n,o=Math.max(0,Math.min(1,a));return Math.max(r,Math.min(i,o))},m=t=>{if(!f)return;const e=t.target;if(!f.contains(e))return;const n=f.getBoundingClientRect(),o=t.clientX-n.left,s=t.clientY-n.top,l=[];for(const e of h){const{values:n,orientation:r}=e.attributes;if(!n)continue;const o="horizontal"===r;p("x"===(u?o?"y":"x":o?"x":"y")?i:a,t)&&l.push(e)}if(0!==l.length){t.preventDefault(),t.stopPropagation();for(const e of l){const{values:n,orientation:i,x:a,y:l,trackLength:c}=e.attributes,[u,f]=n,h=f-u,p="horizontal"===i?v(o,a,c,u,f):v(s,l,c,u,f),m=r*IB(h),y=1+t.deltaY*m,b=Math.max(d,Math.min(1,h*y));let x=p-b*((p-u)/h),w=p+b*((f-p)/h);x<0?(x=0,w=Math.min(1,b)):w>1&&(w=1,x=Math.max(0,1-b)),g(e,[x,w])}}};return f&&f.addEventListener("wheel",m,{passive:!1,capture:!0}),()=>{f&&f.removeEventListener("wheel",m,{capture:!0})}}}gW.props={reapplyWhenUpdate:!0};const vW=`${UA}scrollbar`;function mW(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(vW).length)return()=>{};const{scale:o}=i,{x:s,y:l}=o,c={x:[...s.getOptions().domain],y:[...l.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),l.update({domain:l.getOptions().expectedDomain});return fW(Object.assign({initDomain:c,className:vW,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0]||1!==e[1])return e}},t))(e,n,r)}}function yW(t,e,n){return`<${t} style="${Object.entries(n).map(([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`).join(";")}">${e}</${t}>`}const bW={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function xW(t){return"text"===t.nodeName&&!!t.isOverflowing()}function wW(t){var{offsetX:e=8,offsetY:n=8}=t,r=De(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[a,o]=i.getBounds().min,s=Ja(r,"tip"),l=new Set,c=t=>{const{target:r}=t;if(!xW(r))return void t.stopPropagation();const{offsetX:c,offsetY:u}=t,f=c+e-a,d=u+n-o;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=d);const{text:h}=r.style,p=new Zg({className:"poptip",style:{innerHTML:yW("div",h,Object.assign(Object.assign({},bW),s)),x:f,y:d}});i.appendChild(p),r.tip=p,l.add(p)},u=t=>{const{target:e}=t;xW(e)?e.tip&&(e.tip.remove(),e.tip=null,l.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",c),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",c),i.removeEventListener("pointerout",u),l.forEach(t=>t.remove())}}}wW.props={reapplyWhenUpdate:!0};const kW={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function MW(t={}){const{originData:e=[],layout:n}=t,r=De(t,["originData","layout"]),i=tt({},kW,r),a=Ja(i,"breadCrumb"),o=Ja(i,"active");return t=>{const{update:r,setState:i,container:s,options:l}=t,c=function(t){return Mm(t).select(`.${cE}`).node()}(s),u=l.marks[0],{state:f}=u,d=new Ug;c.appendChild(d);const h=(t,l)=>Fe(this,void 0,void 0,function*(){if(d.removeChildren(),l){let e="",n=a.y,r=0;const i=[],s=c.getBBox().width,l=t.map((o,l)=>{e=`${e}${o}/`,i.push(o);const c=new cv({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:o,x:r,path:[...i],depth:l},a),{y:n})});d.appendChild(c),r+=c.getBBox().width;const u=new cv({style:Object.assign(Object.assign({x:r,text:" / "},a),{y:n})});return d.appendChild(u),r+=u.getBBox().width,r>s&&(n=d.getBBox().height+a.y,r=0,c.attr({x:r,y:n}),r+=c.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),l===ht(t)-1&&u.remove(),c});l.forEach((t,e)=>{if(e===ht(l)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",()=>{t.attr(o)}),t.addEventListener("mouseleave",()=>{t.attr(n)}),t.addEventListener("click",()=>{h(at(t,["style","path"]),at(t,["style","depth"]))})})}!function(t,e){[...VB(t),...XB(t)].forEach(t=>{e(t,t=>t)})}(s,i),i("treemapDrillDown",r=>{const{marks:i}=r,a=t.join("/"),o=i.map(t=>{if("rect"!==t.type)return t;let r=e;if(l){const t=e.filter(t=>{const e=at(t,["id"]);return e&&(e.match(`${a}/`)||a.match(e))}).map(t=>({value:0===t.height?at(t,["value"]):void 0,name:at(t,["id"])})),{paddingLeft:i,paddingBottom:o,paddingRight:s}=n,c=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||d.getBBox().height+10)/(l+1),paddingLeft:i/(l+1),paddingBottom:o/(l+1),paddingRight:s/(l+1),path:t=>t.name,layer:t=>t.depth===l+1});r=BS(t,c,{value:"value"})[0]}else r=e.filter(t=>1===t.depth);const i=[];return r.forEach(({path:t})=>{i.push(j(t))}),tt({},t,{data:r,scale:{color:{domain:i}}})});return Object.assign(Object.assign({},r),{marks:o})}),yield r(void 0,["legendFilter"])}),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:a}=n||{};if("rect"!==r&&i!==ou.TEXT)return;const o=i===ou.TEXT&&!0===at(a,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>at(t,["__data__","key"]))(n),s=_(e,t=>t.id===o);at(s,"height")&&h(at(s,"path"),at(s,"depth"))};c.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{CB(c).forEach(t=>{const n=at(t,["style","cursor"]),r=_(e,e=>e.id===at(t,["__data__","key"]));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=lt(t.attributes,g);t.addEventListener("mouseenter",()=>{t.attr(f.active)}),t.addEventListener("mouseleave",()=>{t.attr(tt(e,f.inactive))})}})};return v(),c.addEventListener("mousemove",v),()=>{d.remove(),c.removeEventListener("click",p),c.removeEventListener("mousemove",v)}}}const OW={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.6)",fontSize:11},y:4,active:{fill:"rgba(0, 0, 0, 0.4)"}};function EW(t={}){const{breadCrumb:e={}}=t,n=tt({},OW,e);return t=>{const{update:e,setState:r,container:i,view:a,options:o}=t,s=i.ownerDocument,l=function(t){return Mm(t).select(`.${cE}`).node()}(i),c=o.marks.find(({id:t})=>t===NA);if(!c)return;const{state:u}=c,f=s.createElement("g");f.style.transform=`translate(${n.x||0}px, ${n.y||0}px)`,f.setAttribute("x","drilldown-breadcrumb"),l.appendChild(f);const d=t=>Fe(this,void 0,void 0,function*(){if(f.removeChildren(),t&&t.length>0){const e=s.createElement("text",{style:Object.assign({text:n.rootText},n.style)});f.appendChild(e);let r="";const i=t;let a=n.style.y,o=e.getBBox().width;const c=l.getBBox().width,u=i.map((t,e)=>{const i=s.createElement("text",{style:Object.assign(Object.assign({x:o,text:" / "},n.style),{y:a})});f.appendChild(i),o+=i.getBBox().width,r=`${r}${t} / `;const l=s.createElement("text",{name:r.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:t,x:o},n.style),{y:a})});return f.appendChild(l),o+=l.getBBox().width,o>c&&(a=f.getBBox().height,o=0,i.attr({x:o,y:a}),o+=i.getBBox().width,l.attr({x:o,y:a}),o+=l.getBBox().width),l});[e,...u].forEach((e,r)=>{if(r===u.length)return;const i=Object.assign({},e.attributes);e.attr("cursor","pointer"),e.addEventListener("mouseenter",()=>{e.attr(n.active)}),e.addEventListener("mouseleave",()=>{e.attr(i)}),e.addEventListener("click",()=>{d(t.slice(0,r))})})}r("drillDown",e=>{const{marks:n}=e,r=n.map(e=>{if(e.id!==NA&&"rect"!==e.type)return e;const{data:n}=e,r=n.filter(e=>{var n;const r=null!==(n=e.path)&&void 0!==n?n:[];if(0===t.length)return!0;if(!Array.isArray(r)||r.length<t.length)return!1;for(let e=0;e<t.length;e++)if(r[e]!==t[e])return!1;return!0});return tt({},e,{data:r})});return Object.assign(Object.assign({},e),{marks:r})}),yield e()}),h=t=>{var e,n;const r=t.target,i=r.markType,a=r.style||{},o=a[PA],s=a[CA],l=r.__data__;if("rect"!==i||o!==NA||!s)return;const c=null!==(n=null===(e=null==l?void 0:l.data)||void 0===e?void 0:e.path)&&void 0!==n?n:[];d(c)};l.addEventListener("click",h);const p=M(Object.assign(Object.assign({},u.active),u.inactive)),g=()=>{const t=(t=>t.querySelectorAll(".element").filter(t=>(t.style||{})[PA]===NA))(l);t.forEach(t=>{const e=at(t,["style",CA]);if("pointer"!==at(t,["style","cursor"])&&e){t.style.cursor="pointer";const e=lt(t.attributes,p);t.addEventListener("mouseenter",()=>{t.attr(u.active)}),t.addEventListener("mouseleave",()=>{t.attr(tt(e,u.inactive))})}})};return l.addEventListener("mousemove",g),()=>{f.remove(),l.removeEventListener("click",h),l.removeEventListener("mousemove",g)}}}const SW={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},AW="movePoint",_W=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},TW=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},NW=(t,e,n)=>{t.forEach((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)})},PW=(t,e,n,r)=>{const i=new nv({style:n}),a=new cv({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},CW=(t,e)=>{if(!at(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},LW=(t,e,n)=>{const r=NB(t,e),i=NB(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function jW(t={}){const{selection:e=[],precision:n=2}=t,r=De(t,["selection","precision"]),i=Object.assign(Object.assign({},SW),r||{}),a=Ja(i,"path"),o=Ja(i,"label"),s=Ja(i,"point");return(t,r,i)=>{const{update:l,setState:c,container:u,view:f,options:{marks:d,coordinate:h}}=t,p=cB(u);let g,v=CB(p),m=e;const{transform:y=[],type:b}=h,x=!!_(y,({type:t})=>"transpose"===t),w="polar"===b,k="theta"===b,M=!!_(v,({markType:t})=>"area"===t);M&&(v=v.filter(({markType:t})=>"area"===t));const O=new Ug({style:{zIndex:2}});p.appendChild(O);const E=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],E(),T(e)},A=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=at(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:h}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:A,y1:N}=h;if(x&&"interval"!==r)return;const{scale:P,coordinate:C}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=P,I=C.getCenter();let D;O.removeChildren();const B=(t,e,n,r)=>Fe(this,void 0,void 0,function*(){return c("elementPointMove",a=>{var o;const s=((null===(o=null==g?void 0:g.options)||void 0===o?void 0:o.marks)||d).map(a=>{if(!r.includes(a.type))return a;const{data:o,encode:s}=a,l=Object.keys(s).reduce((r,i)=>{const a=s[i];return"x"===i&&(r[a]=t),"y"===i&&(r[a]=e),"color"===i&&(r[a]=n),r},{}),c=((t,e,n)=>e.map(e=>{const r=["x","color"].reduce((r,i)=>{const a=n[i];return a?e[a]===t[a]&&r:r},!0);return r?Object.assign(Object.assign({},e),t):e}))(l,o,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(l,c),tt({},a,{data:c,animate:!1})});return Object.assign(Object.assign({},a),{marks:s})}),yield l("elementPointMove")});if(["line","area"].includes(r))v.forEach((e,r)=>{const i=R.invert(A[r]);if(!i)return;const l=new Hg({name:AW,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),c=((t,e)=>{const n=at(t,["__data__","seriesItems",e,"0","value"]),r=at(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=_(o,({type:t})=>"normalizeY"===t),l=at(a,["y","field"]),c=i[r][l];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*c:t})(t,r);l.addEventListener("mousedown",f=>{const d=C.output([A[r],0]),h=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,E()),NW(O.childNodes,m,s);const[p,x]=PW(O,l,a,o),k=t=>{const i=e[1]+t.clientY-D[1];if(M)if(w){const a=e[0]+t.clientX-D[0],[o,s]=LW(I,d,[a,i]),[,u]=C.output([1,j.output(0)]),[,f]=C.invert([o,u-(v[r+h][1]-s)]),g=(r+1)%h,m=PB([v[(r-1+h)%h],[o,s],y[g]&&v[g]]);x.attr("text",c(j.invert(f)).toFixed(n)),p.attr("d",m),l.attr("cx",o),l.attr("cy",s)}else{const[,t]=C.output([1,j.output(0)]),[,a]=C.invert([e[0],t-(v[r+h][1]-i)]),o=PB([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",c(j.invert(a)).toFixed(n)),p.attr("d",o),l.attr("cy",i)}else{const[,t]=C.invert([e[0],i]),a=PB([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",a),l.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const S=()=>Fe(this,void 0,void 0,function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",S),V(x.attr("text")))return;const e=Number(x.attr("text")),n=CW(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)});u.addEventListener("mouseup",S)}),O.appendChild(l)}),NW(O.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=at(t,["__data__","y"]),n=at(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:a},childNodes:o}=t.parentNode,s=_(a,({type:t})=>"normalizeY"===t),l=at(i,["y","field"]),c=r[o.indexOf(t)][l];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*c:t})(t),l=new Hg({name:AW,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});l.addEventListener("mousedown",s=>{u.attr("cursor","move");const c=CW(L,b),[f,d]=PW(O,l,a,o),h=t=>{if(x){const r=e[0]+t.clientX-D[0],[a]=C.output([j.output(0),j.output(0)]),[,o]=C.invert([a+(r-v[2][0]),e[1]]),s=PB([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);d.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),l.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],a=e[0]+t.clientX-D[0],[o,s]=LW(I,[a,r],e),[c,u]=LW(I,[a,r],v[1]),h=C.invert([o,s])[1],p=N-h;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=NB(t,e[1]),a=NB(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}(I,[[o,s],[c,u],v[2],v[3]],p>.5?1:0);d.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),l.attr("cx",o),l.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,a]=C.output([1,j.output(0)]),[,o]=C.invert([e[0],a-(v[2][1]-r)]),s=PB([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);d.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),l.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",h);const p=()=>Fe(this,void 0,void 0,function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",h),V(d.attr("text")))return;const e=Number(d.attr("text"));g=yield B(S,e,c,[r]),d.remove(),f.remove(),T(t)});u.addEventListener("mouseup",p)}),O.appendChild(l)}};v.forEach((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",_W),t.addEventListener("mouseleave",TW)});const N=t=>{const e=null==t?void 0:t.target;e&&(e.name===AW||v.includes(e))||(m=[],E(),O.removeChildren())};return i.on("element-point:select",A),i.on("element-point:unselect",N),u.addEventListener("mousedown",N),()=>{O.remove(),i.off("element-point:select",A),i.off("element-point:unselect",N),u.removeEventListener("mousedown",N),v.forEach(t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",_W),t.removeEventListener("mouseleave",TW)})}}}var RW={},IW={};function DW(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function BW(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}function FW(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function zW(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+FW(-t,6):t>9999?"+"+FW(t,6):FW(t,4)}(t.getUTCFullYear())+"-"+FW(t.getUTCMonth()+1,2)+"-"+FW(t.getUTCDate(),2)+(i?"T"+FW(e,2)+":"+FW(n,2)+":"+FW(r,2)+"."+FW(i,3)+"Z":r?"T"+FW(e,2)+":"+FW(n,2)+":"+FW(r,2)+"Z":n||e?"T"+FW(e,2)+":"+FW(n,2)+"Z":"")}function WW(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,l=a<=0,c=!1;function u(){if(l)return IW;if(c)return c=!1,RW;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?l=!0:10===(r=t.charCodeAt(o++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return l=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==IW;){for(var f=[];r!==RW&&r!==IW;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map(function(e){return n.map(function(t){return o(e[t])}).join(t)})}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?zW(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=DW(t);return function(r,i){return e(n(r),i,t)}}(t,e):DW(t)});return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=BW(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=BW(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function $W(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;GW&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const GW=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),YW=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Fe(void 0,void 0,void 0,function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return WW(r).parse(e,i?$W:Va)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)})};YW.props={};const HW=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap(t=>e.map(e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))):t;var i}};function VW(t){return null!=t&&!Number.isNaN(t)}HW.props={};const qW=t=>{const{callback:e=VW}=t;return t=>t.filter(e)};qW.props={};const XW=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};XW.props={};const UW=t=>{const{fields:e}=t;return t=>t.map(t=>function(t,e=[]){return e.reduce((e,n)=>(n in t&&(e[n]=t[n]),e),{})}(t,e))};UW.props={};const KW=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map(e=>Object.entries(e).reduce((e,[n,r])=>(e[t[n]||n]=r,e),{}))};KW.props={};const ZW=t=>{const{fields:e=[]}=t,n=(r=!0,e.map(t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]}));var r;return t=>[...t].sort((t,e)=>n.reduce((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r]),0))};ZW.props={};const QW=t=>{const{value:e}=t;return()=>e};QW.props={};const JW=t=>{const{callback:e=Va}=t;return t=>e(t)};JW.props={};const t$=t=>{const{callback:e=Va}=t;return t=>Array.isArray(t)?t.map(e):t};t$.props={};const e$=Math.PI/180,n$=2048;function r$(t){return t.text}function i$(){return"serif"}function a$(){return"normal"}function o$(t){return t.value}function s$(){return 90*~~(2*Math.random())}function l$(){return 1}function c$(){}function u$(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,n$/a);let o=0,s=0,l=0;const c=n.length;for(--r;++r<c;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=i.measureText(e.text+"m").width*a,c=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*e$),r=Math.cos(e.rotate*e$),i=t*r,a=t*n,o=c*r,s=c*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,c=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else t=t+31>>5<<5;if(c>l&&(l=c),o+t>=2048&&(o=0,s+=l,l=0),s+c>=n$)break;i.translate((o+(t>>1))/a,(s+(c>>1))/a),e.rotate&&i.rotate(e.rotate*e$),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=c,e.xoff=o,e.yoff=s,e.x1=t>>1,e.y1=c>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=t}const u=i.getImageData(0,0,2048/a,n$/a).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let a=e.y1-e.y0;for(let t=0;t<a*i;t++)f[t]=0;if(o=e.xoff,null==o)return;s=e.yoff;let l=0,c=-1;for(let n=0;n<a;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(o+e)<<2]?1<<31-e%32:0;f[t]|=r,l|=r}l?c=n:(e.y0++,a--,n--,s++)}e.y1=e.y0+c,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function f$(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=127&a,s=32-o,l=t.y1-t.y0;let c,u=(t.y+t.y0)*n+(a>>5);for(let t=0;t<l;t++){c=0;for(let n=0;n<=i;n++)if((c<<s|(n<i?(c=r[t*i+n])>>>o:0))&e[u+n])return!0;u+=n}return!1}function d$(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function h$(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function p$(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function g$(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function v$(){return document.createElement("canvas")}function m$(t){return"function"==typeof t?t:function(){return t}}const y$={archimedean:p$,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function b$(){let t=[256,256],e=r$,n=i$,r=o$,i=a$,a=s$,o=l$,s=p$,l=Math.random,c=c$,u=[],f=null,d=1/0,h=v$;const p=a$,g={};function v(e,n,r){const i=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),c=s(t),u=l()<.5?1:-1;let f,d,h,p=-u;for(;(f=c(p+=u))&&(d=~~f[0],h=~~f[1],!(Math.min(Math.abs(d),Math.abs(h))>=o));)if(n.x=i+d,n.y=a+h,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!f$(n,e,t[0]))&&(!r||h$(n,r))){const r=n.sprite,i=n.width>>5,a=t[0]>>5,o=n.x-(i<<4),s=127&o,l=32-s,c=n.y1-n.y0;let u,f=(n.y+n.y0)*a+(o>>5);for(let t=0;t<c;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<l|(n<i?(u=r[t*i+n])>>>s:0);f+=a}return delete n.sprite,!0}return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=n$/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(h()),b=g.board?g.board:g$((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map(function(t,s,l){return t.text=e.call(this,t,s,l),t.font=n.call(this,t,s,l),t.style=p.call(this,t,s,l),t.weight=i.call(this,t,s,l),t.rotate=a.call(this,t,s,l),t.size=~~r.call(this,t,s,l),t.padding=o.call(this,t,s,l),t}).sort(function(t,e){return e.size-t.size});let M=-1,O=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function E(){const e=Date.now();for(;Date.now()-e<d&&++M<x;){const e=k[M];e.x=s*(l()+.5)>>1,e.y=m*(l()+.5)>>1,u$(y,e,k,M),e.hasText&&v(b,e,O)&&(c.call(null,"word",{cloud:g,word:e}),w.push(e),O?g.hasImage||d$(O,e):O=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=O,M>=x&&(g.stop(),c.call(null,"end",{cloud:g,words:w,bounds:O}))}return f&&clearInterval(f),f=setInterval(E,0),E(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const a=r>>5,o=g$((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const l=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=a*t+(e>>5),i=t*r+e<<2,s=l[i]>=250&&l[i+1]>=250&&l[i+2]>=250?1<<31-e%32:0;o[n]|=s}g.board=o,g.hasImage=!0},g.timeInterval=function(t){d=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=m$(t)},g.font=function(t){n=m$(t)},g.fontWeight=function(t){i=m$(t)},g.rotate=function(t){a=m$(t)},g.canvas=function(t){h=m$(t)},g.spiral=function(t){s=y$[t]||t},g.fontSize=function(t){r=m$(t)},g.padding=function(t){o=m$(t)},g.random=function(t){l=m$(t)},g.on=function(t){c=m$(t)},g}const x$={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function w$(t){return new Promise((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}})}const k$=(t,e)=>n=>Fe(void 0,void 0,void 0,function*(){const r=Object.assign({},x$,t,{canvas:e.createCanvas}),i=b$();var a,o;yield(a=i,o=r,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this},setAsync(t,e,n){return Fe(this,void 0,void 0,function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this})}}).set("fontSize",t=>{const e=n.map(t=>t.value);return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:t})=>(r-n)/(a-i)*(t-i)+n}return()=>t}(t,[kr(e),xr(e)])}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",w$,i.createMask),i.words([...n]);const s=i.start(),[l,c]=r.size,u=[{x:0,y:0},{x:l,y:c}],{_bounds:f=u,_tags:d,hasImage:h}=s,p=d.map(t=>{var{x:e,y:n,font:r}=t,i=De(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+l/2,y:n+c/2,fontFamily:r})}),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:h?0:g,y:h?0:v}),Object.assign(Object.assign({},b),{x:h?l:m,y:h?c:y})),p});function M$(t){return"string"==typeof t?e=>e[t]:t}k$.props={};const O$=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,l=M$(s),c=M$(o),u=ar(e,([t])=>t,t=>l(t));return t=>t.map(t=>{const e=u.get(c(t));return Object.assign(Object.assign({},t),r.reduce((t,n,r)=>(t[i[r]]=e?e[n]:a,t),{}))})};O$.props={};const E$=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};E$.props={};var S$={exports:{}},A$={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(A$),function(t){var e=Math.log(2),n=t.exports,r=A$.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,a=r.isNumber(e.width)?e.width:2,o=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),l=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),c=(l-s)/(o-1);return n&&(s-=2*a*c),i&&(l+=2*a*c),{min:s,max:l}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var a=r.isNumber(e.size)?e.size:50,o=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:a,width:o,min:e.min,max:e.max}),l=s.min,c=s.max-l,u=c/(a-1);if(0===c)return[{x:l,y:1}];for(var f=[],d=0;d<a;d++)f.push({x:l+d*u,y:0});var h=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,o),p=h[o],g=h[o-1]-h[o-2],v=0;t.forEach(function(t){var e=function(t){return Math.floor((t-l)/u)}(t);if(!(e+o<0||e-o>=f.length)){var n=Math.max(e-o,0),i=e,a=Math.min(e+o,f.length-1),s=n-(e-o),c=e+o-a,d=h[-o-1+s]||0,m=h[-o-1+c]||0,y=p/(p-d-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-o+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*y*g)}});var m=v,y=0,b=0;return f.forEach(function(t){y+=t.y,m+=y,t.y=m,b+=m}),b>0&&f.forEach(function(t){t.y/=b}),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach(function(t){e+=t.x*t.y}),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/e,Math.pow(2,n)}}}(S$);var _$=S$.exports;const T$=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=r;return t=>{const r=Array.from(rr(t,t=>n.map(e=>t[e]).join("-")).values());return r.map(t=>{const n=_$.create(t.map(t=>t[e]),{min:i,max:a,size:o,width:s}),r=n.map(t=>t.x),u=n.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:r,[c]:u})})}};T$.props={};const N$=()=>t=>(console.log("G2 data section:",t),t);N$.props={};const P$=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map(t=>t[e]),a=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const a=n*e+(1-e)*i;r.push(a),n=a}return r}(i,n);return t.map((t,e)=>Object.assign(Object.assign({},t),{[r]:a[e]}))}};P$.props={};function C$(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function L$(t,e,n=.01){const[r,i]=t,[a,o]=e;return r>=a[0]-n&&r<=o[0]+n&&i>=a[1]-n&&i<=o[1]+n}function j$(t,e,n=.01){const[r,i]=t;return!(L$(r,e,n)&&L$(i,e,n))}const R$=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach(t=>{aB(t);const e=t.getLocalBounds(),r=n.some(t=>function(t,e){const[n,r]=t,[i,a]=e;return n[0]<a[0]&&r[0]>i[0]&&n[1]<a[1]&&r[1]>i[1]}(C$(e),C$(t.getLocalBounds())));r?iB(t):n.push(t)}),t}};function I$([t,e],[n,r]){return r>t&&e>n}function D$(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function B$(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const F$=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[a,o]=D$(),[s,l]=D$(),[c,u]=D$(),[f,d]=D$();for(const e of t){const{min:t,max:n}=B$(e),[r,i]=t,[a,s]=n;o(e,i),l(e,i),u(e,s-i),d(e,[r,a])}for(let a=0;a<e;a++){t.sort((t,e)=>zn(s(t),s(e)));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let a,o=n+1;for(;(a=t[o])&&!I$(f(i),f(a));)o+=1;if(a){const t=s(i),n=c(i),o=s(a),u=o-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),l(i,t-n),l(a,o+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-a(e);return t}};function z$(t){return"object"==typeof t?t:bd(t)}function W$(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function $$(t,e,n){return.2126*W$(t)+.7152*W$(e)+.0722*W$(n)}function G$(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,l=$$(n,r,i),c=$$(a,o,s);return(Math.max(l,c)+.05)/(Math.min(l,c)+.05)}function Y$(t,e){const n=wr(e,e=>G$(t,z$(e)));return e[n]}const H$=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach(t=>{const r=t.attr("dependentElement").parsedStyle.fill;G$(t.parsedStyle.fill,r)<e&&t.attr("fill",Y$(r,n))}),t)},V$=()=>t=>(t.forEach(t=>{aB(t);const e=t.attr("bounds");j$(C$(t.getLocalBounds()),e)&&iB(t)}),t),q$=(t={})=>(e,{canvas:n,layout:r})=>{const{bounds:i="view",offsetX:a=0,offsetY:o=0}=t,s=(()=>{if("main"===i){const{x:t=0,y:e=0,width:n=0,height:i=0,marginLeft:s=0,marginRight:l=0,marginTop:c=0,marginBottom:u=0,paddingLeft:f=0,paddingRight:d=0,paddingTop:h=0,paddingBottom:p=0}=r;return[[t+s+f+a,e+c+h+o],[t+n-l-d-a,e+i-u-p-o]]}{const{x:t=0,y:e=0,width:n=0,height:i=0}=r;return[[t+a,e+o],[t+n-a,e+i-o]]}})();return e.forEach(t=>{aB(t);const{max:e,min:n}=((t,e)=>t&&t.min&&t.max?e&&e.min&&e.max?{min:[Math.min(t.min[0],e.min[0]),Math.min(t.min[1],e.min[1])],max:[Math.max(t.max[0],e.max[0]),Math.max(t.max[1],e.max[1])]}:t:e&&e.min&&e.max?e:{min:[0,0],max:[0,0]})(t.getRenderBounds(),t.getBounds());if(!e||!n||0===e[0]&&0===e[1]&&0===n[0]&&0===n[1])return;const[r,i]=e,[a,o]=n,l=((t,e)=>{const[[n,r],[i,a]]=e,[[o,s],[l,c]]=t;let u=0,f=0;return o<n?u=n-o:l>i&&(u=i-l),s<r?f=r-s:c>a&&(f=a-c),[u,f]})([[a,o],[r,i]],s);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=l[0],t.style.connectorPoints[0][1]-=l[1]),t.style.x+=l[0],t.style.y+=l[1]}),e};function X$(t){var e;const n=t.getAnimations();if(!n||0===n.length)return uB(t);const r=t.cloneNode(!0);r.style.visibility="hidden",n.forEach(t=>{const e=t.effect.getKeyframes();e&&e.length>0&&r.attr(e[e.length-1])}),null===(e=t.parentNode)||void 0===e||e.appendChild(r);const i=uB(r);return r.destroy(),i}const U$=t=>{const{palette:e=["#000","#fff"],threshold:n=2}=t;return t=>(t.forEach(t=>{var r,i;const a=t.attr("dependentElement"),o=null!==(i=null!==(r=t.attributes.fill)&&void 0!==r?r:t.parsedStyle.fill)&&void 0!==i?i:"#fff";if(j$(C$(X$(t)),C$(X$(a)),n)){const n=Y$(z$(o),e);t.attr("stroke",n)}else t.removeAttribute("stroke")}),t)};function K$(){return{"data.fetch":YW,"data.inline":QW,"data.sortBy":ZW,"data.sort":XW,"data.filter":qW,"data.pick":UW,"data.rename":KW,"data.fold":HW,"data.slice":E$,"data.custom":JW,"data.map":t$,"data.join":O$,"data.kde":T$,"data.log":N$,"data.wordCloud":k$,"data.ema":P$,"transform.stackY":ko,"transform.binX":Ws,"transform.bin":zs,"transform.dodgeX":Vo,"transform.jitter":Zo,"transform.jitterX":Qo,"transform.jitterY":Jo,"transform.symmetryY":ts,"transform.diffY":es,"transform.stackEnter":qo,"transform.normalizeY":Xo,"transform.select":os,"transform.selectX":ss,"transform.selectY":ls,"transform.groupX":xs,"transform.groupY":ws,"transform.groupColor":ks,"transform.group":bs,"transform.sortX":Os,"transform.sortY":Ss,"transform.sortColor":Es,"transform.flexX":As,"transform.pack":Ds,"transform.sample":Gs,"transform.filter":Ys,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":a,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":u,"coordinate.radial":l,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":d,"encode.field":p,"encode.transform":h,"encode.column":g,"mark.interval":wE,"mark.rect":ME,"mark.line":AE,"mark.point":TE,"mark.text":PE,"mark.cell":LE,"mark.area":RE,"mark.link":DE,"mark.image":FE,"mark.polygon":WE,"mark.box":GE,"mark.vector":HE,"mark.lineX":UE,"mark.lineY":qE,"mark.connector":ZE,"mark.range":eS,"mark.rangeX":rS,"mark.rangeY":aS,"mark.path":sS,"mark.shape":FS,"mark.density":EA,"mark.heatmap":AA,"mark.wordCloud":MA,"mark.beeswarm":TA,"palette.category10":LA,"palette.category20":jA,"scale.linear":IA,"scale.ordinal":DA,"scale.band":RA,"scale.identity":BA,"scale.point":FA,"scale.time":zA,"scale.log":WA,"scale.pow":$A,"scale.sqrt":VA,"scale.threshold":GA,"scale.quantile":YA,"scale.quantize":HA,"scale.sequential":qA,"scale.constant":XA,"theme.classic":n_,"theme.classicDark":a_,"theme.academy":s_,"theme.light":e_,"theme.dark":i_,"component.axisX":F_,"component.axisY":z_,"component.legendCategory":iF,"component.legendContinuous":cF,"component.legends":OF,"component.title":vF,"component.sliderX":bF,"component.sliderY":xF,"component.scrollbarX":kF,"component.scrollbarY":MF,"animation.scaleInX":EF,"animation.scaleOutX":SF,"animation.scaleInY":AF,"animation.scaleOutY":_F,"animation.waveIn":YF,"animation.fadeIn":TF,"animation.fadeOut":NF,"animation.zoomIn":HF,"animation.zoomOut":VF,"animation.pathIn":qF,"animation.morphing":GF,"animation.growInX":XF,"animation.growInY":UF,"interaction.elementHighlight":KF,"interaction.elementHighlightByX":ZF,"interaction.elementHighlightByColor":QF,"interaction.elementHoverScale":tz,"interaction.elementSelect":nz,"interaction.elementSelectByX":rz,"interaction.elementSelectByColor":iz,"interaction.fisheye":oz,"interaction.chartIndex":az,"interaction.tooltip":Tz,"interaction.legendFilter":QB,"interaction.legendHighlight":Nz,"interaction.brushHighlight":Fz,"interaction.brushXHighlight":Wz,"interaction.brushYHighlight":Gz,"interaction.brushAxisHighlight":Kz,"interaction.brushFilter":Zz,"interaction.brushXFilter":Qz,"interaction.brushYFilter":Jz,"interaction.sliderFilter":fW,"interaction.sliderWheel":gW,"interaction.scrollbarFilter":mW,"interaction.poptip":wW,"interaction.treemapDrillDown":MW,"interaction.drillDown":EW,"interaction.elementPointMove":jW,"composition.spaceLayer":WC,"composition.spaceFlex":$C,"composition.facetRect":iL,"composition.repeatMatrix":uL,"composition.facetCircle":vL,"composition.timingKeyframe":yL,"labelTransform.overlapHide":R$,"labelTransform.overlapDodgeY":F$,"labelTransform.overflowHide":V$,"labelTransform.contrastReverse":H$,"labelTransform.overflowStroke":U$,"labelTransform.exceedAdjust":q$}}function Z$(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const Q$={};const J$=t=>t?parseInt(t):0;function tG(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class eG{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map(n=>(n[t]=e,n))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex(t=>t===this);e.splice(n,1)}return this}getNodeByKey(t){let e=null;return tG(this,n=>{t===n.attr("key")&&(e=n)}),e}getNodesByType(t){const e=[];return tG(this,n=>{t===n.type&&e.push(n)}),e}getNodeByType(t){let e=null;return tG(this,n=>{e||t===n.type&&(e=n)}),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const nG=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],rG="__remove__",iG="__callback__";function aG(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function oG(t,e){const{width:n,height:r,autoFit:i,depth:a=0}=t;let o=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||J$(e.width),r=t.clientHeight||J$(e.height);return{width:n-(J$(e.paddingLeft)+J$(e.paddingRight)),height:r-(J$(e.paddingTop)+J$(e.paddingBottom))}}(e);o=t||o,s=n||s}return o=n||o,s=r||s,{width:Math.max(I(o)?o:1,1),height:Math.max(I(s)?s:1,1),depth:a}}function sG(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of nG)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,aG(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===iG)e.children=t.value;else{const i=aG(t),{children:a=[]}=e;a.push(i),n.push(t),r.set(t,i),e.children=a}}return r.get(e)}function lG(t,e,n,r,i){const{type:a}=t,{type:o=n||a}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(o,i)){for(const n of nG)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r)){const t={type:"view"},n=Object.assign({},e);for(const e of nG)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function cG(t,e,n){if("function"==typeof t){const e=new eG;return e.value=t,e.type=iG,e}const{type:r,children:i}=t,a=De(t,["type","children"]),o=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new o;return s.value=a,s.type=r,s}function uG(t,e){const{type:n,children:r}=e,i=De(e,["type","children"]);t.type===n||void 0===n?ao(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function fG(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),a=cG(e,n,r);Array.isArray(t.children)&&t.push(a);const{children:o}=e;if(Array.isArray(o))for(const t of o)i.push([a,t]);else"function"==typeof o&&i.push([a,o])}}function dG(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function hG(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function pG(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function gG(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(ro(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function vG(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function mG(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function yG(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?dG(e,n,r):"array"===t?hG(e,n,r):"object"===t?pG(e,n,r):"node"===t?vG(e,n,r):"container"===t?mG(e,n,r):"mix"===t&&gG(e,n)}return e}}function bG(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{type:"node",ctor:e}]))}const xG={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},wG=Object.assign(Object.assign({},xG),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),kG=Object.assign(Object.assign({},xG),{labelTransform:{type:"array"}});let MG=class extends eG{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach(e=>{e.attr("data",t)}),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find(t=>t.key===this._key)}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&aB(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&iB(t)}};MG=Be([yG(kG)],MG);let OG=class extends eG{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find(t=>t.key===this.attr("key"));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};OG=Be([yG(wG)],OG);const EG="G2_CHART_KEY";class SG extends MG{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a,createCanvas:o}=t;super(De(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=K(()=>{this.forceFit()},300),this._renderer=r||new cN,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[rG]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new hN,this._context={library:Object.assign(Object.assign({},a),Q$),emitter:this._emitter,canvas:n,createCanvas:o},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise((t,e)=>VD(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let t,e;return[new Promise((n,r)=>{e=n,t=r}),e,t]}();return t.then(n).then(()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}}).catch(r).then(()=>{this._trailingClear=null,this._renderTrailing()}),e}options(t){if(0===arguments.length)return sG(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const a=[[null,t,lG(t,e,n,r,i)]];for(;a.length;){const[t,e,n]=a.shift();if(e)if(n){uG(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],o=r[i];a.push([e,o,n])}}else"function"==typeof t&&a.push([e,null,t])}else e.remove();else fG(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(t=!0){if(this._rendering)return this._trailingClear=()=>{this.clear(t)},void this._reset();this.options();this.emit(pN.BEFORE_CLEAR),this._reset(),qD(0,this._context,!1,t),this.emit(pN.AFTER_CLEAR)}destroy(){this.options();this.emit(pN.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),qD(0,this._context,!0),this._container[rG]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(pN.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=oG(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pN.BEFORE_CHANGE_SIZE);const n=this.render();return n.then(()=>{this.emit(pN.AFTER_CHANGE_SIZE)}),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pN.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then(()=>{this.emit(pN.AFTER_CHANGE_SIZE)}),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:a=0,startY:o=0}=e,{canvas:s,views:l}=this._context,{document:c}=s,{x:u,y:f}=t,{coordinate:d,scale:h,markState:p,data:g,key:v}=l[0],m=c.getElementsByClassName(sE),y=n?t=>t.__data__.x:t=>t,b=rr(m,y),x=cB(c.getElementsByClassName(lE)[0]),w=t=>Array.from(t.values()).some(t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some(t=>"series"===t.name&&void 0!==t.values))}),k=Oz(r,w(p)),M=t=>at(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=Az({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:d,scale:h,startX:a,startY:o}),e=g.get(`${v}-0`);return t.map(({index:t})=>e[t])}const t=Sz({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:d,scale:h,shared:n});if(Ga(t))return Ya(t,g.get(v));const e=y(t),r=b.get(e);return r?r.map(M):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?M(e):[]}}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter(t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t)];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends OG{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter(t=>t.startsWith("composition.")&&"composition.mark"!==t)];this._compositions=Object.fromEntries(n.map(t=>{const e=t.split(".").pop();let n=class extends MG{constructor(){super({},e)}};return n=Be([yG(bG(this._marks))],n),[e,n]}));for(const t of Object.values(this._compositions))yG(bG(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=EG}=t,{width:n,height:r,depth:i}=oG(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){var t,e;const{width:n,height:r}=oG(this.options(),this._container);this._plugins.push(new fN),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new Ov({container:this._container,width:n,height:r,renderer:this._renderer});const i=null===(e=null===(t=this._context.canvas)||void 0===t?void 0:t.getContextService())||void 0===e?void 0:e.getDomElement();i&&(i.style.display="block")}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e})}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const AG=Z$(SG,Object.assign({},K$()));t.AREA_CLASS_NAME=dE,t.Academy=s_,t.Bin=zs,t.BinX=Ws,t.COMPONENT_CLASS_NAME=uE,t.Chart=AG,t.ChartEvent=pN,t.Classic=n_,t.ClassicDark=a_,t.Dark=i_,t.DiffY=es,t.DodgeX=Vo,t.ELEMENT_CLASS_NAME=sE,t.Filter=Ys,t.FlexX=As,t.Group=bs,t.GroupColor=ks,t.GroupX=xs,t.GroupY=ws,t.Jitter=Zo,t.JitterX=Qo,t.JitterY=Jo,t.LABEL_CLASS_NAME=fE,t.LABEL_LAYER_CLASS_NAME=oE,t.Light=e_,t.LinearAxis=D_,t.MAIN_LAYER_CLASS_NAME=aE,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Bo,t.MaybeDefaultY=Fo,t.MaybeFunctionAttribute=Go,t.MaybeGradient=Ho,t.MaybeIdentityX=Do,t.MaybeIdentityY=Io,t.MaybeKey=Co,t.MaybeSeries=Lo,t.MaybeSize=Po,t.MaybeStackY=Oo,t.MaybeTitle=Ao,t.MaybeTooltip=zo,t.MaybeTuple=Yo,t.MaybeTupleX=Ro,t.MaybeTupleY=jo,t.MaybeVisualPosition=$o,t.MaybeZeroPadding=Wo,t.MaybeZeroX=_o,t.MaybeZeroY=To,t.MaybeZeroY1=Fn,t.MaybeZeroZ=No,t.NormalizeY=Xo,t.PLOT_CLASS_NAME=cE,t.Pack=Ds,t.Runtime=SG,t.Sample=Gs,t.Select=os,t.SelectX=ss,t.SelectY=ls,t.Selection=Om,t.SortColor=Es,t.SortX=Os,t.SortY=Ss,t.StackEnter=qo,t.StackY=ko,t.SymmetryY=ts,t.VIEW_CLASS_NAME=lE,t.corelib=K$,t.dataOf=Ya,t.extend=Z$,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,Sy.set(n,r)):Object.assign(Q$,{[t]:e})},t.render=VD,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:a=640,height:o=480}=t,s=YD(t),{group:l=new Ug,emitter:c=new hN,library:u}=e;(null==l?void 0:l.parentElement)||Ua("renderToMountedElement can't render chart to unmounted group.");const f=Mm(l);return e.group=l,e.emitter=c,e.externals={},e.canvas=e.canvas||(null===(i=null==l?void 0:l.ownerDocument)||void 0===i?void 0:i.defaultView),c.emit(pN.BEFORE_RENDER),hD(Object.assign(Object.assign({},s),{width:a,height:o}),f,e).then(()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame(()=>{c.emit(pN.AFTER_RENDER),null==n||n()})}).catch(t=>{null==r||r(t)}),l},t.select=Mm,t.selectG2Elements=oB,t.selectPlotArea=cB,t.seriesOf=function(t){const e=$a(t).__data__,{scale:n}=e;return Ha(n,t.__data__)},Object.defineProperty(t,"__esModule",{value:!0})});