@antv/g2 5.0.15 → 5.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/g2-lite.min.js +3 -3
- package/dist/g2.min.js +3 -3
- package/esm/animation/morphing.js +2 -0
- package/esm/animation/morphing.js.map +1 -1
- package/esm/component/utils.js +1 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/interaction/event.js +17 -4
- package/esm/interaction/event.js.map +1 -1
- package/esm/runtime/plot.js +19 -11
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/scale.d.ts +1 -0
- package/esm/runtime/scale.js +27 -1
- package/esm/runtime/scale.js.map +1 -1
- package/lib/animation/morphing.js +2 -0
- package/lib/animation/morphing.js.map +1 -1
- package/lib/component/utils.js +1 -0
- package/lib/component/utils.js.map +1 -1
- package/lib/interaction/event.js +17 -4
- package/lib/interaction/event.js.map +1 -1
- package/lib/runtime/plot.js +18 -10
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/scale.d.ts +1 -0
- package/lib/runtime/scale.js +28 -1
- package/lib/runtime/scale.js.map +1 -1
- package/package.json +1 -1
- package/src/animation/morphing.ts +2 -0
- package/src/component/utils.ts +1 -0
- package/src/interaction/event.ts +15 -4
- package/src/runtime/plot.ts +24 -19
- package/src/runtime/scale.ts +28 -1
package/dist/g2-lite.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g"),require("@antv/g-canvas")):"function"==typeof define&&define.amd?define(["exports","@antv/g","@antv/g-canvas"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={},t.window.G,t.window.G.Canvas2D)}(this,function(S,z,T){"use strict";const C="main-layer",ct="label-layer",ut="element",K="view",ht="plot",ft="component",dt="label",pt="area";var N=function(t,e){return(N=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var m=function(){return(m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function at(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function e(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function $(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function j(r,i){var a,o,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},c={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function t(n){return function(t){var e=[n,t];if(a)throw new TypeError("Generator is already executing.");for(;l=c&&e[c=0]?0:l;)try{if(a=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,o=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3]))l.label=e[1];else if(6===e[0]&&l.label<s[1])l.label=s[1],s=e;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(e)}}e=i.call(r,l)}catch(t){e=[6,t],o=0}finally{a=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function R(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{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(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||0<e--)&&!(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 v(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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function I(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&r:e.has(t))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var B,D,F="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},W={exports:{}};function G(){}function H(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function V(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new H(n,r||t,i),r=D?D+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function Y(t,e){0==--t._eventsCount?t._events=new G:delete t._events[e]}function q(){this._events=new G,this._eventsCount=0}n=W,B=Object.prototype.hasOwnProperty,D="~",Object.create&&(G.prototype=Object.create(null),(new G).__proto__||(D=!1)),q.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)B.call(t,e)&&n.push(D?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},q.prototype.listeners=function(t){var t=D?D+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},q.prototype.listenerCount=function(t){t=D?D+t:t,t=this._events[t];return t?t.fn?1:t.length:0},q.prototype.emit=function(t,e,n,r,i,a){var o=D?D+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[f].fn.apply(l[f].context,s)}return!0},q.prototype.on=function(t,e,n){return V(this,t,e,n,!1)},q.prototype.once=function(t,e,n){return V(this,t,e,n,!0)},q.prototype.removeListener=function(t,e,n,r){t=D?D+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||Y(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:Y(this,t)}}else Y(this,t);return this},q.prototype.removeAllListeners=function(t){return t?(t=D?D+t:t,this._events[t]&&Y(this,t)):(this._events=new G,this._eventsCount=0),this},q.prototype.off=q.prototype.removeListener,q.prototype.addListener=q.prototype.on,q.prefixed=D,n.exports=q.EventEmitter=q;var X=W.exports,U=1e-6,Z="undefined"!=typeof Float32Array?Float32Array:Array;function J(){var t=new Z(9);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Q=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=m*r+v*o+n*c,t[7]=m*i+v*s+n*u,t[8]=m*a+v*l+n*e,t};function tt(){var t=new Z(16);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function et(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function nt(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function rt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function it(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]),t}function gt(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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],m=n*s-r*o,v=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,M=i*c-a*l,O=u*g-h*p,k=u*y-f*p,E=u*e-d*p,S=h*y-f*g,_=h*e-d*g,A=f*e-d*y,T=m*A-v*_+b*S+x*E-w*k+M*O;return T?(t[0]=(s*A-l*_+c*S)*(T=1/T),t[1]=(i*_-r*A-a*S)*T,t[2]=(g*M-y*w+e*x)*T,t[3]=(f*w-h*M-d*x)*T,t[4]=(l*E-o*A-c*k)*T,t[5]=(n*A-i*E+a*k)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*_-s*E+c*O)*T,t[9]=(r*E-n*_-a*O)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*k-o*S-l*O)*T,t[13]=(n*S-r*k+i*O)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function yt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function mt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],e=e[15],v=n[0],b=n[1],x=n[2],w=n[3];return t[0]=v*r+b*s+x*h+w*g,t[1]=v*i+b*l+x*f+w*y,t[2]=v*a+b*c+x*d+w*m,t[3]=v*o+b*u+x*p+w*e,v=n[4],b=n[5],x=n[6],w=n[7],t[4]=v*r+b*s+x*h+w*g,t[5]=v*i+b*l+x*f+w*y,t[6]=v*a+b*c+x*d+w*m,t[7]=v*o+b*u+x*p+w*e,v=n[8],b=n[9],x=n[10],w=n[11],t[8]=v*r+b*s+x*h+w*g,t[9]=v*i+b*l+x*f+w*y,t[10]=v*a+b*c+x*d+w*m,t[11]=v*o+b*u+x*p+w*e,v=n[12],b=n[13],x=n[14],w=n[15],t[12]=v*r+b*s+x*h+w*g,t[13]=v*i+b*l+x*f+w*y,t[14]=v*a+b*c+x*d+w*m,t[15]=v*o+b*u+x*p+w*e,t}function vt(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function bt(t,e,n){var r=n[0],i=n[1],n=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function wt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function Mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Ot(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function kt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Et(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function St(t,e){var n=new Z(3),r=(Et(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function _t(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,h=a*l,f=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],y=i[1],i=i[2],m=(1-(d+s))*u,v=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=m,t[1]=v,t[2]=u,t[3]=0,t[4]=f,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(m*g+f*y+p*i),t[13]=n[1]+y-(v*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function At(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tt(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function Pt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var Ct=Pt;function Lt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t}function Nt(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<U&&Math.abs(c-d)<U&&Math.abs(e-n)<U?rt(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function jt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Rt=Object.freeze({__proto__:null,create:tt,clone:function(t){var e=new Z(16);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[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:et,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new Z(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:nt,identity:rt,transpose:it,invert:gt,adjoint: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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:yt,multiply:mt,translate:vt,scale:bt,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M,O,k=r[0],E=r[1],r=r[2],S=Math.hypot(k,E,r);return S<U?null:(k*=S=1/S,E*=S,r*=S,S=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],v=k*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+k*S,w=k*r*i+E*S,M=E*r*i-k*S,O=r*r*i+n,t[0]=a*(n=k*k*i+n)+c*(m=E*k*i+r*S)+d*(r=r*k*i-E*S),t[1]=o*n+u*m+p*r,t[2]=s*n+h*m+g*r,t[3]=l*n+f*m+y*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+h*b+g*x,t[7]=l*v+f*b+y*x,t[8]=a*w+c*M+d*O,t[9]=o*w+u*M+p*O,t[10]=s*w+h*M+g*O,t[11]=l*w+f*M+y*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:xt,rotateY:wt,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:Mt,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<U?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:Ot,fromQuat2:function(t,e){var n=new Z(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),Ot(t,e,n),t},getTranslation:kt,getScaling:Et,getRotation:St,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+h)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:_t,fromQuat:At,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Tt,perspective:Tt,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Pt,ortho:Ct,orthoZO:Lt,lookAt:Nt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:jt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],m=e[0],v=e[1],b=e[2],x=e[3],w=e[4],M=e[5],O=e[6],k=e[7],E=e[8],S=e[9],_=e[10],A=e[11],T=e[12],P=e[13],C=e[14],e=e[15];return Math.abs(n-m)<=U*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=U*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=U*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=U*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=U*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=U*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-O)<=U*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-k)<=U*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-E)<=U*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=U*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-_)<=U*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(d-A)<=U*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-T)<=U*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=U*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-C)<=U*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(t-e)<=U*Math.max(1,Math.abs(t),Math.abs(e))},mul:mt,sub:jt});function It(){var t=new Z(3);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Bt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Dt(t,e,n){var r=new Z(3);return r[0]=t,r[1]=e,r[2]=n,r}function Ft(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2]}function zt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Wt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Ht(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function Vt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Yt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function qt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function Xt(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Ut(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=U*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=U*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=U*Math.max(1,Math.abs(t),Math.abs(e))}var $t=Bt;function Kt(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Zt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function Jt(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Qt(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function te(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function ee(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function ne(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}It(),Kt();var re=function(t,e,n,r){var i=new Z(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ie=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ae=te,oe=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};function se(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}It(),Dt(1,0,0),Dt(0,1,0),Jt(),Jt(),J(),n=new Z(2),Z!=Float32Array&&(n[0]=0,n[1]=0);var le={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var ce={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ue(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return ce[e]===t.length-1&&"achlmqstvz".includes(e)})}function he(t){return ue(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function fe(t){return he(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function de(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ce[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ce[n]))),ce[n]););}function pe(t){return 48<=t&&t<=57}function ge(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function ye(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=ce[s[l].toLowerCase()];if(t.segmentStart=l,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return 1;default:return}}(c)){if(t.index+=1,ge(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(pe(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&pe(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&pe(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;pe(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&pe(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&pe(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),ge(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,ge(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}de(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var me=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function ve(t){var o,s,l,c;return he(t)?se(t):(t=function(t){if(ue(t))return se(t);var e=new me(t);for(ge(e);e.index<e.max&&!e.err.length;)ye(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function be(t){if(fe(t))return se(t);for(var e,n,r,i,a,o,s,l=ve(t),c=m({},le),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function xe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function we(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function Me(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Oe(t,e,n,r,i){var a=Me([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=we([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function ke(t,e,n,r){var t=[t,e],e=[n,r],i=we(t,e,.5),e=we(e,i,.5),a=we(i,e,.5),o=we(e,a,.5),s=we(a,o,.5),t=Oe(t[0],t[1],i[0],i[1],a[0]).point,i=Oe(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function Ee(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=h,t;case"A":return s=[f,d].concat(c),["C"].concat(function t(e,n,r,i,a,o,s,l,c,u){var h=120*Math.PI/180,f=Math.PI/180*(+a||0),d=[],p=(u?(x=u[0],w=u[1],v=u[2],b=u[3]):(e=(y=xe(e,n,-f)).x,n=y.y,1<(p=(g=(e-(l=(y=xe(l,c,-f)).x))/2)*g/(r*r)+(y=(n-(c=y.y))/2)*y/(i*i))&&(r*=p=Math.sqrt(p),i*=p),p=r*r,m=i*i,v=(o=(o===s?-1:1)*Math.sqrt(Math.abs((p*m-p*y*y-m*g*g)/(p*y*y+m*g*g))))*r*y/i+(e+l)/2,b=o*-i*g/r+(n+c)/2,x=Math.asin(((n-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((c-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),x=e<v?Math.PI-x:x,w=l<v?Math.PI-w:w,x<0&&(x=2*Math.PI+x),w<0&&(w=2*Math.PI+w),s&&w<x&&(x-=2*Math.PI),!s&&x<w&&(w-=2*Math.PI)),w-x),g=(Math.abs(p)>h&&(m=w,y=l,o=c,w=x+h*(s&&x<w?1:-1),d=t(l=v+r*Math.cos(w),c=b+i*Math.sin(w),r,i,a,0,s,y,o,[w,m,v,b])),p=w-x,Math.cos(x)),h=Math.sin(x),a=Math.cos(w),s=Math.sin(w),y=Math.tan(p/4),o=4/3*r*y,m=4/3*i*y,v=[e,n],b=[e+o*h,n-m*g],x=[l+o*s,c-m*a],w=[l,c];if(b[0]=2*v[0]-b[0],b[1]=2*v[1]-b[1],u)return b.concat(x,w,d);for(var M=[],O=0,k=(d=b.concat(x,w,d)).length;O<k;O+=1)M[O]=O%2?xe(d[O-1],d[O],f).y:xe(d[O],d[O+1],f).x;return M}(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=h,s=[f,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(ke(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(ke(f,d,p,g))}return t}function Se(t,e){var n;if(void 0===e&&(e=!1),fe(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=se(t),e?[n,[]]:n;for(var r,i=be(t),a=m({},le),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=Ee(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function _e(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Ae(t,e,n,r,i,I,B,a,o,s,l){var c=l.bbox,D=void 0===c||c,c=l.length,F=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],m={x:0,y:0},v=[{x:f,y:d}];h&&s<=0&&(m={x:f,y:d});for(var b,x,w,M,O,k,E,S,_,A,T,P,C,L,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,O=i,k=I,E=B,S=a,_=o,A=R/u,P=j=N=L=C=P=T=void 0,P=Math.abs,C=Math.sin,L=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(M),M=j/180*((O%360+360)%360),f=(T=b===S&&x===_?{x:b,y:x}:0===w||0===P?Oe(b,x,S,_,A).point:(O=(b-S)/2,T=(x-_)/2,O={x:L(M)*O+C(M)*T,y:-C(M)*O+L(M)*T},1<(T=Math.pow(O.x,2)/Math.pow(w,2)+Math.pow(O.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(O.y,2)-Math.pow(P,2)*Math.pow(O.x,2))/(Math.pow(w,2)*Math.pow(O.y,2)+Math.pow(P,2)*Math.pow(O.x,2)),k=(k!==E?1:-1)*N(T<0?0:T),N=w*O.y/P*k,T=-P*O.x/w*k,k=L(M)*N-C(M)*T+(b+S)/2,b=C(M)*N+L(M)*T+(x+_)/2,x=_e({x:1,y:0},S={x:(O.x-N)/w,y:(O.y-T)/P}),_=_e(S,{x:(-O.x-N)/w,y:(-O.y-T)/P}),!E&&0<_?_-=2*j:E&&_<0&&(_+=2*j),S=x+(_%=2*j)*A,N=w*L(S),O=P*C(S),{x:L(M)*N-C(M)*O+k,y:C(M)*N+L(M)*O+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=Me(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(E=(p-s)/(p-g[2]),m={x:y[0]*(1-E)+g[0]*E,y:y[1]*(1-E)+g[1]*E}),g=[f,d,p];return{length:p,point:m=h&&p<=s?{x:a,y:o}:m,min:{x:Math.min.apply(null,v.map(function(t){return t.x})),y:Math.min.apply(null,v.map(function(t){return t.y}))},max:{x:Math.max.apply(null,v.map(function(t){return t.x})),y:Math.max.apply(null,v.map(function(t){return t.y}))}}}function Te(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,m=0,v=[g,y,m],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var M,O,k,E,S,_,A,T,P,C,L=0;L<=d;L+=1)M=t,O=e,k=n,E=r,S=i,_=a,A=o,T=s,C=void 0,C=1-(P=L/d),g=(M={x:Math.pow(C,3)*M+3*Math.pow(C,2)*P*k+3*C*Math.pow(P,2)*S+Math.pow(P,3)*A,y:Math.pow(C,3)*O+3*Math.pow(C,2)*P*E+3*C*Math.pow(P,2)*_+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=Me(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(k=(m-l)/(m-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,y,m];return{length:m,point:x=p&&m<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Pe(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],m=[d,p],v={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(v={x:d,y:p});for(var x,w,M,O,k,E,S,_,A=0;A<=h;A+=1)x=t,w=e,M=n,O=r,k=i,E=a,_=void 0,_=1-(S=A/h),d=(x={x:Math.pow(_,2)*x+2*_*S*M+Math.pow(S,2)*k,y:Math.pow(_,2)*w+2*_*S*O+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=Me(m,[d,p])),m=[d,p],f&&o<=g&&o>y[2]&&(M=(g-o)/(g-y[2]),v={x:m[0]*(1-M)+y[0]*M,y:m[1]*(1-M)+y[1]*M}),y=[d,p,g];return{length:g,point:v=f&&g<=o?{x:i,y:a}:v,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ce(t,e,n){for(var r,i,a,o=be(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},m=y,v=y,b=y,x=0,w=0,M=o.length;w<M;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(m=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=Oe(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point):"A"===i?(g=(r=Ae(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"C"===i?(g=(r=Te(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Q"===i?(g=(r=Pe(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Z"===i&&(g=(r=Oe((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point),s&&x<e&&e<=x+g&&(b=v),p.push(m),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Le(t){return(c=l=s=0)<=Se(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function Ne(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?Te(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=we(n,i,r),i=we(i,a,r),a=we(a,e,r),o=we(n,i,r),i=we(i,a,r),r=we(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var je=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Re=function(t){return"function"==typeof t},p=function(t){return null==t},Ie={}.toString,Be=function(t,e){return Ie.call(t)==="[object "+e+"]"},De=function(t){return Array.isArray?Array.isArray(t):Be(t,"Array")},Fe=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var ze=function(t){return"object"==typeof t&&null!==t},We=function(t){if(!ze(t)||!Be(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},Ge=function(t){if(De(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},He=function(t){if(De(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Ve=function(t,n,e){if(!De(t)&&!We(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(De(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(Fe(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},Ye=function(t){return Be(t,"String")};var qe=function(t,e,n){return t<e?e:n<t?n:t},Xe=function(t){return Be(t,"Number")};function Ue(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function $e(t){return p(t)?"":t.toString()}var Ke=function(t,e){return(t%e+e)%e},Ze=function(t){t=$e(t);return t.charAt(0).toLowerCase()+t.substring(1)};function Je(t){if("object"!=typeof t||null===t)return t;if(De(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Je(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Je(t[i]):e[i]=t[i];return e}var Qe=function(t){t=$e(t);return t.charAt(0).toUpperCase()+t.substring(1)},tn=function(t){return Be(t,"Boolean")},en=function(t){return void 0===t},nn=Je;function rn(r,i,a){var o;return function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}}function an(a,o){var s;if(Re(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var on=5;function sn(t,e){if(t===e)return!0;if(t&&e&&!Ye(t)&&!Ye(e)){if(je(t)||je(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=sn(t[r],e[r]));r++);return n}if(ze(t)||ze(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=sn(t[i[r]],e[i[r]]));r++);return n}}return!1}function ln(t,r){return Ve(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function cn(){}var ot=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)!function t(e,n,r,i){for(var a in r=r||0,i=i||on,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&We(o)?(We(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):De(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},un=sn,hn=function(t,e,n){for(var r=0,i=Ye(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},fn=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function dn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function pn(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function gn(){}var W="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yn=/^#([0-9a-f]{3,8})$/,mn=new RegExp("^rgb\\("+[W,W,W]+"\\)$"),vn=new RegExp("^rgb\\("+[r,r,r]+"\\)$"),bn=new RegExp("^rgba\\("+[W,W,W,n]+"\\)$"),xn=new RegExp("^rgba\\("+[r,r,r,n]+"\\)$"),wn=new RegExp("^hsl\\("+[n,r,r]+"\\)$"),Mn=new RegExp("^hsla\\("+[n,r,r,n]+"\\)$"),On={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 kn(){return this.rgb().formatHex()}function En(){return this.rgb().formatRgb()}function Sn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=yn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_n(e):3===n?new Tn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?An(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?An(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=mn.exec(t))?new Tn(e[1],e[2],e[3],1):(e=vn.exec(t))?new Tn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=bn.exec(t))?An(e[1],e[2],e[3],e[4]):(e=xn.exec(t))?An(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=wn.exec(t))?Nn(e[1],e[2]/100,e[3]/100,1):(e=Mn.exec(t))?Nn(e[1],e[2]/100,e[3]/100,e[4]):On.hasOwnProperty(t)?_n(On[t]):"transparent"===t?new Tn(NaN,NaN,NaN,0):null}function _n(t){return new Tn(t>>16&255,t>>8&255,255&t,1)}function An(t,e,n,r){return new Tn(t=r<=0?e=n=NaN:t,e,n,r)}function Tn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pn(){return"#"+Ln(this.r)+Ln(this.g)+Ln(this.b)}function Cn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ln(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Nn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Rn(t,e,n,r)}function jn(t){var e,n,r,i,a,o,s,l;return t instanceof Rn?new Rn(t.h,t.s,t.l,t.opacity):(t=t instanceof gn?t:Sn(t))?t instanceof Rn?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(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=0<l&&l<1?0:o,new Rn(o,s,l,t.opacity)):new Rn}function Rn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function In(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 Bn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Dn(t,e){var n=Math.min.apply(Math,v([],O(t),!1)),r=Math.min.apply(Math,v([],O(e),!1));return{x:n,y:r,width:Math.max.apply(Math,v([],O(t),!1))-n,height:Math.max.apply(Math,v([],O(e),!1))-r}}function Fn(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d,p,g,h=0;h<u.length;h++){d=t,y=r,p=i,g=u[h];var y=n*Math.cos(p)*Math.cos(g)-y*Math.sin(p)*Math.sin(g)+d;y<l&&(l=y),c<y&&(c=y)}for(var m=Math.atan(r/(n*Math.tan(i))),v=1/0,b=-1/0,x=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var w=m+h;a<o?a<w&&w<o&&x.push(w):o<w&&w<a&&x.push(w)}for(var M,O,k,h=0;h<x.length;h++){M=e,E=r,O=i,k=x[h];var E=n*Math.sin(O)*Math.cos(k)+E*Math.cos(O)*Math.sin(k)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}function zn(t,e,n,r){return Bn(t,e,n,r)}function Wn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Gn(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 Hn(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return Ue(r,0)?Ue(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):Ue(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function Vn(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=Bn(i[0],i[1],a[0],a[1])}return n}function Yn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function qn(t,e,n){n=t+n-2*e;return Ue(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}dn(gn,Sn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:kn,formatHex:kn,formatHsl:function(){return jn(this).formatHsl()},formatRgb:En,toString:En}),dn(Tn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof gn?i:Sn(i))?new Tn((i=i.rgb()).r,i.g,i.b,i.opacity):new Tn:new Tn(t,e,n,null==r?1:r);var i},pn(gn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Tn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Tn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Pn,formatHex:Pn,formatRgb:Cn,toString:Cn})),dn(Rn,function(t,e,n,r){return 1===arguments.length?jn(t):new Rn(t,e,n,null==r?1:r)},pn(gn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Rn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Rn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new Tn(In(240<=t?t-240:120+t,n,e),In(t,n,e),In(t<120?240+t:t-120,n,e),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));function Xn(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,h=e[n],f=r,d=i;for(Un(e,r,n),0<a(e[i],h)&&Un(e,r,i);f<d;){for(Un(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Un(e,r,d):Un(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||$n)}function Un(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function $n(t,e){return t<e?-1:e<t?1:0}function Kn(t,e){Zn(t,0,t.children.length,e,t)}function Zn(t,e,n,r,i){(i=i||ar(null)).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];Jn(i,t.leaf?r(o):o)}return i}function Jn(t,e){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)}function Qn(t,e){return t.minX-e.minX}function tr(t,e){return t.minY-e.minY}function er(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function nr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function rr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ir(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ar(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function or(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Xn(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(W=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()}).prototype.all=function(){return this._all(this.data,[])},W.prototype.search=function(t){var e=this.data,n=[];if(ir(t,e))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;ir(t,s)&&(e.leaf?n.push(o):rr(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},W.prototype.collides=function(t){var e=this.data;if(ir(t,e))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(ir(t,a)){if(e.leaf||rr(t,a))return!0;n.push(i)}}e=n.pop()}return!1},W.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},W.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},W.prototype.clear=function(){return this.data=ar([]),this},W.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(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}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!rr(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},W.prototype.toBBox=function(t){return t},W.prototype.compareMinX=function(t,e){return t.minX-e.minX},W.prototype.compareMinY=function(t,e){return t.minY-e.minY},W.prototype.toJSON=function(){return this.data},W.prototype.fromJSON=function(t){return this.data=t,this},W.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},W.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)Kn(i=ar(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=ar([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));or(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);or(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}Kn(i,this.toBBox)}return i},W.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=er(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.minY))-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]}var h,u;return e},W.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),Jn(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},W.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=ar(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Kn(n,this.toBBox),Kn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},W.prototype._splitRoot=function(t,e){this.data=ar([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Kn(this.data,this.toBBox)},W.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=Zn(t,0,c,this.toBBox),h=Zn(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=er(u)+er(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},W.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:Qn,i=t.leaf?this.compareMinY:tr;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},W.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=Zn(t,0,e,i),o=Zn(t,n-e,n,i),s=nr(a)+nr(o),l=e;l<n-e;l++){var c=t.children[l];Jn(a,t.leaf?i(c):c),s+=nr(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];Jn(o,t.leaf?i(h):h),s+=nr(o)}return s},W.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)Jn(e[r],t)},W.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():Kn(t[e],this.toBBox)};var b,sr,lr=W,W=((r=b=b||{}).GROUP="g",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh",(n=sr=sr||{})[n.ZERO=0]="ZERO",n[n.NEGATIVE_ONE=1]="NEGATIVE_ONE",cr.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},cr.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},cr);function cr(){this.plugins=[]}function ur(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function hr(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function fr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function dr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function pr(t){return void 0===t?0:360<t||t<-360?t%360:t}function gr(t,e,n){var r,i;return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?(r=t,(i=new Z(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):Xe(t)?Dt(t,e,n):Dt(t[0],t[1]||e,t[2]||n)}function yr(t){return t*(Math.PI/180)}function mr(t){return t*(180/Math.PI)}function vr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=O(Et(It(),r),3))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function br(t,e,n,r,i){var a,o,s,l,c=Math.cos(t),t=Math.sin(t);return a=r*c,o=i*t,r=-r*t,t=i*c,c=i=0,e=e,n=n,s=1,(l=new Z(9))[0]=a,l[1]=o,l[2]=i,l[3]=r,l[4]=t,l[5]=c,l[6]=e,l[7]=n,l[8]=s,l}function xr(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);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=mr(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var wr=tt(),Mr=tt(),Or=Kt(),d=[It(),It(),It()],kr=It();function Er(t,e,n,r,i,a){if(function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(wr,t)&&(et(Mr,wr),Mr[3]=0,Mr[7]=0,Mr[11]=0,Mr[15]=1,!(Math.abs(yt(Mr))<1e-8))){var t=wr[3],o=wr[7],s=wr[11],l=wr[12],c=wr[13],u=wr[14],h=wr[15];if(0!==t||0!==o||0!==s){if(Or[0]=t,Or[1]=o,Or[2]=s,Or[3]=h,!gt(Mr,Mr))return;it(Mr,Mr),Zt(i,Or,Mr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=wr,(o=d)[0][0]=t[0],o[0][1]=t[1],o[0][2]=t[2],o[1][0]=t[4],o[1][1]=t[5],o[1][2]=t[6],o[2][0]=t[8],o[2][1]=t[9],o[2][2]=t[10],n[0]=Bt(d[0]),Ht(d[0],d[0]),r[0]=Vt(d[0],d[1]),Sr(d[1],d[1],d[0],1,-r[0]),n[1]=Bt(d[1]),Ht(d[1],d[1]),r[0]/=n[1],r[1]=Vt(d[0],d[2]),Sr(d[2],d[2],d[0],1,-r[1]),r[2]=Vt(d[1],d[2]),Sr(d[2],d[2],d[1],1,-r[2]),n[2]=Bt(d[2]),Ht(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Yt(kr,d[1],d[2]),Vt(d[0],kr)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]),d[0][2]>d[2][0]&&(a[1]=-a[1]),d[1][0]>d[0][1]&&(a[2]=-a[2])}}function Sr(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}Ar.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Ar.prototype.update=function(t,e){ur(this.center,t),ur(this.halfExtents,e),hr(this.min,this.center,this.halfExtents),fr(this.max,this.center,this.halfExtents)},Ar.prototype.setMinMax=function(t,e){fr(this.center,e,t),dr(this.center,this.center,.5),hr(this.halfExtents,e,t),dr(this.halfExtents,this.halfExtents,.5),ur(this.min,t),ur(this.max,e)},Ar.prototype.getMin=function(){return this.min},Ar.prototype.getMax=function(){return this.max},Ar.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Ar.isEmpty(t)||(Ar.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},Ar.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),m=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),M=Math.abs(d);n[0]=e[12]+a*i[0]+o*i[1]+s*i[2],n[1]=e[13]+l*i[0]+c*i[1]+u*i[2],n[2]=e[14]+h*i[0]+f*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+y*t[2],r[1]=m*t[0]+v*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],hr(this.min,n,r),fr(this.max,n,r)},Ar.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},Ar.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Ar,i=[0,0,0],n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=[0,0,0],i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},Ar.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?ur([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]]},Ar.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?ur([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]]};var _r=Ar;function Ar(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Cr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Cr.prototype.distanceToPoint=function(t){return Vt(t,this.normal)-this.distance},Cr.prototype.normalize=function(){var t,e,n,r=1/$t(this.normal);t=this.normal,e=this.normal,n=r,t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},Cr.prototype.intersectsLine=function(t,e,n){var r,i,a=this.distanceToPoint(t),a=a/(a-this.distanceToPoint(e)),o=0<=a&&a<=1;return o&&n&&(n=n,e=e,a=a,r=(t=t)[0],i=t[1],t=t[2],n[0]=r+a*(e[0]-r),n[1]=i+a*(e[1]-i),n[2]=t+a*(e[2]-t)),o};var Tr,Pr=Cr;function Cr(t,e){this.distance=t||0,this.normal=e||Dt(0,1,0),this.updatePNVertexFlag()}(r=Tr=Tr||{})[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE";Nr.prototype.extractFromVPMatrix=function(t){var t=O(t,16),e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];zt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,zt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,zt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,zt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,zt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,zt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})};var Lr=Nr;function Nr(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Pr)}Rr.prototype.clone=function(){return new Rr(this.x,this.y)},Rr.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var jr=Rr;function Rr(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Br.prototype.toJSON=function(){};var Ir=Br;function Br(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}var Dr,Fr,zr,Wr="Method not implemented.",Gr="Use document.documentElement instead.";(n=Dr=Dr||{})[n.ORBITING=0]="ORBITING",n[n.EXPLORING=1]="EXPLORING",n[n.TRACKING=2]="TRACKING",(r=Fr=Fr||{})[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",(n=zr=zr||{})[n.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",n[n.PERSPECTIVE=1]="PERSPECTIVE";var s,Hr,Vr,Yr,qr="updated",r=(i.prototype.isOrtho=function(){return this.projectionMode===zr.ORTHOGRAPHIC},i.prototype.getProjectionMode=function(){return this.projectionMode},i.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},i.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},i.prototype.getFrustum=function(){return this.frustum},i.prototype.getPosition=function(){return this.position},i.prototype.getFocalPoint=function(){return this.focalPoint},i.prototype.getDollyingStep=function(){return this.dollyingStep},i.prototype.getNear=function(){return this.near},i.prototype.getFar=function(){return this.far},i.prototype.getZoom=function(){return this.zoom},i.prototype.getOrthoMatrix=function(){return this.orthoMatrix},i.prototype.getView=function(){return this.view},i.prototype.setEnableUpdate=function(t){this.enableUpdate=t},i.prototype.setType=function(t,e){return this.type=t,this.type===Dr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Dr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},i.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},i.prototype.setTrackingMode=function(t){if(this.type!==Dr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},i.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},i.prototype.getViewTransform=function(){return gt(tt(),this.matrix)},i.prototype.getWorldTransform=function(){return this.matrix},i.prototype.jitterProjectionMatrix=function(t,e){t=Mt(tt(),[t,e,0]);this.jitteredProjectionMatrix=mt(tt(),t,this.projectionMatrix)},i.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},i.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},i.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},i.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},i.prototype.setNear=function(t){return this.projectionMode===zr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},i.prototype.setFar=function(t){return this.projectionMode===zr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},i.prototype.setViewOffset=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===zr.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},i.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===zr.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},i.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===zr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===zr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},i.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=Dt(t.x-r,t.y-n,0),e=Vt(i,this.right)/Bt(this.right),r=Vt(i,this.up)/Bt(this.up);return this.pan(-e,-r),this},i.prototype.setPerspective=function(t,e,n,r){this.projectionMode=zr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,l,c,n=this.near*Math.tan(yr(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,u=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,u+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,u=(a=u)+r,n=(r=n)-e,e=t,t=this.far,o=this.clipSpaceNearZ===sr.ZERO,l=2*e/(r-n),c=(u+a)/(u-a),r=(r+n)/(r-n),n=(o=void 0===o?!1:o)?(s=-t/(t-e),-t*e/(t-e)):(s=-(t+e)/(t-e),-2*t*e/(t-e)),i[0]=2*e/(u-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=c,i[9]=r,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=n,i[15]=0,bt(this.projectionMatrix,this.projectionMatrix,Dt(1,-1,1)),gt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},i.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=zr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),(this.clipSpaceNearZ===sr.NEGATIVE_ONE?Ct:Lt)(this.projectionMatrix,s,n,r,e,i,a),bt(this.projectionMatrix,this.projectionMatrix,Dt(1,-1,1)),gt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},i.prototype.setPosition=function(t,e,n){t=gr(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},i.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=Dt(0,1,0);return this.focalPoint=gr(t,e,n),this.trackingMode===Fr.CINEMATIC&&(t=(r=Gt(It(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Bt(r),e=mr(Math.asin(e/r)),r=90+mr(Math.atan2(n,t)),wt(n=tt(),n,yr(r)),xt(n,n,yr(e)),i=qt(It(),[0,1,0],n)),gt(this.matrix,Nt(tt(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},i.prototype.getDistance=function(){return this.distance},i.prototype.getDistanceVector=function(){return this.distanceVector},i.prototype.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=It(),t=this.distance,n=this.forward,r=this.focalPoint,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},i.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},i.prototype.setMinDistance=function(t){return this.minDistance=t,this},i.prototype.setAzimuth=function(t){return this.azimuth=pr(t),this.computeMatrix(),this._getAxes(),this.type===Dr.ORBITING||this.type===Dr.EXPLORING?this._getPosition():this.type===Dr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getAzimuth=function(){return this.azimuth},i.prototype.setElevation=function(t){return this.elevation=pr(t),this.computeMatrix(),this._getAxes(),this.type===Dr.ORBITING||this.type===Dr.EXPLORING?this._getPosition():this.type===Dr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getElevation=function(){return this.elevation},i.prototype.setRoll=function(t){return this.roll=pr(t),this.computeMatrix(),this._getAxes(),this.type===Dr.ORBITING||this.type===Dr.EXPLORING?this._getPosition():this.type===Dr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getRoll=function(){return this.roll},i.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},i.prototype.computeMatrix=function(){var t=Qt(Jt(),[0,0,1],yr(this.roll)),e=(rt(this.matrix),Qt(Jt(),[1,0,0],yr((this.rotateWorld&&this.type!==Dr.TRACKING||this.type===Dr.TRACKING?1:-1)*this.elevation))),n=Qt(Jt(),[0,1,0],yr((this.rotateWorld&&this.type!==Dr.TRACKING||this.type===Dr.TRACKING?1:-1)*this.azimuth)),n=te(Jt(),n,e),n=te(Jt(),n,t),e=At(tt(),n);this.type===Dr.ORBITING||this.type===Dr.EXPLORING?(vt(this.matrix,this.matrix,this.focalPoint),mt(this.matrix,this.matrix,e),vt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Dr.TRACKING&&(vt(this.matrix,this.matrix,this.position),mt(this.matrix,this.matrix,e))},i.prototype._setPosition=function(t,e,n){this.position=gr(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},i.prototype._getAxes=function(){Ft(this.right,gr(Zt(Kt(),[1,0,0,0],this.matrix))),Ft(this.up,gr(Zt(Kt(),[0,1,0,0],this.matrix))),Ft(this.forward,gr(Zt(Kt(),[0,0,1,0],this.matrix))),Ht(this.right,this.right),Ht(this.up,this.up),Ht(this.forward,this.forward)},i.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Bt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Dr.TRACKING||this.rotateWorld?(this.elevation=mr(Math.asin(e/r)),this.azimuth=mr(Math.atan2(-t,-n))):(this.elevation=-mr(Math.asin(e/r)),this.azimuth=-mr(Math.atan2(-t,-n)))},i.prototype._getPosition=function(){Ft(this.position,gr(Zt(Kt(),[0,0,0,1],this.matrix))),this._getDistance()},i.prototype._getFocalPoint=function(){var t,e;Xt(this.distanceVector,[0,0,-this.distance],(t=J(),e=this.matrix,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)),Wt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},i.prototype._getDistance=function(){this.distanceVector=Gt(It(),this.focalPoint,this.position),this.distance=Bt(this.distanceVector),this.dollyingStep=this.distance/100},i.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===zr.ORTHOGRAPHIC&&(t=this.position,e=Qt(Jt(),[0,0,1],-this.roll*Math.PI/180),_t(this.orthoMatrix,e,Dt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Dt(this.zoom,this.zoom,1),t))},i.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=mt(tt(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(qr))},i.prototype.rotate=function(t,e,n){throw new Error(Wr)},i.prototype.pan=function(t,e){throw new Error(Wr)},i.prototype.dolly=function(t){throw new Error(Wr)},i.prototype.createLandmark=function(t,e){throw new Error(Wr)},i.prototype.gotoLandmark=function(t,e){throw new Error(Wr)},i.prototype.cancelLandmarkAnimation=function(){throw new Error(Wr)},i);function i(){this.clipSpaceNearZ=sr.NEGATIVE_ONE,this.eventEmitter=new X,this.matrix=tt(),this.right=Dt(1,0,0),this.up=Dt(0,1,0),this.forward=Dt(0,0,1),this.position=Dt(0,0,1),this.focalPoint=Dt(0,0,0),this.distanceVector=Dt(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=tt(),this.projectionMatrixInverse=tt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Dr.EXPLORING,this.trackingMode=Fr.DEFAULT,this.projectionMode=zr.PERSPECTIVE,this.frustum=new Lr,this.orthoMatrix=tt()}function Xr(a,o){if("function"!=typeof a||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),s.cache=i.set(r,n)||i,n)}return s.cache=new(Xr.Cache||Map),s}Xr.Cache=Map,(n=s=s||{})[n.kUnknown=0]="kUnknown",n[n.kNumber=1]="kNumber",n[n.kPercentage=2]="kPercentage",n[n.kEms=3]="kEms",n[n.kPixels=4]="kPixels",n[n.kRems=5]="kRems",n[n.kDegrees=6]="kDegrees",n[n.kRadians=7]="kRadians",n[n.kGradians=8]="kGradians",n[n.kTurns=9]="kTurns",n[n.kMilliseconds=10]="kMilliseconds",n[n.kSeconds=11]="kSeconds",n[n.kInteger=12]="kInteger",(n=Hr=Hr||{})[n.kUNumber=0]="kUNumber",n[n.kUPercent=1]="kUPercent",n[n.kULength=2]="kULength",n[n.kUAngle=3]="kUAngle",n[n.kUTime=4]="kUTime",n[n.kUOther=5]="kUOther",(n=Vr=Vr||{})[n.kYes=0]="kYes",n[n.kNo=1]="kNo",(n=Yr=Yr||{})[n.kYes=0]="kYes",n[n.kNo=1]="kNo";function Ur(t){var e=1;switch(t){case s.kPixels:case s.kDegrees:case s.kSeconds:break;case s.kMilliseconds:e=.001;break;case s.kRadians:e=180/Math.PI;break;case s.kGradians:e=.9;break;case s.kTurns:e=360}return e}function $r(t){switch(t){case s.kNumber:case s.kInteger:return"";case s.kPercentage:return"%";case s.kEms:return"em";case s.kRems:return"rem";case s.kPixels:return"px";case s.kDegrees:return"deg";case s.kRadians:return"rad";case s.kGradians:return"grad";case s.kMilliseconds:return"ms";case s.kSeconds:return"s";case s.kTurns:return"turn"}return""}var Kr,Zr=[{name:"em",unit_type:s.kEms},{name:"px",unit_type:s.kPixels},{name:"deg",unit_type:s.kDegrees},{name:"rad",unit_type:s.kRadians},{name:"grad",unit_type:s.kGradians},{name:"ms",unit_type:s.kMilliseconds},{name:"s",unit_type:s.kSeconds},{name:"rem",unit_type:s.kRems},{name:"turn",unit_type:s.kTurns}],Jr=((n=Kr=Kr||{})[n.kUnknownType=0]="kUnknownType",n[n.kUnparsedType=1]="kUnparsedType",n[n.kKeywordType=2]="kKeywordType",n[n.kUnitType=3]="kUnitType",n[n.kSumType=4]="kSumType",n[n.kProductType=5]="kProductType",n[n.kNegateType=6]="kNegateType",n[n.kInvertType=7]="kInvertType",n[n.kMinType=8]="kMinType",n[n.kMaxType=9]="kMaxType",n[n.kClampType=10]="kClampType",n[n.kTransformType=11]="kTransformType",n[n.kPositionType=12]="kPositionType",n[n.kURLImageType=13]="kURLImageType",n[n.kColorType=14]="kColorType",n[n.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Zr.find(function(t){return t.name===e}).unit_type}),n=(Qr.isAngle=function(t){return t===s.kDegrees||t===s.kRadians||t===s.kGradians||t===s.kTurns},Qr.isLength=function(t){return t>=s.kEms&&t<s.kDegrees},Qr.isRelativeUnit=function(t){return t===s.kPercentage||t===s.kEms||t===s.kRems},Qr.isTime=function(t){return t===s.kSeconds||t===s.kMilliseconds},Qr.prototype.toString=function(){return this.buildCSSText(Vr.kNo,Yr.kNo,"")},Qr.prototype.isNumericValue=function(){return this.getType()>=Kr.kUnitType&&this.getType()<=Kr.kClampType},Qr);function Qr(){}t(ri,ti=n),ri.prototype.getType=function(){return Kr.kColorType},ri.prototype.to=function(t){return this};var ti,ei,ni=ri;function ri(t){var e=ti.call(this)||this;return e.colorSpace=t,e}(a=ei=ei||{})[a.Constant=0]="Constant",a[a.LinearGradient=1]="LinearGradient",a[a.RadialGradient=2]="RadialGradient";t(oi,ii=n),oi.prototype.clone=function(){return new oi(this.type,this.value)},oi.prototype.buildCSSText=function(t,e,n){return n},oi.prototype.getType=function(){return Kr.kColorType};var ii,ai=oi;function oi(t,e){var n=ii.call(this)||this;return n.type=t,n.value=e,n}t(ci,si=n),ci.prototype.clone=function(){return new ci(this.value)},ci.prototype.getType=function(){return Kr.kKeywordType},ci.prototype.buildCSSText=function(t,e,n){return n+this.value};var si,li=ci;function ci(t){var e=si.call(this)||this;return e.value=t,e}function ui(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var hi=Xr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function fi(t){return"function"==typeof t}function di(t,e){void 0===e&&(e="");var n="";if(Number.isFinite(t)){if(!Number.isNaN(t))throw new Error;n="NaN"}else n=0<t?"infinity":"-infinity";return n+e}function pi(t){switch(function(t){switch(t){case s.kNumber:case s.kInteger:return Hr.kUNumber;case s.kPercentage:return Hr.kUPercent;case s.kPixels:return Hr.kULength;case s.kMilliseconds:case s.kSeconds:return Hr.kUTime;case s.kDegrees:case s.kRadians:case s.kGradians:case s.kTurns:return Hr.kUAngle;default:return Hr.kUOther}}(t)){case Hr.kUNumber:return s.kNumber;case Hr.kULength:return s.kPixels;case Hr.kUPercent:return s.kPercentage;case Hr.kUTime:return s.kSeconds;case Hr.kUAngle:return s.kDegrees;default:return s.kUnknown}}var gi,yi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},mi=Xr(function(t){var t=hi(t),e=yi[t];return(null==e?void 0:e.alias)||t}),vi=(t(bi,gi=n),bi.prototype.clone=function(){return new bi(this.value,this.unit)},bi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},bi.prototype.getType=function(){return Kr.kUnitType},bi.prototype.convertTo=function(t){var e;return this.unit===t?new bi(this.value,this.unit):(e=pi(this.unit))!==pi(t)||e===s.kUnknown?null:(e=Ur(this.unit)/Ur(t),new bi(this.value*e,t))},bi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case s.kUnknown:break;case s.kInteger:i=Number(this.value).toFixed(0);break;case s.kNumber:case s.kPercentage:case s.kEms:case s.kRems:case s.kPixels:case s.kDegrees:case s.kRadians:case s.kGradians:case s.kMilliseconds:case s.kSeconds:case s.kTurns:var r,i,a=this.value,o=$r(this.unit);i=a<-999999||999999<a?(r=$r(this.unit),!Number.isFinite(a)||Number.isNaN(a)?di(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},bi);function bi(t,e){void 0===e&&(e=s.kNumber);var n=gi.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?s.kNumber:"percent"===r||"%"===r?s.kPercentage:Jr(r):s.kUnknown:e;return n.unit=r,n.value=t,n}var xi,wi=new vi(0,"px"),Mi=(new vi(1,"px"),new vi(0,"deg")),Oi=(t(ki,xi=ni),ki.prototype.clone=function(){return new ki(this.r,this.g,this.b,this.alpha)},ki.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},ki);function ki(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=xi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function Ei(t){return Ti[t]||(Ti[t]=new li(t)),Ti[t]}var Si,_i,Ai=new li("unset"),a=new li("initial"),n=new li("inherit"),Ti={"":Ai,unset:Ai,initial:a,inherit:n},Pi=new Oi(0,0,0,0,!0),Ci=new Oi(0,0,0,0),Li=Xr(function(t,e,n,r){return new Oi(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ni=function(t,e){return void 0===e&&(e=s.kNumber),new vi(t,e)},ji=new vi(50,"%"),Ri=(Si=Si||{},Si[Si.Standard=0]="Standard",(ni=_i=_i||{})[ni.ADDED=0]="ADDED",ni[ni.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(ni[ni.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ir(0,0,0,0)});(a=u=u||{}).COORDINATE="<coordinate>",a.COLOR="<color>",a.PAINT="<paint>",a.NUMBER="<number>",a.ANGLE="<angle>",a.OPACITY_VALUE="<opacity-value>",a.SHADOW_BLUR="<shadow-blur>",a.LENGTH="<length>",a.PERCENTAGE="<percentage>",a.LENGTH_PERCENTAGE="<length> | <percentage>",a.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",a.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",a.LIST_OF_POINTS="<list-of-points>",a.PATH="<path>",a.FILTER="<filter>",a.Z_INDEX="<z-index>",a.OFFSET_DISTANCE="<offset-distance>",a.DEFINED_PATH="<defined-path>",a.MARKER="<marker>",a.TRANSFORM="<transform>",a.TRANSFORM_ORIGIN="<transform-origin>",a.TEXT="<text>",a.TEXT_TRANSFORM="<text-transform>";Ii={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},Bi="";var Ii,Bi,Di=function(t){return Bi=t,zi()};function Fi(t){throw new Error(Bi+": "+t)}function zi(){var t=Ki(Wi);return 0<Bi.length&&Fi("Invalid input not EOF"),t}function Wi(){return Gi("linear-gradient",Ii.linearGradient,Vi)||Gi("repeating-linear-gradient",Ii.repeatingLinearGradient,Vi)||Gi("radial-gradient",Ii.radialGradient,Yi)||Gi("repeating-radial-gradient",Ii.repeatingRadialGradient,Yi)||Gi("conic-gradient",Ii.conicGradient,Yi)}function Gi(n,t,r){return Hi(t,function(t){var e=r();return e&&!ra(Ii.comma)&&Fi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Ki(Zi)}})}function Hi(t,e){t=ra(t);if(t)return ra(Ii.startCall)||Fi("Missing ("),e=e(t),ra(Ii.endCall)||Fi("Missing )"),e}function Vi(){return na("directional",Ii.sideOrCorner,1)||na("angular",Ii.angleValue,1)}function Yi(){var t,e,n=qi();return n&&((t=[]).push(n),e=Bi,ra(Ii.comma))&&((n=qi())?t.push(n):Bi=e),t}function qi(){var t,e=function(){var t=na("shape",/^(circle)/i,0);t&&(t.style=ea()||Xi());return t}()||function(){var t=na("shape",/^(ellipse)/i,0);t&&(t.style=Qi()||Xi());return t}();return e?e.at=Ui():(t=Xi())?(e=t,(t=Ui())&&(e.at=t)):(t=$i())&&(e={type:"default-radial",at:t}),e}function Xi(){return na("extent-keyword",Ii.extentKeywords,1)}function Ui(){var t;if(na("position",/^at/,0))return(t=$i())||Fi("Missing positioning value"),t}function $i(){var t={x:Qi(),y:Qi()};if(t.x||t.y)return{type:"position",value:t}}function Ki(t){var e=t(),n=[];if(e)for(n.push(e);ra(Ii.comma);)(e=t())?n.push(e):Fi("One extra comma");return n}function Zi(){var t=na("hex",Ii.hexColor,1)||Hi(Ii.rgbaColor,function(){return{type:"rgba",value:Ki(Ji)}})||Hi(Ii.rgbColor,function(){return{type:"rgb",value:Ki(Ji)}})||na("literal",Ii.literalColor,0);return t||Fi("Expected color definition"),t.length=Qi(),t}function Ji(){return ra(Ii.number)[1]}function Qi(){return na("%",Ii.percentageValue,1)||ta()||ea()}function ta(){return na("position-keyword",Ii.positionKeywords,1)}function ea(){return na("px",Ii.pixelValue,1)||na("em",Ii.emValue,1)}function na(t,e,n){e=ra(e);if(e)return{type:t,value:e[n]}}function ra(t){var e=/^[\n\r\t\s]+/.exec(Bi),e=(e&&ia(e[0].length),t.exec(Bi));return e&&ia(e[0].length),e}function ia(t){Bi=Bi.substring(t)}var aa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,oa=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,sa=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,la=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ca={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},ua=Xr(function(t){t="angular"===t.type?Number(t.value):ca[t.value]||0;return Ni(t,"deg")}),ha=Xr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:Ni(n,i),cy:Ni(r,a)}}),fa=Xr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return Di(t).map(function(t){for(var e,n=t.type,r=t.orientation,t=t.colorStops,i=t,a=i.length,o=(i[a-1].length=null!=(d=i[a-1].length)?d:{type:"%",value:"100"},1<a&&(i[0].length=null!=(d=i[0].length)?d:{type:"%",value:"0"}),0),s=Number(i[0].length.value),l=1;l<a;l++){var c=null==(e=i[l].length)?void 0:e.value;if(!p(c)&&!p(s)){for(var u=1;u<l-o;u++)i[o+u].length={type:"%",value:"".concat(s+(Number(c)-s)*u/(l-o))};o=l,s=Number(c)}}var h,f,d=t.map(function(t){return{offset:Ni(Number(t.length.value),"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#".concat(t):"literal"===e?t:("rgb"===e?"rgb(":"rgba(").concat(t.join(","),")"))};var e});return"linear-gradient"===n?new ai(ei.LinearGradient,{angle:r?ua(r):Mi,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=ha(r[0].at)).cx,t=t.cy,f=void 0,r[0].style&&(h=(r=r[0].style).type,r=r.value,f="extent-keyword"===h?Ei(r):Ni(r,h)),new ai(ei.RadialGradient,{cx:n,cy:t,size:f,steps:d})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=aa.exec(t);if(n)return r=(null==(r=n[2].match(la))?void 0:r.map(function(t){return t.split(":")}))||[],[new ai(ei.LinearGradient,{angle:Ni(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=O(t,2),e=t[0],t=t[1];return{offset:Ni(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=oa.exec(t);if(t)return t=(null==(t=t[4].match(la))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ni(50,"%"),cy:Ni(50,"%"),steps:t.map(function(t){var t=O(t,2),e=t[0],t=t[1];return{offset:Ni(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!Ye(n))return[new ai(ei.RadialGradient,n)]}else if("p"===e){var r=t;if(r=sa.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function da(t){return t&&!p(t.r)&&!p(t.g)&&!p(t.b)}var pa=Xr(function(t){var e;return(e=t)&&e.image?m({repetition:"repeat"},t):"transparent"===(t=p(t)?"":t)?Ci:fa(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=Sn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),Li.apply(void 0,v([],O(e),!1)))});function ga(t,e){if(da(t)&&da(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(qe(e[n],0,255));return e[3]=qe(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ya(t,e){if(p(e))return Ni(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ni(Number(e),"px");if(0<="deg".search(t))return Ni(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return Ni(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var ma=Xr(function(t){return ya(new RegExp("px","g"),t)}),va=(Xr(function(t){return ya(new RegExp("%","g"),t)}),function(t){return Xe(t)||isFinite(Number(t))?Ni(Number(t)||0,"px"):ya(new RegExp("px|%|em|rem","g"),t)}),ba=Xr(function(t){return ya(new RegExp("deg|rad|grad|turn","g"),t)});function xa(t){var e=0;return t.unit===s.kDegrees?e=t.value:t.unit===s.kRadians?e=mr(Number(t.value)):t.unit===s.kTurns&&(e=360*Number(t.value)),e}function wa(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Ye(t)?n=t.split(" ").map(function(t){return Number(t)}):Xe(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]: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]]}function Ma(t){return Ye(t)?t.split(" ").map(function(t){return va(t)}):t.map(function(t){return va(t.toString())})}function Oa(t,e,n){return 0===t.value?0:t.unit===s.kPixels?Number(t.value):t.unit===s.kPercentage&&n?(n=n.nodeName===b.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var ka=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ea(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))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,-1<ka.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ya(/deg|rad|grad|turn|px|%/g,t)||pa(t)})}),n.lastIndex===t.length)return r}return[]}function Sa(t){return t.toString()}var _a=Xr(function(t){return"number"==typeof t?Ni(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ni(Number(t)):Ni(0)});function Aa(t,e){return[t,e,Sa]}function Ta(n,r){return function(t,e){return[t,e,function(t){return Sa(qe(t,n,r))}]}}function Pa(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Ca(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ce(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function La(t,e){return t[0]===e[0]&&t[1]===e[1]}function Na(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(k=t[p]).currentPoint,y=k.params,m=k.prePoint,v=void 0;switch(k.command){case"Q":b=m[0],n=m[1],r=y[1],i=y[2],a=y[3],o=y[4],u=c=l=s=void 0,s=qn(b,r,a)[0],l=qn(n,i,o)[0],c=[b,a],u=[n,o],void 0!==s&&c.push(Yn(b,r,a,s)),void 0!==l&&u.push(Yn(n,i,o,l)),v=Dn(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Hn(t,n,i,o),h=Hn(e,r,a,s),f=0;f<u.length;f++)l.push(Gn(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(Gn(e,r,a,s,h[f]));return Dn(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=k.arcParams,v=Fn(b.cx,b.cy,b.rx,b.ry,b.xRotation,b.startAngle,b.endAngle);break;default:h.push(g[0]),f.push(g[1])}v&&(k.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===k.command||"M"===k.command)&&k.prePoint&&k.nextPoint&&d.push(k)}var h=h.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),f=f.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),x=He(h),w=He(f),M=Ge(h),O=Ge(f);if(0!==d.length)for(p=0;p<d.length;p++){var k;(g=(k=d[p]).currentPoint)[0]===x?x-=ja(k,e).xExtra:g[0]===M&&(M+=ja(k,e).xExtra),g[1]===w?w-=ja(k,e).yExtra:g[1]===O&&(O+=ja(k,e).yExtra)}return{x:x,y:w,width:M-x,height:O-w}}function ja(t,e){var n=t.prePoint,r=t.currentPoint,t=t.nextPoint,i=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),n=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),n=Math.acos((i+a-n)/(2*Math.sqrt(i)*Math.sqrt(a)));return!n||0===Math.sin(n)||Ue(n,0)?{xExtra:0,yExtra:0}:(i=Math.abs(Math.atan2(t[1]-r[1],t[0]-r[0])),a=Math.abs(Math.atan2(t[0]-r[0],t[1]-r[1])),i=i>Math.PI/2?Math.PI-i:i,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(n/2-i)*(e/2*(1/Math.sin(n/2)))-e/2||0,yExtra:Math.cos(a-n/2)*(e/2*(1/Math.sin(n/2)))-e/2||0})}function Ra(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xr(function(t){return(Ye(t)?t.split(" "):t).map(_a)});function Ia(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=yr(r=Ke(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=Ba({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=Ba(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var Ba=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)};function Da(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],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 h=function(t,e){var n=e[1],r=e[2],i=Ke(yr(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=Ga([1,0],p),h=Ga(p,u);Wa(p,u)<=-1&&(h=Math.PI);1<=Wa(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:La(t,[c,e])?0:n,ry:La(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):n=[l[(v=l.length)-2],l[v-1]],r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&La(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,m,v=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=v,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(f=Ra((d=e[s-1]).currentPoint,b),"Q"===d.command?(u.command="Q",u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(p=[l[1],l[2]],g=[l[3],l[4]],u.startTangent=[b[0]-p[0],b[1]-p[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[p[0]-g[0],p[1]-g[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[g[0]-p[0],g[1]-p[1]])):"S"===c?(p=Ra((d=e[s-1]).currentPoint,b),g=[l[1],l[2]],"C"===d.command?(u.command="C",u.startTangent=[b[0]-p[0],b[1]-p[1]]):(u.command="SQ",u.startTangent=[b[0]-g[0],b[1]-g[1]]),u.endTangent=[n[0]-g[0],n[1]-g[1]]):"A"===c&&(c=(b=Fa(u,0)).x,b=b.y,y=(m=Fa(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Fa(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=Ia({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Ia({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function za(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Wa(t,e){return za(t)*za(e)?(t[0]*e[0]+t[1]*e[1])/(za(t)*za(e)):1}function Ga(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Wa(t,e))}function Ha(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=be(e)}catch(t){n=be(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}var e=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}(n),t=(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 0<r.length&&n.push(r),{polygons:e,polylines:n}}(n)).polygons,r=r.polylines,i=Da(n),a=(l=Na(i,0)).x,o=l.y,s=l.width,l=l.height;return{absolutePath:n,hasArc:e,segments:i,polygons:t,polylines:r,totalLength:0,rect:{x:Number.isFinite(a)?a:0,y:Number.isFinite(o)?o:0,width:Number.isFinite(s)?s:0,height:Number.isFinite(l)?l:0}}}var Va=Xr(Ha);function Ya(t){return(Ye(t)?Va:Ha)(t)}function qa(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=Se(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=Se(e.absolutePath,!1),e.curve=d),[f,d]),f=Le((t=f.length!==d.length?function t(e,n,r){var i,e=Ne(e),n=Ne(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],h=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Le(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):se(t[0]);return[f,(i=t[1],a=f,c=i.length-1,u=[],h=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){h+=Me(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Xa(t,e){var n,r,i=Ye(t)?t.split(" ").map(function(t){var t=O(t.split(","),2),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Vn(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=zn(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,v([],O(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,v([],O(i.map(function(t){return t[1]})),!1));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function Ua(t,e){return[t.points,e.points,function(t){return t}]}var $a=null;function Ka(t){return function(e){var n=0;return t.map(function(t){return t===$a?e[n++]:t})}}function Za(t){return t}var Ja={matrix:["NNNNNN",[$a,$a,0,0,$a,$a,0,0,0,0,1,0,$a,$a,0,1],Za],matrix3d:["NNNNNNNNNNNNNNNN",Za],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ka([$a,$a,new vi(1)]),Za],scalex:["N",Ka([$a,new vi(1),new vi(1)]),Ka([$a,new vi(1)])],scaley:["N",Ka([new vi(1),$a,new vi(1)]),Ka([new vi(1),$a])],scalez:["N",Ka([new vi(1),new vi(1),$a])],scale3d:["NNN",Za],skew:["Aa",null,Za],skewx:["A",null,Ka([$a,Mi])],skewy:["A",null,Ka([Mi,$a])],translate:["Tt",Ka([$a,$a,wi]),Za],translatex:["T",Ka([$a,wi,wi]),Ka([$a,wi])],translatey:["T",Ka([wi,$a,wi]),Ka([wi,$a])],translatez:["L",Ka([wi,wi,$a])],translate3d:["TTL",Za]};function Qa(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=Ja[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?Mi:ba(t)},N:_a,T:va,L:ma}[f.toUpperCase()](h):{a:Mi,n:c[0],t:wi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function to(t){switch(t.t){case"rotatex":return i=yr(xa(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=yr(xa(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=yr(xa(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":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=yr(xa(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,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":o=yr(xa(t.d[0])),a=yr(xa(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=yr(xa(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=yr(xa(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=Oa(t.d[0],0,null)||0,n=Oa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oa(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=Oa(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=Oa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oa(t.d[0],0,null)||0,n=Oa(t.d[1],0,null)||0,r=Oa(t.d[2],0,null)||0,1];case"perspective":a=Oa(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a: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 eo(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 no(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 Er(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(to).reduce(eo),e,n,r,i,a),[[e,n,r,a,i]]}var ro=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(o=0;o<3;o++)for(var s=0;s<3;s++)a[3][o]+=t[s]*a[s][o];var l=r[0],c=r[1],u=r[2],r=r[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=(h[0][0]=1-2*(c*c+u*u),h[0][1]=2*(l*c-u*r),h[0][2]=2*(l*u+c*r),h[1][0]=2*(l*c+u*r),h[1][1]=1-2*(l*l+u*u),h[1][2]=2*(c*u-l*r),h[2][0]=2*(l*u-c*r),h[2][1]=2*(c*u+l*r),h[2][2]=1-2*(l*l+c*c),a=io(a,h),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);for(n[2]&&(u[2][1]=n[2],a=io(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=io(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=io(a,u)),o=0;o<3;o++)for(s=0;s<3;s++)a[o][s]*=e[o];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])};function io(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}function ao(t){return t.toFixed(6).replace(".000000","")}function oo(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=no(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=no(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,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),i=(r=qe(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+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}(r[0][3],i[0][3],t[5]);return ro(t[0],t[1],t[2],e,t[4]).map(ao).join(",")}])}function so(t){return t.replace(/[xy]/,"")}function lo(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var co=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function uo(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?Ni(n):Ni(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=oo(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];else for(n=0;n<r.length;n++){var l=r[n].t,c=i[n].t,u=r[n].d,h=i[n].d,f=Ja[l],d=Ja[c],p=void 0;if(co(l,c)){var g=oo([r[n]],[i[n]]);a.push(g[0]),o.push(g[1]),s.push(["matrix",[g[2]]])}else{if(l===c)p=l;else if(f[2]&&d[2]&&so(l)===so(c))p=so(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||lo(l)!==lo(c)){a=[(g=oo(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=lo(l),u=f[1](u),h=d[1](h)}for(var y=[],m=[],v=[],b=0;b<u.length;b++){g=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=pi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=$r(t.unit)):(vi.isLength(t.unit)||vi.isLength(e.unit))&&(o=Oa(t,i,n),s=Oa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(u[b],h[b],t,!1,b);y[b]=g[0],m[b]=g[1],v.push(g[2])}a.push(y),o.push(m),s.push([p,v])}}return e&&(e=a,a=o,o=e),[a,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var ho=Xr(function(t){var e;return Ye(t)?"text-anchor"===t?[Ni(0,"px"),Ni(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[va(fo(e[0])),va(fo(e[1]))]):[Ni(t[0]||0,"px"),Ni(t[1]||0,"px")]});function fo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var po=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:u.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:u.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:u.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:u.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:u.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:u.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:u.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:u.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:u.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:u.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:u.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:u.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:u.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:u.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:u.FILTER},{n:"clipPath",syntax:u.DEFINED_PATH},{n:"textPath",syntax:u.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:u.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===b.CIRCLE||t===b.ELLIPSE?"center":t===b.TEXT?"text-anchor":"left top"},l:!0,syntax:u.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===b.CIRCLE||t===b.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:u.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:u.COORDINATE},{n:"cy",int:!0,d:"0",syntax:u.COORDINATE},{n:"cz",int:!0,d:"0",syntax:u.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:u.COORDINATE},{n:"y",int:!0,d:"0",syntax:u.COORDINATE},{n:"z",int:!0,d:"0",syntax:u.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:u.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:u.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:u.COORDINATE},{n:"y1",int:!0,l:!0,syntax:u.COORDINATE},{n:"z1",int:!0,l:!0,syntax:u.COORDINATE},{n:"x2",int:!0,l:!0,syntax:u.COORDINATE},{n:"y2",int:!0,l:!0,syntax:u.COORDINATE},{n:"z2",int:!0,l:!0,syntax:u.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:u.PATH,p:50},{n:"points",int:!0,l:!0,syntax:u.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:u.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:u.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:u.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:u.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:u.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:u.NUMBER,d:function(t){return t===b.PATH||t===b.POLYGON||t===b.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:u.MARKER},{n:"markerEnd",syntax:u.MARKER},{n:"markerMid",syntax:u.MARKER},{n:"markerStartOffset",syntax:u.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:u.LENGTH,l:!0,int:!0,d:"0"}],go=po.filter(function(t){return!!t.l}).map(function(t){return t.n}),yo={},mo=new WeakMap,n=(vo.prototype.registerMetadata=function(e){v([e.n],O(e.a||[]),!1).forEach(function(t){yo[t]=e})},vo.prototype.unregisterMetadata=function(t){delete yo[t]},vo.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},vo.prototype.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),this.runtime.enableCSSParsing){var i=t.skipUpdateAttribute,a=t.skipParse,o=t.forceUpdateGeometry,s=t.usedAttributes,l=o,c=Object.keys(e);c.forEach(function(t){i||(n.attributes[t]=e[t]),!l&&null!=(t=yo[t])&&t.l&&(l=!0)}),a||c.forEach(function(t){n.computedStyle[t]=r.parseProperty(t,n.attributes[t],n)}),(c=null!=s&&s.length?Array.from(new Set(c.concat(s))):c).forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=r.computeProperty(t,n.computedStyle[t],n))}),l&&this.updateGeometry(n),c.forEach(function(t){t in n.parsedStyle&&r.postProcessProperty(t,n,c)}),this.runtime.enableCSSParsing&&n.children.length&&c.forEach(function(e){e in n.parsedStyle&&r.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(n.attributes,e);var o=Object.keys(e),a=n.parsedStyle.clipPath,s=n.parsedStyle.offsetPath,u=(n.parsedStyle=Object.assign(n.parsedStyle,e),!!t.forceUpdateGeometry);if(!u)for(var h=0;h<go.length;h++)if(go[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=pa(e.fill)),e.stroke&&(n.parsedStyle.stroke=pa(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=pa(e.shadowColor)),e.filter&&(n.parsedStyle.filter=Ea(e.filter)),p(e.radius)||(n.parsedStyle.radius=wa(e.radius,4)),p(e.lineDash)||(n.parsedStyle.lineDash=wa(e.lineDash,2)),e.points&&(n.parsedStyle.points=Xa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Ri)),e.path&&(n.parsedStyle.path=Ya(e.path),n.parsedStyle.defX=n.parsedStyle.path.rect.x,n.parsedStyle.defY=n.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,n,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,n,this.runtime),e.anchor&&(n.parsedStyle.anchor=wa(e.anchor,2)),e.transform&&(n.parsedStyle.transform=Qa(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=ho(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==b.CIRCLE&&n.nodeName!==b.ELLIPSE||p(e.cx)&&p(e.cy))&&(n.nodeName!==b.RECT&&n.nodeName!==b.IMAGE&&n.nodeName!==b.GROUP&&n.nodeName!==b.HTML&&n.nodeName!==b.TEXT&&n.nodeName!==b.MESH||p(e.x)&&p(e.y)&&p(e.z))&&(n.nodeName!==b.LINE||p(e.x1)&&p(e.y1)&&p(e.z1)&&p(e.x2)&&p(e.y2)&&p(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),p(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(n,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,o),p(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},vo.prototype.parseProperty=function(t,e,n){var r,t=yo[t],i=e;return"unset"===(e=""!==e&&!p(e)?e:"unset")||"initial"===e||"inherit"===e?i=Ei(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Ei(e):t&&t.parser&&(i=t.parser(e,n))),i},vo.prototype.computeProperty=function(t,e,n){var r=yo[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof li){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))p(r)||(e=this.parseProperty(t,fi(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),p(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this.runtime)):e instanceof li?e.value:e}return a},vo.prototype.postProcessProperty=function(t,e,n){var t=yo[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},vo.prototype.addUnresolveProperty=function(t,e){var n=mo.get(t);n||(mo.set(t,[]),n=mo.get(t)),-1===n.indexOf(e)&&n.push(e)},vo.prototype.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=mo.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},vo.prototype.recalc=function(e){var n,t=mo.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),mo.delete(e))},vo.prototype.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y=t.nodeName,m=this.runtime.geometryUpdaterFactory[y];m&&((s=t.geometry).contentBounds||(s.contentBounds=new _r),s.renderBounds||(s.renderBounds=new _r),e=t.parsedStyle,n=(m=m.update(e,t)).width,r=m.height,h=void 0===(h=m.depth)?0:h,u=void 0===(u=m.offsetX)?0:u,p=void 0===(p=m.offsetY)?0:p,m=void 0===(m=m.offsetZ)?0:m,h=[Math.abs(n)/2,Math.abs(r)/2,h/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,f=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,y===b.TEXT?delete e.anchor:y===b.MESH&&(e.anchor[2]=.5),u=[(1-2*(o&&o[0]||0))*n/2+u,(1-2*(o&&o[1]||0))*r/2+p,(1-2*(o&&o[2]||0))*h[2]+m],s.contentBounds.update(u,h),p=y===b.POLYLINE||y===b.POLYGON||y===b.PATH?Math.SQRT2:.5,l&&!l.isNone&&(h[0]+=m=((c||0)+(g||0))*p,h[1]+=m),s.renderBounds.update(u,h),f&&d&&"inner"!==d&&(l=(y=s.renderBounds).min,c=y.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,m=e.shadowOffsetY||0,u=l[0]-g+p,h=c[0]+g+p,f=l[1]-g+m,d=c[1]+g+m,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),s.renderBounds.setMinMax(l,c)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,fr(s.renderBounds.halfExtents,s.renderBounds.halfExtents,[i,i,0]))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,y=r<0,g=((p=n<0)?-1:1)*(a?Oa(a[0],0,t):0),m=(y?-1:1)*(a?Oa(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,m-=(y?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,m),this.runtime.sceneGraphService.dirtifyToRoot(t))},vo.prototype.isPropertyInheritable=function(t){t=yo[t];return!!t&&t.inh},vo);function vo(t){var e=this;this.runtime=t,po.forEach(function(t){e.registerMetadata(t)})}bo.prototype.calculator=function(t,e,n,r){return xa(n)};ni=bo;function bo(){this.parser=ba,this.parserWithCSSDisabled=null,this.mixer=Aa}xo.prototype.calculator=function(t,e,n,r,i){return n instanceof li&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};a=xo;function xo(){}Mo.prototype.calculator=function(t,e,n,r){return n instanceof li?"none"===n.value?Pi:Ci:n};var wo=Mo;function Mo(){this.parser=pa,this.parserWithCSSDisabled=pa,this.mixer=ga}ko.prototype.calculator=function(t,e,n){return n instanceof li?[]:n};var Oo=ko;function ko(){this.parser=Ea}function Eo(t){t=t.parsedStyle.fontSize;return p(t)?null:t}_o.prototype.calculator=function(t,e,n,r,i){var a,o;return Xe(n)?n:vi.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===s.kPercentage?0:n.unit===s.kEms?r.parentNode&&(o=Eo(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===s.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=Eo(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var So=_o;function _o(){this.parser=va,this.parserWithCSSDisabled=null,this.mixer=Aa}To.prototype.parser=function(t){t=Ma(Xe(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},To.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ao=To;function To(){this.mixer=Pa}Co.prototype.parser=function(t){t=Ma(Xe(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},Co.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Po=Co;function Co(){this.mixer=Pa}var Lo=tt();function No(t,l){var c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0;l.resetLocalTransform(),l.setLocalPosition(c,u),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?l.translateLocal((e=t||[wi,wi])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[wi])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[wi])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[wi])[0].value):"translate3d"===s?l.translateLocal((e=t||[wi,wi,wi])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,xa((t||[Mi])[0])):"rotatex"===s?l.rotateLocal(xa((t||[Mi])[0]),0,0):"rotatey"===s?l.rotateLocal(0,xa((t||[Mi])[0]),0):"rotatez"===s?l.rotateLocal(0,0,xa((t||[Mi])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(yr(n[0]),yr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(yr(n[0]),l.getLocalSkew()[1])):"skewy"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],yr(n[0]))):"matrix"===s?(e=(o=O(t.map(function(t){return t.value}),6))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(nt(Lo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(nt.apply(Rt,v([Lo],O(t.map(function(t){return t.value})),!1)),Lo[12]+=c,Lo[13]+=u,l.setLocalTransform(Lo)))}),l.getLocalTransform()}t(Io,jo=So),Io.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case b.CIRCLE:case b.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;p(a)||(l=a),p(o)||(c=o),p(i)||(u=i);break;case b.LINE:var a=t.parsedStyle,o=a.x1,i=a.x2,s=a.y1,a=a.y2,l=Math.min(o,i),c=Math.min(s,a),u=0;break;case b.RECT:case b.IMAGE:case b.GROUP:case b.HTML:case b.TEXT:case b.MESH:p(t.parsedStyle.x)||(l=t.parsedStyle.x),p(t.parsedStyle.y)||(c=t.parsedStyle.y),p(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==b.PATH&&t.nodeName!==b.POLYLINE&&t.nodeName!==b.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),p(l)&&p(c)&&p(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?No(e,t):(n=(e=O(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(p(l)?n:l,p(c)?r:c,p(u)?e:u)))};var jo,Ro=Io;function Io(){return null!==jo&&jo.apply(this,arguments)||this}Do.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof li?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Bo=Do;function Do(){}zo.prototype.calculator=function(t,e,n){return n.value};var Fo=zo;function zo(){this.mixer=Aa,this.parser=_a,this.parserWithCSSDisabled=null}Go.prototype.calculator=function(t,e,n){return n.value},Go.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==b.LINE&&e!==b.PATH&&e!==b.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var Wo=Go;function Go(){this.parser=_a,this.parserWithCSSDisabled=null,this.mixer=Ta(0,1)}Vo.prototype.calculator=function(t,e,n){return n.value};var Ho=Vo;function Vo(){this.parser=_a,this.parserWithCSSDisabled=null,this.mixer=Ta(0,1)}qo.prototype.calculator=function(t,e,n){return n instanceof li&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ir(0,0,0,0)}:n},qo.prototype.postProcessor=function(t,e){var n;t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===b.PATH&&-1===e.indexOf("transform")&&(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(void 0===n?0:n,void 0===e?0:e))};var Yo=qo;function qo(){this.parser=Ya,this.parserWithCSSDisabled=Ya,this.mixer=qa}Uo.prototype.postProcessor=function(t,e){var n;t.nodeName!==b.POLYGON&&t.nodeName!==b.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var Xo=Uo;function Uo(){this.parser=Xa,this.mixer=Ua}t(Zo,$o=So);var $o,Ko=Zo;function Zo(){var t=null!==$o&&$o.apply(this,arguments)||this;return t.mixer=Ta(0,1/0),t}Qo.prototype.calculator=function(t,e,n,r){return n instanceof li?"unset"===n.value?"":n.value:"".concat(n)},Qo.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var Jo=Qo;function Qo(){}es.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value};var ts=es;function es(){}var ns={},rs=0;var is="undefined"!=typeof window&&void 0!==window.document;function as(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function os(t,e){if(is)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function ss(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-ms)?0:16-e,r=fs();return ys[r]=t,1<Object.keys(ys).length||setTimeout(function(){ms=n;var e=ys;ys={},Object.keys(e).forEach(function(t){return e[t](gs())})},e),r}function ls(t){delete ys[t]}function cs(t){return"string"!=typeof t?ss:""===t?ds.requestAnimationFrame:ds[t+"RequestAnimationFrame"]}var us={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},hs=1,fs=function(){return hs++},ds="object"==typeof self&&self.self==self?self:"object"==typeof F&&F.global==F?F:{},ps=Date.now(),gs=function(){return ds.performance&&"function"==typeof ds.performance.now?ds.performance.now():Date.now()-ps},ys={},ms=Date.now(),vs=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],cs),bs=cs(vs),xs="string"!=typeof(vs=vs)?ls:""===vs?ds.cancelAnimationFrame:ds[vs+"CancelAnimationFrame"]||ds[vs+"CancelRequestAnimationFrame"],ws=(ds.requestAnimationFrame=bs,ds.cancelAnimationFrame=xs,Ms.prototype.getCallbacksNum=function(){return this.callbacks.length},Ms.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ms.prototype.promise=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,v([],O(e),!1))}))},Ms);function Ms(){this.callbacks=[]}ks.prototype.tapPromise=function(t,e){this.callbacks.push(e)},ks.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return $(this,void 0,void 0,function(){var e,n,r;return j(this,function(t){switch(t.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,v([],O(i),!1))]:[3,6];case 1:e=t.sent(),n=0,t.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=t.sent(),t.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}})})};var Os=ks;function ks(){this.callbacks=[]}Ss.prototype.tap=function(t,e){this.callbacks.push(e)},Ss.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Es=Ss;function Ss(){this.callbacks=[]}As.prototype.tap=function(t,e){this.callbacks.push(e)},As.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;e<this.callbacks.length-1;e++)t=(0,this.callbacks[e])(t);return t}return null};var _s=As;function As(){this.callbacks=[]}var Ts=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ps=/([\"\'])[^\'\"]+\1/;Cs.prototype.calculator=function(t,e,n,r){return n instanceof li?[]:n},Cs.prototype.postProcessor=function(t){No(t.parsedStyle.transform,t)};vs=Cs;function Cs(){this.parser=Qa,this.parserWithCSSDisabled=Qa,this.mixer=uo}var Ls=function(){this.parser=ho},Ns=(js.prototype.calculator=function(t,e,n,r){return n.value},js.prototype.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0,t.dirtyReason=_i.Z_INDEX_CHANGED)},js);function js(){this.parser=_a}Is.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Rs=Is;function Is(){}Ds.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Bs=Ds;function Ds(){}zs.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}};var Fs=zs;function zs(){}Gs.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Ws=Gs;function Gs(){}Vs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,v([],O(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,v([],O(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,v([],O(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,v([],O(t.map(function(t){return t[1]})),!1))-r}};var Hs=Vs;function Vs(){}qs.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!Ye(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var Ys=qs;function qs(){}Us.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!p(t)},Us.prototype.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,l=t.dx,c=t.dy,u=((null==(u=null==(u=null==e?void 0:e.ownerDocument)?void 0:u.defaultView)?void 0:u.getConfig())||{}).offscreenCanvas;return this.isReadyToMeasure(t,e)?(e=this.globalRuntime.textService.measureText(i,t,u),i=(t.metrics=e).width,u=e.height,n=e.lineHeight,e=e.fontProperties,i=[i/2,u/2,0],u=[0,1],r=0,"center"===a||"middle"===a?(r=o/2,u=[.5,1]):"right"!==a&&"end"!==a||(r=o,u=[1,1]),a=0,"middle"===s?a=i[1]:"top"===s||"hanging"===s?a=2*i[1]:"alphabetic"===s?a=this.globalRuntime.enableCSSParsing?n-e.ascent:0:"bottom"!==s&&"ideographic"!==s||(a=0),l&&(r+=l),c&&(a+=c),t.anchor=[u[0],u[1],0],{width:2*i[0],height:2*i[1],offsetX:r,offsetY:a}):(t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0})};var Xs=Us;function Us(t){this.globalRuntime=t}Object.defineProperty(Ks.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),Ks.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(Ks.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),Ks.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},Ks.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},Ks.prototype.stopPropagation=function(){this.propagationStopped=!0},Ks.prototype.initEvent=function(){},Ks.prototype.initUIEvent=function(){},Ks.prototype.clone=function(){throw new Error(Wr)};var $s=Ks;function Ks(t){this.eventPhase=Ks.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new jr,this.page=new jr,this.canvas=new jr,this.viewport=new jr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(Qs,Zs=$s),Object.defineProperty(Qs.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),Qs.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},Qs.prototype.initMouseEvent=function(){throw new Error(Wr)};var Zs,Js=Qs;function Qs(){var t=null!==Zs&&Zs.apply(this,arguments)||this;return t.client=new jr,t.movement=new jr,t.offset=new jr,t.global=new jr,t.screen=new jr,t}t(nl,tl=Js),nl.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},nl.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},nl.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var tl,el=nl;function nl(){var t=null!==tl&&tl.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(al,rl=Js),al.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var rl,il=al;function al(){return null!==rl&&rl.apply(this,arguments)||this}t(ll,ol=$s);var ol,sl=ll;function ll(t,e){var n=ol.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}cl.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},cl.prototype.addEventListener=function(t,e,n){var r,i,a,o=tn(n)&&n||Fe(n)&&n.capture,n=Fe(n)&&n.once,s=fi(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=O(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=fi(e)?e:e.handleEvent,l&&(a=e,e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null==(t=e[0].target)?void 0:t.name)===c&&a.apply(void 0,v([],O(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},cl.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},cl.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},cl.prototype.removeEventListener=function(t,e,n){var n=tn(n)&&n||Fe(n)&&n.capture,r=fi(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=fi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},cl.prototype.emit=function(t,e){this.dispatchEvent(new sl(t,e))},cl.prototype.dispatchEvent=function(t,e){var n;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented};Js=cl;function cl(){this.emitter=new X}t(g,ul=Js),g.isNode=function(t){return!!t.childNodes},Object.defineProperty(g.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===b.TEXT&&(n+=this.style.text);try{for(var r=R(this.childNodes),i=r.next();!i.done;i=r.next()){var a=i.value;a.nodeName===b.TEXT?n+=a.nodeValue:n+=a.textContent}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===b.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),g.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},g.prototype.hasChildNodes=function(){return 0<this.childNodes.length},g.prototype.isDefaultNamespace=function(t){throw new Error(Wr)},g.prototype.lookupNamespaceURI=function(t){throw new Error(Wr)},g.prototype.lookupPrefix=function(t){throw new Error(Wr)},g.prototype.normalize=function(){throw new Error(Wr)},g.prototype.isEqualNode=function(t){return this===t},g.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(g.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),g.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!=(e=n.parentNode)?e:r.parentNode;)n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r;if(n!==r)return g.DOCUMENT_POSITION_DISCONNECTED|g.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|g.DOCUMENT_POSITION_PRECEDING;var o=a.length<i.length?i:a,s=o===i?a:i;if(o[o.length-s.length]===s[0])return o===i?g.DOCUMENT_POSITION_CONTAINED_BY|g.DOCUMENT_POSITION_FOLLOWING:g.DOCUMENT_POSITION_CONTAINS|g.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===i?g.DOCUMENT_POSITION_PRECEDING:g.DOCUMENT_POSITION_FOLLOWING:o===i?g.DOCUMENT_POSITION_PRECEDING:g.DOCUMENT_POSITION_FOLLOWING}return g.DOCUMENT_POSITION_FOLLOWING},g.prototype.contain=function(t){return this.contains(t)},g.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},g.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},g.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},g.DOCUMENT_POSITION_DISCONNECTED=1,g.DOCUMENT_POSITION_PRECEDING=2,g.DOCUMENT_POSITION_FOLLOWING=4,g.DOCUMENT_POSITION_CONTAINS=8,g.DOCUMENT_POSITION_CONTAINED_BY=16,g.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ul,hl=g;function g(){var t=null!==ul&&ul.apply(this,arguments)||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}dl.prototype.init=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)},dl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},dl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new jr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},dl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new jr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},dl.prototype.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=mt(this.tmpMatrix,n,a),a=zt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return qt(a,a,n),new jr(a[0],a[1])},dl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=mt(this.tmpMatrix,n,e),e=zt(this.tmpVec3,t.x,t.y,0),t=(qt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new jr((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},dl.prototype.setPickHandler=function(t){this.pickHandler=t},dl.prototype.addEventMapping=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})},dl.prototype.mapEvent=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))}},dl.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},dl.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;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(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},dl.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)hl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},dl.prototype.hitTest=function(a){return $(this,void 0,void 0,function(){var e,n,r,i;return j(this,function(t){switch(t.label){case 0:return e=a.viewportX,n=a.viewportY,i=this.context.config,r=i.width,i=i.height,e<0||n<0||r<e||i<n?[2,null]:[4,this.pickHandler(a)];case 1:return[2,t.sent()||this.rootTarget||null]}})})},dl.prototype.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},dl.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=R(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.globalRuntime.nativeHTMLMap.get(a);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},dl.prototype.pickTarget=function(e){return $(this,void 0,void 0,function(){return j(this,function(t){return[2,this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})]})})},dl.prototype.createPointerEvent=function(s,l,c,u){return $(this,void 0,void 0,function(){var e,n,r,i,a,o;return j(this,function(t){switch(t.label){case 0:return(e=this.allocateEvent(el),this.copyPointerData(s,e),this.copyMouseData(s,e),this.copyData(s,e),e.nativeEvent=s.nativeEvent,e.originalEvent=s,n=this.getExistedHTML(e),r=e,null==c)?[3,1]:(i=c,[3,5]);case 1:return(a=n)?[3,4]:(o=this.isNativeEventFromCanvas(e))?[4,this.pickTarget(e)]:[3,3];case 2:o=t.sent(),t.label=3;case 3:a=o,t.label=4;case 4:i=a||u,t.label=5;case 5:return r.target=i,"string"==typeof l&&(e.type=l),[2,e]}})})},dl.prototype.createWheelEvent=function(a){return $(this,void 0,void 0,function(){var e,n,r,i;return j(this,function(t){switch(t.label){case 0:return(e=this.allocateEvent(il),this.copyWheelData(a,e),this.copyMouseData(a,e),this.copyData(a,e),e.nativeEvent=a.nativeEvent,e.originalEvent=a,r=this.getExistedHTML(e),n=e,r=r)?[3,3]:(i=this.isNativeEventFromCanvas(e))?[4,this.pickTarget(e)]:[3,2];case 1:i=t.sent(),t.label=2;case 2:r=i,t.label=3;case 3:return n.target=r,[2,e]}})})},dl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},dl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(il);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},dl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(el);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},dl.prototype.copyPointerData=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},dl.prototype.copyMouseData=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)},dl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},dl.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},dl.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},dl.prototype.freeEvent=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)},dl.prototype.notifyTarget=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)},dl.prototype.notifyListeners=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)},dl.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||hl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},dl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=hl.isNode(e)&&e.parentNode}};var fl=dl;function dl(t,e){var i=this;this.globalRuntime=t,this.context=e,this.emitter=new X,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=tt(),this.tmpVec3=It(),this.onPointerDown=function(r){return $(i,void 0,void 0,function(){var e,n;return j(this,function(t){switch(t.label){case 0:return[4,this.createPointerEvent(r)];case 1:return e=t.sent(),this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType?this.dispatchEvent(e,"touchstart"):"mouse"!==e.pointerType&&"pen"!==e.pointerType||(n=2===e.button,this.dispatchEvent(e,n?"rightdown":"mousedown")),this.trackingData(r.pointerId).pressTargetsByButton[r.button]=e.composedPath(),this.freeEvent(e),[2]}})})},this.onPointerUp=function(l){return $(i,void 0,void 0,function(){var e,n,r,i,a,o,s;return j(this,function(t){switch(t.label){case 0:return e=performance.now(),[4,this.createPointerEvent(l,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0)];case 1:if(n=t.sent(),this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?this.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(i=2===n.button,this.dispatchEvent(n,i?"rightup":"mouseup")),s=this.trackingData(l.pointerId),a=this.findMountedTarget(s.pressTargetsByButton[l.button]),(o=a)&&!n.composedPath().includes(a)){for(r=a;r&&!n.composedPath().includes(r);)n.currentTarget=r,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(i=2===n.button,this.notifyTarget(n,i?"rightupoutside":"mouseupoutside")),hl.isNode(r)&&(r=r.parentNode);delete s.pressTargetsByButton[l.button],o=r}return o&&((a=this.clonePointerEvent(n,"click")).target=o,a.path=[],s.clicksByButton[l.button]||(s.clicksByButton[l.button]={clickCount:0,target:a.target,timeStamp:e}),(o=s.clicksByButton[l.button]).target===a.target&&e-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=a.target,o.timeStamp=e,a.detail=o.clickCount,null!=(s=n.detail)&&s.preventClick||(this.context.config.useNativeClickEvent||"mouse"!==a.pointerType&&"touch"!==a.pointerType||this.dispatchEvent(a,"click"),this.dispatchEvent(a,"pointertap")),this.freeEvent(a)),this.freeEvent(n),[2]}})})},this.onPointerMove=function(h){return $(i,void 0,void 0,function(){var e,n,r,i,a,o,s,l,c,u;return j(this,function(t){switch(t.label){case 0:return[4,this.createPointerEvent(h,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0)];case 1:return(e=t.sent(),n="mouse"===e.pointerType||"pen"===e.pointerType,r=this.trackingData(h.pointerId),i=this.findMountedTarget(r.overTargets),r.overTargets&&i!==e.target)?(s="mousemove"===h.type?"mouseout":"pointerout",[4,this.createPointerEvent(h,s,i||void 0)]):[3,5];case 2:return a=t.sent(),this.dispatchEvent(a,"pointerout"),n&&this.dispatchEvent(a,"mouseout"),e.composedPath().includes(i)?[3,4]:[4,this.createPointerEvent(h,"pointerleave",i||void 0)];case 3:for((o=t.sent()).eventPhase=o.AT_TARGET;o.target&&!e.composedPath().includes(o.target);)o.currentTarget=o.target,this.notifyTarget(o),n&&this.notifyTarget(o,"mouseleave"),hl.isNode(o.target)&&(o.target=o.target.parentNode);this.freeEvent(o),t.label=4;case 4:this.freeEvent(a),t.label=5;case 5:if(i!==e.target){for(s="mousemove"===h.type?"mouseover":"pointerover",l=this.clonePointerEvent(e,s),this.dispatchEvent(l,"pointerover"),n&&this.dispatchEvent(l,"mouseover"),c=i&&hl.isNode(i)&&i.parentNode;c&&c!==(hl.isNode(this.rootTarget)&&this.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(hl.isNode(this.rootTarget)&&this.rootTarget.parentNode)){for((u=this.clonePointerEvent(e,"pointerenter")).eventPhase=u.AT_TARGET;u.target&&u.target!==i&&u.target!==(hl.isNode(this.rootTarget)&&this.rootTarget.parentNode);)u.currentTarget=u.target,this.notifyTarget(u),n&&this.notifyTarget(u,"mouseenter"),hl.isNode(u.target)&&(u.target=u.target.parentNode);this.freeEvent(u)}this.freeEvent(l)}return this.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&this.dispatchEvent(e,"touchmove"),n&&(this.dispatchEvent(e,"mousemove"),this.cursor=this.getCursor(e.target)),r.overTargets=e.composedPath(),this.freeEvent(e),[2]}})})},this.onPointerOut=function(o){return $(i,void 0,void 0,function(){var e,n,r,i,a;return j(this,function(t){switch(t.label){case 0:return(e=this.trackingData(o.pointerId)).overTargets?(n="mouse"===o.pointerType||"pen"===o.pointerType,r=this.findMountedTarget(e.overTargets),[4,this.createPointerEvent(o,"pointerout",r||void 0)]):[3,3];case 1:return i=t.sent(),this.dispatchEvent(i),n&&this.dispatchEvent(i,"mouseout"),[4,this.createPointerEvent(o,"pointerleave",r||void 0)];case 2:for((a=t.sent()).eventPhase=a.AT_TARGET;a.target&&a.target!==(hl.isNode(this.rootTarget)&&this.rootTarget.parentNode);)a.currentTarget=a.target,this.notifyTarget(a),n&&this.notifyTarget(a,"mouseleave"),hl.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,this.freeEvent(i),this.freeEvent(a),t.label=3;case 3:return this.cursor=null,[2]}})})},this.onPointerOver=function(a){return $(i,void 0,void 0,function(){var e,n,r,i;return j(this,function(t){switch(t.label){case 0:return e=this.trackingData(a.pointerId),[4,this.createPointerEvent(a)];case 1:for(n=t.sent(),r="mouse"===n.pointerType||"pen"===n.pointerType,this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursor=this.getCursor(n.target)),(i=this.clonePointerEvent(n,"pointerenter")).eventPhase=i.AT_TARGET;i.target&&i.target!==(hl.isNode(this.rootTarget)&&this.rootTarget.parentNode);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseenter"),hl.isNode(i.target)&&(i.target=i.target.parentNode);return e.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i),[2]}})})},this.onPointerUpOutside=function(a){return $(i,void 0,void 0,function(){var e,n,r,i;return j(this,function(t){switch(t.label){case 0:return e=this.trackingData(a.pointerId),n=this.findMountedTarget(e.pressTargetsByButton[a.button]),[4,this.createPointerEvent(a)];case 1:if(r=t.sent(),n){for(i=n;i;)r.currentTarget=i,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),hl.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[a.button]}return this.freeEvent(r),[2]}})})},this.onWheel=function(n){return $(i,void 0,void 0,function(){var e;return j(this,function(t){switch(t.label){case 0:return[4,this.createWheelEvent(n)];case 1:return e=t.sent(),this.dispatchEvent(e),this.freeEvent(e),[2]}})})},this.onClick=function(n){return $(i,void 0,void 0,function(){var e;return j(this,function(t){switch(t.label){case 0:return this.context.config.useNativeClickEvent?[4,this.createPointerEvent(n)]:[3,2];case 1:e=t.sent(),this.dispatchEvent(e),this.freeEvent(e),t.label=2;case 2:return[2]}})})},this.onPointerCancel=function(n){return $(i,void 0,void 0,function(){var e;return j(this,function(t){switch(t.label){case 0:return[4,this.createPointerEvent(n,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0)];case 1:return e=t.sent(),this.dispatchEvent(e),this.freeEvent(e),[2]}})})}}yl.prototype.getOrCreateCanvas=function(t,e){if(!this.canvas){if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",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",e)}this.canvas.width=10,this.canvas.height=10}return this.canvas},yl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var pl,gl=yl;function yl(){}(xl=pl=pl||{})[xl.CAMERA_CHANGED=0]="CAMERA_CHANGED",xl[xl.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",xl[xl.NONE=2]="NONE";vl.prototype.init=function(t){var e=this,n=m(m({},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()})},vl.prototype.getStats=function(){return this.stats},vl.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(pl.CAMERA_CHANGED)},vl.prototype.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach(function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)}),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},vl.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable);a.dirty&&(this.sort(t,a),a.dirty=!1,a.dirtyChildren=[],a.dirtyReason=void 0),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)})},vl.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==_i.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(t){var e;-1===n.childNodes.indexOf(t)?0<=(e=r.sorted.indexOf(t))&&r.sorted.splice(e,1):0===r.sorted.length?r.sorted.push(t):(e=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;as(t[i],e)<0?n=1+i:r=i}return n}(r.sorted,t),r.sorted.splice(e,0,t))}):r.sorted=n.childNodes.slice().sort(as)},vl.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},vl.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(pl.DISPLAY_OBJECT_CHANGED)};var ml=vl;function vl(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Es,initAsync:new ws,dirtycheck:new _s,cull:new _s,beginFrame:new Es,beforeRender:new Es,render:new Es,afterRender:new Es,endFrame:new Es,destroy:new Es,pick:new Os,pickSync:new _s,pointerDown:new Es,pointerUp:new Es,pointerMove:new Es,pointerOut:new Es,pointerOver:new Es,pointerWheel:new Es,pointerCancel:new Es,click:new Es}}var bl=/\[\s*(.*)=(.*)\s*\]/,xl=(wl.prototype.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},wl.prototype.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},wl.prototype.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},wl.prototype.getIdOrClassname=function(t){return t.substring(1)},wl.prototype.getAttribute=function(t){var t=t.match(bl),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},wl.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!p(t))&&t.toString?t.toString():""},wl);function wl(){}t(El,Ml=$s),El.ADDITION=2,El.MODIFICATION=1,El.REMOVAL=3;var Ml,Ol,kl=El;function El(t,e,n,r,i,a,o,s){var l=Ml.call(this,null)||this;return l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}function Sl(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}($s=Ol=Ol||{}).REPARENT="reparent",$s.DESTROY="destroy",$s.ATTR_MODIFIED="DOMAttrModified",$s.INSERTED="DOMNodeInserted",$s.REMOVED="removed",$s.MOUNTED="DOMNodeInsertedIntoDocument",$s.UNMOUNTED="DOMNodeRemovedFromDocument",$s.BOUNDS_CHANGED="bounds-changed",$s.CULLED="culled";var _l=new kl(Ol.REPARENT,null,"","","",0,"",""),$s=(o.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},o.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},o.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},o.prototype.attach=function(t,e,n){var r=!1,n=(t.parentNode&&(r=t.parentNode!==e,this.detach(t)),t.parentNode=e,p(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t),e.sortable),e=((null!=(e=null==n?void 0:n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=_i.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(_l)},o.prototype.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(r=null==(n=t.parentNode.sortable)?void 0:n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=_i.REMOVED),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},o.prototype.getOrigin=function(t){return t.transformable.origin},o.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=t.transformable;(e="number"==typeof e?[e,n,r]:e)[0]===i.origin[0]&&e[1]===i.origin[1]&&e[2]===i.origin[2]||((n=i.origin)[0]=e[0],n[1]=e[1],n[2]=e[2]||0,this.dirtifyLocal(t,i))},o.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));n=t.transformable;ne(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},o.prototype.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=Dt(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},o.prototype.setLocalScale=function(t,e){var n=t.transformable,e=Dt(e[0],e[1],e[2]||n.localScale[2]);Ut(e,n.localScale)||(Ft(n.localScale,e),this.dirtifyLocal(t,n))},o.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=re(e,n,r,i));n=t.transformable;ie(n.localRotation,e),this.dirtifyLocal(t,n)},o.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new Z(2))[0]=i,r[1]=n,e=r);var r,i=t.transformable;n=i.localSkew,r=e,n[0]=r[0],n[1]=r[1],this.dirtifyLocal(t,i)},o.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},o.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},o.prototype.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var t=O(t,2),e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},o.prototype.clearPendingEvents=function(){this.pendingEvents=[]},o.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Sl(n),n=n.parentNode;e&&t.forEach(function(t){Sl(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},o.prototype.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},o.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new kl(Ol.ATTR_MODIFIED,t,n,n,e,kl.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},o.prototype.getPosition=function(t){var e=t.transformable;return kt(e.position,this.getWorldTransform(t,e))},o.prototype.getRotation=function(t){var e=t.transformable;return St(e.rotation,this.getWorldTransform(t,e))},o.prototype.getScale=function(t){var e=t.transformable;return Et(e.scaling,this.getWorldTransform(t,e))},o.prototype.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},o.prototype.getLocalPosition=function(t){return t.transformable.localPosition},o.prototype.getLocalRotation=function(t){return t.transformable.localRotation},o.prototype.getLocalScale=function(t){return t.transformable.localScale},o.prototype.getLocalSkew=function(t){return t.transformable.localSkew},o.prototype.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},o.prototype.setLocalTransform=function(t,e){var n=kt(It(),e),r=St(Jt(),e),e=Et(It(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},o.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},o.prototype.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return _r.isEmpty(e)?null:((n=n||new _r).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},o.prototype.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new _r},o.prototype.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new _r).update(t.center,t.halfExtents))}),e&&(t=function(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new _r)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},o.prototype.getLocalBounds=function(t){if(t.parentNode){var e,n=tt(),r=(t.parentNode.transformable&&(n=gt(tt(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!_r.isEmpty(r))return(e=new _r).setFromTransformedAABB(r,n),e}return this.getBounds(t)},o.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(_r.isEmpty(i)||(r=new _r).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=O(r.getMin(),2))[0],t=t[1],n=(r=O(r.getMax(),2))[0],r=r[1],new Ir(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Ir((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},o.prototype.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},o.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},o.prototype.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?mt(e.worldTransform,n.worldTransform,e.localTransform):et(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},o.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},o);function o(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new sl(Ol.BOUNDS_CHANGED),this.rotate=(o=Jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(ne(r=Jt(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),ie(o,a),ee(o,o),te(r,o,r),te(n.localRotation,r,i),oe(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));n=t.transformable;ne(i,e[0],e[1],e[2]),ae(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(ne(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),ie(a,ee(Jt(),r)),ae(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ut(e,It())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,Wt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=tt(),s=It(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ut(g.getPosition(t),s)||(Ft(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,et(r,e.worldTransform),gt(r,r),qt(n.localPosition,s,r)):Ft(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=It(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ut(n.localPosition,l)||(Ft(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=It(),u=It(),h=It(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ut(e="number"==typeof e?zt(u,e,n,r):e,c)||(Wt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Jt();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=re(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),ie(o,n),ee(o,o),te(a.localRotation,o,e),oe(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=tt(),f=It(),d=re(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(_t(t.localTransform,t.localRotation,t.localPosition,Dt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=rt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),mt(t.localTransform,t.localTransform,e)),e=_t(n,d,f,t.localScale,t.origin),mt(t.localTransform,t.localTransform,e)):_t(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Al={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]},Tl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Pl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Cl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ll=(Nl.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),e=this.runtime.offscreenCanvas.getOrCreateContext(e,{willReadFrequently:!0}),i=(e.font=t,Al.MetricsString+Al.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Al.BaselineSymbol).width),s=Al.HeightMultiplier*o,o=o*Al.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},Nl.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=Xe(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Ps.test(s)&&Ts.indexOf(s)<0&&(s='"'.concat(s,'"')),a[o]=s}return"".concat(r," ").concat(i," ").concat(t," ").concat(e," ").concat(a.join(","))}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),m=0;if(!u){for(M=0;M<g.length;M++){var v=p.measureText(g[M]).width+(g[M].length-1)*c;y[M]=v,m=Math.max(m,v)}var b=m+o,x=a||d.fontSize+o,r=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-r/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-r:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:b,height:r,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:m,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Ir(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var M=0;M<g.length;M++)var b=p.measureText(g[M]).width+(g[M].length-1)*c},Nl.prototype.setGraphemeOnPath=function(){},Nl.prototype.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),c=i+a,u="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),m=Array.from(t),v=0;v<m.length;v++){var b=m[v],x=t[v-1],w=t[v+1],M=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+M){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var O=h[f].length,k=0,E=O,S=0;S<O;S++){var _=g(h[f][S]);if(c<k+_+y){E=S;break}k+=_}h[f]=(h[f]||"").slice(0,E)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=M,h[f]=(h[f]||"")+b}}return h.join("\n")},Nl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Al.BreakingSpaces.indexOf(t.charCodeAt(0))},Nl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Al.Newlines.indexOf(t.charCodeAt(0))},Nl.prototype.trimToBreakable=function(t){var e,t=v([],O(t),!1),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},Nl.prototype.canBreakInLastChar=function(t){return!t||!Tl.test(t)},Nl.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},Nl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!Tl.test(t[e]))return e;return-1},Nl.prototype.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},Nl);function Nl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Cl.exec(e)&&!Pl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=v([],O(t),!1),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t}}var jl,k={},Rs=(Ys=new Ys,Hs=new Hs,(ph={})[b.CIRCLE]=new Rs,ph[b.ELLIPSE]=new Bs,ph[b.RECT]=Ys,ph[b.IMAGE]=Ys,ph[b.GROUP]=Ys,ph[b.LINE]=new Fs,ph[b.TEXT]=new Xs(k),ph[b.POLYLINE]=Hs,ph[b.POLYGON]=Hs,ph[b.PATH]=new Ws,ph[b.HTML]=null,ph[b.MESH]=null,ph),Xs=(Bs=new wo,Ys=new So,(Fs={})[u.PERCENTAGE]=null,Fs[u.NUMBER]=new Fo,Fs[u.ANGLE]=new ni,Fs[u.DEFINED_PATH]=new a,Fs[u.PAINT]=Bs,Fs[u.COLOR]=Bs,Fs[u.FILTER]=new Oo,Fs[u.LENGTH]=Ys,Fs[u.LENGTH_PERCENTAGE]=Ys,Fs[u.LENGTH_PERCENTAGE_12]=new Ao,Fs[u.LENGTH_PERCENTAGE_14]=new Po,Fs[u.COORDINATE]=new Ro,Fs[u.OFFSET_DISTANCE]=new Wo,Fs[u.OPACITY_VALUE]=new Ho,Fs[u.PATH]=new Yo,Fs[u.LIST_OF_POINTS]=new Xo,Fs[u.SHADOW_BLUR]=new Ko,Fs[u.TEXT]=new Jo,Fs[u.TEXT_TRANSFORM]=new ts,Fs[u.TRANSFORM]=new vs,Fs[u.TRANSFORM_ORIGIN]=new Ls,Fs[u.Z_INDEX]=new Ns,Fs[u.MARKER]=new Bo,Fs),Rl=(k.CameraContribution=r,k.AnimationTimeline=null,k.EasingFunction=null,k.offscreenCanvas=new gl,k.nativeHTMLMap=new WeakMap,k.sceneGraphSelector=new xl,k.sceneGraphService=new $s(k),k.textService=new Ll(k),k.geometryUpdaterFactory=Rs,k.CSSPropertySyntaxFactory=Xs,k.styleValueRegistry=new n(k),k.layoutRegistry=null,k.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==F)return F;throw new Error("Unable to locate global `this`")}(),k.enableCSSParsing=!0,k.enableDataset=!1,k.enableStyleSyntax=!0,0),Il=new kl(Ol.INSERTED,null,"","","",0,"",""),Bl=new kl(Ol.REMOVED,null,"","","",0,"",""),Dl=new sl(Ol.DESTROY),Hs=(t(l,jl=hl),Object.defineProperty(l.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(t){return""!==t})},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"nextSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"previousSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null},enumerable:!1,configurable:!0}),l.prototype.cloneNode=function(t){throw new Error(Wr)},l.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return k.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Il.relatedNode=this,t.dispatchEvent(Il),t},l.prototype.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},l.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},l.prototype.removeChild=function(t){var e;return Bl.relatedNode=this,t.dispatchEvent(Bl),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),k.sceneGraphService.detach(t),t},l.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];this.removeChild(e)}},l.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},l.prototype.matches=function(t){return k.sceneGraphService.matches(t,this)},l.prototype.getElementById=function(t){return k.sceneGraphService.querySelector("#".concat(t),this)},l.prototype.getElementsByName=function(t){return k.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},l.prototype.getElementsByClassName=function(t){return k.sceneGraphService.querySelectorAll(".".concat(t),this)},l.prototype.getElementsByTagName=function(t){return k.sceneGraphService.querySelectorAll(t,this)},l.prototype.querySelector=function(t){return k.sceneGraphService.querySelector(t,this)},l.prototype.querySelectorAll=function(t){return k.sceneGraphService.querySelectorAll(t,this)},l.prototype.closest=function(t){var e=this;do{if(k.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},l.prototype.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},l.prototype.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},l.prototype.after=function(){for(var r,i=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.parentNode&&(r=this.parentNode.childNodes.indexOf(this),t.forEach(function(t,e){var n;return null==(n=i.parentNode)?void 0:n.appendChild(t,r+e+1)}))},l.prototype.before=function(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),e=(n=O(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,v([],O(n),!1)))},l.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,v([],O(t),!1)),this.remove()},l.prototype.append=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(t){return e.appendChild(t)})},l.prototype.prepend=function(){for(var n=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];t.forEach(function(t,e){return n.appendChild(t,e)})},l.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,v([],O(t),!1))},l.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},l.prototype.destroy=function(){this.dispatchEvent(Dl),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},l.prototype.getGeometryBounds=function(){return k.sceneGraphService.getGeometryBounds(this)},l.prototype.getRenderBounds=function(){return k.sceneGraphService.getBounds(this,!0)},l.prototype.getBounds=function(){return k.sceneGraphService.getBounds(this)},l.prototype.getLocalBounds=function(){return k.sceneGraphService.getLocalBounds(this)},l.prototype.getBoundingClientRect=function(){return k.sceneGraphService.getBoundingClientRect(this)},l.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},l.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},l.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},l.prototype.getAttribute=function(t){var e;return"symbol"==typeof t?k.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=mi(t),e=this.attributes[t],k.enableCSSParsing)&&p(e)?null:e},l.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},l.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},l.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},l.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},l.prototype.getAttributeNS=function(t,e){throw new Error(Wr)},l.prototype.getAttributeNode=function(t){throw new Error(Wr)},l.prototype.getAttributeNodeNS=function(t,e){throw new Error(Wr)},l.prototype.hasAttributeNS=function(t,e){throw new Error(Wr)},l.prototype.removeAttributeNS=function(t,e){throw new Error(Wr)},l.prototype.removeAttributeNode=function(t){throw new Error(Wr)},l.prototype.setAttributeNS=function(t,e,n){throw new Error(Wr)},l.prototype.setAttributeNode=function(t){throw new Error(Wr)},l.prototype.setAttributeNodeNS=function(t){throw new Error(Wr)},l.prototype.toggleAttribute=function(t,e){throw new Error(Wr)},l);function l(){var t=null!==jl&&jl.apply(this,arguments)||this;return t.entity=Rl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:Si.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!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.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle=k.enableCSSParsing?{anchor:Ai,opacity:Ai,fillOpacity:Ai,strokeOpacity:Ai,fill:Ai,stroke:Ai,transform:Ai,transformOrigin:Ai,visibility:Ai,pointerEvents:Ai,lineWidth:Ai,lineCap:Ai,lineJoin:Ai,increasedLineWidthForHitTesting:Ai,fontSize:Ai,fontFamily:Ai,fontStyle:Ai,fontWeight:Ai,fontVariant:Ai,textAlign:Ai,textBaseline:Ai,textTransform:Ai,zIndex:Ai,filter:Ai,shadowType:Ai}:null,t.parsedStyle={},t.attributes={},t}function Fl(t){return null!=t&&t.nodeName}var zl,Wl=new kl(Ol.ATTR_MODIFIED,null,null,null,null,kl.MODIFICATION,null,null),Gl={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Hl={anchor:[0,0],fill:Pi,stroke:Pi,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Vl=m(m({},Hl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Yl=v(v([],O(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),ql=(t(c,zl=Hs),c.prototype.destroy=function(){zl.prototype.destroy.call(this),this.getAnimations().forEach(function(t){t.cancel()})},c.prototype.cloneNode=function(e,t){var n,r=m({},this.attributes);for(n in r){var i=r[n];Fl(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},c.prototype.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(k.enableCSSParsing&&(r.usedAttributes=Yl),{});for(e in t)i[mi(e)]=t[e];k.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},c.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=mi(t);en(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),zl.prototype.setAttribute.call(this,t,e))},c.prototype.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(k.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Wl.relatedNode=this,Wl.prevValue=i,Wl.newValue=e,Wl.attrName=t,Wl.prevParsedValue=a,Wl.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Wl):(Wl.target=this).ownerDocument.defaultView.dispatchEvent(Wl,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},c.prototype.getBBox=function(){var t=this.getBounds(),e=O(t.getMin(),2),n=e[0],e=e[1],t=O(t.getMax(),2),r=t[0],t=t[1];return new Ir(n,e,r-n,t-e)},c.prototype.setOrigin=function(t,e,n){return k.sceneGraphService.setOrigin(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.getOrigin=function(){return k.sceneGraphService.getOrigin(this)},c.prototype.setPosition=function(t,e,n){return k.sceneGraphService.setPosition(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.setLocalPosition=function(t,e,n){return k.sceneGraphService.setLocalPosition(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.translate=function(t,e,n){return k.sceneGraphService.translate(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.translateLocal=function(t,e,n){return k.sceneGraphService.translateLocal(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.getPosition=function(){return k.sceneGraphService.getPosition(this)},c.prototype.getLocalPosition=function(){return k.sceneGraphService.getLocalPosition(this)},c.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},c.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=gr(t,e=e||t,n=n||t)),k.sceneGraphService.scaleLocal(this,t),this},c.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=gr(t,e=e||t,n=n||t)),k.sceneGraphService.setLocalScale(this,t),this},c.prototype.getLocalScale=function(){return k.sceneGraphService.getLocalScale(this)},c.prototype.getScale=function(){return k.sceneGraphService.getScale(this)},c.prototype.getEulerAngles=function(){return mr(O(vr(It(),k.sceneGraphService.getWorldTransform(this)),3)[2])},c.prototype.getLocalEulerAngles=function(){return mr(O(vr(It(),k.sceneGraphService.getLocalRotation(this)),3)[2])},c.prototype.setEulerAngles=function(t){return k.sceneGraphService.setEulerAngles(this,0,0,t),this},c.prototype.setLocalEulerAngles=function(t){return k.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},c.prototype.rotateLocal=function(t,e,n){return p(e)&&p(n)?k.sceneGraphService.rotateLocal(this,0,0,t):k.sceneGraphService.rotateLocal(this,t,e,n),this},c.prototype.rotate=function(t,e,n){return p(e)&&p(n)?k.sceneGraphService.rotate(this,0,0,t):k.sceneGraphService.rotate(this,t,e,n),this},c.prototype.setRotation=function(t,e,n,r){return k.sceneGraphService.setRotation(this,t,e,n,r),this},c.prototype.setLocalRotation=function(t,e,n,r){return k.sceneGraphService.setLocalRotation(this,t,e,n,r),this},c.prototype.setLocalSkew=function(t,e){return k.sceneGraphService.setLocalSkew(this,t,e),this},c.prototype.getRotation=function(){return k.sceneGraphService.getRotation(this)},c.prototype.getLocalRotation=function(){return k.sceneGraphService.getLocalRotation(this)},c.prototype.getLocalSkew=function(){return k.sceneGraphService.getLocalSkew(this)},c.prototype.getLocalTransform=function(){return k.sceneGraphService.getLocalTransform(this)},c.prototype.getWorldTransform=function(){return k.sceneGraphService.getWorldTransform(this)},c.prototype.setLocalTransform=function(t){return k.sceneGraphService.setLocalTransform(this,t),this},c.prototype.resetLocalTransform=function(){k.sceneGraphService.resetLocalTransform(this)},c.prototype.getAnimations=function(){return this.activeAnimations},c.prototype.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},c.prototype.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},Object.defineProperty(c.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),c.prototype.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},c.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},c.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,v([],O(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))+1),this},c.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,v([],O(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))-1),this},c.prototype.getConfig=function(){return this.config},c.prototype.attr=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=O(t,2),i=r[0],r=r[1];return i?Fe(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===t.length?(this.setAttribute(i,r),this):this.attributes[i]:this.attributes},c.prototype.getMatrix=function(t){var t=t||this.getWorldTransform(),e=O(kt(It(),t),2),n=e[0],e=e[1],r=O(Et(It(),t),2),i=r[0],r=r[1],t=St(Jt(),t),t=O(vr(It(),t),3),a=t[0],t=t[2];return br(a||t,n,e,i,r)},c.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},c.prototype.setMatrix=function(t){var t=O(xr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},c.prototype.setLocalMatrix=function(t){var t=O(xr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},c.prototype.show=function(){k.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},c.prototype.hide=function(){k.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(t){t.style.visibility="hidden"})},c.prototype.getCount=function(){return this.childElementCount},c.prototype.getParent=function(){return this.parentElement},c.prototype.getChildren=function(){return this.children},c.prototype.getFirst=function(){return this.firstElementChild},c.prototype.getLast=function(){return this.lastElementChild},c.prototype.getChildByIndex=function(t){return this.children[t]||null},c.prototype.add=function(t,e){return this.appendChild(t,e)},c.prototype.setClip=function(t){this.style.clipPath=t},c.prototype.set=function(t,e){this.config[t]=e},c.prototype.get=function(t){return this.config[t]},c.prototype.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},c.prototype.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},c.prototype.setZIndex=function(t){return this.style.zIndex=t,this},c);function c(t){var r=this,t=((r=zl.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||b.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,k.enableCSSParsing?Hl:Vl,r.config.initialParsedStyle),k.enableCSSParsing&&Object.assign(r.attributes,Gl),r.initAttributes(r.config.style),k.globalThis.Proxy||function(){});return k.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(ui(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(ui(e)),n),!0}})),k.enableStyleSyntax&&(r.style=new t({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}t(Kl,Xl=ql);var Xl,Ul,$l=Kl;function Kl(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Xl.call(this,m({type:b.CIRCLE,style:k.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:k.enableCSSParsing?null:[ji,ji]}},t))||this}function Zl(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=Ul.call(this,m({style:k.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(Zl,Ul=ql);t(tc,Jl=ql);var Jl,Ql=tc;function tc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Jl.call(this,m({type:b.ELLIPSE,style:k.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:k.enableCSSParsing?null:[ji,ji]}},t))||this}t(rc,ec=ql);var ec,nc=rc;function rc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return ec.call(this,m({type:b.GROUP,style:k.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(oc,ic=ql),oc.prototype.getDomElement=function(){return this.parsedStyle.$el},oc.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},oc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},oc.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null==(r=null==(r=this.ownerDocument)?void 0:r.defaultView)?void 0:r.getContextService().getBoundingClientRect();return r?(t=n.left-r.left,r=n.top-r.top,(e=new _r).setMinMax([t,r,0],[t+n.width,r+n.height,0]),e):null},oc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=gt(tt(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!_r.isEmpty(n))return(t=new _r).setFromTransformedAABB(n,e),t}return this.getBounds()};var ic,ac=oc;function oc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=ic.call(this,m({type:b.HTML,style:k.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(cc,sc=ql);var sc,lc=cc;function cc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return sc.call(this,m({type:b.IMAGE,style:k.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(fc,uc=ql),fc.prototype.attributeChangedCallback=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&&Fl(r)&&(this.markerStartAngle=0,r.remove()),i&&Fl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Fl(r)&&(this.markerEndAngle=0,r.remove()),i)&&Fl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},fc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&Fl(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},fc.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=Wn(r,i,a,o,t),i=r.x,a=r.y,o=qt(It(),Dt(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new jr(o[0],o[1])},fc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},fc.prototype.getTotalLength=function(){var t=this.parsedStyle;return zn(t.x1,t.y1,t.x2,t.y2)};var uc,hc=fc;function fc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=uc.call(this,m({type:b.LINE,style:m({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},n)},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),t=n.markerStart,n=n.markerEnd;return t&&Fl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Fl(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(gc,dc=ql),gc.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===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&&Fl(r)&&(this.markerStartAngle=0,r.remove()),i&&Fl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fl(r)&&(this.markerEndAngle=0,r.remove()),i&&Fl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},gc.prototype.transformMarker=function(t){var e,n,r,i,a,o,s,l=this.parsedStyle,c=l.markerStart,u=l.markerEnd,h=l.markerStartOffset,f=l.markerEndOffset,d=l.defX,l=l.defY,c=t?c:u;c&&Fl(c)&&(u=0,h=t?(o=(t=O(this.getStartTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=h||0,this.markerStartAngle):(o=(t=O(this.getEndTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=f||0,this.markerEndAngle),u=Math.atan2(i,r),c.setLocalEulerAngles(180*u/Math.PI+h),c.setLocalPosition(e+Math.cos(u)*a,n+Math.sin(u)*a))},gc.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Fl(t))for(var a=1;a<n.length-1;a++){var o=O(n[a].currentPoint,2),s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},gc.prototype.getTotalLength=function(){return Ca(this)},gc.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ce(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=qt(It(),Dt(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new jr(n[0],n[1])},gc.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Ca(this),e)},gc.prototype.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},gc.prototype.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i};var dc,pc=gc;function gc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=dc.call(this,m({type:b.PATH,style:k.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:k.enableCSSParsing?null:{miterLimit:4,path:m({},Ri)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&Fl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Fl(n)&&e.placeMarkerMid(n),r&&Fl(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(vc,yc=ql),vc.prototype.attributeChangedCallback=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&&Fl(r)&&(this.markerStartAngle=0,r.remove()),i&&Fl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fl(r)&&(this.markerEndAngle=0,r.remove()),i&&Fl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},vc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&Fl(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.parsedStyle.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},vc.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Fl(t))for(var a=1;a<(this.parsedStyle.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}};var yc,mc=vc;function vc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=yc.call(this,m({type:b.POLYGON,style:k.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:k.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&Fl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Fl(n)&&e.placeMarkerMid(n),r&&Fl(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(wc,bc=mc),wc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},wc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},wc.prototype.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),Wn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=qt(It(),Dt(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new jr(a[0],a[1])},wc.prototype.getStartTangent=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},wc.prototype.getEndTangent=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};var bc,xc=wc;function wc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return bc.call(this,m({type:b.POLYLINE,style:k.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:k.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(kc,Mc=ql);var Mc,Oc=kc;function kc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Mc.call(this,m({type:b.RECT,style:k.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(_c,Ec=ql),_c.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},_c.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},_c.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var Ec,Sc=_c;function _c(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Ec.call(this,m({type:b.TEXT,style:k.enableCSSParsing?m({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0},e):m({fill:"black"},e),initialParsedStyle:k.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},t))||this}Tc.prototype.define=function(t,e){this.registry[t]=e},Tc.prototype.get=function(t){return this.registry[t]};var Ac=Tc;function Tc(){this.registry={},this.define(b.CIRCLE,$l),this.define(b.ELLIPSE,Ql),this.define(b.RECT,Oc),this.define(b.IMAGE,lc),this.define(b.LINE,hc),this.define(b.GROUP,nc),this.define(b.PATH,pc),this.define(b.POLYGON,mc),this.define(b.POLYLINE,xc),this.define(b.TEXT,Sc),this.define(b.HTML,ac)}t(Lc,Pc=hl),Object.defineProperty(Lc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Lc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Lc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Lc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Lc.prototype.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Sc:nc),(t=new n(e)).ownerDocument=this,t)},Lc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Lc.prototype.cloneNode=function(t){throw new Error(Wr)},Lc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Lc.prototype.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.displayObject,e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},Lc.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},Lc.prototype.elementFromPoint=function(a,o){return $(this,void 0,void 0,function(){var e,n,r,i;return j(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,null]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return[2,(i=t.sent().picked)&&i[0]||this.documentElement]}})})},Lc.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},Lc.prototype.elementsFromPoint=function(a,o){return $(this,void 0,void 0,function(){var e,n,r,i;return j(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,[]]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return(i=t.sent().picked)[i.length-1]!==this.documentElement&&i.push(this.documentElement),[2,i]}})})},Lc.prototype.appendChild=function(t,e){throw new Error(Gr)},Lc.prototype.insertBefore=function(t,e){throw new Error(Gr)},Lc.prototype.removeChild=function(t,e){throw new Error(Gr)},Lc.prototype.replaceChild=function(t,e,n){throw new Error(Gr)},Lc.prototype.append=function(){throw new Error(Gr)},Lc.prototype.prepend=function(){throw new Error(Gr)},Lc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Lc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Lc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Lc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Lc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Lc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Lc.prototype.find=function(t){return this.documentElement.find(t)},Lc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var Pc,Cc=Lc;function Lc(){var t=Pc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new k.AnimationTimeline(t)}catch(t){}var r={};return po.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=fi(t)?t(b.GROUP):t)}),t.documentElement=new nc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}jc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(jc.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new sl(Ol.CULLED)),null))}),e.hooks.afterRender.tap(jc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},jc.tag="Culling";var Nc=jc;function jc(t){this.strategies=t}Ic.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(Ic.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},Ic.tag="DirtyCheck";var Rc=Ic;function Ic(){}Dc.prototype.apply=function(t){var c=this,t=(this.context=t).renderingService,u=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(e){return $(c,void 0,void 0,function(){return j(this,function(t){switch(t.label){case 0:return[4,this.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0})];case 1:return[2,t.sent().picked[0]||null]}})})}),t.hooks.pointerWheel.tap(Dc.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(Dc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.normalizeToPointerEvent(t,u);!c.autoPreventDefault||!r[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();try{for(var i=R(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerUp.tap(Dc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.context.contextService.getDomElement(),i="outside";try{i=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":""}catch(t){}r=c.normalizeToPointerEvent(t,u);try{for(var a=R(r),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,u,t);l.type+=i,c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerMove.tap(Dc.tag,this.onPointerMove),t.hooks.pointerOver.tap(Dc.tag,this.onPointerMove),t.hooks.pointerOut.tap(Dc.tag,this.onPointerMove),t.hooks.click.tap(Dc.tag,this.onClick),t.hooks.pointerCancel.tap(Dc.tag,function(t){var e,n,r=c.normalizeToPointerEvent(t,u);try{for(var i=R(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)})},Dc.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||p(n)||p(r)?(e=(i=this.context.eventService.client2Viewport(new jr(i,t))).x,i.y):(e=n,r),{x:e,y:t}},Dc.prototype.bootstrapEvent=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 e=(n=this.getViewportXY(e)).x,n=n.y,n=(t.viewport.x=e,t.viewport.y=n,(e=this.context.eventService.viewport2Canvas(t.viewport)).x),e=e.y;return t.canvas.x=n,t.canvas.y=e,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=us[t.type]||t.type),t},Dc.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,(r=this.getViewportXY(t)).x),r=r.y,r=(e.viewport.x=n,e.viewport.y=r,(n=this.context.eventService.viewport2Canvas(e.viewport)).x),n=n.y;return e.canvas.x=r,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},Dc.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.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},Dc.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},Dc.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];en(i.button)&&(i.button=0),en(i.buttons)&&(i.buttons=1),en(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),en(i.width)&&(i.width=i.radiusX||1),en(i.height)&&(i.height=i.radiusY||1),en(i.tiltX)&&(i.tiltX=0),en(i.tiltY)&&(i.tiltY=0),en(i.pointerType)&&(i.pointerType="touch"),en(i.pointerId)&&(i.pointerId=i.identifier||0),en(i.pressure)&&(i.pressure=i.force||.5),en(i.twist)&&(i.twist=0),en(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(en((e=t).isPrimary)&&(e.isPrimary=!0),en(e.width)&&(e.width=1),en(e.height)&&(e.height=1),en(e.tiltX)&&(e.tiltX=0),en(e.tiltY)&&(e.tiltY=0),en(e.pointerType)&&(e.pointerType="mouse"),en(e.pointerId)&&(e.pointerId=1),en(e.pressure)&&(e.pressure=.5),en(e.twist)&&(e.twist=0),en(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},Dc.tag="Event";var Bc=Dc;function Dc(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new el(null),this.rootWheelEvent=new il(null),this.onPointerMove=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i=c.normalizeToPointerEvent(t,r);try{for(var a=R(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}},this.onClick=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView,i=c.normalizeToPointerEvent(t,r);try{for(var a=R(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}var Fc=[b.CIRCLE,b.ELLIPSE,b.IMAGE,b.RECT,b.LINE,b.POLYLINE,b.POLYGON,b.TEXT,b.PATH,b.HTML],zc=(Wc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!_r.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=null==(r=e.parentNode)?void 0:r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Tr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Tr.OUTSIDE,i.visible))},Wc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Tr.OUTSIDE||n===Tr.INSIDE)return n;for(var i=Tr.INSIDE,a=-1<Fc.indexOf(t.nodeName),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,c=c.distance;if(Vt(u,e.getPositiveFarPoint(r[o]))+c<0)return Tr.OUTSIDE;Vt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Wc);function Wc(){}Vc.prototype.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,k.enableCSSParsing&&k.styleValueRegistry.recalc(t),k.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),k.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tap(Vc.tag,function(){l.addEventListener(Ol.MOUNTED,r),l.addEventListener(Ol.UNMOUNTED,i),l.addEventListener(Ol.ATTR_MODIFIED,e),l.addEventListener(Ol.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(Vc.tag,function(){l.removeEventListener(Ol.MOUNTED,r),l.removeEventListener(Ol.UNMOUNTED,i),l.removeEventListener(Ol.ATTR_MODIFIED,e),l.removeEventListener(Ol.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(Vc.tag,function(){a.syncRTree()})},Vc.prototype.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=O(a.getMin(),2))[0],n=n[1],r=(a=O(a.getMax(),2))[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},Vc.tag="Prepare";var Gc,Hc=Vc;function Vc(){this.toSync=new Set}(Ws=Gc=Gc||{}).READY="ready",Ws.BEFORE_RENDER="beforerender",Ws.RERENDER="rerender",Ws.AFTER_RENDER="afterrender",Ws.BEFORE_DESTROY="beforedestroy",Ws.AFTER_DESTROY="afterdestroy",Ws.RESIZE="resize",Ws.DIRTY_RECTANGLE="dirtyrectangle",Ws.RENDERER_CHANGED="rendererchanged";var Yc,qc=new sl(Ol.MOUNTED),Xc=new sl(Ol.UNMOUNTED),Uc=new sl(Gc.BEFORE_RENDER),$c=new sl(Gc.RERENDER),Kc=new sl(Gc.AFTER_RENDER);function Zc(t){var e=Yc.call(this)||this,n=(e.Element=ql,e.inited=!1,e.context={},e.document=new Cc,(e.document.defaultView=e).customElements=new Ac,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,m=t.supportsCSSTransform,v=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,x=t.isTouchEvent,t=t.isMouseEvent,w=(M=e,(w=n)&&(w="string"==typeof w?w:w.id||rs++,ns[w]&&ns[w].destroy(),ns[w]=M),a),M=o,O=s;return r&&(O=1<=(O=s||is&&window.devicePixelRatio||1)?Math.ceil(O):1,w=a||("auto"===(a=os(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/O,M=o||("auto"===(a=os(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/O),e.devicePixelRatio=O,e.requestAnimationFrame=null!=f?f:bs.bind(k.globalThis),e.cancelAnimationFrame=null!=d?d:xs.bind(k.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in k.globalThis,e.supportsPointerEvents=null!=g?g:!!k.globalThis.PointerEvent,e.isTouchEvent=null!=x?x:function(t){return e.supportsTouchEvents&&t instanceof k.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!k.globalThis.MouseEvent||t instanceof k.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof k.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:w,height:M,renderer:l,offscreenCanvas:i,devicePixelRatio:O,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:m,useNativeClickEvent:v,alwaysTriggerPointerEventOnCanvas:b}),e.initDefaultCamera(w,M,l.clipSpaceNearZ),e.initRenderer(l,!0),e}t(Zc,Yc=Js),Zc.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},Zc.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new k.CameraContribution;i.clipSpaceNearZ=n,i.setType(Dr.EXPLORING,Fr.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(qr,function(){r.context.renderingContext.renderReasons.add(pl.CAMERA_CHANGED)}),this.context.camera=i},Zc.prototype.getConfig=function(){return this.context.config},Zc.prototype.getRoot=function(){return this.document.documentElement},Zc.prototype.getCamera=function(){return this.context.camera},Zc.prototype.getContextService=function(){return this.context.contextService},Zc.prototype.getEventService=function(){return this.context.eventService},Zc.prototype.getRenderingService=function(){return this.context.renderingService},Zc.prototype.getRenderingContext=function(){return this.context.renderingContext},Zc.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(Zc.prototype,"ready",{get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Zc.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new sl(Gc.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new sl(Gc.AFTER_DESTROY))},Zc.prototype.changeSize=function(t,e){this.resize(t,e)},Zc.prototype.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===zr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new sl(Gc.RESIZE,{width:t,height:e}))},Zc.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},Zc.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},Zc.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},Zc.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},Zc.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},Zc.prototype.render=function(){var t=this;this.dispatchEvent(Uc),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent($c)}),this.dispatchEvent(Kc)},Zc.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},Zc.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Bc,new Hc,new Rc,new Nc([new zc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},k),this.context)),this.context.renderingService=new ml(k,this.context),this.context.eventService=new fl(k,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then(function(){n.initRenderingService(t,e)})},Zc.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init(function(){r.inited=!0,e?(n?r.requestAnimationFrame(function(){r.dispatchEvent(new sl(Gc.READY))}):r.dispatchEvent(new sl(Gc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new sl(Gc.RENDERER_CHANGED)),e||r.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()})},Zc.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(k)})},Zc.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),v([],O(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(k)}),this.initRenderer(t))},Zc.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},Zc.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(Xc):(Xc.target=t,this.dispatchEvent(Xc,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},Zc.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(qc):(qc.target=t,this.dispatchEvent(qc,!0))):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)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},Zc.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},Zc.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},Zc.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},Zc.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},Zc.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},Zc.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})};Qc.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===d,f=h&&n.dragndropPluginOptions.isDocumentDraggable?d:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],i.addEventListener("pointermove",e=function(i){return $(n,void 0,void 0,function(){var e,n,r;return j(this,function(t){switch(t.label){case 0:if(!a){if(e=i.timeStamp-o,n=Me([i.clientX,i.clientY],s),e<=this.dragndropPluginOptions.dragstartTimeThreshold||n<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];i.type="dragstart",f.dispatchEvent(i),a=!0}return(i.type="drag",i.dx=i.clientX-c[0],i.dy=i.clientY-c[1],f.dispatchEvent(i),c=[i.clientX,i.clientY],h)?[3,2]:(e="pointer"===this.dragndropPluginOptions.overlap?[i.canvasX,i.canvasY]:u.getBounds().center,[4,d.elementsFromPoint(e[0],e[1])]);case 1:n=t.sent(),r=n[n.indexOf(u)+1],r=(null==r?void 0:r.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?d:null),l!==r&&(l&&(i.type="dragleave",(i.target=l).dispatchEvent(i)),r&&(i.type="dragenter",(i.target=r).dispatchEvent(i)),l=r)&&(i.type="dragover",(i.target=l).dispatchEvent(i)),t.label=2;case 2:return[2]}})})}),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",f.dispatchEvent(t),a=!1),i.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var n=this,r=t.renderingService,d=t.renderingContext.root.ownerDocument,i=d.defaultView;r.hooks.init.tap(Qc.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(Qc.tag,function(){i.removeEventListener("pointerdown",e)})},Qc.tag="Dragndrop";var Jc=Qc;function Qc(t){this.dragndropPluginOptions=t}t(nu,tu=W),nu.prototype.init=function(){this.addRenderingPlugin(new Jc(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},nu.prototype.destroy=function(){this.removeAllRenderingPlugins()},nu.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var tu,eu=nu;function nu(t){void 0===t&&(t={});var e=tu.call(this)||this;return e.options=t,e.name="dragndrop",e}iu.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},iu.prototype.once=function(t,e){return this.on(t,e,!0)},iu.prototype.emit=function(a){for(var o=this,s=[],t=1;t<arguments.length;t++)s[t-1]=arguments[t];function e(t){for(var e,n,r=t.length,i=0;i<r;i++)t[i]&&(n=(e=t[i]).callback,e.once&&(t.splice(i,1),0===t.length&&delete o._events[a],r--,i--),n.apply(o,s))}var n=this._events[a]||[],r=this._events["*"]||[];e(n),e(r)},iu.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},iu.prototype.getEvents=function(){return this._events};var ru=iu;function iu(){this._events={}}const au=()=>[["cartesian"]],ou=(au.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),su=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=ou(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},lu=(su.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),cu=(lu.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),uu=(cu.props={transform:!0},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...cu(),...su({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),hu=(uu.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),fu=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=hu(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...su({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},du=(fu.props={},()=>[["parallel",0,1,0,1]]),pu=(du.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),gu=(pu.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...du(),...su({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),yu=(gu.props={},({value:e})=>t=>t.map(()=>e)),mu=(yu.props={},({value:e})=>t=>t.map(e)),vu=(mu.props={},({value:e})=>t=>t.map(t=>t[e])),bu=(vu.props={},({value:t})=>()=>t);function xu(t,e){return t.parent===e.parent?1:2}function wu(t,e){return t+e.x}function Mu(t,e){return Math.max(t,e.y)}function Ou(){var s=xu,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(wu,0)/e.length,t.y=1+n.reduce(Mu,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function ku(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function Eu(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=_u)):void 0===e&&(e=Su);for(var n,r,i,a,o,t=new Pu(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new Pu(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(Tu)}function Su(t){return t.children}function _u(t){return Array.isArray(t)?t[1]:null}function Au(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Tu(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function Pu(t){this.data=t,this.depth=this.height=0,this.parent=null}function Cu(t){return null==t?null:Lu(t)}function Lu(t){if("function"!=typeof t)throw new Error;return t}function Nu(){return 0}function ju(t){return function(){return t}}bu.props={},Pu.prototype=Eu.prototype={constructor:Pu,count:function(){return this.eachAfter(ku)},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,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);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(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},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 e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return Eu(this).eachBefore(Au)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const Ru=4294967296;function Iu(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&Du(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return zu(t[0],t[1]);case 3:return Wu(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Fu(e,t))return[e];for(n=0;n<t.length;++n)if(Bu(e,t[n])&&Fu(zu(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Bu(zu(t[n],t[r]),e)&&Bu(zu(t[n],e),t[r])&&Bu(zu(t[r],e),t[n])&&Fu(Wu(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function Bu(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function Du(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Fu(t,e){for(var n=0;n<e.length;++n)if(!Du(t,e[n]))return;return 1}function zu(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function Wu(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,h=i-o,f=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function Gu(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function Hu(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Vu(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function Yu(t){this._=t,this.next=null,this.previous=null}function qu(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,h,f,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;Gu(r,d,i=t[2]),d=new Yu(d),r=new Yu(r),i=new Yu(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){Gu(d._,r._,i=t[l]),i=new Yu(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(Hu(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(Hu(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=Vu(d);(i=i.next)!==r;)(s=Vu(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=Iu(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Xu(t){return Math.sqrt(t.value)}function Uu(){var n=null,r=1,i=1,a=Nu;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Ru)/Ru}();return t.x=r/2,t.y=i/2,n?t.eachBefore($u(n)).eachAfter(Ku(a,.5,e)).eachBefore(Zu(1)):t.eachBefore($u(Xu)).eachAfter(Ku(Nu,1,e)).eachAfter(Ku(a,t.r/Math.min(r,i),e)).eachBefore(Zu(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=Cu(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:ju(+t),e):a},e}function $u(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Ku(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=qu(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function Zu(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function Ju(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 Qu(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}var th={depth:-1},eh={},nh={};function rh(t){return t.id}function ih(t){return t.parentId}function ah(){var y,m=rh,v=ih;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=m,h=v,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=sh(t,e-1)&&!sh(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(oh);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(oh(r)),c.push(nh));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new Pu(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?eh:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===eh)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=y){for(;i.data===nh&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===nh;--t)o.data=null}if(i.parent=th,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(Tu),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=Cu(t),e):m},e.parentId=function(t){return arguments.length?(v=Cu(t),e):v},e.path=function(t){return arguments.length?(y=Cu(t),e):y},e}function oh(t){let e=t.length;if(e<2)return"";for(;1<--e&&!sh(t,e););return t.slice(0,e)}function sh(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function lh(t,e){return t.parent===e.parent?1:2}function ch(t){var e=t.children;return e?e[0]:t.t}function uh(t){var e=t.children;return e?e[e.length-1]:t.t}function hh(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function fh(){var f=lh,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new hh(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new hh(r[i],i)),n.parent=e;return(t.parent=new hh(null,0)).children=[t],t}(t);return s.eachAfter(h),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:f(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function h(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,h=s.m;o=uh(o),i=ch(i),o&&i;)s=ch(s),(a=uh(a)).a=t,0<(r=o.z+u-i.z-l+f(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,h+=s.m,c+=a.m;o&&!uh(a)&&(a.t=o,a.m+=u-c),i&&!ch(s)&&(s.t=i,s.m+=l-h,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(f=t,e):f},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function dh(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}hh.prototype=Object.create(Pu.prototype);var ph=(1+Math.sqrt(5))/2;function gh(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,m=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){for(l=i-n,c=a-r;!(u=v[x++].value)&&x<w;);for(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=v[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}m.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?Qu(o,n,r,i,M?r+=c*u/M:a):dh(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var yh=function e(a){function t(t,e,n,r,i){gh(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ph);function mh(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function vh(t,e,n,r,i){(1&t.depth?dh:Qu)(t,e,n,r,i)}var bh=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?Qu(o,e,n,r,f?n+=(i-n)*o.value/f:i):dh(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=gh(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ph);function xh(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{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 wh(t={}){return[...xh(t),{name:"title",scale:"identity"}]}function Mh(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function Oh(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function kh(t={}){return xh(t)}function Eh(){return[{type:"maybeKey"}]}function Sh(t,e){return t.getBandWidth(t.invert(e))}function _h(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:h=r,bandOffsetY:f=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?Sh(l,a[e]):0;var r=p?Sh(c,o[e]):0,e=g&&s?(Sh(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function Ah(t){return parseFloat(t)/100}function Th(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?Ah(e)*o:+e,"string"==typeof t?Ah(t)*s:+t]]})]}function Ph(e){return"function"==typeof e?e:t=>t[e]}function Ch(t,e){return Array.from(t,Ph(e))}function Lh(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=Ch(t,e),o=Ch(t,n),s=Ch(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}function Nh(t,e){return t.getBandWidth(t.invert(e))}const jh=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=Nh(c,a[t]),n=e*(u?Nh(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};jh.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Eh(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Oh()],interaction:{shareTooltip:!0}};const Rh=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};function Ih(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function Bh(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=Ih,o=(t,e)=>Ih(n(t),e),(t,e)=>n(t)-e):(a=n===Ih||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:Dh,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function Dh(){return 0}function Fh(t){return null===t?NaN:+t}Rh.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeZeroY1"}],postInference:[...Oh()],interaction:{shareTooltip:!0}};wo=Bh(Ih);const zh=wo.right,Wh=wo.left,Gh=Bh(Fh).center;function Hh(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function Vh(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function Yh(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class qh{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class Xh extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Uh(this,t))}has(t){return super.has(Uh(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function Uh({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function $h(t){return t}function Kh(t,...e){return tf(t,$h,$h,e)}function Zh(t,...e){return tf(t,Array.from,$h,e)}function Jh(t,e,...n){return tf(t,$h,e,n)}function Qh(t,e,...n){return tf(t,Array.from,e,n)}function tf(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Xh,i=f[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function ef(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=rf(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>rf(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(nf(n))}function nf(r=Ih){if(r===Ih)return rf;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function rf(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var af=Array.prototype.slice;function of(t){return()=>t}const sf=Math.sqrt(50),lf=Math.sqrt(10),cf=Math.sqrt(2);function uf(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=sf?10:r>=lf?5:r>=cf?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/s<t&&++a,o/s>e&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*s<t&&++a,o*s>e&&--o),o<a&&.5<=n&&n<2?uf(t,e,2*n):[a,o,s]}function hf(t,e,n){return uf(t=+t,e=+e,n=+n)[2]}function ff(t){return Math.max(1,Math.ceil(Math.log(Hh(t))/Math.LN2)+1)}function df(){var m=$h,v=Yh,b=ff;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=m(t[a],a,t);var o=v(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(v===Yh&&([s,l]=function(t,e,n){let r;for(;;){var i=hf(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(s,l,u)),(c=function(t,e,n){if(!(0<(n=+n)))return[];if((t=+t)===(e=+e))return[t];var r=e<t,[i,a,o]=r?uf(e,t,n):uf(t,e,n);if(!(i<=a))return[];var s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(s,l,u))[0]<=s&&(n=hf(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===Yh){const n=hf(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[zh(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:of(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:of([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:of(Array.isArray(t)?af.call(t):t),e):b},e}function pf(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function gf(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function yf(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function mf(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function vf(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?rf:nf(o);i<a;){600<a-i&&(s=a-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),u=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),vf(n,r,Math.max(i,Math.floor(r-l*c/s+u)),Math.min(a,Math.floor(r+(s-l)*c/s+u)),o));var s,l,c,u,h=n[r];let t=i,e=a;for(bf(n,i,r),0<o(n[a],h)&&bf(n,i,a);t<e;){for(bf(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?bf(n,i,e):bf(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function bf(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function xf(t,e,n){var r;if((n=(t=Float64Array.from(function*(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?yf(t):1<=e?pf(t):(n=(n-1)*e,(r=pf(vf(t,e=Math.floor(n)).subarray(0,e+1)))+(yf(t.subarray(e+1))-r)*(n-e))}function wf(n,t,r=Fh){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>Fh(r(n[e],e,n))),t<=0?mf(i):1<=t?gf(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,vf(e,t=Math.floor(a*t),0,a,(t,e)=>rf(i[t],i[e])),0<=(t=function(e,n){let r,i=!1;if(1===n.length){let t;for(const o of e){var a=n(o);(i?0<Ih(a,t):0===Ih(a,a))&&(r=o,t=a,i=!0)}}else for(const t of e)(i?0<n(t,r):0===n(t,t))&&(r=t,i=!0);return r}(e.subarray(0,t+1),t=>i[t]))?t:-1)}function Mf(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function Of(t,e){return xf(t,.5,e)}function kf(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Ef(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function Sf(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function _f(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function Af(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function Tf(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function Pf(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function Cf(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function Lf(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function Nf(t){return Pf(t)||Af(t)}function jf(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function Rf(t,e=!0){var t=t.getOptions()["transformations"],[,t,n]=t.find(t=>"polar"===t[0]);return e?[180*+t/Math.PI,180*+n/Math.PI]:[t,n]}const If=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(Kh(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]).filter(t=>void 0!==t);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},Bf=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},Df=()=>(t,e,n,r)=>{return(Cf(r)?Bf:If)(t,e,n,r)};Df.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Eh(),{type:"maybeGradient"},{type:"maybeSeries"}],postInference:[...Oh(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Ff=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=_h(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/h,r=r/f,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};Ff.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Eh(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...Mh()]};const zf=s=>{var{cartesian:t=!1}=s;return t?Th:(t,e,n,r)=>{const{x:i,y:a}=n,o=_h(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};zf.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Eh(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Mh()]};const Wf=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};Wf.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Eh(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...Mh()]};const Gf=()=>(t,e,n,a)=>{var r;const{x:o,y:s,y1:l,series:i}=n;var{x:n,y:e}=e,t=i?Array.from(Kh(t,t=>i[t]).values()):[t],c=t.map(t=>t[0]).filter(t=>void 0!==t);const u=((null==(r=null==n?void 0:n.getBandWidth)?void 0:r.call(n))||0)/2,h=((null==(r=null==e?void 0:e.getBandWidth)?void 0:r.call(e))||0)/2;return[c,Array.from(t,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i]+u,+s[i]+h]),r[n+t]=a.map([+o[i]+u,+l[i]+h])}return r}),t]};Gf.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Eh(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...Oh()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Hf=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=_h(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};Hf.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...Mh()]};const Vf=s=>{var t=s["cartesian"];return t?Th:(t,e,n,r)=>{const{x:i,y:a}=n,o=_h(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};Vf.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Eh(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Mh()]};const Yf=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};Yf.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh()],postInference:[...Mh()]};const qf=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+h[t],+f[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]},Xf=(qf.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Eh(),{type:"maybeZeroX"}],postInference:[...Oh()],interaction:{shareTooltip:!0}},()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]});Xf.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Eh()],postInference:[...Mh()]};const Uf=()=>(t,e,n,r)=>{const i=n["y"];return[t,Array.from(t,t=>{return[[0,i[t]],[1,i[t]]].map(t=>r.map(t))})]};Uf.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["line"]}),{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeTupleY"}],postInference:[]};const $f=()=>(t,e,n,r)=>{const i=n["x"];return[t,Array.from(t,t=>{return[[i[t],1],[i[t],0]].map(t=>r.map(t))})]};$f.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["line"]}),{name:"x",required:!0}],preInference:[...Eh(),{type:"maybeTupleX"}],postInference:[]};const Kf=(...t)=>Hf(...t);function Zf(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function Jf(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=Zf("x",r,n,e.x),o=Zf("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}Kf.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh()],postInference:[]};const Qf=()=>Jf();Qf.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh()],postInference:[]};const td=()=>Jf({extendY:!0});td.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["range"]}),{name:"x",required:!0}],preInference:[...Eh()],postInference:[]};const ed=()=>Jf({extendX:!0});function nd(t){return t.target.depth}function rd(t,e){return t.sourceLinks.length?t.depth:e-1}function id(t){return function(){return t}}function ad(t,e){return sd(t.source,e.source)||t.index-e.index}function od(t,e){return sd(t.target,e.target)||t.index-e.index}function sd(t,e){return t.y0-e.y0}function ld(t){return t.value}function cd(t){return t.index}function ud(t){return t.nodes}function hd(t){return t.links}function fd(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function dd({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function pd(){let x=0,w=0,M=1,O=1,k=24,E=8,S,_=cd,A=rd,T,P,C,L=ud,N=hd,j=6;function e(e){e={nodes:L(e),links:N(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[_(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=fd(g,n)),"object"!=typeof r&&(r=t.target=fd(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=C)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(C),r.sort(C)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(Sf(y.sourceLinks,ld),Sf(y.targetLinks,ld)):y.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(T){var s,l=Math.max(pf(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(pf(t,t=>t.depth)+1,0),n=(M-x-k)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(A.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+k,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(E,(O-w)/(pf(u,t=>t.length)-1)),u),h=yf(t,t=>(O-w-(t.length-1)*S)/Sf(t,ld));for(const m of t){let e=w;for(const v of m){v.y0=e,v.y1=e+v.value*h,e=v.y1+S;for(const b of v.sourceLinks)b.width=b.value*h}e=(O-e+S)/(m.length+1);for(let t=0;t<m.length;++t){var f=m[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===C)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(od),n.sort(ad)}(m)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(sd),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(sd),o.length&&R(o,i)}}(u,d,p)}return dd(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,O,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+S}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-S}}function I({sourceLinks:t,targetLinks:e}){if(void 0===C){for(const{source:{sourceLinks:t}}of e)t.sort(od);for(const{target:{targetLinks:e}}of t)e.sort(ad)}}return e.update=function(t){return dd(t),t},e.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:id(t),e):_},e.nodeAlign=function(t){return arguments.length?(A="function"==typeof t?t:id(t),e):A},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(k=+t,e):k},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(L="function"==typeof t?t:id(t),e):L},e.links=function(t){return arguments.length?(N="function"==typeof t?t:id(t),e):N},e.linkSort=function(t){return arguments.length?(C=t,e):C},e.size=function(t){return arguments.length?(x=w=0,M=+t[0],O=+t[1],e):[M-x,O-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],O=+t[1][1],e):[[x,w],[M,O]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}ed.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["range"]}),{name:"y",required:!0}],preInference:[...Eh()],postInference:[]};const gd={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},yd={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?yf(t.sourceLinks,nd)-1:0},justify:rd};const md=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},gd,h),l=pd().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?yd[n]||rd:"function"==c?n:rd).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}};function vd(t){return t}function bd(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),vd)}function xd(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function wd(t=""){throw new Error(t)}function Md(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function Od(t){return null!=t&&!Number.isNaN(t)}function st(t,e){return kd(t,e)||{}}function kd(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Ze(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Ed(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function Sd(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function _d(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Ad(t){return null===t||!1===t}function Td(t,e,n={},r=!1){return Ad(t)||Array.isArray(t)&&r?t:(r=st(t,e),ot(n,r))}function Pd(t,e={}){return!Ad(t)&&!Array.isArray(t)&&Cd(t)?ot(e,t):t}function Cd(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function Ld(t,e){return"object"==typeof t?st(t,e):t}md.props={};const Nd={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},jd={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},Rd={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},Id={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},Bd=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,{links:t,nodes:c}=Lh(t,e),u=st(e,"node"),e=st(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=md(Object.assign(Object.assign(Object.assign({},Nd),{nodeId:Ph(h)}),i))({links:t,nodes:c});const d=st(r,"label"),{text:p=h,spacing:g=5}=d,y=at(d,["text","spacing"]),m=Ph(h);c=Td(l,"node",{title:m,items:[{field:"value"}]},!0),h=Td(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},jd,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:st(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},Id),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:Ld(s,"node"),axis:!1}),ot({},Rd,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},st(r,"link")),tooltip:h,animate:Ld(s,"link")})]},Dd=(Bd.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);function Fd(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:mh,treemapDice:Qu,treemapSlice:dh,treemapSliceDice:vh,treemapSquarify:yh,treemapResquarify:bh};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?ah().path(p):ah():Eu)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(Ju),t}function y(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:Ph(r)(t)).sort(e.sort):p.count(),o=yh,i=!1,s=a=1,l=[0],d=f=h=u=c=Nu,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=Lu(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:ju(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:ju(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:ju(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:ju(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:ju(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}Dd.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...Eh()],postInference:[]};const zd={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},Wd={title:t=>t.data.name,items:[{field:"value"}]},Gd=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a,style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),r=Fd(r,ot({},(r=e,u=n,{tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[r,u],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}),s),i),u=st(o,"label");return ot({},{type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,e],range:[0,1]},y:{domain:[0,n],range:[0,1]}},style:{stroke:"#fff"}},Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},zd),u),...l]},t),{tooltip:Pd(c,Wd),axis:!1}))},Hd=(Gd.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),Vd={title:t=>t.data.name,items:[{field:"value"}]},Yd=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a={},style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,e]},y:{domain:[0,n]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:i.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:i.color?void 0:t=>0===t.height?"":"#000"}},r=((t,e,n)=>{const r=n["value"];n=(De(t)?ah().path(e.path):Eu)(t);return r?n.sum(t=>Ph(r)(t)).sort(e.sort):n.count(),Uu().size(e.size).padding(e.padding)(n),n.descendants()})(r,ot({},{size:[e,n],padding:0,sort:(t,e)=>e.value-t.value},s),ot({},u.encode,i)),e=st(o,"label");return ot({},u,Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},Hd),e),...l]},t),{tooltip:Pd(c,Vd),axis:!1}))};function qd(t,e){return yf(t,t=>e[t])}function Xd(t,e){return pf(t,t=>e[t])}function Ud(t,e){const n=2.5*$d(t,e)-1.5*Zd(t,e);return yf(t,t=>e[t]>=n?e[t]:NaN)}function $d(t,e){return xf(t,.25,t=>e[t])}function Kd(t,e){return xf(t,.5,t=>e[t])}function Zd(t,e){return xf(t,.75,t=>e[t])}function Jd(t,e){const n=2.5*Zd(t,e)-1.5*$d(t,e);return pf(t,t=>e[t]<=n?e[t]:NaN)}function Qd(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Kh(t,t=>a[+t]).values()).flatMap(t=>{const e=Ud(t,i),n=Jd(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}Yd.props={};const tp=t=>{var e,{data:n,encode:r,style:i={},tooltip:a={},animate:o}=t,t=at(t,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=i,i=at(i,["point"]),l=r["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:$d,y2:Kd,y3:Zd},u=Td(a,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),a=Td(a,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=st(i,"box"),e=st(i,"point"),[Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:Ud},c),{y4:Jd})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:Ld(o,"box")},t),{type:"point",data:n,transform:[{type:Qd}],encode:r,style:Object.assign({},e),tooltip:a,animate:Ld(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:qd},c),{y4:Xd})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},ep=(tp.props={},s=>{var t=s["cartesian"];return t?Th:(t,e,n,r)=>{const{x:i,y:a}=n,o=_h(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function np(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,!(d=(i=d)[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function rp(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ip(t){return t[0]}function ap(t){return t[1]}function op(t,e,n){e=new sp(null==e?ip:e,null==n?ap:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function sp(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 lp(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}ep.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};So=op.prototype=sp.prototype;function cp(t){return function(){return t}}function up(t){return 1e-6*(t()-.5)}function hp(t){return t.index}function fp(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function dp(c){var u,h,a,o,f,d,s=hp,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=cp(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||up(d),o=i.y+i.vy-r.y-r.vy||up(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=fp(r,t.source)),"object"!=typeof t.target&&(t.target=fp(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)h[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:cp(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:cp(+t),g(),e):r},e}So.copy=function(){var t,e,n=new sp(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)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]=lp(e));else n._root=lp(r);return n},So.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return np(this.cover(e,n),e,n,t)},So.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)np(this,i[u],a[u],t[u]);return this},So.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){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;t<n||i<=t||e<r||a<=e;)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)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},So.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},So.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]]},So.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new rp(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new rp(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new rp(y[2],s,c,a,i),new rp(y[1],a,l,o,c),new rp(y[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},So.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},So.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},So.root=function(){return this._root},So.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},So.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new rp(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new rp(e,o,s,i,a)),(e=c[2])&&l.push(new rp(e,n,s,o,a)),(e=c[1])&&l.push(new rp(e,o,r,i,s)),e=c[0])&&l.push(new rp(e,n,r,o,s));return this},So.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new rp(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new rp(i,a,o,c,u)),(i=h[1])&&n.push(new rp(i,c,o,s,u)),(i=h[2])&&n.push(new rp(i,a,u,c,l)),i=h[3])&&n.push(new rp(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},So.x=function(t){return arguments.length?(this._x=t,this):this._x},So.y=function(t){return arguments.length?(this._y=t,this):this._y};var pp={value:()=>{}};function gp(){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 yp(r)}function yp(t){this._=t}function mp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=pp,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}yp.prototype=gp.prototype={constructor:yp,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(0<=n&&(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]=mp(i[n],t.name,e);else if(null==e)for(n in i)i[n]=mp(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new yp(e)},call:function(t,e){if(0<(n=arguments.length-2))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 vp,bp,xp=0,wp=0,Mp=0,Op=1e3,kp=0,Ep=0,Sp=0,_p="object"==typeof performance&&performance.now?performance:Date,Ap="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Tp(){return Ep||(Ap(Pp),Ep=_p.now()+Sp)}function Pp(){Ep=0}function Cp(){this._call=this._time=this._next=null}function Lp(t,e,n){var r=new Cp;return r.restart(t,e,n),r}function Np(){Ep=(kp=_p.now())+Sp,xp=wp=0;try{Tp(),++xp;for(var t,e=vp;e;)0<=(t=Ep-e._time)&&e._call.call(void 0,t),e=e._next;--xp}finally{for(var n,r,i=vp,a=1/(xp=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:vp=r);bp=n,Rp(a),Ep=0}}function jp(){var t=_p.now(),e=t-kp;Op<e&&(Sp-=e,kp=t)}function Rp(t){xp||(wp=wp&&clearTimeout(wp),24<t-Ep?(t<1/0&&(wp=setTimeout(Np,t-_p.now()-Sp)),Mp=Mp&&clearInterval(Mp)):(Mp||(kp=_p.now(),Mp=setInterval(jp,Op)),xp=1,Ap(Np)))}Cp.prototype=Lp.prototype={constructor:Cp,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Tp():+n)+(null==e?0:+e),this._next||bp===this||(bp?bp._next=this:vp=this,bp=this),this._call=t,this._time=n,Rp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rp())}};const Ip=4294967296;function Bp(t){return t.x}function Dp(t){return t.y}var Fp=10,zp=Math.PI*(3-Math.sqrt(5));function Wp(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=Lp(i),n=gp("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Ip)/Ip}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=Fp*Math.sqrt(.5+r),e=r*zp,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}const Gp={joint:!0},Hp={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},Vp={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},Yp={text:""};function qp(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=cp(-30),d=(f=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:cp(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=op(i,Bp,Dp).visitAfter(D);for(u=t,e=0;e<n;++e)l=i[e],r.visit(F)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function D(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=h[e.data.index],e=e.next;);t.value=o}function F(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=up(c))*i),0===a&&(s+=(a=up(c))*a),s<f&&(s=Math.sqrt(f*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=up(c))*i),0===a&&(s+=(a=up(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,m,v,b,x,w,M,O,k,E,S,_,A,T,n=dp(a).id(Ph(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),Wp(t).force("link",n).force("charge",I));function C(t){for(var e,n=0,r=m.length;n<r;++n)(e=m[n]).vy+=(b[n]-e.y)*v[n]*t}function L(){if(m){var t,e=m.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+y(m[t],t,m))?0:+x(m[t],t,m)}}function N(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(k[n]-e.x)*O[n]*t}function j(){if(M){var t,e=M.length;for(O=new Array(e),k=new Array(e),t=0;t<e;++t)O[t]=isNaN(k[t]=+w(M[t],t,M))?0:+E(M[t],t,M)}}function R(){for(var t,e=A.length,n=0,r=0,i=0;i<e;++i)n+=(t=A[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-_)*T,i=0;i<e;++i)(t=A[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==_&&(_=0),R.initialize=function(t){A=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(_=+t,R):_},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=cp(.1),"function"!=typeof w&&(w=cp(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:cp(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:cp(+t),j(),N):w},N)).force("y",(x=cp(.1),"function"!=typeof y&&(y=cp(null==y?0:+y)),C.initialize=function(t){m=t,L()},C.strength=function(t){return arguments.length?(x="function"==typeof t?t:cp(+t),L(),C):x},C.y=function(t){return arguments.length?(y="function"==typeof t?t:cp(+t),L(),C):y},C)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const Xp=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,h=at(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},h),f=st(e,"node"),d=st(e,"link"),{links:t,nodes:p}=Lh(t,e),{nodesData:t,linksData:p}=qp({links:t,nodes:p},ot({},Gp,i),e),i=Td(l,"link",{items:[t=>({name:"source",value:Ph(u)(t.source)}),t=>({name:"target",value:Ph(u)(t.target)})]}),e=Td(l,"node",{items:[t=>({name:"key",value:Ph(c)(t)})]},!0);return[ot({},Hp,{data:p,encode:d,labels:o,style:st(r,"link"),tooltip:i,animate:Ld(s,"link")}),ot({},Vp,{data:t,encode:Object.assign({},f),scale:n,style:st(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},Yp),st(r,"label")),...a],animate:Ld(s,"link")})]},Up=(Xp.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=Eu(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),$p=t=>Up(Ou)(t),Kp=($p.props={},t=>Up(fh)(t)),Zp=(Kp.props={},{sortBy:(t,e)=>e.value-t.value}),Jp={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},Qp={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},t0={text:"",fontSize:10},e0=t=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,c=null==e?void 0:e.value,{nodes:i,edges:c}=Kp(Object.assign(Object.assign(Object.assign({},Zp),i),{field:c}))(t),t=Td(l,"node",{title:"name",items:["value"]},!0),l=Td(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},Qp,{data:c,encode:st(e,"link"),scale:st(n,"link"),labels:o,style:Object.assign({stroke:"#999"},st(r,"link")),tooltip:l,animate:Ld(s,"link")}),ot({},Jp,{data:i,scale:st(n,"node"),encode:st(e,"node"),labels:[Object.assign(Object.assign({},t0),st(r,"label")),...a],style:Object.assign({},st(r,"node")),tooltip:t,animate:Ld(s,"node")})]};e0.props={};var n0={},r0={},i0=34,a0=10,o0=13;function s0(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function l0(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function c0(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function u0(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+c0(-e,6):9999<e?"+"+c0(e,6):c0(e,4))+"-"+c0(t.getUTCMonth()+1,2)+"-"+c0(t.getUTCDate(),2)+(a?"T"+c0(n,2)+":"+c0(r,2)+":"+c0(i,2)+"."+c0(a,3)+"Z":i?"T"+c0(n,2)+":"+c0(r,2)+":"+c0(i,2)+"Z":r||n?"T"+c0(n,2)+":"+c0(r,2)+"Z":"")}function h0(r){var e=new RegExp('["'+r+"\n\r]"),h=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return r0;if(l)return l=!1,n0;var t,e,n=a;if(r.charCodeAt(n)===i0){for(;a++<i&&r.charCodeAt(a)!==i0||r.charCodeAt(++a)===i0;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===a0?l=!0:e===o0&&(l=!0,r.charCodeAt(a)===a0)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===a0)l=!0;else if(e===o0)l=!0,r.charCodeAt(a)===a0&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===a0&&--i,r.charCodeAt(i-1)===o0&&--i;(e=c())!==r0;){for(var u=[];e!==n0&&e!==r0;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?u0(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=s0(n=t),function(t,e){return r(i(t),e,n)}):s0(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?l0(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?l0(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function f0(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;d0&&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 d0=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),p0=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>$(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),h0(i).parse(t,a?f0:vd);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};p0.props={};const g0=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};g0.props={};const y0=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},m0=(y0.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});m0.props={};const v0=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};v0.props={};const b0=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};b0.props={};const x0=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},w0=(x0.props={},t=>{const e=t["value"];return()=>e}),M0=(w0.props={},t=>{const{callback:e=vd}=t;return t=>e(t)}),O0=(M0.props={},t=>{const{callback:e=vd}=t;return t=>Array.isArray(t)?t.map(e):t});O0.props={};var k0=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const E0={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function S0(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:m,sortBy:v}=Object.assign(Object.assign({},E0),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=y(t),t.targetWeight=m(t)});const i=Kh(r,t=>t.source),a=Kh(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=Sf(e,t=>t.sourceWeight)+Sf(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:k0[v])&&r.sort(n),!(n=(r=e).length))throw wd("Invalid nodes: it's empty!");if(h){const o=f/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-f),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!h)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=Kh(e,t=>t.source),l=Kh(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const _0=e=>t=>S0(e)(t),A0=(_0.props={},Math.PI/180),T0=64,P0=2048;function C0(t){return t.text}function L0(){return"serif"}function N0(){return"normal"}function j0(t){return t.value}function R0(){return 90*~~(2*Math.random())}function I0(){return 1}function B0(){}function D0(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(T0<<5)/c,P0/c);let i=0,a=0,n=0;var u,h,f,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*A0),f=Math.cos(o.rotate*A0),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=T0<<5&&(i=0,a+=n,n=0),a+e>=P0)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*A0),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(T0<<5)/c,P0/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,m=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*m;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<y;t++){var v=m*e+(t>>5),b=p[(a+e)*(T0<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*m)}}}function F0(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function z0(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function W0(){return document.createElement("canvas")}function G0(t){return"function"==typeof t?t:function(){return t}}const H0={archimedean:F0,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function V0(){let b=[256,256],r=C0,i=L0,p=j0,g=N0,y=R0,m=I0,x=F0,w=Math.random,v=B0,M=[],O=null,k=1/0;const E=N0,S=W0,_={};return _.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(T0<<5)/e,t.height=P0/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=_.board||z0((b[0]>>5)*b[1]),c=M.length,u=[],h=M.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=E.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=m.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=_.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<k&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,D0(s,i,h,f),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(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}(t,e))){var f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,m=32-y,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<v;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<m|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:_,word:i}),u.push(i),d?_.hasImage||(t=d,e=i,n=void 0,n=t[0],t=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>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}_._tags=u,_._bounds=d,f>=c&&(_.stop(),v.call(null,"end",{cloud:_,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),_},_.stop=function(){return O&&(clearInterval(O),O=null),_},_.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=z0((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}_.board=a,_.hasImage=!0}},_.timeInterval=function(t){k=null==t?1/0:t},_.words=function(t){M=t},_.size=function(t=[]){b=[+t[0],+t[1]]},_.text=function(t){r=G0(t)},_.font=function(t){i=G0(t)},_.fontWeight=function(t){g=G0(t)},_.rotate=function(t){y=G0(t)},_.spiral=function(t){x=H0[t]||t},_.fontSize=function(t){p=G0(t)},_.padding=function(t){m=G0(t)},_.random=function(t){w=G0(t)},_.on=function(t){v=G0(t)},_}const Y0={size:[500,500],fontSize:[14,28]};function q0(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const X0=f=>h=>$(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},Y0,f),e=V0(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return $(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=h.map(t=>t.value),n=t,t=[yf(e),pf(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",q0,e.createMask),e.words([...h]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=at(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function U0(e){return"string"==typeof e?t=>t[e]:e}X0.props={};const $0=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=U0(r),l=U0(t),c=Jh(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},K0=($0.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});K0.props={};var Z0,J0,Q0,tg,Fo={exports:{}},ni={exports:{}};function eg(t){return 1-Math.abs(t)}Z0=(a=ni).exports,a.exports.isNumber=function(t){return"number"==typeof t},a.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},a.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},a.exports.findMinMulti=function(t){for(var e=Z0.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,Z0.findMin(t[n]));return e},a.exports.findMaxMulti=function(t){for(var e=Z0.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,Z0.findMax(t[n]));return e},a.exports.inside=function(t,e,n){return t<=n&&n<=e},Bs=Fo,J0=Math.log(2),Q0=Bs.exports,tg=ni.exports,Bs.exports.getUnifiedMinMax=function(t,e){return Q0.getUnifiedMinMaxMulti([t],e)},Bs.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=tg.isNumber((e=e||{}).width)?e.width:2,a=tg.isNumber(e.size)?e.size:50,o=tg.isNumber(e.min)?e.min:(n=!0,tg.findMinMulti(t)),e=tg.isNumber(e.max)?e.max:(r=!0,tg.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},Bs.exports.create=function(t,e){if(!t||0===t.length)return[];var n=tg.isNumber((e=e||{}).size)?e.size:50,o=tg.isNumber(e.width)?e.width:2,e=Q0.getUnifiedMinMax(t,{size:n,width:o,min:e.min,max:e.max}),s=e.min,e=e.max-s,l=e/(n-1);if(0==e)return[{x:s,y:1}];for(var c=[],r=0;r<n;r++)c.push({x:s+r*l,y:0});var u=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(eg,o),h=u[o],f=u[o-1]-u[o-2],d=0,i=(t.forEach(function(t){var e,n,r,i,a,t=Math.floor((t-s)/l);t+o<0||c.length<=t-o||(r=Math.max(t-o,0),e=t,n=Math.min(t+o,c.length-1),i=u[-o-1+(r=r-(t-o))]||0,a=u[-o-1+(t+o-n)]||0,i=h/(h-i-a),0<r&&(d+=i*(r-1)*f),a=Math.max(0,t-o+1),tg.inside(0,c.length-1,a)&&(c[a].y+=i*f),tg.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),tg.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*f))}),d),a=0,p=0;return c.forEach(function(t){a+=t.y,i+=a,t.y=i,p+=i}),0<p&&c.forEach(function(t){t.y/=p}),c},Bs.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},Bs.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&!(e<=(n+=t[r=i].y));i++);return t[r].x}},Bs.exports.getPerplexity=function(t){var n;if(t&&0!==t.length)return n=0,t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/J0,Math.pow(2,n)};var ng=Fo.exports;const rg=t=>{const{field:r,groupBy:n,as:e=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=e;return t=>{return Array.from(Kh(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=ng.create(t.map(t=>t[r]),{min:i,max:a,size:o,width:s}),n=e.map(t=>t.x),e=e.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:n,[c]:e})})}};rg.props={};var ig={exports:{}};function ag(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function og(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function sg(t){return Math.sqrt(og(t,t))}function lg(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function cg(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function ug(i,a,o,s,l,c,u){var h=o.fx,f=og(o.fxprime,a),d=h,t=h,p=f,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,cg(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=og(s.fxprime,a),h+c*l*f<d||n<=d)e=l;else{if(Math.abs(p)<=-u*f)return l;0<=p*(e-t)&&(e=t),t=l,n=d}return 0}l=l||1,c=c||1e-6,u=u||.1;for(var r=0;r<10;++r){if(cg(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=og(s.fxprime,a),h+c*l*f<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*f)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(Oo=Oo=ig.exports).bisect=function(t,e,n,r){var i=(r=r||{}).maxIterations||100,a=r.tolerance||1e-10,o=t(e),r=t(n),s=n-e;if(0<o*r)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===r)return n;for(var l=0;l<i;++l){var c=e+(s/=2),u=t(c);if(0<=u*o&&(e=c),Math.abs(s)<a||0===u)return c}return e+s},Oo.nelderMead=function(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,a=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,s=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,u=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5,d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e);for(var g=p[0].id=0;g<d;++g){var y=e.slice();y[g]=y[g]?y[g]*a:o,p[g+1]=y,p[g+1].fx=t(y),p[g+1].id=g+1}function m(t){for(var e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}for(var v=function(t,e){return t.fx-e.fx},b=e.slice(),x=e.slice(),w=e.slice(),M=e.slice(),O=0;O<i;++O){for(p.sort(v),n.history&&((E=p.map(function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e})).sort(function(t,e){return t.id-e.id}),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:E})),g=r=0;g<d;++g)r=Math.max(r,Math.abs(p[0][g]-p[1][g]));if(Math.abs(p[0].fx-p[d].fx)<s&&r<l)break;for(g=0;g<d;++g){for(var k=b[g]=0;k<d;++k)b[g]+=p[k][g];b[g]/=d}var E=p[d];if(cg(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)cg(M,1+u,b,-u,E),M.fx=t(M),M.fx<x.fx?m(M):m(x);else if(x.fx>=p[d-1].fx){var S=!1;if(x.fx>E.fx?(cg(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(cg(w,1-h*c,b,h*c,E),w.fx=t(w),w.fx<x.fx?m(w):S=!0),S){if(1<=f)break;for(g=1;g<p.length;++g)cg(p[g],1-f,p[0],f,p[g]),p[g].fx=t(p[g])}}else m(x)}return p.sort(v),{fx:p[0].fx,x:p[0]}},Oo.conjugateGradient=function(t,e,n){var r,i,a={x:e.slice(),fx:0,fxprime:e.slice()},o={x:e.slice(),fx:0,fxprime:e.slice()},s=e.slice(),l=1;i=(n=n||{}).maxIterations||20*e.length,a.fx=t(a.x,a.fxprime),lg(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=ug(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(cg(s,1,o.fxprime,-1,a.fxprime),u=og(a.fxprime,a.fxprime),u=Math.max(0,og(s,o.fxprime)/u),cg(r,u,r,-1,o.fxprime),u=a,a=o,o=u):lg(r,a.fxprime,-1),sg(a.fxprime)<=1e-5)break}n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l});return a},Oo.gradientDescent=function(t,e,n){for(var r=(n=n||{}).maxIterations||100*e.length,i=n.learnRate||.001,a={x:e.slice(),fx:0,fxprime:e.slice()},o=0;o<r&&(a.fx=t(a.x,a.fxprime),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice()}),cg(a.x,1,a.x,-i,a.fxprime),!(sg(a.fxprime)<=1e-5));++o);return a},Oo.gradientDescentLineSearch=function(t,e,n){n=n||{};var r,i={x:e.slice(),fx:0,fxprime:e.slice()},a={x:e.slice(),fx:0,fxprime:e.slice()},o=n.maxIterations||100*e.length,s=n.learnRate||1,l=e.slice(),c=n.c1||.001,u=n.c2||.1,h=[];{var f;n.history&&(f=t,t=function(t,e){return h.push(t.slice()),f(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(lg(l,i.fxprime,-1),s=ug(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:h,learnRate:s,alpha:s}),h=[]),r=i,i=a,a=r,!(0===s||sg(i.fxprime)<1e-5));++d);return i},Oo.zeros=ag,Oo.zerosM=function(t,e){return ag(t).map(function(){return ag(e)})},Oo.norm2=sg,Oo.weightedSum=cg,Oo.scale=lg;const hg=1e-10;function fg(a,t){var e=function(t){var r=[];for(let n=0;n<t.length;++n)for(let e=n+1;e<t.length;++e){var i=yg(t[n],t[e]);for(let t=0;t<i.length;++t){var a=i[t];a.parentIndex=[n,e],r.push(a)}}return r}(a),n=e.filter(function(t){var e=t,n=a;for(let t=0;t<n.length;++t)if(pg(e,n[t])>n[t].radius+hg)return!1;return!0});let o=0,s=0,l;var c=[];if(1<n.length){var r=function(e){var n={x:0,y:0};for(let t=0;t<e.length;++t)n.x+=e[t].x,n.y+=e[t].y;return n.x/=e.length,n.y/=e.length,n}(n);for(l=0;l<n.length;++l){var u=n[l];u.angle=Math.atan2(u.x-r.x,u.y-r.y)}n.sort(function(t,e){return e.angle-t.angle});let i=n[n.length-1];for(l=0;l<n.length;++l){var h=n[l],f=(s+=(i.x+h.x)*(h.y-i.y),{x:(h.x+i.x)/2,y:(h.y+i.y)/2});let r=null;for(let n=0;n<h.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(h.parentIndex[n])){var d=a[h.parentIndex[n]],p=Math.atan2(h.x-d.x,h.y-d.y),g=Math.atan2(i.x-d.x,i.y-d.y);let t=g-p;t<0&&(t+=2*Math.PI);p=g-t/2;let e=pg(f,{x:d.x+d.radius*Math.sin(p),y:d.y+d.radius*Math.cos(p)});e>2*d.radius&&(e=2*d.radius),(null===r||r.width>e)&&(r={circle:d,width:e,p1:h,p2:i})}null!==r&&(c.push(r),o+=dg(r.circle.radius,r.width),i=h)}}else{let t=a[0];for(l=1;l<a.length;++l)a[l].radius<t.radius&&(t=a[l]);let e=!1;for(l=0;l<a.length;++l)if(pg(a[l],t)>Math.abs(t.radius-a[l].radius)){e=!0;break}e?o=s=0:(o=t.radius*t.radius*Math.PI,c.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-hg,y:t.y+t.radius},width:2*t.radius}))}return s/=2,t&&(t.area=o+s,t.arcArea=o,t.polygonArea=s,t.arcs=c,t.innerPoints=n,t.intersectionPoints=e),o+s}function dg(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function pg(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function gg(t,e,n){var r;return t+e<=n?0:n<=Math.abs(t-e)?Math.PI*Math.min(t,e)*Math.min(t,e):(r=e-(n*n-t*t+e*e)/(2*n),dg(t,t-(n*n-e*e+t*t)/(2*n))+dg(e,r))}function yg(t,e){var n,r,i=pg(t,e),a=t.radius,o=e.radius;return a+o<=i||i<=Math.abs(a-o)?[]:(o=(a*a-o*o+i*i)/(2*i),a=Math.sqrt(a*a-o*o),n=t.x+o*(e.x-t.x)/i,o=t.y+o*(e.y-t.y)/i,[{x:n+(r=-(e.y-t.y)*(a/i)),y:o-(e=-(e.x-t.x)*(a/i))},{x:n-r,y:o+e}])}function mg(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||xg;const i=e.lossFunction||wg,a=n(t=function(t){t=t.slice();var e=[],n={};let r,i,a,o;for(r=0;r<t.length;++r){var s=t[r];1==s.sets.length?e.push(s.sets[0]):2==s.sets.length&&(a=s.sets[0],o=s.sets[1],n[[a,o]]=!0,n[[o,a]]=!0)}for(e.sort((t,e)=>e<t?1:-1),r=0;r<e.length;++r)for(a=e[r],i=r+1;i<e.length;++i)o=e[i],[a,o]in n||t.push({sets:[a,o],size:0});return t}(t),e),r=[],o=[];let s;for(s in a)a.hasOwnProperty(s)&&(r.push(a[s].x),r.push(a[s].y),o.push(s));var l=ig.exports.nelderMead(function(e){var n={};for(let t=0;t<o.length;++t){var r=o[t];n[r]={x:e[2*t],y:e[2*t+1],radius:a[r].radius}}return i(n,t)},r,e).x;for(let t=0;t<o.length;++t)s=o[t],a[s].x=l[2*t],a[s].y=l[2*t+1];return a}const vg=1e-10;function bg(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+vg?Math.abs(e-n):ig.exports.bisect(function(t){return gg(e,n,t)-r},0,e+n)}function xg(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:wg,a={},o={};let s;for(let t=0;t<r.length;++t){var e=r[t];1==e.sets.length&&(s=e.sets[0],a[s]={x:1e10,y:1e10,rowid:Object.keys(a).length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},o[s]=[])}r=r.filter(function(t){return 2==t.sets.length});for(let e=0;e<r.length;++e){var n=r[e];let t=n.hasOwnProperty("weight")?n.weight:1;var l=n.sets[0],c=n.sets[1];n.size+vg>=Math.min(a[l].size,a[c].size)&&(t=0),o[l].push({set:c,size:n.size,weight:t}),o[c].push({set:l,size:n.size,weight:t})}var u=[];for(s in o)if(o.hasOwnProperty(s)){let e=0;for(let t=0;t<o[s].length;++t)e+=o[s][t].size*o[s][t].weight;u.push({set:s,size:e})}function h(t,e){return e.size-t.size}u.sort(h);const f={};function d(t){return t.set in f}function p(t,e){a[e].x=t.x,a[e].y=t.y,f[e]=!0}p({x:0,y:0},u[0].set);for(let t=1;t<u.length;++t){var g=u[t].set,y=o[g].filter(d);if(s=a[g],y.sort(h),0===y.length)throw"ERROR: missing pairwise overlap information";var m=[];for(let e=0;e<y.length;++e){var v=a[y[e].set],b=bg(s.radius,v.radius,y[e].size);m.push({x:v.x+b,y:v.y}),m.push({x:v.x-b,y:v.y}),m.push({y:v.y+b,x:v.x}),m.push({y:v.y-b,x:v.x});for(let t=e+1;t<y.length;++t){var x=a[y[t].set],w=bg(s.radius,x.radius,y[t].size),M=yg({x:v.x,y:v.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)m.push(M[t])}}let e=1e50,n=m[0];for(let t=0;t<m.length;++t){a[g].x=m[t].x,a[g].y=m[t].y;var O=i(a,r);O<e&&(e=O,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||wg;return n=8<=t.length&&r(e=function(t,e){var n=(e=e||{}).restarts||10,r=[],i={};let a;for(a=0;a<t.length;++a){var o=t[a];1==o.sets.length&&(i[o.sets[0]]=r.length,r.push(o))}var s=function(t,a,o){const s=ig.exports.zerosM(a.length,a.length),l=ig.exports.zerosM(a.length,a.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){var e=o[t.sets[0]],n=o[t.sets[1]],r=bg(Math.sqrt(a[e].size/Math.PI),Math.sqrt(a[n].size/Math.PI),t.size);s[e][n]=s[n][e]=r;let i=0;t.size+1e-10>=Math.min(a[e].size,a[n].size)?i=1:t.size<=1e-10&&(i=-1),l[e][n]=l[n][e]=i}),{distances:s,constraints:l}}(t,r,i);let y=s.distances;function l(t,r){{var i=t,a=r,o=y,s=m;let e=0,n;for(n=0;n<a.length;++n)a[n]=0;for(n=0;n<o.length;++n){var l=i[2*n],c=i[2*n+1];for(let t=n+1;t<o.length;++t){var u=i[2*t],h=i[2*t+1],f=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(h-c)*(h-c),g=Math.sqrt(p),p=p-f*f;0<d&&g<=f||d<0&&f<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-h),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(h-c))}}return e}}const m=s.constraints,c=ig.exports.norm2(y.map(ig.exports.norm2))/y.length;y=y.map(function(t){return t.map(function(t){return t/c})});let u,h;for(a=0;a<n;++a){var f=ig.exports.zeros(2*y.length).map(Math.random);h=ig.exports.conjugateGradient(l,f,e),(!u||h.fx<u.fx)&&(u=h)}var d=u.x,p={};for(a=0;a<r.length;++a){var g=r[a];p[g.sets[0]]={x:d[2*a]*c,y:d[2*a+1]*c,radius:Math.sqrt(g.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)ig.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function wg(n,r){let i=0;for(let e=0;e<r.length;++e){var a,o,s=r[e];let t;1!=s.sets.length&&(t=2==s.sets.length?(o=n[s.sets[0]],a=n[s.sets[1]],gg(o.radius,a.radius,pg(o,a))):fg(s.sets.map(function(t){return n[t]})),o=s.hasOwnProperty("weight")?s.weight:1,i+=o*(t-s.size)*(t-s.size))}return i}function Mg(t){function e(e){return{max:Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),min:Math.min.apply(null,t.map(function(t){return t[e]-t.radius}))}}return{xRange:e("x"),yRange:e("y")}}const Og=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:o=0}=t,[s,l]=r;return t=>{t=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[s]:t.sets.join("&")}));t.sort((t,e)=>t.sets.length-e.sets.length);const i=mg(t);let a;return t.map(t=>{const r=t[e];return Object.assign(Object.assign({},t),{[l]:({width:t,height:e})=>{a=a||function(t,e,n,r){var i=[],a=[];for(const g in t)t.hasOwnProperty(g)&&(a.push(g),i.push(t[g]));e-=2*r,n-=2*r;var o=(l=Mg(i)).xRange,s=l.yRange;if(o.max==o.min||s.max==s.min)return console.log("not scaling solution: zero size detected"),t;var l=e/(o.max-o.min),c=n/(s.max-s.min),u=Math.min(c,l),h=(e-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2,d={};for(let t=0;t<i.length;++t){var p=i[t];d[a[t]]={radius:u*p.radius,x:r+h+(p.x-o.min)*u,y:r+f+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(fg(t,e),e.arcs);if(0===n.length)return"M 0 0";if(1==n.length)return t=n[0].circle,e=t.x,r=t.y,t=t.radius,(i=[]).push("M",e-=t,r),i.push("A",t,t,0,1,0,e+2*t,r),i.push("A",t,t,0,1,0,e,r),i.join(" ");var r,i,a=["\nM",n[0].p2.x,n[0].p2.y];for(let t=0;t<n.length;++t){var o=n[t],s=o.circle.radius,l=o.width>s;a.push("\nA",s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return a.join(" ")}(r.map(t=>a[t]));return/[zZ]$/.test(n)||(n+=" Z"),n}})})}};Og.props={};const kg=(l,c)=>$(void 0,void 0,void 0,function*(){var{width:t,height:e}=c,{data:n,encode:r={},scale:i,style:a={},layout:o={}}=l,s=at(l,["data","encode","scale","style","layout"]),n=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]}))}(n,r),o=yield X0(Object.assign(Object.assign({},{size:[t,e]}),o))(n);return ot({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},Object.assign(Object.assign({data:o,encode:r,scale:i,style:a},s),{axis:!1}))});function Eg(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Sg(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function _g(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}kg.props={};const Ag=Math.sqrt(50),Tg=Math.sqrt(10),Pg=Math.sqrt(2);function Cg(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=Ag?10:n>=Tg?5:n>=Pg?2:1)*10**t:-(10**-t)/(n>=Ag?10:n>=Tg?5:n>=Pg?2:1)}function Lg(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=Ag?r*=10:n>=Tg?r*=5:n>=Pg&&(r*=2),e<t?-r:r}const Ng=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=Cg(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=Cg(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=Cg(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},jg=36e5,Rg=864e5,Ig=7*Rg;Rg,Rg;function Bg(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}Ys=Bg(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ao=Bg(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),Po=Bg(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),Ro=Bg(jg,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+jg*e)},t=>t.getHours()),Wo=Bg(Rg,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Rg*e)},t=>t.getDate()-1);const Dg=Bg(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());Ho=Bg(Ig,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ig*e)},t=>{var e=Dg.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Ig)}),Yo=Bg(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const Fg={millisecond:Ys,second:Ao,minute:Po,hour:Ro,day:Wo,week:Ho,month:Dg,year:Yo};Xo=Bg(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ko=Bg(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Jo=Bg(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),ts=Bg(jg,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+jg*e)},t=>t.getUTCHours()),vs=Bg(Rg,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Rg*e)},t=>t.getUTCDate()-1);const zg=Bg(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());Ls=Bg(Ig,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ig*e)},t=>{var e=zg.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Ig)}),Ns=Bg(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const Wg={millisecond:Xo,second:Ko,minute:Jo,hour:ts,day:vs,week:Ls,month:zg,year:Ns};function Gg(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?Wg:Fg;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=_g(i,l,0,c,s);let h;return h=u===c?[a,Lg(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(Lg(t,e,n),1)]}const Hg=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Gg(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function Vg(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Yg(t){return Ug(t,"Function")}function qg(t){return null==t}var Xg={}.toString,Ug=function(t,e){return Xg.call(t)==="[object "+e+"]"},$g=function(t){return Array.isArray?Array.isArray(t):Ug(t,"Array")};var Kg=function(t){if("object"!=typeof(e=t)||null===e||!Ug(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},Zg=function(t){return Ug(t,"Number")},Jg=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Yg(n)&&"prototype"===e||r.push(t)};if(e)if($g(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},Qg=5;function t1(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Qg,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Kg(o)?(Kg(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):$g(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function e1(t){return t}var n1,r1=function(t,e){if(!Vg(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r};function i1(t){return qg(t)?0:(Vg(t)?t:Object.keys(t)).length}function a1(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Yg(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(n1=n1||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),n1.measureText(Ug(t,"String")?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],Jg(e=void 0===e?{}:e)).join("")});const o1=e=>t=>-e(-t),s1=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?o1(t):t},l1=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?o1(n):n},c1=(t,e,n,r)=>{var i=t<0,a=s1(r,i),r=l1(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function u1(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return Zg(t)?Math.round(t):t}):i;this.output=Eg(a,r,e,t)},t.prototype.invert=void 0}}var h1,u={exports:{}},Bo={exports:{}},f1=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},d1=Array.prototype.concat,p1=Array.prototype.slice,g1=Bo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];f1(i)?e=d1.call(e,p1.call(i)):e.push(i)}return e},y1=(g1.wrap=function(t){return function(){return t(g1(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),m1=Bo.exports,v1=Object.hasOwnProperty,b1=Object.create(null);for(h1 in y1)v1.call(y1,h1)&&(b1[y1[h1]]=h1);var x1=u.exports={to:{},get:{}};function w1(t,e,n){return Math.min(Math.max(e,t),n)}function M1(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}x1.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=x1.get.hsl(t),n="hsl";break;case"hwb":e=x1.get.hwb(t),n="hwb";break;default:e=x1.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},x1.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:v1.call(y1,e[1])?((i=y1[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]))}e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=w1(i[n],0,255);return i[3]=w1(i[3],0,1),i},x1.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,w1(parseFloat(t[2]),0,100),w1(parseFloat(t[3]),0,100),w1(isNaN(e)?1:e,0,1)]):null},x1.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,w1(parseFloat(t[2]),0,100),w1(parseFloat(t[3]),0,100),w1(isNaN(e)?1:e,0,1)]):null},x1.to.hex=function(){var t=m1(arguments);return"#"+M1(t[0])+M1(t[1])+M1(t[2])+(t[3]<1?M1(Math.round(255*t[3])):"")},x1.to.rgb=function(){var t=m1(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},x1.to.rgb.percent=function(){var t=m1(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},x1.to.hsl=function(){var t=m1(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},x1.to.hwb=function(){var t=m1(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},x1.to.keyword=function(t){return b1[t.slice(0,3)]};var O1=u.exports;function k1(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function E1(t){var e,n,r,t=O1.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*k1(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*k1(n,r,e),255*k1(n,r,e-1/3),t]):null):null}const S1=(e,n)=>t=>e*(1-t)+n*t,_1=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return S1(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=E1(n),c=E1(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},A1=(t,e)=>{const n=S1(t,e);return t=>Math.round(n(t))};function T1({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function P1(t){return"object"==typeof t?t.valueOf():t}class C1 extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=P1,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(T1({map:this.map,initKey:this.initKey},t))}has(t){return super.has(T1({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class L1{constructor(t){this.options=t1({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=t1({},this.options,t),this.rescale(t)}rescale(t){}}const N1=Symbol("defaultUnknown");function j1(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function R1(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==N1)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function I1(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class B1 extends L1{getDefaultOptions(){return{domain:[],range:[],unknown:N1}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&j1(this.domainIndexMap,this.getDomain(),this.domainKey),R1({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&j1(this.rangeIndexMap,this.getRange(),this.rangeKey),R1({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=I1(e),this.rangeKey=I1(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new B1(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function D1(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new C1(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new C1(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:m}}class F1 extends B1{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:N1,flex:[]}}constructor(t){super(t)}clone(){return new F1(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(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return D1(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const z1=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=Cg(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<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}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};class W1 extends L1{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:z1}}map(t){var[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){var[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){var{tickMethod:t,domain:e,tickCount:n}=this.options,[e,r]=e;return Zg(e)&&Zg(r)?t(e,r,n):[]}clone(){return new W1(this.options)}}function G1(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const H1=[1,5,2,2.5,4,3],V1=100*Number.EPSILON;const Y1=(n,r,t=5,i=!0,a=H1,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var m=a[t],v=(h=m,f=a,d=y,p=void 0,p=i1(f),1-r1(f,h)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){y=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*v+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/y/m;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*m*10**t,M=(k=r,M=w*(e-1),(k-=n)<M?1-((M-k)/2)**2/(.1*k)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var O=Math.floor(r/w)*y-(e-1)*y,k=Math.ceil(n/w)*y;if(O<=k){var E=k-O;for(let t=0;t<=E;t+=1){var S=(O+t)*(w/y),_=S+w*(e-1),A=w,T=function(t,e,n,r,i,a){var o=i1(e),e=r1(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<V1||a-t<V1)&&r<=0&&0<=i?1:s)}(m,a,y,S,_,A),P=1-.5*((r-_)**2+(n-S)**2)/(.1*(r-n))**2,C=(l=e,C=n,l=(l-1)/(_-(L=S)),c=((c=s)-1)/(Math.max(_,r)-Math.min(C,L)),2-Math.max(l/c,c/l)),L=o[0]*T+o[1]*P+o[2]*C+ +o[3];g.score<L&&(!i||S<=n&&r<=_)&&(g.lmin=S,g.lmax=_,g.lstep=A,g.score=L)}}t+=1}e+=1}}y+=1}var t=G1(g.lmax),e=G1(g.lmin),N=G1(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=G1(e);for(let t=1;t<j;t+=1)R[t]=G1(R[t-1]+N);return R};class q1 extends L1{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Y1}}map(t){return a1(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new q1(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Zg(t)&&Zg(r)?n(t,r,e):[]}}const X1=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return Eg(o=t<r?(a=Sg(t,r),n(e,i)):(a=Sg(r,t),n(i,e)),a)},U1=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=Sg(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=_g(r,t,1,i)-1,n=a[e];return Eg(o[e],n)(t)}},$1=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?U1:X1)(t,e,r?A1:n)};class K1 extends L1{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:S1,tickCount:5}}map(t){return a1(t)?this.output(t):this.options.unknown}invert(t){return a1(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ng}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return e1}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=$1(n.map(t),r,a,i);this.output=Eg(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=$1(i,r.map(t),S1);this.input=Eg(e,n,i)}}class Z1 extends K1{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:_1,tickMethod:z1,tickCount:5}}chooseTransforms(){return[e1,e1]}clone(){return new Z1(this.options)}}class J1 extends F1{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:N1,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new J1(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Q1=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ty extends K1{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:_1,tickMethod:z1,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[e1,e1]:(t=.5===r?Q1:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new ty(this.options)}}class ey extends ty{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:_1,tickMethod:z1,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ey(this.options)}}class ny extends L1{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return a1(t)?(t=_g(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new ny(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ry=(t,e,n,r=10)=>{var i=t<0,a=l1(r,i),o=s1(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=z1(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=z1(u,h,t).map(a)}return s?f.reverse():f};class iy extends K1{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:_1,tickMethod:ry,tickCount:5}}chooseNice(){return c1}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[s1(t,e),l1(t,e)]}clone(){return new iy(this.options)}}class ay extends ny{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Y1}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=Ng(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new ay(this.options)}}function oy(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class sy extends ny{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Y1}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=oy(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new sy(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ly=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,cy=/\[([^]*?)\]/gm;function uy(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function hy(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a,o=i[r];for(a in o)t[a]=o[a]}return t}function fy(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var dy,Fs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=["January","February","March","April","May","June","July","August","September","October","November","December"],gl=uy(r,3),py=hy({},{dayNamesShort:uy(Fs,3),dayNames:Fs,monthNamesShort:gl,monthNames:r,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),gy={D:function(t){return String(t.getDate())},DD:function(t){return fy(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return fy(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return fy(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return fy(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return fy(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return fy(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return fy(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return fy(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return fy(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return fy(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return fy(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return(t.getHours()<12?e.amPm[0]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+fy(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+fy(Math.floor(Math.abs(t)/60),2)+":"+fy(Math.abs(t)%60,2)}},yy={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const my=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Gg(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function vy(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class by extends K1{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:my,interpolate:S1,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Hg}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?Wg:Fg,s=t?vy:e1;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=yy.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=yy[t]||t).replace(cy,function(t,e){return r.push(e),"@@@"}),hy(hy({},py),n));return(t=t.replace(ly,function(t){return gy[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new by(this.options)}}var xy;let wy=dy=class extends Z1{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e1,tickMethod:z1,tickCount:5}}constructor(t){super(t)}clone(){return new dy(this.options)}};wy=dy=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([u1(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return Eg(S1(0,1),Sg(t,e))})],wy);let My=xy=class extends Z1{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e1,tickMethod:z1,tickCount:5}}constructor(t){super(t)}clone(){return new xy(this.options)}};function Oy(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function ky(t){return t.map((t,e)=>e)}function Ey(t){return t[t.length-1]}function Sy(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function _y(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)_y(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function Ay([t,e],[n,r]){return[t-n,e-r]}function Ty([t,e],[n,r]){return[t+n,e+r]}function Py([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Cy([t,e]){return Math.atan2(e,t)}function Ly([t,e]){return Cy([t,e])+Math.PI/2}function Ny(t,e){t=Cy(t),e=Cy(e);return t<e?e-t:2*Math.PI-(t-e)}function jy(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function Ry([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function L(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function Iy(t,e,n,r,i){e=Cy(Ay(r,e))+Math.PI,n=Cy(Ay(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function By(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=ky(a),[r,o]=Yh(t,t=>a[t]);const s=new Z1({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function Dy(t){var[t,e,n,r]=t;return[r,t,e,n]}function Fy(t,e,n){var[e,r,,i]=_f(t)?Dy(e):e,[n,a]=n,t=t.getCenter(),o=Ly(Ay(e,t)),r=Ly(Ay(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:Py(i,t),outerRadius:Py(e,t)}}function zy(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Wy(t,e){return Af(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function Gy(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function lt(t){return new Hy([t],null,t,t.ownerDocument)}My=xy=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([u1(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=Eg(S1(0,.5),Sg(e,n)),a=Eg(S1(.5,1),Sg(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],My);class Hy{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){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Hy(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Hy(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Hy([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new Hy(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new Hy(n,null,n[0],this._document)}maybeAppend(t,e){var n=this._elements[0],r=n.getElementById(t);return r||((r="string"==typeof e?this.createElement(e):e()).id=t,n.appendChild(r)),new Hy([r],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),h=Kh(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Kh=h.get(d);s.push([f,Kh]);for(const y of Kh)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new Hy([],i,this._parent,this._document),new Hy(a,null,this._parent,this._document),new Hy(o,null,this._parent,this._document),new Hy([],s,this._parent,this._document),new Hy(l,null,this._parent,this._document)];return new Hy(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new Hy(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=Hy.registry[t])?new e:wd("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){var e=this._transitions[t];e?(e=Array.isArray(e)?e:[e],Promise.all(e.map(t=>t.finished)).then(()=>{this._elements[t].remove()})):this._elements[t].remove()}return new Hy([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}Hy.registry={g:z.Group,rect:z.Rect,circle:z.Circle,path:z.Path,text:z.Text,ellipse:z.Ellipse,image:z.Image,line:z.Line,polygon:z.Polygon,polyline:z.Polyline,html:z.HTML};const Vy={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},Yy={style:{shape:(t,e)=>{const l=t["radius"],c=at(t,["shape","radius"]);var t=st(c,"pointer"),n=st(c,"pin");const u=t["shape"],h=at(t,["shape"]),f=n["shape"],d=at(n,["shape"]),{coordinate:p,theme:g}=e;return(t,e)=>{var t=t.map(t=>p.invert(t)),[n,r,i]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(p,"polar");const a=p.clone();var o=e["color"],n=fu({startAngle:n,endAngle:r,innerRadius:i,outerRadius:l});n.push(["cartesian"]),a.update({transformations:n});const s=t.map(t=>a.map(t));var[r,i]=Gy(s),[n,t]=p.getCenter(),r=Object.assign(Object.assign({x1:r,y1:i,x2:n,y2:t,stroke:o},h),c),i=Object.assign(Object.assign({cx:n,cy:t,stroke:o},d),c),n=lt(new z.Group);return Ad(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(L,r).node()),Ad(f)||("function"==typeof f?n.append(()=>f(s,e,a,g)):n.append("circle").call(L,i).node()),n.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},qy={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const Xy=t=>{var n,{data:e={},scale:r={},style:i={},animate:a={}}=t,t=at(t,["data","scale","style","animate","transform"]),{targetData:e,totalData:r,target:o,total:s,scale:l}=function(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=t;var t=a||r,s=a?1:i,e=Object.assign({y:{domain:[0,s]}},e);return o.length?{targetData:[{x:n,y:t,color:"target"}],totalData:o.map((t,e)=>({x:n,y:1<=e?t-o[e-1]:t,color:e})),target:t,total:s,scale:e}:{targetData:[{x:n,y:t,color:"target"}],totalData:[{x:n,y:t,color:"target"},{x:n,y:s-t,color:"total"}],target:t,total:s,scale:e}}(e,r),c=st(i,"text"),u=(n=["pointer","pin"],Object.fromEntries(Object.entries(i).filter(([e])=>n.find(t=>e.startsWith(t)))));return[ot({},Vy,Object.assign({type:"interval",transform:[{type:"stackY"}],data:r,scale:l,style:st(i,"arc"),animate:"object"==typeof a?st(a,"arc"):a},t)),ot({},Vy,Yy,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?st(a,"indicator"):a},t)),ot({},qy,{style:Object.assign({text:([r,{target:i,total:e}]=[c,{target:o,total:s}],(r=r.content)?r(i,e):i.toString())},c),animate:"object"==typeof a?st(a,"text"):a})]},Uy=(Xy.props={},()=>(i,t,e,a)=>{const{x:o,series:s}=e,l=Object.entries(e).filter(([t])=>t.startsWith("y")).map(([,t])=>t),c=Object.entries(e).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===o||void 0===l||void 0===c)throw new Error("Missing encode for x or y or size channel.");const u=t.x,h=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(h?h.getBandWidth(h.invert(+(null===s||void 0===s?void 0:s[n]))):1),t=(+(null===s||void 0===s?void 0:s[n])||0)*t;const r=+o[n]+t+e/2;return[...l.map((t,e)=>[r+ +c[e][n]/i.length,+l[e][n]]),...l.map((t,e)=>[r-+c[e][n]/i.length,+l[e][n]]).reverse()].map(t=>a.map(t))});return[i,e]});Uy.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["density"]}),{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:[...Eh(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Oh()],interaction:{shareTooltip:!0}};const $y=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,t=>{var e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]})]]};$y.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Eh(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...Mh()]};const Ky=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Zy=(Ky.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),Jy=(Zy.props={},t=>new F1(t)),Qy=(Jy.props={},t=>new Z1(t)),tm=(Qy.props={},t=>new B1(t)),em=(tm.props={},t=>new q1(t)),nm=(em.props={},t=>new J1(t)),rm=(nm.props={},t=>new by(t)),im=(rm.props={},t=>new iy(t)),am=(im.props={},t=>new ty(t)),om=(am.props={},t=>new ny(t)),sm=(om.props={},t=>new sy(t)),lm=(sm.props={},t=>new ay(t)),cm=(lm.props={},t=>new ey(t)),um=(cm.props={},t=>new wy(t)),hm=(um.props={},t=>new W1(t));function fm(t){return function(){return t}}hm.props={};const dm=Math.abs,pm=Math.atan2,gm=Math.cos,ym=Math.max,mm=Math.min,vm=Math.sin,bm=Math.sqrt,xm=1e-12,wm=Math.PI,Mm=wm/2,Om=2*wm;function km(t){return 1<=t?Mm:t<=-1?-Mm:Math.asin(t)}const Em=Math.PI,Sm=2*Em,_m=1e-6,Am=Sm-_m;function Tm(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class Pm{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Tm:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return Tm;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>_m&&(Math.abs(f*c-u*h)>_m&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((Em-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>_m&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>_m||Math.abs(this._y1-c)>_m)&&this._append`L${l},${c}`,n&&((h=h<0?h%Sm+Sm:h)>Am?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>_m&&this._append`A${n},${n},0,${+(h>=Em)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Cm(){return new Pm}function Lm(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new Pm(r)}function Nm(t){return t.innerRadius}function jm(t){return t.outerRadius}function Rm(t){return t.startAngle}function Im(t){return t.endAngle}function Bm(t){return t&&t.padAngle}function Dm(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/bm(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*bm(ym(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function Fm(){var A=Nm,T=jm,P=fm(0),C=null,L=Rm,N=Im,j=Bm,R=null,I=Lm(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M=+A.apply(this,arguments),O=+T.apply(this,arguments),k=L.apply(this,arguments)-Mm,E=N.apply(this,arguments)-Mm,S=dm(E-k),_=k<E;if(R=R||(t=I()),O<M&&(e=O,O=M,M=e),O>xm?S>Om-xm?(R.moveTo(O*gm(k),O*vm(k)),R.arc(0,0,O,k,E,!_),M>xm&&(R.moveTo(M*gm(E),M*vm(E)),R.arc(0,0,M,E,k,_))):(r=e=k,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>xm&&(C?+C.apply(this,arguments):bm(M*M+O*O)),w=x=s=mm(dm(O-M)/2,+P.apply(this,arguments)),f>xm&&(h=km(f/M*vm(u)),f=km(f/O*vm(u)),(a-=2*h)>xm?(r+=h*=_?1:-1,i-=h):(a=0,r=i=(k+E)/2),(o-=2*f)>xm?(e+=f*=_?1:-1,n-=f):(o=0,e=n=(k+E)/2)),u=O*gm(e),h=O*vm(e),f=M*gm(i),k=M*vm(i),s>xm&&(d=O*gm(n),p=O*vm(n),g=M*gm(r),y=M*vm(r),S<wm)&&((E=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<xm))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,k))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/vm((1<(S=(S*b+v*m)/(bm(S*S+v*v)*bm(b*b+m*m)))?0:S<-1?wm:Math.acos(S))/2),b=bm(E[0]*E[0]+E[1]*E[1]),x=mm(s,(M-b)/(v-1)),w=mm(s,(O-b)/(1+v))):x=w=0),o>xm?w>xm?(l=Dm(g,y,u,h,O,w,_),c=Dm(d,p,f,k,O,w,_),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,pm(l.y01,l.x01),pm(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,w,pm(l.y01,l.x01),pm(l.y11,l.x11),!_),R.arc(0,0,O,pm(l.cy+l.y11,l.cx+l.x11),pm(c.cy+c.y11,c.cx+c.x11),!_),R.arc(c.cx,c.cy,w,pm(c.y11,c.x11),pm(c.y01,c.x01),!_))):(R.moveTo(u,h),R.arc(0,0,O,e,n,!_)):R.moveTo(u,h),M>xm&&a>xm?x>xm?(l=Dm(f,k,d,p,M,-x,_),c=Dm(u,h,g,y,M,-x,_),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,pm(l.y01,l.x01),pm(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,x,pm(l.y01,l.x01),pm(l.y11,l.x11),!_),R.arc(0,0,M,pm(l.cy+l.y11,l.cx+l.x11),pm(c.cy+c.y11,c.cx+c.x11),_),R.arc(c.cx,c.cy,x,pm(c.y11,c.x11),pm(c.y01,c.x01),!_))):R.arc(0,0,M,i,r,_):R.lineTo(f,k)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+A.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+L.apply(this,arguments)+ +N.apply(this,arguments))/2-wm/2;return[gm(e)*t,vm(e)*t]},e.innerRadius=function(t){return arguments.length?(A="function"==typeof t?t:fm(+t),e):A},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:fm(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:fm(+t),e):P},e.padRadius=function(t){return arguments.length?(C=null==t?null:"function"==typeof t?t:fm(+t),e):C},e.startAngle=function(t){return arguments.length?(L="function"==typeof t?t:fm(+t),e):L},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:fm(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:fm(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function zm(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Wm(t){this._context=t}function Gm(t){return new Wm(t)}function Hm(t){return t[0]}function Vm(t){return t[1]}function Ym(o,s){var l=fm(!0),c=null,u=Gm,h=null,f=Lm(e);function e(t){var e,n,r,i=(t=zm(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?Hm:fm(o),s="function"==typeof s?s:void 0===s?Vm:fm(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:fm(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:fm(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:fm(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function qm(u,h,f){var d=null,p=fm(!0),g=null,y=Gm,m=null,v=Lm(e);function e(t){var e,n,r,i,a,o=(t=zm(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(m=y(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),r=e-1;n<=r;--r)m.point(l[r],c[r]);m.lineEnd(),m.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),m.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return m=null,a+""||null}function t(){return Ym().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?Hm:fm(+u),h="function"==typeof h?h:fm(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?Vm:fm(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:fm(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:fm(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:fm(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:fm(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:fm(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:fm(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:fm(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(m=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=m=null:m=y(g=t),e):g},e}Cm.prototype=Pm.prototype,Wm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Xm=$m(Gm);function Um(t){this._curve=t}function $m(e){function t(t){return new Um(e(t))}return t._curve=e,t}function Km(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e($m(t)):e()._curve},t}function Zm(){}function Jm(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Qm(t,e){this._context=t,this._k=(1-e)/6}function tv(t,e){this._context=t,this._k=(1-e)/6}function ev(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>xm&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>xm&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function nv(t,e){this._context=t,this._alpha=e}Um.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Qm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Jm(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Jm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new Qm(t,n)}return t.tension=function(t){return e(+t)},t}(0),tv.prototype={areaStart:Zm,areaEnd:Zm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Jm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new tv(t,n)}return t.tension=function(t){return e(+t)},t}(0),nv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ev(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var rv=function e(n){function t(t){return n?new nv(t,n):new Qm(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function iv(t,e){this._context=t,this._alpha=e}iv.prototype={areaStart:Zm,areaEnd:Zm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ev(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var av=function e(n){function t(t){return n?new iv(t,n):new tv(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function ov(t){this._context=t}function sv(t){return new ov(t)}function lv(t,e){this._context=t,this._t=e}function cv(t){return new lv(t,.5)}function uv(t){return new lv(t,0)}function hv(t){return new lv(t,1)}function fv(t,e,n){return Math.max(e,Math.min(t,n))}function dv(t,e,n,r,i={}){var{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:h=o,radiusBottomRight:f=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:y=1/0}=i,i=at(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!Af(r)&&!Pf(r)){var m=!!_f(r),[v,,b]=m?Dy(e):e;const[k,M]=v;var[b,v]=Ay(b,v),x=(0<b?k:k+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:fv(b,g,y),v=m?fv(s,g,y):s,l=x-(c-b)/2,u=w-(v-s)/2;return lt(t.createElement("rect",{})).style("x",l).style("y",u).style("width",c).style("height",v).style("radius",[d,p,f,h]).call(L,i).node()}const{y:M,y1:O}=n;m=r.getCenter(),g=Fy(r,e,[M,O]),y=Fm().cornerRadius(o).padAngle(a*Math.PI/180);return lt(t.createElement("path",{})).style("path",y(g)).style("transform",`translate(${m[0]}, ${m[1]})`).style("radius",o).style("inset",a).call(L,i).node()}ov.prototype={areaStart:Zm,areaEnd:Zm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},lv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};const pv=(E,t)=>{const{colorAttribute:S,first:_=!0,last:A=!0}=E,T=at(E,["colorAttribute","opacityAttribute","first","last"]),{coordinate:P,document:C}=t;return(t,e,n)=>{var{color:r,radius:i=0}=n,n=at(n,["color","radius"]),a=n.lineWidth||1,{stroke:o,radius:i=i,radiusTopLeft:s=i,radiusTopRight:l=i,radiusBottomRight:c=i,radiusBottomLeft:u=i,innerRadius:h=0,innerRadiusTopLeft:f=h,innerRadiusTopRight:d=h,innerRadiusBottomRight:p=h,innerRadiusBottomLeft:h=h,lineWidth:a="stroke"===S||o?a:0,inset:g=0,insetLeft:y=g,insetRight:m=g,insetBottom:v=g,insetTop:b=g,minWidth:x,maxWidth:w}=T,M=at(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:r=r,opacity:O}=e;const k=[_?s:f,_?l:d,A?c:p,A?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],_f(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,k[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return lt(dv(C,t,e,P,f)).call(L,n).style("fill","transparent").style(S,r).style(zy(E),O).style("lineWidth",a).style("stroke",void 0===o?r:o).call(L,M).node()}},gv=(pv.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>pv(Object.assign({colorAttribute:"fill"},t),e)),yv=(gv.props=Object.assign(Object.assign({},pv.props),{defaultMarker:"square"}),(t,e)=>pv(Object.assign({colorAttribute:"stroke"},t),e));yv.props=Object.assign(Object.assign({},pv.props),{defaultMarker:"hollowSquare"});const mv=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(_f(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,l=at(t,["adjustPoints"]),{coordinate:c,document:u}=e;return(t,e,n,r)=>{var i=e["index"],a=n["color"],n=at(n,["color"]),r=r[i+1],i=s(t,r,c),[t,r,i,o]=!!_f(c)?Dy(i):i,{color:e=a,opacity:a}=e,t=Ym().curve(sv)([t,r,i,o]);return lt(u.createElement("path",{})).call(L,n).style("path",t).style("fill",e).style("fillOpacity",a).call(L,l).node()}};function vv(t,e,n){var[t,r,i,a]=t;if(_f(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}mv.props={defaultMarker:"square"};const bv=(t,e)=>mv(Object.assign({adjustPoints:vv},t),e);function xv(t){const e="function"==typeof t?t:t.render;return class extends z.CustomElement{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}bv.props={defaultMarker:"square"};const wv=xv(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(L,r),lt(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(L,i)});const Mv=(t,e)=>{const{curve:u,gradient:h=!1,gradientColor:f="between",defined:d=t=>!Number.isNaN(t)&&null!=t,connect:p=!1}=t,g=at(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:y,document:m}=e;return(t,e,n)=>{var{color:r,lineWidth:i}=n,n=at(n,["color","lineWidth"]),{color:r=r,size:i=i,seriesColor:a,seriesX:o,seriesY:s}=e,a=h&&a?By(a,o,s,h,f):r,o=Wy(y,e),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a&&{stroke:a}),i&&{lineWidth:i}),o&&{transform:o}),g);let l;if(Af(y)){const c=y.getCenter();l=n=>Km(Ym().curve(Xm)).angle((t,e)=>Ly(Ay(n[e],c))).radius((t,e)=>Py(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=Ym().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>d(t)&&d(e)).curve(u);var[r,e]=function(t,e){var 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,d),n=st(s,"connect"),a=!!e.length;return(!a||p&&!Object.keys(n).length?lt(m.createElement("path",{})).style("d",l(r)||[]).call(L,s):a&&!p?lt(m.createElement("path",{})).style("d",l(t)).call(L,s):lt(new wv).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}},Ov=(Mv.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=Af(i)?sv:Gm;return Mv(Object.assign({curve:e},n),r)(...t)}}),kv=(Ov.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"line"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=Af(a)?av:rv;return Mv(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),Ev=(kv.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"smooth"}),(t,e)=>Mv(Object.assign({curve:hv},t),e)),Sv=(Ev.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"hv"}),(t,e)=>Mv(Object.assign({curve:uv},t),e)),_v=(Sv.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"vh"}),(t,e)=>Mv(Object.assign({curve:cv},t),e));_v.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"hvh"});const Av=(b,t)=>{const x=t["document"];return(e,t,n)=>{var r,i,a,o,s,l,c,u,h,{seriesSize:f,color:t}=t,d=n["color"],n=at(n,["color"]),p=Cm();for(let t=0;t<e.length-1;t++){var g=e[t],y=e[t+1],m=f[t],v=f[t+1];[...g,...y].every(Od)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=Cy(Ay(y=y,g=g)))+Math.PI/2,a=[m/2*Math.cos(i),m/2*Math.sin(i)],i=[v/2*Math.cos(i),v/2*Math.sin(i)],o=[v/2*Math.cos(s),v/2*Math.sin(s)],s=[m/2*Math.cos(s),m/2*Math.sin(s)],l=Ty(g,a),c=Ty(y,i),u=Ty(c,o),h=Ay(o=Ty(y,o),i),y=Ay(y,i),i=Ay(g,a),a=Ay(i,s),g=Ay(g,s),s=Ay(l,s),r.moveTo(...l),r.lineTo(...c),r.arcTo(...u,...o,v/2),r.arcTo(...h,...y,v/2),r.lineTo(...i),r.arcTo(...a,...g,m/2),r.arcTo(...s,...l,m/2),r.closePath())}return lt(x.createElement("path",{})).call(L,n).style("fill",t||d).style("d",p.toString()).call(L,b).node()}};Av.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"line"});xl=(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"]],xl.style=["fill"],$s=xl.bind(void 0),$s.style=["stroke","lineWidth"],Ll=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],Ll.style=["fill"],Rs=Ll.bind(void 0),Rs.style=["fill"],Xs=Ll.bind(void 0),Xs.style=["stroke","lineWidth"],n=(t,e,n)=>{var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]},n.style=["fill"],Hs=n.bind(void 0),Hs.style=["stroke","lineWidth"],Ws=(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"]]},Ws.style=["fill"],Js=Ws.bind(void 0),Js.style=["stroke","lineWidth"],W=(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"]]},W.style=["fill"],ph=W.bind(void 0),ph.style=["stroke","lineWidth"],wo=(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"]]},wo.style=["fill"],So=wo.bind(void 0),So.style=["stroke","lineWidth"],a=(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"]]},a.style=["fill"],ni=a.bind(void 0),ni.style=["stroke","lineWidth"],Bs=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Bs.style=["stroke","lineWidth"],Fo=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],Fo.style=["stroke","lineWidth"],Oo=(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]],Oo.style=["stroke","lineWidth"],Ys=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],Ys.style=["stroke","lineWidth"],Ao=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Ao.style=["stroke","lineWidth"],Po=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Po.style=["stroke","lineWidth"],Ro=Po.bind(void 0),Ro.style=["stroke","lineWidth"],Wo=(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]],Wo.style=["stroke","lineWidth"],Ho=(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]],Ho.style=["stroke","lineWidth"],Yo=(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]],Yo.style=["stroke","lineWidth"],Xo=(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]],Xo.style=["stroke","lineWidth"],Ko=(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]];Ko.style=["stroke","lineWidth"];const Tv=new Map([["bowtie",a],["cross",Fo],["dash",Ro],["diamond",n],["dot",Po],["hexagon",wo],["hollowBowtie",ni],["hollowDiamond",Hs],["hollowHexagon",So],["hollowPoint",$s],["hollowSquare",Xs],["hollowTriangle",Js],["hollowTriangleDown",ph],["hv",Ho],["hvh",Xo],["hyphen",Ao],["line",Bs],["plus",Ys],["point",xl],["rect",Rs],["smooth",Wo],["square",Ll],["tick",Oo],["triangleDown",W],["triangle",Ws],["vh",Yo],["vhv",Ko]]);const h=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=at(c,["colorAttribute","symbol","mode"]),d=Tv.get(e)||Tv.get("point"),{coordinate:p,document:g}=t;return(t,e,n)=>{var{lineWidth:r,color:i}=n,r=f.stroke?r||1:r,{color:i=i,transform:a,opacity:o}=e,[s,l]=Gy(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||Lf(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(h,t,e,p)||f.r||n.r;return lt(g.createElement("path",{})).call(L,n).style("fill","transparent").style("d",d(s,l,t)).style("lineWidth",r).style("transform",a).style("stroke",i).style(zy(c),o).style(u,i).call(L,f).node()}},Pv=(h.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e)),Cv=(Pv.props=Object.assign({defaultMarker:"bowtie"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e)),Lv=(Cv.props=Object.assign({defaultMarker:"cross"},h.props),(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e)),Nv=(Lv.props=Object.assign({defaultMarker:"diamond"},h.props),(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e)),jv=(Nv.props=Object.assign({defaultMarker:"hexagon"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e)),Rv=(jv.props=Object.assign({defaultMarker:"hollowBowtie"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e)),Iv=(Rv.props=Object.assign({defaultMarker:"hollowDiamond"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e)),Bv=(Iv.props=Object.assign({defaultMarker:"hollowHexagon"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e)),Dv=(Bv.props=Object.assign({defaultMarker:"hollowPoint"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e)),Fv=(Dv.props=Object.assign({defaultMarker:"hollowSquare"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e)),zv=(Fv.props=Object.assign({defaultMarker:"hollowTriangle"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e)),Wv=(zv.props=Object.assign({defaultMarker:"hollowTriangleDown"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e)),Gv=(Wv.props=Object.assign({defaultMarker:"hyphen"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e)),Hv=(Gv.props=Object.assign({defaultMarker:"line"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e)),Vv=(Hv.props=Object.assign({defaultMarker:"plus"},h.props),(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"point"},t),e)),Yv=(Vv.props=Object.assign({defaultMarker:"point"},h.props),(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"square"},t),e)),qv=(Yv.props=Object.assign({defaultMarker:"square"},h.props),(t,e)=>h(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e)),Xv=(qv.props=Object.assign({defaultMarker:"tick"},h.props),(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e)),Uv=(Xv.props=Object.assign({defaultMarker:"triangle"},h.props),(t,e)=>h(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e)),$v=(Uv.props=Object.assign({defaultMarker:"triangleDown"},h.props),(t,e)=>{const{arrow:u=!0,arrowSize:h="40%"}=t,f=at(t,["arrow","arrowSize"]),d=e["document"];return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=Cm();return c.moveTo(...t),c.lineTo(...l),u&&([a,o]=(t=t,r=l,i="string"==typeof(i=(i={arrowSize:h})["arrowSize"])?+parseFloat(i)/100*Py(t,r):i,a=Math.PI/6,t=Math.atan2(r[1]-t[1],r[0]-t[0]),o=Math.PI/2-t-a,t-=a,[[r[0]-i*Math.sin(o),r[1]-i*Math.cos(o)],[r[0]-i*Math.cos(t),r[1]-i*Math.sin(t)]]),c.moveTo(...l),c.lineTo(...a),c.moveTo(...l),c.lineTo(...o)),lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,f).node()}});function Kv(t){Jv(t,!0)}function Zv(t){Jv(t,!1)}function Jv(t,e){var n=e?"visible":"hidden";!function e(t,n){n(t),t.children&&t.children.forEach(function(t){t&&e(t,n)})}(t,function(t){t.attr("visibility",n)})}$v.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(eb,Qv=z.Group);var Qv,tb=eb;function eb(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qv.apply(this,v([],O(t),!1))||this;return n.addEventListener(z.ElementEvent.INSERTED,function(){Zv(n)}),n}function nb(t){t=t.appendChild(new tb({class:"offscreen"}));return Zv(t),t}t(ab,rb=z.Text),Object.defineProperty(ab.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=nb(this)),this._offscreen},enumerable:!1,configurable:!0}),ab.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var rb,ib=ab;function ab(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return rb.call(this,m({style:m({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},e)},t))||this}function ob(t){return t*Math.PI/180}function sb(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(cb.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(cb.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(cb.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(cb.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),cb.fromRect=function(t){return new cb(t.x,t.y,t.width,t.height)},cb.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}};var lb=cb;function cb(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}function ub(t,e){return Re(t)?t.apply(void 0,v([],O(e),!1)):t}function hb(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=O(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function fb(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)pb(t,e[r]);return t}var db,pb=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=O(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?We(t)?(We(r[e])||(n[e]={}),a<o?pb(r[e],t,a+1,o):n[e]=i[e]):De(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},gb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},yb=an(function(t,e){var n=Ye(t)?t:t.style.text.toString(),e=e||mb(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(db=db||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),db.measureText(n).width},function(t,e){return[Ye(t)?t:t.style.text.toString(),Object.values(e||mb(t)).join()].join("")}),mb=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,t=t.style.fontSize;return{fontSize:"object"==typeof t?t.value:t,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function vb(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function bb(t,e){t=vb(t);t&&t.attr(e)}function xb(t,e,n){bb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function wb(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}function Mb(t){return"function"==typeof t?t():Ye(t)||Xe(t)?new ib({style:{text:String(t)}}):t}function Ob(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 kb(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var Eb=function(e,n){return function(t){return e*(1-t)+n*t}};function Sb(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?Eb(e,t):Array.isArray(e)&&Array.isArray(t)?(i=e,o=(a=t)?a.length:0,s=i?Math.min(o,i.length):0,function(t){for(var e=new Array(s),n=new Array(o),r=0,r=0;r<s;++r)e[r]=Sb(i[r],a[r]);for(;r<o;++r)n[r]=a[r];for(r=0;r<s;++r)n[r]=e[r](t);return n}):"object"==typeof e&&"object"==typeof t?(void 0===(n=e)&&(n={}),void 0===(t=t)&&(t={}),r={},l={},Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];e in n?r[e]=Sb(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function _b(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,o=O([s+o.width,l+o.height],2),c=o[0],o=o[1];s<e&&(e=s),l<n&&(n=l),r<c&&(r=c),i<o&&(i=o)}return new lb(e,n,r-e,i-n)}function Ab(n,t,e){function r(t){var e=O(u?["height",a]:["width",i],2),n=e[0],r=e[1];switch(c){case"flex-start":return 0;case"flex-end":return r-t[n];case"center":return r/2-t[n]/2;default:return 0}}var i=n.width,a=n.height,o=void 0===(o=e.flexDirection)?"row":o,s=(e.flexWrap,e.justifyContent),l=void 0===s?"flex-start":s;e.alignContent;var c=void 0===(s=e.alignItems)?"flex-start":s,u="row"===o,e="row"===o||"column"===o,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=O([0,0],2))[0],d=s[1],e=_b(o=t.map(function(t){var e=t.width,t=t.height,n=O([f,d],2),r=n[0],n=n[1],i=O([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new lb(r,n,e,t)})),p={"flex-start":0,"flex-end":u?i-e.width:a-e.height,center:u?(i-e.width)/2:(a-e.height)/2};return _b(s=o.map(function(t){var e=t.x,n=t.y,t=lb.fromRect(t);return t.x=u?e+p[l]:e,t.y=u?n:n+p[l],t})),s.map(function(t){var e=t.x,n=t.y,t=lb.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=lb.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function Tb(t,e,n){return[]}function Pb(t,e){return[t[0]*e,t[1]*e]}function Cb(t,e){return[t[0]+e[0],t[1]+e[1]]}function Lb(t,e){return[t[0]-e[0],t[1]-e[1]]}function Nb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function jb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Rb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ib(t){var e;return 0===t[0]&&0===t[1]?[0,0]:(e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),[t[0]/e,t[1]/e])}function Bb(t,e){e=Math.pow(10,e);return~~(t*e)/e}function Db(t,e){var n,r={},i=Array.isArray(e)?e:[e];for(n in t)i.includes(n)||(r[n]=t[n]);return r}function Fb(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r,s=[1/0,1/0],l=[-1/0,-1/0];if(o){s=(r=O(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Nb(s,x=t[c]),l=jb(l,x)}for(var c=0,h=t.length;c<h;c+=1){var f,d,p,g,y,m,v,b,x=t[c];0!==c||n?c!==h-1||n?(f=t[[c?c-1:h-1,c-1][n?0:1]],m=[0,0],m=Pb(m=Lb(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=Rb(x,f))+(g=Rb(x,d)))&&(p/=y,g/=y),y=Pb(m,-p),m=Pb(m,g),v=Cb(x,y),b=Nb(b=Cb(x,m),jb(d,x)),b=jb(b,Nb(d,x)),v=Nb(v=Cb(x,y=Pb(y=Lb(b,x),-p/g)),jb(f,x)),b=Cb(x,m=Pb(m=Lb(x,v=jb(v,Nb(f,x))),g/p)),o&&(v=Nb(v=jb(v,s),l),b=Nb(b=jb(b,s),l)),a.push(i),a.push(v),i=b):(v=x,a.push(i),a.push(v)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],l=O(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var zb=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","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 Wb(t){var e,n,r={};for(e in t)n=e,zb.includes(n)&&(r[e]=t[e]);return r}function Gb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}M.prototype.selectAll=function(t){return new M("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},M.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new M(this._elements,null,this._parent,this._document,void 0,void 0,t)},M.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new M([t],null,t,this._document)},M.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=O(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new M(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new M(r,null,r[0],this._document)},M.prototype.maybeAppend=function(t,e){e=I(this,Hb,"m",Vb).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},M.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=I(this,Hb,"m",Vb).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},M.prototype.maybeAppendByName=function(t,e){e=I(this,Hb,"m",Vb).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},M.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Kh(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var m=f.get(g);l.push([p,m]);try{r=void 0;for(var v=R(m),b=v.next();!b.done;b=v.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new M([],a,this._parent,this._document),new M(o,null,this._parent,this._document),new M(s,null,this._parent,this._document),new M([],l,this._parent,this._document),new M(c,null,this._parent,this._document)];return new M(this._elements,null,this._parent,this._document,w)},M.prototype.merge=function(t){var e=v(v([],O(this._elements),!1),O(t._elements),!1),t=v(v([],O(this._transitions),!1),O(t._transitions),!1);return new M(e,null,this._parent,this._document,void 0,t)},M.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=M.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},M.prototype.join=function(t,e,n,r,i){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()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},M.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new M([],null,this._parent,this._document,void 0,this._transitions)},M.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},M.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},M.prototype.style=function(n,r,t){void 0===t&&(t=!0);var i="function"==typeof r&&t?r:function(){return r};return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},M.prototype.styles=function(t,o){return void 0===t&&(t={}),void 0===o&&(o=!0),this.each(function(r,i){var a=this;Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],n=t[1],t="function"==typeof n&&o?n:function(){return n};void 0!==n&&a.attr(e,t.call(a,r,i))})})},M.prototype.update=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.maybeUpdate=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},M.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},M.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,v([this._parent,this],O(e),!1)),this},M.prototype.node=function(){return this._elements[0]},M.prototype.nodes=function(){return this._elements},M.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},M.prototype.parent=function(){return this._parent},Hb=new WeakSet,Vb=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new M([t],null,this._parent,this._document)},M.registry={g:z.Group,rect:z.Rect,circle:z.Circle,path:z.Path,text:ib,ellipse:z.Ellipse,image:z.Image,line:z.Line,polygon:z.Polygon,polyline:z.Polyline,html:z.HTML};var Hb,Vb,Yb=M;function M(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),Hb.add(this),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}function x(t){return new Yb([t],null,t,t.ownerDocument)}function qb(t,e,n){return t.querySelector(e)?x(t).select(e):x(t).append(n)}function Xb(t){if(Xe(t))return[t,t,t,t];if(De(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 t=t.getLocalBounds(),t=O([t.min,t.max],2),e=O(t[0],2),n=e[0],e=e[1],t=O(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function $b(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Kb(t,e,n){void 0===n&&(n=!0);var e=e||(null==(e=t.match(/^([a-z][a-z0-9]+)/))?void 0:e[0])||"",t=t.replace(new RegExp("^(".concat(e,")")),"");return n?(e=t).toString().charAt(0).toLowerCase()+e.toString().slice(1):t}function w(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=O(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&Kb(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat($b(e)))?a[n]=t:a[n.replace(new RegExp($b(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=Kb(n,r))&&"function"==typeof t||(a[e]=t))}),a}function Zb(t,r){return Object.entries(t).reduce(function(t,e){var e=O(e,2),n=e[0],e=e[1];return n.startsWith("show")?t["show".concat(r).concat(n.slice(4))]=e:t["".concat(r).concat($b(n))]=e,t},{})}function Jb(t,n){void 0===n&&(n=["x","y","class","className"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function Qb(o,t){if(t)try{var e=t.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=(r=o).getBBox()).width,a=r.height,[(r=O([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",e)}catch(t){}}t(e2,t2=z.CustomElement),Object.defineProperty(e2.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=nb(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e2.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e2.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e2.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},e2.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){Jv(this,"hidden"!==this.attributes.visibility)}.call(this)},e2.prototype.update=function(t,e){return this.attr(fb({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},e2.prototype.clear=function(){this.removeChildren()},e2.prototype.bindEvents=function(t,e){};var t2,Jo=e2;function e2(t,e){t=t2.call(this,fb({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function n2(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"]]}function r2(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function i2(t,e,n){return[["M",t-n,e],["L",t+n,e]]}ts=n2,vs=i2;function a2(t){n="default",Fe(e=t)&&e instanceof Image?n="image":Re(e)?n="symbol":Ye(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}t(l2,o2=Jo),l2.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=at(t,["symbol","size"]),o=a2(r);Ob(!!o,x(e),function(t){t.maybeAppendByClassName("marker",o).attr("className","marker ".concat(o,"-marker")).call(function(t){var e,n;"image"===o?t.styles({img:r,width:e=2*i,height:e,x:-i,y:-i}):(e=i/2,n=Re(r)?r:l2.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},l2.MARKER_SYMBOL_MAP=new Map,l2.registerSymbol=function(t,e){l2.MARKER_SYMBOL_MAP.set(t,e)},l2.getSymbol=function(t){return l2.MARKER_SYMBOL_MAP.get(t)};var o2,s2=l2;function l2(){return null!==o2&&o2.apply(this,arguments)||this}s2.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]]}),s2.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),s2.registerSymbol("line",r2),s2.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),s2.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]]}),s2.registerSymbol("circle",n2),s2.registerSymbol("point",ts),s2.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"]]}),s2.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"]]}),s2.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"]]}),s2.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),s2.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"]]}),s2.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"]]}),s2.registerSymbol("line",r2),s2.registerSymbol("dot",i2),s2.registerSymbol("dash",vs),s2.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]]}),s2.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]]}),s2.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]]}),s2.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]]}),s2.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]]});t(h2,c2=z.DisplayObject),h2.prototype.render=function(){var t=this.attributes.columns;x(this.columnsGroup).selectAll(".column").data(t.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()})},h2.prototype.update=function(t){this.attr(fb({},this.attributes,t)),this.render()},h2.prototype.clear=function(){this.removeChildren()};var c2,u2=h2;function h2(t){var e=this,n=t.style,t=at(t,["style"]);return(e=c2.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new z.Group({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(p2,f2=z.DisplayObject),p2.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},p2.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},p2.prototype.update=function(t){this.attr(fb({},this.attributes,t)),this.render()},p2.prototype.renderLines=function(t){x(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()})},p2.prototype.renderAreas=function(t){x(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()})};var f2,d2=p2;function p2(t){var e=this,n=t.style,t=at(t,["style"]);return(e=f2.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new z.Group),e.areasGroup=e.appendChild(new z.Group),e.render(),e}function g2(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return v([e===n?"M":"L"],O(t),!1)});return e?t.reverse():t}function y2(t,e){if(void 0===e&&(e=!1),t.length<=2)return g2(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];un(a,n.slice(-2))||n.push.apply(n,v([],O(a),!1))}var o=Fb(n,!1);return e?o.unshift(v(["M"],O(t[r-1]),!1)):o.unshift(v(["M"],O(t[0]),!1)),o}function m2(t,e,n){t=nn(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function v2(t){return 0===t.length?[0,0]:[He(function(t,e){if(De(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Re(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return He(t)||0})),Ge(function(t,e){if(De(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Re(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return Ge(t)||0}))]}function b2(t){for(var e=nn(t),n=e[0].length,t=O([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}t(M2,x2=Jo),Object.defineProperty(M2.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=nn(t),Xe(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"data",{get:function(){return this.attributes.isStack?b2(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"baseline",{get:function(){var t=this.scales.y,e=O(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"linesStyle",{get:function(){var n=this,t=this.attributes,e=t.type,r=t.isStack,i=t.smooth;if("line"!==e)throw new Error("linesStyle can only be used in line type");var a,o,s,l,c,u,h,f,d,p=w(this.attributes,"area"),g=w(this.attributes,"line"),t=this.containerShape.width,e=this.data;return 0===e[0].length?{lines:[],areas:[]}:(a=this.scales,u=a.x,a=a.y,e=e,o=(u={type:"line",x:u,y:a}).x,s=u.y,l=(u=O(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=O([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),qe(s.map(t),c,l)]})}),u=[],p&&(e=this.baseline,u=r?(i?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=y2(o),l=void 0,l=0===i?m2(s,e,n):(a=y2(t[i-1],!0),o=o[0],a[0][0]="L",v(v(v([],O(s),!1),O(a),!1),[v(["M"],O(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=g2(t[i]),s=void 0,s=0===i?m2(o,e,n):((a=g2(t[i-1],!0))[0][0]="L",v(v(v([],O(o),!1),O(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return m2((h?y2:g2)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?y2:g2)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"columnsStyle",{get:function(){var i=this,a=w(this.attributes,"column"),t=this.attributes,o=t.isStack;if("column"!==t.type)throw new Error("columnsStyle can only be used in column type");var t=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=b2(s));var e=this.createScales(s),l=e.x,c=e.y,e=O(v2(s),2),n=e[0],e=e[1],u=new Z1({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return m(m({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),M2.prototype.render=function(t,e){this.container=qb(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=qb(e,".".concat(r),function(){return new("line"===n?d2:u2)({className:r,style:i})}).styles(i).node()},M2.prototype.getColor=function(t){var e=this.attributes.color;return De(e)?e[t%e.length]:Re(e)?e.call(null,t):e},M2.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,i=n.range,i=void 0===i?[]:i,a=n.isGroup,n=n.spacing,o=this.containerShape,s=o.width,o=o.height,l=O(v2(t),2),c=l[0],l=l[1],c=new Z1({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new Z1({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new F1({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},M2.tag="sparkline";var x2,w2=M2;function M2(t){return x2.call(this,t,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff"})||this}function O2(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=O(t,1)[0];return!e.includes(t)})),Object.fromEntries(e.map(function(t){var e;return"boolean"!=typeof(e=n)&&"enter"in e&&"update"in e&&"exit"in e?!1===n[t]?[t,!1]:[t,m(m({},n[t]),r)]:[t,r]}))):{enter:!1,update:!1,exit:!1}}function k2(t,e){t?t.finished.then(e):e()}function E2(t,e){"update"in t?t.update(e):t.attr(e)}function S2(t,e,n){return 0===e.length?null:n?t.animate(e,n):(E2(t,{style:e.slice(-1)[0]}),null)}function _2(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=O(t,2),n=t[0],t=t[1];p(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?S2(r,[i,a],m({fill:"both"},e)):(E2(r,a),null)}function A2(t,e){return t.style.opacity||(t.style.opacity=1),_2(t,{opacity:0},e)}var T2,P2={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},C2={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},L2={orientation:"horizontal",showLabel:!0,type:"start"},N2=hb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),j2=hb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),R2=(t(I2,T2=Jo),I2.prototype.render=function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orientation,t=at(t,["size","radius","orientation"]),a=2.4*n,r=x(e).maybeAppendByClassName(j2.iconRect,"rect").styles(m(m({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(j2.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(j2.iconLine,"-2"),"line").styles(m({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},I2);function I2(){return null!==T2&&T2.apply(this,arguments)||this}t(F2,B2=Jo),F2.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=w(this.attributes,"label"),i=r.transform,r=O(Jb(at(r,["transform"]),[]),2),a=r[0],r=r[1],t=x(t).maybeAppendByClassName(j2.labelGroup,"g").styles(r),r=m(m({},C2),a),o=r.text,s=at(r,["text"]);Ob(!!n,t,function(t){e.label=t.maybeAppendByClassName(j2.label,"text").styles(m(m({},s),{transform:i,text:"".concat(o)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},F2.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},P2),w(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new R2({style:n})}:e;x(t).maybeAppendByClassName(j2.iconGroup,"g").selectAll(j2.icon.class).data([r]).join(function(t){return t.append(r).attr("className",j2.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},F2.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var B2,D2=F2;function F2(t){return B2.call(this,t,L2)||this}t(G2,z2=Jo),Object.defineProperty(G2.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=w(this.attributes,"sparkline"),m(m({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=O(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"availableSpace",{get:function(){var t=O(Xb(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),G2.prototype.getValues=function(){return this.values},G2.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attributes.values=t=void 0===t?[0,0]:t;t=!1!==e&&this.attributes.animate;_2(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},G2.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(_2(this.startHandle,this.getHandleStyle("start"),t),_2(this.endHandle,this.getHandleStyle("end"),t))},G2.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.attr("values",t),this.setValues(t),e&&this.onValueChange(n)},G2.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=w(this.attributes,"track");this.trackShape=x(t).maybeAppendByClassName(N2.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},G2.prototype.renderSparkline=function(t){var n=this;Ob("horizontal"===this.attributes.orientation,x(t).maybeAppendByClassName(N2.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(N2.sparkline,function(){return new w2({style:e})}).update(e)})},Object.defineProperty(G2.prototype,"selectionStyle",{get:function(){var t=w(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),G2.prototype.renderHandles=function(){var t,e=this,n=(this.attributes.showHandle?["start","end"]:[]).map(function(t){return{type:t}}),r=this;null!=(t=this.foregroundGroup)&&t.selectAll(N2.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new D2({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(N2.handle.name," ").concat(e,"-handle")),"".concat(e,"Handle"));(r[t]=this).addEventListener("pointerdown",function(t){r.onDragStart(e)(t)})})},function(t){return t.each(function(t){t=t.type;this.update(r.getHandleStyle(t))})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");r[t]=void 0}).remove()})},G2.prototype.renderSelection=function(t){this.foregroundGroup=x(t).maybeAppendByClassName(N2.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(N2.selection,"rect").styles(this.selectionStyle),this.renderHandles()},G2.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},G2.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=O(this.range,2),r=n[0],n=n[1],i=O(this.getValues().map(function(t){return Bb(t,e)}),2),a=i[0],i=i[1],t=O((t||[a,i]).map(function(t){return Bb(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=O([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},G2.prototype.calcMask=function(t){var t=O(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},G2.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=O(this.clampValues(),2),o=a[0],a=a[1],t=("start"===t?o:a)*this.getOrientVal([i,e]);return{x:n+this.getOrientVal([t,i/2]),y:r+this.getOrientVal([e/2,t])}},G2.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},G2.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,h=c.formatter,c=c.autoFitLabel,f=w(this.attributes,"handle"),d=w(f,"label"),f=f.spacing,p=this.getHandleSize(),g=this.clampValues(),h=h("start"===t?g[0]:g[1]),g=new ib({style:m(m(m({},d),this.inferTextStyle(t)),{text:h})}),d=g.getBBox(),y=d.width,d=d.height;return g.destroy(),c?(c=g=0,l=(e=this.availableSpace).width,e=e.height,n=(a=this.calcMask()).x,r=a.y,i=a.width,a=a.height,o=f+p,"horizontal"===u?(s=o+y/2,g="start"===t?0<n-o-y?-s:s:y<l-n-i-o?s:-s):(l=d+o,c="start"===t?d<r-p?-l:o:d<e-(r+a)-p?l:-o),{x:g,y:c,text:h}):(n=f+p+("horizontal"===u?y/2:0),(i={text:h})["horizontal"===u?"x":"y"]="start"===t?-n:n,i)},G2.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=w(this.attributes,"handleLabel"),m(m(m({},e),this.calcHandleText(t)),this.inferTextStyle(t))):{}},G2.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=w(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return m({cursor:n,shape:t,size:r},e)},G2.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,e=e.orientation,r=this.calcHandlePosition(t),i=this.calcHandleText(t);return m(m(m(m({},Zb(this.getHandleIconStyle(),"icon")),Zb(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},G2.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,t=t.height;return e||Math.floor((this.getOrientVal([+t,+n])+4)/2.4)},G2.prototype.getOrientVal=function(t){var t=O(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},G2.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=O(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},G2.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},G2.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new z.CustomEvent(n,{detail:t}))})},G2.prototype.bindEvents=function(){var t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},G2.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},G2.tag="slider";var z2,W2=G2;function G2(t){var a=z2.call(this,t,m(m(m({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",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]},Zb(L2,"handle")),Zb(P2,"handleIcon")),Zb(C2,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(wb(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(wb(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new z.CustomEvent("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(Y2,H2=Jo),Object.defineProperty(Y2.prototype,"padding",{get:function(){return Xb(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"value",{get:function(){var t=this.attributes.value,e=O(this.range,2),n=e[0],e=e[1];return qe(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=O(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=O(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"thumbRadius",{get:function(){var t,e=this.attributes,n=e.isRound,e=e.thumbRadius;return n?(t=(n=this.availableSpace).width,n=n.height,e||this.getOrientVal([n,t])/2):0},enumerable:!1,configurable:!0}),Y2.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=O(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},Y2.prototype.getValue=function(){return this.value},Y2.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=w(this.attributes,"track"),o=w(this.attributes,"thumb"),s=m(m({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:e,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Zb(a,"track")),Zb(o,"selection"));this.slider=x(t).maybeAppendByClassName("scrollbar",function(){return new W2({style:s})}).update(s).node()},Y2.prototype.render=function(t,e){this.renderSlider(e)},Y2.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=O(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(qe(t,i,r)),e),this.onValueChange(n)},Y2.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},Y2.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},Y2.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)},Y2.tag="scrollbar";var H2,V2=Y2;function Y2(t){var a=H2.call(this,t,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.attributes.value;t!==e&&(a.dispatchEvent(new z.CustomEvent("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new z.CustomEvent("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=O(a.getLocalPosition(),2))[0],e=e[1],n=(i=O(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(wb(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new z.CustomEvent("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new z.CustomEvent("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new z.CustomEvent("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new z.CustomEvent("trackMouseleave",{detail:t.detail}))},a}var q2={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 z.Path({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",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",tickStrokeOpacity:.65,labelOverlap:[]},X2=(ot({},q2,{style:{type:"arc"}}),ot({},q2,{style:{}}),hb({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis")),U2=hb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function $2(t){return t.reduce(function(t,e,n){return t.push(v([0===n?"M":"L"],O(e),!1)),t},[])}function K2(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?$2(r):e?(i=Rb(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(v(["M"],O(e),!1)):t.push(v(["A",i,i,0,0,a],O(e),!1)),t},[])):[]):$2(t)}function Z2(t,e,n){function r(t,e){return[l,t,c,e,s].flat()}var i=n.type,a=n.connect,o=n.center,s=n.closed?[["Z"]]:[],n=O([K2(t,n),K2(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=O([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([v(["L"],O(e),!1)],[v(["L"],O(t),!1)]);if(o)return a=(n=O([Rb(e,o),Rb(t,o)],2))[0],i=n[1],r([v(["A",a,a,0,0,1],O(e),!1),v(["L"],O(e),!1)],[v(["A",i,i,0,0,0],O(t),!1),v(["L"],O(t),!1)]);throw new Error("Arc grid need to specified center")}function J2(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=[],l=0;l<e.length-1;l++){var c=O([e[l].points,e[l+1].points],2),c=Z2(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(U2.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=ub(t,[t,e,s]);this.attr(t)}).attr("className",U2.region.name)},function(t){return t.transition(function(t,e){return _2(this,ub(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=A2(this,r.exit);return k2(e,function(){return t.remove()}),e})}).transitions()}t(ex,Q2=Jo),ex.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=at(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=O(e,1)[0];return m(m({},t),{points:v(v([],O(e),!1),[n],!1)})}):s),l=x(e).maybeAppendByClassName(U2.lineGroup,"g"),e=x(e).maybeAppendByClassName(U2.regionGroup,"g"),o=(l=l,r=o,i=(n=t).animate,a=s.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:K2(t.points,n)}}),l.selectAll(U2.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=ub(Wb(m({path:t.path},r)),[t,e,a]);this.attr(m({class:U2.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return _2(this,ub(Wb(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=A2(this,i.exit);return k2(e,function(){return t.remove()}),e})}).transitions()),l=J2(e,s,t);return v(v([],O(o),!1),O(l),!1)};var Q2,tx=ex;function ex(){return null!==Q2&&Q2.apply(this,arguments)||this}function nx(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=O(t,2);return[t[0],ub(t[1],e)]}))}function rx(t,e){return e&&Re(e)?t.filter(e):t}var ix=an(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),ax=an(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=O(e.startPos,2))[0],n=n[1],i=O(e.endPos,2),Ib([(r=O([i[0]-r,i[1]-n],2))[0],r[1]])):(i=ob(ix(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n,r,i,a="linear"===(n=e).type?(a=n.startPos,r=n.endPos,v(v([],O(a),!1),O(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,v(v([a,r],O(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function ox(t,e,n){t=ax(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function sx(t,e){return ox(t,e.labelDirection,e)}var lx=an(function(t,e){var n=O(e.startPos,2),r=n[0],n=n[1],e=O(e.endPos,2),e=O([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return v(v([t],O(e.startPos),!1),O(e.endPos),!1).join()}),cx=an(function(t,e){var n=e.radius,r=O(e.center,2),i=r[0],r=r[1],t=ob(ix(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return v([t,e.startAngle,e.endAngle,e.radius],O(e.center),!1).join()});function ux(t,e){return("linear"===e.type?lx:cx)(t,e)}function hx(t){return 0===ax(0,t)[1]}function fx(t){return 0===ax(0,t)[0]}function dx(t,e){return e-t==360}function px(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=O([i,i],2),l=s[0],s=s[1],c=O([ob(t),ob(e)],2),u=c[0],c=c[1],h=O(a(u),2),f=h[0],h=h[1],d=O(a(c),2),p=d[0],d=d[1];return dx(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=O(a((c+u)/2),2))[0],c[1]],["A",l,s,0,1,0,p,d]]:(u=180<o?1:0,c=e<t?0:1,"M".concat(f,",").concat(h,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function gx(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(X2.line.class).data([{path:px.apply(void 0,v(v([l,c],O(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",X2.line.name).styles(e).styles({path:function(t){return t.path}})},function(t){return t.transition(function(){var t,r,e,n,i,a=this,o=(o=(i=(i=t=this).attributes).startAngle,e=i.endAngle,n=i.center,i=i.radius,o=v(v([o,e],O(n),!1),[i],!1),e=v(v([l,c],O(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=Sb(o,e),o=Math.ceil(+i/16),i=new Array(o).fill(0).map(function(t,e,n){return{__keyframe_data__:r(e/(n.length-1))}}),t.animate(i,m({fill:"both"},n))):(t.attr("__keyframe_data__",e),null));return o&&(o.onframe=i=function(){var t=hn(a.attributes,"__keyframe_data__");a.style.path=px.apply(void 0,v([],O(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function yx(t){var t=O(t,2),e=O(t[0],2),n=e[0],e=e[1],t=O(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function mx(e,t,n,r){function i(t){return e.selectAll(X2.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(X2.line.name," ").concat(t.className)}).styles(n).transition(function(t){return _2(this,yx(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return _2(this,yx(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,h=t.truncRange,f=t.lineExtension,d=O([c,u],2),p=O(d[0],2),g=p[0],p=p[1],d=O(d[1],2),y=d[0],d=d[1],u=O(f?(c=O([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=O(c[0],2))[0],u=u[1],m=(a=O(c[1],2))[0],a=a[1],v=(c=O(c[2],2))[0],c=c[1],f=(m=O([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=O([-v/u,c/u],2))[0],c=m[1],[v*f,v*a,c*f,c*a]):new Array(4).fill(0),4),m=u[0],v=u[1],f=u[2],c=u[3];return l&&h?(u=(a=O(h,2))[0],l=a[1],o=(u=O([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=O([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:X2.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:X2.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:X2.line.name}])}function vx(t,e,n){var r,i,a,o,s,l=e.type,c=w(e,"line"),n=("linear"===l?mx:gx)(t,e,Db(c,"arrow"),n);return t=t,l=l,c=c,r=(e=e).showArrow,i=e.showTrunc,a=e.lineArrow,o=e.lineArrowOffset,s=e.lineArrowSize,l="arc"!==l&&i?t.select(X2.lineSecond.class):t.select(X2.line.class),!r||!a||"arc"===e.type&&dx(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=Mb(a)).attr(c),Gb(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function bx(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function xx(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=O(ux(t,i),2),r=n[0],n=n[1],t=O(Pb(ox(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function wx(t,e,n,r){var i=w(n,"grid"),a=i.type,o=i.areaFill,s=bx(n),l=rx(e,n.gridFilter),e=("segment"===a?xx:function(t,o){var s,l,c=o.gridControlAngles,e=bx(o);if(!e)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(c&&0!==c.length)return e=O(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=O(ux(t.value,o),2),n=t[0],t=t[1],n=O([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=ob(t),t=O([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];a.push([r*e-i*t+s,r*t+i*e+l])}),{points:a,id:e}});throw new Error("Invalid gridControlAngles")})(l,n),c=m(m({},i),{center:s,areaFill:Re(o)?l.map(function(t,e){return ub(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(X2.grid.class).data([1]).join(function(t){return t.append(function(){return new tx({style:c})}).attr("className",X2.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(Ox.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),Ox.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*r-t*i+l,t*r+s*i+e],[s*a-t*i+l,t*a+s*i+e]]},Ox.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},Ox.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var Mx=Ox;function Ox(t,e,n,r){this.set(t,e,n,r)}function kx(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=O(r.min,2),a=i[0],i=i[1],r=O(r.max,2),o=r[0],r=r[1],s=Ex(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=vb(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?h=(a+o)/2:"right"!==p&&"end"!==p||(h=o),"middle"===(p=d.style.textBaseline)?f=(i+r)/2:"bottom"===p&&(f=r)),O(Xb(e),4)),d=o[0],p=void 0===d?0:d,r=o[1],e=void 0===r?0:r,d=o[2],r=o[3],o=new Mx((c+=a)-(void 0===r?e:r),(u+=i)-p,c+l+e,u+s+(void 0===d?p:d));return t.setEulerAngles(n),o.rotatedPoints(ob(n),h,f)}function Ex(t){return t.__bbox__||t.getBBox()}function Sx(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 _x(t,e,n){t=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0==t?0:t<0?2:1}function Ax(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,l,c=[e,[9999,e[1]]],u=0,h=0;do{var f=[t[h],t[(h+1)%n]];if(i=c,l=s=o=a=void 0,a=_x((r=f)[0],r[1],i[0]),o=_x(r[0],r[1],i[1]),s=_x(i[0],i[1],r[0]),l=_x(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&Sx(r,i[0])||0===o&&Sx(r,i[1])||0===s&&Sx(i,r[0])||!(0!==l||!Sx(i,r[1]))){if(0===_x(f[0],e,f[1]))return Sx(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function Tx(t,e,n){var r,i=t.x1,a=t.x2,o=t.y1,t=t.y2,o=[[i,o],[a,o],[a,t],[i,t]],a=kx(e,n);return r=o,a.every(function(t){return Ax(r,t)})}function Px(t,c){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 t=t,n=(e=O(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=O(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function Cx(t,e,l){function n(t,e){if(t){var n,r,i=Xb(l),t=kx(t,i).flat(1),a=kx(e,i).flat(1),e=[[t[0],t[1],t[2],t[3]],[t[0],t[1],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[2],t[3],t[6],t[7]]];try{for(var o=R(e),s=o.next();!s.done;s=o.next())if(Px(a,s.value))return}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return 1}var r,i,a,o,s,c,u,h,f,d,p,g,y=e.crossPadding,m=new Set,v=null,b=(y=y,f=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===f?(f=e.center,h=e.radius,u=(f=O(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=O(Xb(y),4))[0],s=d[1],c=d[2],d=d[3],new Mx(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=O(e.startPos,2))[0],o=d[1],s=(u=O(e.endPos,2))[0],f=u[1],c=(h=O(fx(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=Pb(sx(0,e),p),(e=new Mx(a,o,s,f)).x1+=y,e.y1+=c,e.x2+=d+h[0],e.y2+=u+h[1],e)));try{for(var x=R(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!Tx(b,g)?m.add(M):!v||n(v,M)?v=M:(m.add(v),m.add(M))}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}return Array.from(m)}function Lx(t,e){return void 0===e&&(e={}),p(t)?0:"number"==typeof t?t:Math.floor(yb(t,e))}var Nx=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(Zv(t),1))})};var jx=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,u,h=Nx,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,v([1],O(t.map(function(t){return Ex(t).width})),!1));for("linear"===n.type&&(hx(n)||fx(n))&&(s=Ub(t[0]).left,l=Ub(t[i-1]).right,l=Math.abs(l-s)||1,d=Math.max(Math.floor(i*y/l),d)),a&&(c=p.splice(0,1)[0]),o&&(u=p.splice(-1,1)[0],p.reverse()),f(p);d<t.length&&Cx((u?v(v([u],O(g),!1),[c],!1):v([c],O(g),!1)).filter(gb),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=h(f(p),{seq:d}),d++}}],["rotate",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.rotate(t,+e)})}var a,o,s=void 0===(s=e.optionalAngles)?[0,45,90]:s,l=e.margin,e=void 0===(e=e.recoverWhenFailed)||e,c=t.map(function(t){return t.getLocalEulerAngles()});try{for(var u=R(s),h=u.next();!h.done;h=u.next())if(i(h.value),Cx(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}e&&i(c)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i=void 0===(a=e.suffix)?"...":a,a=e.minLength,o=void 0===(o=e.maxLength)?1/0:o,s=void 0===(s=e.step)?" ":s,l=void 0===(e=e.margin)?[0,0,0,0]:e,e=mb(r.getTextShape(t[0])),c=Lx(s,e),u=a?Lx(a,e):c,s=Lx(o,e),h=(!p(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return Ex(t).width}))),t.slice()),f=((a=O(l,4))[0],a[1],a[2],a[3],s);u+c<f;f-=c){var d=function(e){if(h.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(h=Cx(t,n,l)).length<1)return{value:void 0}}(f);if("object"==typeof d)return d.value}}],["wrap",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.wrap(t,l,e,d)})}var a,o,s,l=void 0===(u=e.wordWrapWidth)?50:u,c=void 0===(u=e.maxLines)?3:u,u=void 0===(u=e.recoverWhenFailed)||u,h=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),f=Math.min.apply(Math,v([],O(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&hx(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),Cx(t,n,h).length<1)return;u&&i(e)}}]]);function Rx(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=jx.get(e);!function(t,e,n){if(!(e.labelOverlap.length<1))if("hide"===n){for(var r=t[0];r;){if("offscreen"===r.className)return;r=r.parent}return 1}else return"rotate"===n?!t.some(function(t){return!(null==(t=t.attr("transform"))||!t.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||1<t.filter(function(t){return t.querySelector("text")}).length}(r,i,e)||null==n||n(r,t,i,a)})}function Ix(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var Bx=an(function(t,e){var t=O(t,2),n=t[0],t=t[1],e=O(e,2),r=e[0],e=e[1],n=O([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return v(v([],O(t),!1),O(e),!1).join()});function Dx(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=sx(t.value,n),t=ax(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?Bx([1,0],e):Bx([t[0]<0?-1:1,0],t),kb(n=((n=sb(r))+360)%180,-90,90)||(n+=180),n))}function Fx(t,e,n){var r=n.type,i=n.labelAlign,t=sx(t,n),n=Ix(e),e=Ix(sb(Bx([1,0],t))),a="center",o="middle";return"linear"===r?[90,270].includes(e)&&0===n?(a="center",o=1===t[1]?"top":"bottom"):e%180||![90,270].includes(n)?0===e?(kb(n,0,90,!1,!0)||kb(n,0,90)||kb(n,270,360))&&(a="start"):90===e?kb(n,0,90,!1,!0)?a="start":(kb(n,90,180)||kb(n,270,360))&&(a="end"):270===e?kb(n,0,90,!1,!0)?a="end":(kb(n,90,180)||kb(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(kb(n,0,90)||kb(n,270,360))&&(a="end")):a="center":"parallel"===i?o=kb(e,0,180,!0)?"top":"bottom":"horizontal"===i?kb(e,90,270,!1)?a="end":(kb(e,270,360,!1)||kb(e,0,90))&&(a="start"):"perpendicular"===i&&(a=kb(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function zx(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=ub(s,[t,l,e]),o=O([sx(t.value,n),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(o,a)],2),a=O(Cb(Pb(o[0],s+(1===o[1]?ub(r?i:0,[t,l,e]):0)),ux(t.value,n)),2);return{x:a[0],y:a[1]}}function Wx(t,e){"text"===t.nodeName&&t.attr(e)}function Gx(r){Rx(this.node().childNodes,r,{hide:Zv,show:Kv,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=Fx(t.__data__.value,e,n),(n=t.querySelector(X2.labelItem.class))&&Wx(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&xb(t,e,n)},wrap:function(t,e,n){var r;t&&bb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:t=void 0===(t=n)?2:t,textBaseline:r=void 0===r?"top":r})},getTextShape:function(t){return t.querySelector("text")}})}function Hx(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),h=x(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,Re(c)?function(){return Mb(ub(c,[a,o,s,sx(a.value,l)]))}:function(){return Mb(a.label||"")})).attr("className",X2.labelItem.name).node(),r=O(Jb(nx(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=at(n,["transform"]),f=(Qb(t,r),Dx(e,t,i));return t.setLocalEulerAngles(+f),Wx(h,m(m({},Fx(e.value,f,i)),u)),Qb(t,r),t.attr(n),h}function Vx(n,f,d,p){var t=rx(f,d.labelFilter),g=w(d,"label");return n.selectAll(X2.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",X2.label.name).transition(function(t){return Hx(this,t,f,g,d),this.attr(zx(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return Gx.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l,c=this.querySelector(X2.labelItem.class),u=Hx(this,t,f,g,d),h=(e=c,n=u,c=p.update,void 0===r&&(r="destroy"),u=n,"text"===(i=e).nodeName&&"text"===u.nodeName&&i.attributes.text===u.attributes.text?(e.remove(),[null]):(i=function(){"destroy"===r?e.destroy():"hide"===r&&Zv(e),n.isVisible()&&Kv(n)},c?(u=void 0===(u=c.duration)?0:u,a=void 0===(a=c.delay)?0:a,o=Math.ceil(+u/2),u=+u/4,s=(h=O((l=function(t){var e,n;return"circle"===t.nodeName?(n=(e=O(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],h=h[1],l=O(l(n),2),l=(s=O([(s+l[0])/2-s,(h+l[1])/2-h],2))[0],h=s[1],s=e.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(l,", ").concat(h,")")}],m(m({fill:"both"},c),{duration:a+o+u})),k2(l=n.animate([{opacity:0,transform:"translate(".concat(-l,", ").concat(-h,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],m(m({fill:"both"},c),{duration:o+u,delay:a+o-u})),i),[s,l]):(i(),[null]))),c=_2(this,zx(t,f,d),p.update);return this.__bbox__=t.bbox,v(v([],O(h),!1),[c],!1)}).call(function(t){var e,t=hn(t,"_transitions").flat().filter(gb);e=function(){return Gx.call(n,d)},0===(t=t).length?e():Promise.all(t.map(function(t){return null==t?void 0:t.finished})).then(e)})},function(t){return t.transition(function(){var t=this,e=A2(this.childNodes[0],p.exit);return k2(e,function(){return x(t).remove()}),e})}).transitions()}function Yx(t,e){return ox(t,e.tickDirection,e)}var qx=an(function(t,e){t=O(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return v(v([],O(t),!1),[e],!1).join()});function Xx(t,e,n,r,i,a,o){var s=Yx(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=O(qx(l,ub(a,[c,u,h])),2),a=O(l[0],2),c=a[0],u=a[1],h=O(l[1],2),{x1:c,x2:h[0],y1:u,y2:h[1]}),l=a.x1,c=a.x2,u=a.y1,h=a.y2,a=O(Jb(nx(o,[t,e,n,s])),2),o=a[0],t=a[1];"line"===r.node().nodeName&&r.styles(m({x1:l,x2:c,y1:u,y2:h},o)),i.attr(t),r.styles(o)}function Ux(t,e,n,r,i,a){o=x(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=Yx(s.value,u),u="line",Re(h)&&(u=function(){return ub(h,[s,l,c,f])});Xx(t,e,n,o.append(u).attr("className",X2.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=O(ux(t.value,r),2);return _2(this,{x:e[0],y:e[1]},a)}var $x=hb({text:"text"},"title");function Kx(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function Zx(r,t){t=Object.entries(t).reduce(function(t,e){var e=O(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(tw,Jx=Jo),tw.prototype.getAvailableSpace=function(){var t=this.attributes,r=t.width,i=t.height,e=t.position,n=t.spacing,t=t.inset,a=this.querySelector($x.text.class);if(!a)return new lb(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=O(Xb(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=O([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=Kx(e);if(a.includes("i"))return new lb(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=O(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=O([+r-o-h],1),p=n[0]),"b"===t&&(n=O([+i-s-l],1),g=n[0]),"l"===t&&(n=O(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=O(Xb(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=O([n+a,e+t],2),t=a[0],a=a[1];return new lb(f+n,d+e,p-t,g-a)},tw.prototype.getBBox=function(){return this.title?this.title.getBBox():new lb(0,0,0,0)},tw.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,at(t,["width","height","position","spacing"])),u=O(Jb(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=O([+h/2,+r/2],2),a=(i=O([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=Kx(t)).includes("l")&&(a=(n=O([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=O([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=O([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=O([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;Ob(!!c.text,x(e),function(t){l.title=t.maybeAppendByClassName($x.text,"text").styles(u).call(Zx,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var Jx,Qx=tw;function tw(t){return Jx.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}function ew(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=O(Jb(w(r,"title")),2),p=d[0],d=d[1],g=d.transform,d=at(d,["transform"]),d=(t.styles(p),e.styles(d),g||function(t,e,n){if((t=t.cloneNode(!0)).style.transform="scale(1, 1)",t.style.transform="none",t=t.getBBox().height,"vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(t/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(t/2,")")}return""}(t.node(),p.direction,p.position)),y=(Qb(t.node(),d),g=x(n._offscreen||n.querySelector(X2.mainGroup.class)),p=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=Kx(r),g=g.node().getLocalBounds(),s=(l=O(g.min,2))[0],l=l[1],c=(g=O(g.halfExtents,2))[0],g=g[1],u=(p=O(p.node().getLocalBounds().halfExtents,2))[0],p=p[1],l=(s=O([s+c,l+g],2))[0],s=s[1],m=(a=O(Xb(a),4))[0],h=a[1],f=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(y=n.startPos,n=n.endPos,n=(r=O("start"===r?[y,n]:[n,y],2))[0],y=(r=O(Pb(Ib([-(y=r[1])[0]+n[0],-y[1]+n[1]]),m),2))[0],r=r[1],{x:n[0]+y,y:n[1]+r}):(o.includes("t")&&(s-=g+p+m),o.includes("r")&&(l+=c+u+h),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=g+p+f),{x:l,y:s})),n=y.x,r=y.y,m=_2(e.node(),{x:n,y:r},i);return Qb(t.node(),d),m}function nw(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=Ob(n,t.maybeAppendByClassName(X2.lineGroup,"g"),function(t){return vx(t,e,s)})||[],r=Ob(r,t.maybeAppendByClassName(X2.tickGroup,"g"),function(t){return t=t,r=s,i=rx(o,(n=e).tickFilter),a=w(n,"tick"),t.selectAll(X2.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",X2.tick.name).transition(function(t,e){return Ux.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),Ux.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=A2(this.childNodes[0],r.exit);return k2(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=Ob(i,t.maybeAppendByClassName(X2.labelGroup,"g"),function(t){return Vx(t,o,e,s)})||[];return v(v(v([],O(n),!1),O(r),!1),O(i),!1).filter(function(t){return!!t})}t(aw,rw=Jo),aw.prototype.render=function(o,t,e){var s=this,n=o.titleText,r=o.data,i=o.animate,a=o.showTitle,l=o.showGrid,c=o.dataThreshold,u=o.truncRange,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}(r,c).filter(function(t){t=t.value;return!(u&&t>u[0]&&t<u[1])}),f=O2(void 0===e?i:e),r=Ob(l,x(t).maybeAppendByClassName(X2.gridGroup,"g"),function(t){return wx(t,h,o,f)})||[],c=x(t).maybeAppendByClassName(X2.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&nw(o,x(this.offscreenGroup),h,O2(!1)),nw(o,x(c.node()),h,f)),e=Ob(a,x(t).maybeAppendByClassName(X2.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(X2.title.class).data([{title:a}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(t){return t.append(function(){return Mb(a)}).attr("className",X2.title.name).transition(function(){return ew(x(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return ew(x(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return v(v(v([],O(r),!1),O(i),!1),O(e),!1).flat().filter(function(t){return!!t})};var rw,iw=aw;function aw(t){return rw.call(this,t,q2)||this}var ow,sw=hb({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"),lw=(t(cw,ow=Jo),Object.defineProperty(cw.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return qe(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=O((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,v([],O(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),cw.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(cw.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),cw.prototype.getBBox=function(){var t=ow.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new lb(e,t,i+n.width,r)},cw.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this.currPage,i=this.playState,a=this.playWindow,o=this.pageViews;if("idle"!==i||t<0||o.length<=0||t>=o.length)return null;o[r].setLocalPosition(0,0),this.prepareFollowingPage(t);i=O(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=S2(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return k2(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},cw.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?null:(t=t?(n-1+e)%e:qe(n-1,0,e),this.goTo(t))},cw.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?null:(t=t?(n+1)%e:qe(n+1,0,e),this.goTo(t))},cw.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(sw.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},cw.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?Kv:Zv)(t)})},cw.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orientation,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,O("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=O(i.offset,3),o=O(a[0],2),s=o[0],c=o[1],l=O(a[1],2),r=l[0],o=l[1],l=O(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},cw.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(sw.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},cw.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orientation,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},cw.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=O(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},cw.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(sw.controller,"g");Jv(t.node(),u),u&&(u=w(this.attributes,"button"),e=w(this.attributes,"pageNum"),i=(u=O(Jb(u),2))[0],u=u[1],n=i.size,r=at(i,["size"]),i=!t.select(sw.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(sw.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(sw.prevBtn,"path"),u=t.maybeAppendByClassName(sw.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(sw.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),Gb(t.node(),n,!0)}),a=t.maybeAppendByClassName(sw.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(sw.pageInfo,"text").styles(e),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),i)&&(this.prevBtnGroup.addEventListener("click",function(){o.prev()}),this.nextBtnGroup.addEventListener("click",function(){o.next()}))},cw.prototype.render=function(t,e){e=x(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},cw.prototype.bindEvents=function(){var t=this,e=rn(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(z.ElementEvent.INSERTED,e),this.playWindow.addEventListener(z.ElementEvent.REMOVED,e)},cw);function cw(t){var e,n,t=ow.call(this,t,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:[["M",(t=0)-(n=6),(e=0)-n],["L",t+n,e],["L",t-n,e+n],["Z"]],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 t.playState="idle",t.contentGroup=t.appendChild(new z.Group({class:sw.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new z.Group({class:sw.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function uw(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}s2.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"]]}),s2.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),s2.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var hw=hb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");t(pw,fw=Jo),Object.defineProperty(pw.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(pw.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height;return{markerWidth:n,labelWidth:r,valueWidth:i,height:Math.max(n,t,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=O(Xb(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=O(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=O(this.span,2),a=(e=O([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=O(Xb(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=O(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(hw.marker.class))?t.style:{},e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,r=void 0===r?t.strokeWidth:r,i=e.markerLineWidth,i=void 0===i?t.lineWidth:i,e=e.markerStroke,t=void 0===e?t.stroke:e,e=+(r||i||(t?1:0))*Math.sqrt(2),r=this.markerGroup.node().getBBox(),i=r.width,t=r.height;return(1-e/Math.max(i,t))*n},enumerable:!1,configurable:!0}),pw.prototype.renderMarker=function(t){var f=this,d=this.attributes.marker,p=w(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(hw.markerGroup,"g").style("zIndex",0),Ob(!!d,this.markerGroup,function(){var t=f.markerGroup.node(),e=t.getElementsByClassName(hw.marker.name)[0],n=d();if(e)if(n.nodeName===e.nodeName){var r,i,a=e,o=(o=n).attributes;try{for(var s=R(Object.entries(o)),l=s.next();!l.done;l=s.next()){var c=O(l.value,2),u=c[0],h=c[1];"id"!==u&&"className"!==u&&a.attr(u,h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}x(e).styles(p)}else e.remove(),x(n).attr("className",hw.marker.name).styles(p),t.appendChild(n);else x(n).attr("className",hw.marker.name).styles(p),t.appendChild(n);f.markerGroup.node().scale(1/f.markerGroup.node().getScale()[0]),Gb(f.markerGroup.node(),f.scaleSize,!0)})},pw.prototype.renderLabel=function(t){var e=w(this.attributes,"label"),n=e.text,e=at(e,["text"]);this.labelGroup=t.maybeAppendByClassName(hw.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(hw.label,function(){return Mb(n)}).styles(e)},pw.prototype.renderValue=function(t){var e=this,n=w(this.attributes,"value"),r=n.text,i=at(n,["text"]);this.valueGroup=t.maybeAppendByClassName(hw.valueGroup,"g").style("zIndex",0),Ob(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(hw.value,function(){return Mb(r)}).styles(i)})},pw.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=w(this.attributes,"background");this.background=t.maybeAppendByClassName(hw.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(hw.background,"rect").styles(m({width:n,height:e},r))},pw.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=O(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),xb(this.labelGroup.select(hw.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),xb(this.valueGroup.select(hw.value.class).node(),Math.ceil(n)))},pw.prototype.render=function(t,e){e=x(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var fw,dw=pw;function pw(t){return fw.call(this,t,{span:[1,1],marker:function(){return new z.Circle({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function gw(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var yw,mw=hb({page:"item-page",navigator:"navigator",item:"item"},"items"),vw=(t(bw,yw=Jo),Object.defineProperty(bw.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(bw.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(bw.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=w(this.attributes,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:m({layout:o,labelText:r,valueText:i},Object.fromEntries(Object.entries(s).map(function(t){t=O(t,2);return[t[0],ub(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),bw.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=O(this.navigatorShape,1)[0],t=O(this.grid,2),y=t[0],m=t[1],v=m*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(m,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),O(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=O([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=O([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=O([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},bw.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=O(this.navigatorShape,1)[0],r=O(this.grid,2),s=r[0],l=r[1],r=O([e-t,n],2),c=r[0],u=r[1],e=O([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],m=e[6],v=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===m?0:o,i=m+r+n;return i<=c&&gw(g,function(t){return t<l})?(r=O([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=O([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&gw(y,function(t){return t<s})?(r=O([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=O([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],m=i[2],v=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(bw.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),bw.prototype.ifHorizontal=function(t,e){return uw(this.attributes.orientation,t,e)},bw.prototype.flattenPage=function(e){e.querySelectorAll(mw.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(mw.page.class).forEach(function(t){e.removeChild(t).destroy()})},bw.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));x(t).selectAll(mw.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new dw({style:t})}).attr("className",mw.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("pointerenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("pointerleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},bw.prototype.relayoutNavigator=function(){var t=this.attributes,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=O(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},bw.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=O(t,2);return{page:t[0],layouts:t[1]}}),u=v([],O(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new z.Group({className:mw.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=Ye(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(Fe(r[t])||(r[t]=Xe(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},bw.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=w(this.attributes,"nav"),r=fb({orientation:e},n),i=this;return t.selectAll(mw.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new lw({style:r})}).attr("className",mw.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},bw.prototype.getBBox=function(){return this.navigator.getBBox()},bw.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(x(e)),this.renderItems(n.getContainer()),this.adjustLayout())},bw.prototype.dispatchCustomEvent=function(t,e){t=new z.CustomEvent(t,{detail:e});this.dispatchEvent(t)},bw);function bw(t){t=yw.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:cn,mouseenter:cn,mouseleave:cn})||this;return t.navigatorShape=[0,0],t}var xw,ww=hb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Mw={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},Ow=(t(kw,xw=Jo),kw.prototype.render=function(t,e){var n=x(e).maybeAppendByClassName(ww.markerGroup,"g"),n=(this.renderMarker(n),x(e).maybeAppendByClassName(ww.labelGroup,"g"));this.renderLabel(n)},kw.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?uw(n,"horizontalHandle","verticalHandle"):e;Ob(!!i,t,function(t){var e=w(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(ww.marker,function(){return new s2({style:n})}).update(n)})},kw.prototype.renderLabel=function(t){var s=this,e=this.attributes,n=e.showLabel,l=e.orientation,r=e.spacing,c=void 0===r?0:r,u=e.formatter;Ob(n,t,function(t){var e=w(s.attributes,"label"),n=e.text,e=at(e,["text"]),r=(null==(r=t.select(ww.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=O(uw(l,[0,(void 0===r?0:r)+c,"center","top"],[(void 0===i?0:i)+c,0,"start","middle"]),4),i=r[0],a=r[1],o=r[2],r=r[3];t.maybeAppendByClassName(ww.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},kw);function kw(t){return xw.call(this,t,Mw)||this}var Ew,Ls={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Sw=fb({},Ls,{}),_w=fb({},Ls,Zb(Mw,"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"}),Aw=hb({title:"title",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"),Tw=(t(Pw,Ew=Jo),Pw.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=O(Jb(w(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(Aw.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(Aw.title,function(){return new Qx({style:s})}).update(s)},Pw.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=O(Jb(w(this.attributes,"title",!0)),2),o=a[0],a=a[1],s=m(m({},o),{width:i,height:e,x:0,y:0}),l=(this.itemsGroup=t.maybeAppendByClassName(Aw.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(Aw.items.class).data(["items"]).join(function(t){return t.append(function(){return new vw({style:s})}).attr("className",Aw.items.name).each(function(){l.items=x(this)})},function(t){return t.update(s)},function(t){return t.remove()})},Pw.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.title.node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(Pw.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new lb(0,0,n,t)},enumerable:!1,configurable:!0}),Pw.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),h=null==(h=this.items)?void 0:h.node();return u&&h?(h=h,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=h.getBBox(),t=Kx(t),e=(r=O(Xb(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=O(Xb(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=O([r+a,e+o],2))[0],e=r[1],r=(o=O([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new lb(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new lb(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=O([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new lb(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):Ew.prototype.getBBox.call(this)},Pw.prototype.render=function(t,e){var n=t.width,t=t.height,e=x(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},Pw);function Pw(t){return Ew.call(this,t,Sw)||this}var Cw,Lw={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",zIndex:999},Nw=hb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),jw=(t(Rw,Cw=Jo),Rw.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=O(Xb(i.padding),4))[0],e=i[1],n=i[2],i=i[3],a=(r=this.label.node().getLocalBounds()).min,r=r.max,i=[[a[0]-i,a[1]-o],[r[0]+e,r[1]+n]],a=this.getPath(t,i),o=w(this.attributes,"background"),this.background=x(this.group).maybeAppendByClassName(Nw.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},Rw.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=O(Jb(w(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,at(r,["text"]));this.label=x(this.group).maybeAppendByClassName(Nw.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(Nw.label,function(){return Mb(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},Rw.prototype.adjustLayout=function(){var t=O(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},Rw.prototype.getPath=function(n,t){var r=this,t=O(t,2),e=O(t[0],2),i=e[0],e=e[1],t=O(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=O(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[v(["M"],O(t[0]),!1),v(["L"],O(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},Rw.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=O(t,2))[0],t=t[1],r=(e=O(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,v([],O(t),!1)),t=O(t,2),r=O(t[0],2),i=r[0],r=r[1],t=O(t[1],2),a=t[0],t=t[1],a=O(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=O(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=O([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},Rw.prototype.bindEvents=function(){this.label.on(z.ElementEvent.BOUNDS_CHANGED,this.renderBackground)},Rw.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},Rw);function Rw(t){t=Cw.call(this,t,Lw)||this;return t.point=[0,0],t.group=t.appendChild(new z.Group({})),t.isMutationObserved=!0,t}function Iw(t,e){var t=O(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var Bw=hb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Dw(t){var e=t.orientation,n=t.size,t=t.length;return uw(e,[t,n],[n,t])}function Fw(t){var e=t.type,t=O(Dw(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function zw(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Re(r)?new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))}):r).length,l=l.map(function(t){return z.parseColor(t).toString()});return s?1===s?l[0]:n?(i=t,n=e,a=Array.from(l),o=i.length,new Array(o).fill(0).reduce(function(t,e,n){var r=a[n%a.length];return t+" ".concat(i[n],":").concat(r).concat(n<o-1?" ".concat(i[n+1],":").concat(r):"")},"l(".concat("horizontal"===n?"0":"270",")"))):l.reduce(function(t,e,n){return t+" ".concat(n/(s-1),":").concat(e)},"l(".concat(uw(e,"0","270"),")")):""}function Ww(t,e){var n,r,i,a=w(e,"selection"),o=zw(e),t=t.maybeAppendByClassName(Bw.selection,"path").styles(m({path:Fw(e),fill:o},a)),a=t.maybeAppendByClassName(Bw.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=O(Dw(o),2))[0],o=o[1],n=(e=O(e,2))[0],e=e[1],i=uw(a,n*r,0),n=uw(a,0,n*o),r=uw(a,e*r,r),[["M",i,n],["L",i,i=uw(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(Vw,Gw=Jo),Vw.prototype.render=function(t,e){var n,r,i=x(e).maybeAppendByClassName(Bw.trackGroup,"g");i=i,r=w(n=t,"track"),i.maybeAppendByClassName(Bw.track,"path").styles(m({path:Fw(n)},r)),Ww(x(e).maybeAppendByClassName(Bw.selectionGroup,"g"),t)};var Gw,Hw=Vw;function Vw(t){return Gw.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var Yw,qw,Xw,Uw,$w=an(function(t){return{min:Math.min.apply(Math,v([],O(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,v([],O(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),Kw=(t(f,Yw=Jo),Object.defineProperty(f.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),f.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new lb(0,0,e,t)},f.prototype.render=function(t,e){var n=this,t=t.showLabel,r=(this.renderTitle(x(e)),this.availableSpace),i=r.x,r=r.y,e=x(e).maybeAppendByClassName(Aw.contentGroup,"g").styles({x:i,y:r}),i=(Ob(!!t,e.maybeAppendByClassName(Aw.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(Aw.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(Aw.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(f.prototype,"range",{get:function(){var t=this.attributes.data;return $w(t)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"ribbonRange",{get:function(){var t=O(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=O(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),f.prototype.ifHorizontal=function(t,e){return uw(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},f.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=w(this.attributes,"title"),o=m(m({},a),{width:i,height:e,text:r}),s=this;t.selectAll(Aw.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new Qx({style:o})}).attr("className",Aw.title.name).each(function(){s.title=this})},function(t){return t.update(o)},function(t){return t.each(function(){s.title=void 0}).remove()})},Object.defineProperty(f.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new lb(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,t=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][t]},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(X2.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new lb(0,0,t,e)),this.cacheLabelBBox):new lb(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"labelShape",{get:function(){var t,e=this.attributes,n=e.showLabel,e=e.labelSpacing,e=void 0===e?0:e;return n?{width:t=(n=this.labelBBox).width,height:n=n.height,size:this.ifHorizontal(n,t)+e+this.labelFixedSpacing,length:this.ifHorizontal(t,n)}:{width:0,height:0,size:0,length:0}},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,t=t.ribbonSize,n=this.availableSpace,r=n.width,n=n.height,i=this.labelShape,a=i.size,i=i.length,r=O(this.ifHorizontal([n,r],[r,n]),2),n=r[0],r=r[1],e=e?this.handleShape:{size:0,length:0},o=e.size,e=e.length,s=this.handleOffsetRatio,l=0,c=this.labelPosition,l=t||(["bottom","right"].includes(c)?Math.min(n-a,(n-o)/s):o<n*(1-s)?Math.max(n-a,0):Math.max((n-a-o)/s,0)),t=Math.max(e,i),n=r-t,o=O(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=O(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new lb(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,t=t.height;return this.ifHorizontal({size:t,length:e},{size:e,length:t})},enumerable:!1,configurable:!0}),f.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=w(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.length,h=h.size,d=fb({x:u,y:s,length:f,size:h,type:r,orientation:i,color:a,block:e,partition:n.map(function(t){return(t.value-l)/(c-l)}),range:this.ribbonRange},o);this.ribbon=t.maybeAppendByClassName(Aw.ribbon,function(){return new Hw({style:d})}).update(d)},f.prototype.getHandleClassName=function(t){return"".concat(Aw.prefix("".concat(t,"-handle")))},f.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=w(this.attributes,"handle"),r=O(this.selection,2),i=r[0],r=r[1],a=m(m({},n),{orientation:t}),t=n.shape,o="basic"===(void 0===t?"slider":t)?Ow:D2,s=this;this.handlesGroup.selectAll(Aw.handle.class).data(e?[{value:i,type:"start"},{value:r,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new o({style:a})}).attr("className",function(t){t=t.type;return"".concat(Aw.handle," ").concat(s.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(s[t]=this).addEventListener("pointerdown",s.onDragStart(e))})},function(t){return t.update(a).each(function(t){t=t.value;this.update({labelText:t})})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");s[t]=void 0}).remove()})},f.prototype.adjustHandles=function(){var t=O(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},f.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,t=t.orientation,n=O(this.getElementsByClassName(Aw.title.name),1)[0],r=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();n&&r&&"top-left"===e&&"horizontal"===t&&(e=O(r.getLocalBounds().min,1)[0],t=O(n.getLocalBounds().min,1)[0],n.style.x=+(this.style.x||0)+(e-t))},Object.defineProperty(f.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new lb(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,t=t.height,n=this.endHandle.getBBox(),r=n.width,n=n.height,e=O([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new lb(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=O(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),f.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,r=r.y,a=this.ribbonShape.size,e=this.getOffset(e),i=O(this.ifHorizontal([i+e,r+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,r+e]),2),a=i[0],r=i[1],e=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null!=e&&e.update({x:a,y:r,formatter:n})},f.prototype.renderIndicator=function(t){var e=w(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Aw.indicator,function(){return new jw({})}).update(e)},Object.defineProperty(f.prototype,"labelData",{get:function(){var s=this;return this.attributes.data.reduce(function(t,e,n,r){var i,a,o=null!=(o=null==e?void 0:e.id)?o:n.toString();return t.push(m(m({},e),{id:o,index:n,type:"value",label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:s.ribbonScale.map(e.value)})),n<r.length-1&&(i=r[n+1],a=((i=(r=O([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(m(m({},e),{id:o,index:n,type:"range",range:[i,r],label:[i,r].join("~"),value:s.ribbonScale.map(a)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"labelStyle",{get:function(){var t=O(["center","middle"],2),e=t[0],t=t[1],n=this.labelPosition;return"top"===n?t="bottom":"bottom"===n?t="top":"left"===n?e="end":"right"===n&&(e="start"),{labelTextAlign:e,labelTextBaseline:t}},enumerable:!1,configurable:!0}),f.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=w(this.attributes,"tick"),a=w(this.attributes,"label"),o=a.align,n=fb(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Zb(i,"tick"),Zb(a,"label"),{data:this.labelData}),i={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!r||r(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===o&&(!r||r(t,t.index,n.filter(function(t){return t.type===o})))},labelFormatter:e},s=m(m(m({},n),i),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Aw.label,function(){return new iw({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(f.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,t=t.tickLength,i=this.ribbonShape.size,a=this.labelPosition,o=this.labelFixedSpacing,s=O([0,0,0],3),l=s[0],s=(s[1],s[2]),t=null!=t?t:i;return e?(s=t,"positive"===n?"right"===a?s=l=t:"bottom"===a&&(l=s):"negative"!==n||"top"!==a&&"left"!==a||(l=i)):"positive"===n&&"right"!==a&&"bottom"===a&&(l=i+o),{offset:l,spacing:r,tickLength:s}},enumerable:!1,configurable:!0}),f.prototype.adjustLabel=function(){var t,e,n,r,i,a,o;this.attributes.showLabel&&(o=(a=this.ribbonBBox).x,t=a.y,i=a.width,a=a.height,e=(r=this.labelAxisStyle).offset,n=r.spacing,r=r.tickLength,a=(i=O(this.ifHorizontal([[o,t+e],[o+i,t+e]],[[o+e,t+a],[o+e,t]]),2))[0],o=i[1],this.label.update({startPos:a,endPos:o,tickLength:r,labelSpacing:n},!1))},f.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},f.prototype.showIndicator=function(t,e){var n,r,i,a;void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t?(i=(a=this.range).min,a=a.max,n=(r=this.ribbonBBox).x,r=r.y,t=qe(t,i,a),i=this.getOffset(t),a=this.ifHorizontal([i+n,r],[n,i+r]),this.indicator.update({x:a[0],y:a[1],position:this.ifHorizontal("top","left"),labelText:e}),Kv(this.indicator.node())):this.hideIndicator()},f.prototype.hideIndicator=function(){Zv(this.indicator.node())},f.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},f.prototype.setSelection=function(t,e){this.updateSelection(t,e)},f.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=O(this.selection,2),c=l[0],l=l[1],t=O([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=O((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=O(n,2))[0],n=n[1],a=(c=O(c,2))[0],c=c[1],o=(l=O(l,2))[0],l=l[1],c=(a=O([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=O([a,c],2))[0],a=u[1]),n-i<s?[i,n]:c<i?o===i&&l===a?[i,a]:[i,s+i]:n<a?l===n&&o===c?[c,n]:[n-s,n]:[Bb(c,r),Bb(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(f.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return en(t)?Bb(.01*(e-n),0):t},enumerable:!1,configurable:!0}),f.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?Iw(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},f.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=O(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,v([],O(wb(t)),!1));return qe(this.getOffset(i-a,!0),r,n)},f.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},f.prototype.dispatchSelection=function(){var t=new z.CustomEvent("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},f.prototype.dispatchIndicated=function(t,e){t=new z.CustomEvent("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},f);function f(t){var a=Yw.call(this,t,_w)||this;return a.eventToOffsetScale=new Z1({}),a.innerRibbonScale=new Z1({}),a.cacheLabelBBox=null,a.cacheHandleBBox=null,a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=Iw(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),O(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function Zw(t){qw||(qw=document.createElement("table"),Uw=document.createElement("tr"),Xw=/^\s*<(\w+|!)[^>]*>/,Uw={tr:document.createElement("tbody"),tbody:qw,thead:qw,tfoot:qw,td:Uw,th:Uw,"*":document.createElement("div")});var e=Xw.test(t)&&RegExp.$1,e=(e&&e in Uw||(e="*"),Uw[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}function Jw(t){return{CONTAINER:"".concat(t=void 0===t?"":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 Qw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(i5,t5=Jo),Object.defineProperty(i5.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),i5.prototype.getContainer=function(){return this.element},Object.defineProperty(i5.prototype,"position",{set:function(t){var t=O(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(i5.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(i5.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,o=t.template;return e.map(function(t,e){var n,r=t.name,r=void 0===r?"":r,i=t.color,i=void 0===i?"black":i,a=t.index,t=at(t,["name","color","index"]),r=m({name:r,color:i,index:null!=a?a:e},t);return Zw((i=o.item,n=r,i&&n?i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):i))})},enumerable:!1,configurable:!0}),i5.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},i5.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),t5.prototype.destroy.call(this)},i5.prototype.show=function(t,e){var n,r=this;void 0!==t&&void 0!==e&&(n=this.element.style.transition,this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(function(){r.element.style.transition=n},10)),this.element.style.visibility="visible"},i5.prototype.hide=function(){this.element.style.visibility="hidden"},i5.prototype.initShape=function(){var t=this.attributes.template;this.element=Zw(t.container),this.id&&this.element.setAttribute("id",this.id)},i5.prototype.renderCustomContent=function(){var t;(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey)&&(this.prevCustomContentKey=this.attributes.contentKey,t=this.attributes.content)&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))},i5.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=Jw(e.prefixCls),s=this.element;this.element.style.pointerEvents=i?"auto":"none",t?this.renderCustomContent():(n?(s.innerHTML=e.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=n):null!=(t=null==(i=s.getElementsByClassName(o.TITLE))?void 0:i[0])&&t.remove(),e=this.HTMLTooltipItemsElements,(n=document.createElement("ul")).className=o.LIST,n.replaceChildren.apply(n,v([],O(e),!1)),(i=this.element.querySelector(".".concat(o.LIST)))?i.replaceWith(n):s.appendChild(n)),r=s,Object.entries(a).forEach(function(t){var t=O(t,2),e=t[0],n=t[1];v([r],O(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})},i5.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=O(l,2),n=e[0],e=e[1],t=O(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},i5.prototype.setOffsetPosition=function(t){var t=O(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat(+(void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(+i+n+t,"px")},i5.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},i5.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=O(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.bounding,c=c.position;return f?(e=(n=this.element).offsetWidth,n=n.offsetHeight,h=(u=O([+u+l,+h+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=f.x,i=f.y,a={left:h<s,right:s+f.width<h+e,top:u<i,bottom:i+f.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},i5.tag="tooltip",e([(void 0===(e5=100)&&(e5=0),void 0===(n5=!0)&&(n5=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,n5&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},e5))})})],i5.prototype,"updatePosition",null);var t5,e5,n5,r5=i5;function i5(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=Jw(n);return(e=t5.call(this,t,{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(r.CONTAINER,'"></div>'),title:'<div class="'.concat(r.TITLE,'"></div>'),item:'<li class="'.concat(r.LIST_ITEM,'" data-index={index}>\n <span class="').concat(r.NAME,'">\n <span class="').concat(r.MARKER,'" style="background:{color}"></span>\n <span class="').concat(r.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(r.VALUE,'" title="{value}">{value}</span>\n </li>')},style:(t=Jw(t=void 0===(t=n)?"":t),(r={})[".".concat(t.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"},r[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},r[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},r[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},r[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},r[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},r[".".concat(t.NAME_LABEL)]=m({flex:1},Qw),r[".".concat(t.VALUE)]=m({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Qw),r[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r)})||this).prevCustomContentKey=e.attributes.contentKey,e.initShape(),e.render(e.attributes,e),e}t(o5,a5=z.Group),Object.defineProperty(o5.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Xb(t)},enumerable:!1,configurable:!0}),Object.defineProperty(o5.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Xb(t)},enumerable:!1,configurable:!0}),o5.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=O(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new lb(e-i,n-a,r+i+o,t+a+s)},o5.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,a5.prototype.appendChild.call(this,t,e),t},o5.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=O(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=O(this.$margin,4),s=o[0],o=o[3];return new lb(n+o,r+s,e-n-i,t-r-a)},o5.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:Ab,grid:Tb})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},o5.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},o5.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var a5,Ns=o5;function o5(t){var e=a5.call(this,t)||this,t=(e.layoutEvents=[z.ElementEvent.BOUNDS_CHANGED,z.ElementEvent.INSERTED,z.ElementEvent.REMOVED],e.$margin=Xb(0),e.$padding=Xb(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function s5(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return Ym()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[[0,0]]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=Py(l,t),t=Py(t,i),i=Py(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),Ym()(s)}const l5=xv(t=>{var e,n,r,i,a=t.attributes,{labelTransform:o,labelTransformOrigin:s,x:l,y:c,x0:u=l,y0:h=c,background:f,connector:d,startMarker:p,endMarker:g,coordCenter:y}=a,a=at(a,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]);[l,c,u,h].some(t=>!Xe(t))||(e=(n=st(a,"background"))["padding"],n=at(n,["padding"]),{points:r=[]}=i=st(a,"connector"),i=at(i,["points"]),u=[[+u,+h],[+l,+c]],h=lt(t).maybeAppend("text","text").style("zIndex",0).call(L,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},a)).node(),l=s5(lt(t).maybeAppend("background","rect").style("zIndex",-1).call(L,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(h,e)).call(L,f?n:{}).node(),u,r,y),c=p&&new s2({id:"startMarker",style:Object.assign({x:0,y:0},st(a,"startMarker"))}),o=g&&new s2({id:"endMarker",style:Object.assign({x:0,y:0},st(a,"endMarker"))}),lt(t).maybeAppend("connector","path").style("zIndex",0).style("path",l).style("markerStart",c).style("markerEnd",o).call(L,d?i:{}))}),c5=(s,t)=>{const l=t["coordinate"];return(t,e,n)=>{var{color:e,text:r="",fontSize:i,rotate:a=0,transform:o=""}=e,r={text:String(r),stroke:e,fill:e,fontSize:i},[[e,i]]=t;return lt(new l5).style("x",e).style("y",i).call(L,n).style("transform",o+`rotate(${+a})`).style("coordCenter",l.getCenter()).call(L,r).call(L,s).node()}};c5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const u5=xv(t=>{var e=at(t.attributes,["class","x","y"]);const n=st(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(lt(t).maybeAppend("marker",()=>new s2({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());lt(t).maybeAppend("text","text").style("x",i).style("y",a).call(L,e)}),h5=(t,e)=>{const i=at(t,[]);return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,text:r=""}=e,r={text:String(r),stroke:e,fill:e},[[e,t]]=t;return lt(new u5).call(L,n).style("x",e).style("y",t).call(L,r).call(L,i).node()}};h5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const f5=xv(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(L,i),lt(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(L,r)}),d5=(t,e)=>{const{curve:c,gradient:l=!1,defined:u=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,f=at(t,["curve","gradient","defined","connect"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r=n["color"],{color:r=r,seriesColor:i,seriesX:a,seriesY:o}=e,e=Wy(d,e),i=l&&i?By(i,a,o,l):r;const s=Object.assign(Object.assign(Object.assign(Object.assign({},n),{stroke:i,fill:i}),e&&{transform:e}),f);var[a,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,u),r=st(s,"connect"),n=!!o.length,i=t=>lt(p.createElement("path",{})).style("d",t||"").call(L,s).node();return Af(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=qm().curve(Xm),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,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 Km(a())},delete t.lineX0,t.lineEndAngle=function(){return Km(o())},delete t.lineX1,t.lineInnerRadius=function(){return Km(s())},delete t.lineY0,t.lineOuterRadius=function(){return Km(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e($m(t)):e()._curve},t.angle((t,e)=>Ly(Ay(r[e],n))).outerRadius((t,e)=>Py(r[e],n)).innerRadius((t,e)=>Py(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(u)).curve(c)(i);var e,a,o,s,l},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new f5).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(_f(d)?qm().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(u)):qm().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(u))).curve(c)(n)},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new f5).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},p5=(d5.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=Af(i)?sv:Gm;return d5(Object.assign({curve:e},n),r)(...t)}}),g5=(p5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"square"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=Af(a)?av:rv;return d5(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),y5=(g5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"smooth"}),(e,n)=>(...t)=>d5(Object.assign({curve:cv},e),n)(...t)),m5=(y5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"hvh"}),(e,n)=>(...t)=>d5(Object.assign({curve:uv},e),n)(...t)),v5=(m5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"vh"}),(e,n)=>(...t)=>d5(Object.assign({curve:hv},e),n)(...t)),b5=(v5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"hv"}),(e,n)=>{const{arrow:r=!1}=e;return(...t)=>$v(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)}),x5=(b5.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const o=at(t,[]),s=e["document"];return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,[t,i]=t,a=Cm();return a.moveTo(t[0],t[1]),a.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),lt(s.createElement("path",{})).call(L,n).style("d",a.toString()).style("stroke",e).style("transform",r).call(L,o).node()}});x5.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const w5=(t,e)=>{const{cornerRatio:u=1/3}=t,h=at(t,["cornerRatio"]),{coordinate:f,document:d}=e;return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=(t=t,l=l,r=f,i=u,o=Cm(),Af(r)?(a=Py(t,c=r.getCenter()),a=(Py(l,c)-a)*i+a,o.moveTo(t[0],t[1]),Iy(o,t,l,c,a)):_f(r)?(o.moveTo(t[0],t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,l[1])):(o.moveTo(t[0],t[1]),o.lineTo(t[0],t[1]+(l[1]-t[1])*i),o.lineTo(l[0],t[1]+(l[1]-t[1])*i)),o.lineTo(l[0],l[1]),o);return lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,h).node()}},M5=(w5.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const s=at(t,[]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r,i=n["color"],n=at(n,["color"]),{color:e=i,transform:i}=e,[t,a]=t,o=Cm();return o.moveTo(t[0],t[1]),Af(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):Iy(o,t,a,Ry(t,a),Py(t,a)/2),lt(c.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(L,s).node()}}),O5=(M5.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(u,t)=>{const{coordinate:h,document:f}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,src:r="",size:i=32,transform:a=""}=e,{width:o=i,height:i=i}=u,[[t,s]]=t,[l,c]=h.getSize(),o="string"==typeof o?Ah(o)*l:o,i="string"==typeof i?Ah(i)*c:i,l=t-Number(o)/2,c=s-Number(i)/2;return lt(f.createElement("image",{})).call(L,n).style("x",l).style("y",c).style("img",r).style("stroke",e).style("transform",a).call(L,u).style("width",o).style("height",i).node()}});O5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const k5=(i,t)=>{const{coordinate:a,document:o}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,t=function(i,t){const a=Cm();if(Af(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>Py(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?Iy(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,a);return lt(o.createElement("path",{})).call(L,n).style("d",t.toString()).style("stroke",e).style("fill",e).style("transform",r).call(L,i).node()}};k5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const E5=(t,e)=>{const a=at(t,[]),{coordinate:o,document:s}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:i}=e,t=function(t,e){var n,[t,r,i,a]=t,o=Cm();return Af(e)?(n=Py(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),Iy(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),Iy(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[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(t[0],t[1]),o.closePath()),o}(t,o);return lt(s.createElement("path",{})).call(L,n).style("d",t.toString()).style("fill",e||r).style("stroke",e||r).style("transform",i).call(L,a).node()}};E5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const S5=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,h=Cm(),Af(r)?([i,a]=r=r.getCenter(),o=Cy(Ay(t[0],r)),s=Cy(Ay(t[1],r)),g=Py(r,t[2]),l=Py(r,t[3]),c=Py(r,t[8]),u=Py(r,t[10]),r=Py(r,t[11]),h.moveTo(...t[0]),h.arc(i,a,g,o,s),h.arc(i,a,g,s,o,!0),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.arc(i,a,l,o,s),h.lineTo(...t[6]),h.arc(i,a,u,s,o,!0),h.closePath(),h.moveTo(...t[8]),h.arc(i,a,c,o,s),h.arc(i,a,c,s,o,!0),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.arc(i,a,r,o,s),h.arc(i,a,r,s,o,!0)):(h.moveTo(...t[0]),h.lineTo(...t[1]),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.lineTo(...t[5]),h.lineTo(...t[6]),h.lineTo(...t[7]),h.closePath(),h.moveTo(...t[8]),h.lineTo(...t[9]),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.lineTo(...t[13])),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};S5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _5=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,i=4,h=Cm(),Af(r)?([a,o]=r=r.getCenter(),s=Py(r,t[3]),l=Py(r,t[8]),g=Py(r,t[10]),c=(r=Cy(Ay(t[2],r)))-(u=Math.asin(i/l)),r+=u,h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.arc(a,o,s,c,r),h.lineTo(Math.cos(r)*g+a,Math.sin(r)*g+o),h.arc(a,o,g,r,c,!0),h.lineTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),u=(c+r)/2,h.moveTo(Math.cos(u)*(l+i/2)+a,Math.sin(u)*(l+i/2)+o),h.arc(Math.cos(u)*l+a,Math.sin(u)*l+o,i/2,u,2*Math.PI+u)):(h.moveTo(...t[2]),h.lineTo(...t[3]),h.lineTo(t[3][0]-i,t[3][1]),h.lineTo(t[10][0]-i,t[10][1]),h.lineTo(t[10][0]+i,t[10][1]),h.lineTo(t[3][0]+i,t[3][1]),h.lineTo(...t[3]),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(t[3][0]+i/2,t[8][1]),h.arc(t[3][0],t[8][1],i/2,0,2*Math.PI)),h.closePath(),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};_5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const A5=(t,e)=>{const{arrow:u,arrowSize:h=4}=t,f=at(t,["arrow","arrowSize"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r,i,a,{color:o,lineWidth:s}=n,n=at(n,["color","lineWidth"]),{color:o=o,size:s=s}=e,l=u?(l=p,r=h,i=Object.assign({fill:f.stroke||o,stroke:f.stroke||o},st(f,"arrow")),l.createElement("path",{style:Object.assign({path:`M ${r},${r} L -${r},0 L ${r},-${r} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(r=t,Af(i=d)?(i=i.getCenter(),Fm()({startAngle:0,endAngle:2*Math.PI,outerRadius:Py(r[0],i),innerRadius:Py(r[1],i)})):Ym().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,Af(c)?([c,a]=c.getCenter(),`translate(${c}, ${a}) `+(e||"")):e);return lt(p.createElement("path",{})).call(L,n).style("d",t).style("stroke",o).style("lineWidth",s).style("transform",c).style("markerEnd",l).call(L,f).node()}};function T5(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}A5.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const P5=xv(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=at(e,["points","class","endMarker","direction"]),i=st(e,"endMarker"),n=(n=n,Ym().x(t=>t[0]).y(t=>t[1])(n));lt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new s2({className:"marker",style:Object.assign(Object.assign({},i),{symbol:T5})}):null).call(L,e)});const C5=(t,e)=>{const{offset:o=0,connectLength1:s}=t,l=at(t,["offset","connectLength1"]),c=e["coordinate"];return(t,e,n)=>{var{color:r,connectLength1:i=s}=n,n=at(n,["color","connectLength1"]),{color:e,transform:a}=e,t=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(_f(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(c,t,o,i);return lt(new P5).call(L,n).style("points",t).style("stroke",e||r).style("transform",a).call(L,l).node()}};function L5(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function N5(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=Sd(a.x,c),i=Sd(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function j5(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:h}=Fy(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=I5(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?R5(s,f,n):Ry(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function R5(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function I5(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function B5(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Fy(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:I5(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=R5(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function D5(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function F5(t,e,n,r){var i=n["bounds"];return 1===i.length?D5(0,0,n):(Tf(r)?j5:Nf(r)?B5:N5)(t,e,n,r)}function z5(t,e,n){var{innerRadius:n,outerRadius:t}=Fy(n,t,[e.y,e.y1]);return n+(t-n)}function W5(t,e,n){var{startAngle:n,endAngle:t}=Fy(n,t,[e.y,e.y1]);return(n+t)/2}function G5(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,h=r.getCenter(),f=W5(e,n,r),d=0<Math.sin(f)?1:-1,i=I5(f,i,a),a={textAlign:0<d||Tf(r)?"start":"end",textBaseline:"middle",rotate:i},i=z5(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=R5(t,e,n),[t,r]=R5(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}C5.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var H5=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=gf(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=Cy(Ay(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:F5,bottomLeft:F5,bottomRight:F5,inside:F5,left:F5,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?D5(0,0,n):(Tf(r)?j5:Nf(r)?G5:N5)(t,e,n,r)},right:F5,spider:function(t,e,n,r){var i,a,o,s,l,c;return Nf(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=at(G5(0,e,n,r),[]),s=r.getCenter(),l=z5(e,n,r),e=W5(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return Nf(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=at(G5(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(Nf(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=Ly([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=R5(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:F5,topLeft:F5,topRight:F5});function V5(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:Nf(o)?"inside":_f(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=H5[L5(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const Y5=(s,t)=>{const{coordinate:l,theme:c}=t;return(t,e)=>{var{text:n,transform:r="",transformOrigin:i}=e,a=at(e,["text","x","y","transform","transformOrigin"]),t=V5(t,e,l,c,s),{rotate:e=0,transform:o=""}=t,t=at(t,["rotate","transform"]);return lt(new l5).call(L,t).style("text",""+n).style("labelTransform",(o+` rotate(${+e}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",l.getCenter()).call(L,a).node()}},q5=(Y5.props={defaultMarker:"point"},(t,e)=>{const o=t["colorAttribute"],s=at(t,["arrow","colorAttribute"]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color","stroke"]),{d:e,color:r=r}=e,[i,a]=l.getSize();return lt(c.createElement("path",{})).call(L,n).style("d","function"==typeof e?e({width:i,height:a}):e).style(o,r).call(L,s).node()}}),X5=(q5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>q5(Object.assign({colorAttribute:"fill"},t),e)),U5=(X5.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>q5(Object.assign({fill:"none",colorAttribute:"stroke"},t),e)),$5=(U5.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(s,t)=>{const l=t["document"];return(t,e,n)=>{var r=e["transform"],i=n["color"],n=at(n,["color"]),{color:e=i}=e,[t,...a]=t;const o=Cm();return o.moveTo(...t),a.forEach(([t,e])=>{o.lineTo(t,e)}),o.closePath(),lt(l.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e||i).style("fill",e||i).style("fillOpacity",.4).style("transform",r).call(L,s).node()}});function K5(t){var n,r,i,a=t||1;function o(t,e){++n>a&&(i=r,s(1),++n),r[t]=e}function s(t){n=0,r=Object.create(null),t||(i=Object.create(null))}return s(),{clear:s,has:function(t){return void 0!==r[t]||void 0!==i[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=i[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}function Z5(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}$5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},K5(3);const J5=function(n,r,t=16){const i=K5(t);return(...t)=>{var e=r(...t);i.get(e);return i.has(e)?i.get(e):(t=n(...t),i.set(e,t),t)}}((t,e,n)=>{var n=Z5(n,2*t,2*t),r=n.getContext("2d"),i=t,a=t;return 1===e?(r.beginPath(),r.arc(i,a,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(i,a,t*e,i,a,t)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*t,2*t)),n},t=>""+t);function Q5(t,e,n,r,i,a,o){a=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);a.minOpacity*=255,a.opacity*=255,a.maxOpacity*=255;var s=Z5(o,t,e).getContext("2d"),l=function(t,e){const n=(e=Z5(e,256,1).getContext("2d")).createLinearGradient(0,0,256,1);return("string"==typeof(t=t)?t.split(" ").map(t=>{var[t,e]=t.split(":");return[+t,e]}):t).forEach(([t,e])=>{n.addColorStop(t,e)}),e.fillStyle=n,e.fillRect(0,0,256,1),e.getImageData(0,0,256,1).data}(a.gradient,o);s.clearRect(0,0,t,e);{var c=s,u=n,h=r,f=i,d=o,p=(n=a)["blur"];let t=f.length;for(;t--;){var{x:g,y,value:m,radius:v}=f[t],m=Math.min(m,h),g=g-v,y=y-v,v=J5(v,1-p,d);c.globalAlpha=Math.max((m-u)/(h-u),.001),c.drawImage(v,g,y)}}r=function(t,e,n,r,i){var{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=(i=t.getImageData(0,0,e,n)).data,u=c.length;for(let t=3;t<u;t+=4){var h=c[t],f=4*h;f&&(h=o||Math.max(0,Math.min(s,Math.max(a,h))),c[t-3]=r[f],c[t-2]=r[1+f],c[t-1]=r[2+f],c[t]=l?r[3+f]:h)}return i}(s,t,e,l,a),i=Z5(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const tM=(t,e)=>{const{gradient:u,opacity:h,maxOpacity:f,minOpacity:d,blur:p,useGradientOpacity:g}=t,y=at(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:m,createCanvas:v,document:b}=e;return(t,e,n)=>{var r,i,e=e["transform"],[a,o]=m.getSize(),s=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),l=yf(t,t=>t[2]),t=pf(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?Q5(a,o,l,t,s,(r=c,i=t=>void 0===t,Object.keys(r).reduce((t,e)=>{var n=r[e];return i(n,e)||(t[e]=n),t},{})),v):{canvas:null};return lt(b.createElement("image",{})).call(L,n).style("x",0).style("y",0).style("width",a).style("height",o).style("src",l.canvas).style("transform",e).call(L,y).node()}},eM=(tM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const n=t["render"],r=at(t,["render"]);return t=>{var[[t,e]]=t;return n(Object.assign(Object.assign({},r),{x:t,y:e}))}}),nM=(eM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),rM=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:nM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:nM.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:nM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:nM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:nM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:nM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:nM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:nM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:nM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:nM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:nM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:nM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:nM.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:nM.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:nM.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:nM.BLACK,tickStrokeOpacity:.25,titleFill:nM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,labelAutoRotate:!1,tickDirection:"negative",titlePosition:"right",titleSpacing:0,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",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:nM.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:nM.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:nM.BLACK,navButtonFillOpacity:.65,navPageNumFill:nM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:nM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:nM.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:nM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:nM.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:nM.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:nM.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:nM.BLACK,tickStrokeOpacity:.25},label:{fill:nM.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:nM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:nM.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:nM.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:nM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:nM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{titleFill:nM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:nM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},iM=(rM.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),aM=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:iM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:iM.BLACK,lineWidth:1}},text:{text:{fill:iM.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:iM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:iM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:iM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:iM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:iM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:iM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:iM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:iM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:iM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:iM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:iM.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:iM.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:iM.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:iM.BLACK,tickStrokeOpacity:.25,titleFill:iM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:iM.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:iM.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:iM.BLACK,navButtonFillOpacity:.45,navPageNumFill:iM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:iM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:iM.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:iM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:iM.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:iM.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:iM.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:iM.BLACK,tickStrokeOpacity:.25},label:{fill:iM.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:iM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:iM.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:iM.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:iM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:iM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:iM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:iM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},oM=(aM.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),sM=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:oM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},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,connectFill:oM.BLACK,connectFillOpacity:.1}},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:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:oM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:oM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:oM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:oM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:oM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:oM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:oM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:oM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:oM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:oM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:oM.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:oM.STROKE,tickStrokeOpacity:1,titleFill:oM.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:oM.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:oM.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:oM.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:oM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:oM.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:oM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:oM.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:oM.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:oM.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!0,titleSpacing:4,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontWeight:"bold"},label:{fill:oM.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:oM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:oM.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:oM.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:oM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:oM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:oM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:oM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function lM(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}sM.props={};var cM,uM=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function hM(t){var e;if(e=uM.exec(t))return new fM({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]});throw new Error("invalid format: "+t)}function fM(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 dM(t,e){var n,e=lM(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}hM.prototype=fM.prototype,fM.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 pM={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?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)=>dM(100*t,e),r:dM,s:function(t,e){var n,r,i=lM(t,e);return i?(n=i[0],(i=(i=i[1])-(cM=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+lM(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function gM(t){return t}var yM,mM=Array.prototype.map,vM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bM(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?gM:(s=mM.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",O=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?gM:(e=mM.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",E=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=hM(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,m=t.type,v=("n"===m?(p=!0,m="g"):pM[m]||(void 0===g&&(g=12),y=!0,m="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b="$"===e?i:/[%p]/.test(m)?a:"",x=pM[m],w=/[defgprs%]/.test(m);function n(t){var e,n,r,i=v,a=b;if("c"===m)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),y&&(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;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==h?!1:o)?"("===h?h:E:"-"===h||"("===h?"":h)+i,a=("s"===m?vM[8+cM/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?O+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(t=M(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&f&&(t=M(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return k(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=hM(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=lM(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=vM[8+e/3];return function(t){return n(r*t)+i}}}}function xM(t,e,n){return t.querySelector(e)?lt(t).select(e):lt(t).append(n)}function wM(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function MM(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};var a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","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)}Bo=bM({thousands:",",grouping:[3],currency:["$",""]}),yM=Bo.format,Bo.formatPrefix;class OM extends Ns{get child(){var t;return null==(t=this.children)?void 0:t[0]}update(t){var e,t=(this.attr(t),t)["subOptions"];null!=(e=this.child)&&e.update(t)}}class kM extends OM{update(t){var e,t=t["subOptions"];null!=(e=this.child)&&e.update(t)}}function EM(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function SM(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i,crossPadding:a=0}=e,e=["top","bottom","center"].includes(e),[t,o]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:s}=n.props,r=(r||n||t)-2*a,n=i||s||o,[t,a]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:a,size:r,length:n}}function _M(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=at(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Qe(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function AM(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function TM(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function PM(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=Yh(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=t=>!(t instanceof Date)&&"object"==typeof t&&t?t:String(t),h=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,f=function(t,e){if(Af(e))return t=>t;var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new Z1({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),d=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return Lf(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new Z1({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new Z1({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return Af(s)||_f(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=f(a.map(t)+i);return{value:Tf(s)&&"center"===o||_f(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(h(TM(t),e,n)),id:String(e)}}):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0;return{value:d(f(a.map(t)+r)),label:u(h(TM(t),e,n)),id:String(e)}})}function CM(t,e,n){var r;return!(Af(r=e)&&_f(r)||Cf(e))&&(void 0===t?!!n.getTicks:t)}function LM(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+xd(e)]),Object.assign({},n,r)}(n,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(i=a)||i===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var NM,u=s=>i=>{const{labelFormatter:a,labelFilter:o=()=>!0}=i;return t=>{var[e]=t["scales"];const r=(null==(n=e.getTicks)?void 0:n.call(e))||e.getOptions().domain;var n="string"==typeof a?yM(a):a,n=Object.assign(Object.assign({},i),{labelFormatter:n,labelFilter:(t,e,n)=>o(r[e],e,r),scale:e});return s(n)(t)}};const jM=u(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:h,style:f={},title:d,tickCount:p,tickFilter:g,tickMethod:y,transform:m,indexBBox:v}=t,b=at(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],r=LM(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=AM(e);return t.includes("bottom")||t.includes("top")?n:e}(u,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("right"===t)return{endPos:[n,i+o],startPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("number"==typeof e){var[t,s]=r.getCenter(),[l,c]=jf(r);const[u,h]=Rf(r);var a=Math.min(a,o)/2,{insetLeft:o,insetTop:r}=r.getOptions(),l=l*a,c=c*a,[a,t]=[t+n-o,s+i-r],[n,o]=[Math.cos(e),Math.sin(e)];return{startPos:[a+c*n,t+c*o],endPos:[a+l*n,t+l*o],gridClosed:h-u==360,gridCenter:[a,t],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(h-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=PM(t,i,p,l,g,y,u,n),i=v?i.map((t,e)=>{e=v.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):i,i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,crossSize:h,titleText:wM(d),labelOverlap:function(t=[],e){if(0<t.length)return t;var{labelAutoRotate:t,labelAutoHide:e,labelAutoEllipsis:n,labelAutoWrap:r}=e;const i=[];var a=(t,e)=>{e&&i.push(t)};return a({type:"rotate",optionalAngles:[0,15,30,45,60,90]},t),a({type:"ellipsis",minLength:20},n),a({type:"hide"},e),a({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},r),i}(m,r),grid:CM(r.grid,n,t),gridLength:a,line:!0,indexBBox:v}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new iw({className:"axis",style:_M(i)})}}),RM=u(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:h={},indexBBox:f,title:d,grid:p=!1}=t,g=at(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=PM(t,i,c,s,l,u,o,n),i=f?t.map((t,e)=>{e=f.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):t,[t,a]=jf(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=Rf(i),[l,c]=AM(i),a={center:e,radius:a,startAngle:o,endAngle:s,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?({insetLeft:o,insetTop:s}=i.getOptions(),Object.assign(Object.assign({},a),{center:[e[0]-o,e[1]-s],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},a),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(o,e,t,a,n),{axis:t,axisArc:a={}}=r,n=_M(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:wM(d),grid:p},g),h)));return new iw({style:ln(n,["transform"])})}}),IM=(jM.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},RM.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>jM(Object.assign({},{crossPadding:50},e))(...t)),BM=(IM.props=Object.assign(Object.assign({},jM.props),{defaultPosition:"bottom"}),e=>(...t)=>jM(Object.assign({},{crossPadding:10},e))(...t));BM.props=Object.assign(Object.assign({},jM.props),{defaultPosition:"left"});const DM=a=>{const{important:o={}}=a,s=at(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return jM(Object.assign(Object.assign(Object.assign({},s),(e=a.orientation,(e%=2*Math.PI)==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)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[t]=r,r=t.getOptions().name;const[a,o]=Rf(n);var{axisRadar:t={}}=e;return Object.assign(Object.assign({},t),{grid:"position"===r,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{return(o-a)/i.count*e})})}(a,n,r,i)),o)}))(t)}};function FM(t,e,n,r,i={}){const a=(null==(e=null==(e=e["shape."+t])?void 0:e.props)?void 0:e.defaultMarker)||function(t){if(je(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=at(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=Tv.get(t)||Tv.get("point");return(...t)=>{return new z.Path({style:Object.assign(Object.assign({},o),{path:s(...t),stroke:s.style.includes("stroke")?a||r:"",fill:s.style.includes("fill")?a||n:"",lineWidth:s.style.includes("lineWidth")?i||2:0})})}}(a,i)(0,0,6)}function zM(t,{scales:e,library:n,markState:r}){const[i,a]=function(t,e){var n=EM(t,"shape"),r=EM(t,"color");const i=n?n.clone():null,a=[];for(const[c,u]of e){var o=c.type,s=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:u.data).map((t,e)=>{return i?i.map(t||"point"):(null==(t=null===c||void 0===c?void 0:c.style)?void 0:t.shape)||u.defaultShape||"point"});"string"==typeof o&&a.push([o,s])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const l=n.getOptions()["range"];return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){var r=l[t%l.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(e,r),o=(t,e)=>FM(t,n,0,0,{color:e}),s=t=>i+"."+a[t],l=t["itemMarker"];return EM(e,"shape")&&!l?(t,e)=>o(s(e),t.color):"function"==typeof l?(t,e)=>{e=l(t.id,e);return"string"==typeof e?o(e,t.color):e}:(t,e)=>o(l||s(e),t.color)}function WM(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i={itemMarker:zM(t,e),itemMarkerSize:(t=r,e=i.legendCategory.itemMarkerSize,(t=EM(t,"size"))?2*t.map(NaN):e),itemMarkerOpacity:function(t){if(t=EM(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const a="string"==typeof n?yM(n):n,o=EM(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:a(t),color:o.map(t)}))})}DM.props=Object.assign(Object.assign({},jM.props),{defaultPosition:"center"});const GM=o=>{const{layout:s,position:l,title:c,cols:u}=o,h=at(o,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),f=h["gridRow"];return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:e,height:i}=function(t,e,n){var r;if("center"===(r=e["position"])){r=t["bbox"];const{width:i,height:a}=r;return{width:i,height:a}}const{width:i,height:a}=SM(t,e,n);return{width:i,height:a}}(e,o,GM),a=MM(l,s),e=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(l)?"vertical":"horizontal",width:e,height:i,layout:void 0!==u?"grid":"flex"},void 0!==u&&{gridCol:u}),void 0!==f&&{gridRow:f}),{titleText:wM(c)}),WM(o,t)),{legendCategory:i={}}=n,t=_M(Object.assign({},i,e,h)),n=new kM({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new Tw({className:"legend-category",style:t})),n}};function HM(t,e,n,r,i){var a,e=e.thresholds,o=(a=r,t=>({value:t/a,label:String(t)}));return Object.assign(Object.assign({},t),{color:i,data:[n,...e,r].map(o)})}function VM(t){var t=t.getOptions()["domain"],[t,e]=[t[0],Ey(t)];return[t,e]}function YM(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.defaultColor;const s=e||(a=i,i=(e=n||r).getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[z.parseColor(a).toString()]})),e),[l,c]=VM(s);return Object.assign(Object.assign({},t),{data:s.getTicks().map(t=>({value:t})),color:new Array(o).fill(0).map((t,e)=>{var e=(c-l)/(o-1)*e+l,n=s.map(e);const i=r?r.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})})}function qM(t,e,n,r,i,a){var o=EM(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=SM(t,e,n);return e=r-2*i,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}(n,r,i);if(o instanceof ny){var r=o.getOptions()["range"],[i,s]=VM(o);if(o instanceof ay||o instanceof sy)return HM(n,o,i,s,r);{i=n;s=o;const l=[-1/0,...s.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},i),{data:l,color:r,labelFilter:(t,e)=>0<e&&e<l.length-1})}}return YM(n,o,EM(t,"size"),EM(t,"opacity"),e,a)}GM.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const XM=u=>{const{labelFormatter:h,layout:f,position:d,title:p,style:g}=u,y=at(u,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:t,value:e,theme:n,scale:r})=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,l=MM(d,f),{legendContinuous:c={}}=n,c=_M(Object.assign({},c,Object.assign(Object.assign({titleText:wM(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>yM(h)(t.label):h},qM(t,r,e,u,XM,n)),g),y)),t=new OM({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new Kw({style:c})),t}},UM=(XM.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>XM(Object.assign({},{block:!0},e))(...t)),$M=(UM.props=Object.assign(Object.assign({},XM.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=EM(e,"size");return XM(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),KM=($M.props=Object.assign(Object.assign({},XM.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>$M(Object.assign({},{block:!0},t)));function ZM(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"}}}KM.props=Object.assign(Object.assign({},XM.props),{defaultPosition:"top",defaultOrientation:"horizontal"});NM={render(t,e){const{y:n,width:r,title:i,subtitle:a}=t,o=t.style,{spacing:s=2,align:l="left"}=o,c=at(o,["spacing","align"]);t=st(c,"title");const u=st(c,"subtitle"),h=xM(e,".title","text").attr("className","title").call(L,Object.assign(Object.assign(Object.assign({},ZM(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();xM(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},ZM(0,h.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const JM=class extends z.CustomElement{constructor(t){super(t),this.descriptor=NM}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(ot({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},QM=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new JM({style:ot({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function tO(t){return t.getBandWidth}function eO(t,e,n){if(!tO(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=Wh(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function nO(t,e,n){if(!e)return t.getOptions().domain;if(!tO(t))return o=ef(e),n?([i]=o,r=t.getOptions()["range"],[r,a]=r,a=a<r?-1:1,[i,t.invert(t.map(i)+a*n)]):o;var r=t.getOptions()["domain"],i=e[0],a=r.indexOf(i);if(n){const s=a+Math.round(r.length*n);return r.slice(a,s)}var o=e[e.length-1];const s=r.indexOf(o);return r.slice(a,s+1)}function rO(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[eO(o,t,e),eO(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[nO(o,[t[0],e[0]]),nO(s,[t[1],e[1]])]}function iO(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}QM.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const aO=t=>{const{orientation:u,labelFormatter:h,style:f={},position:d}=t,p=at(t,["orientation","labelFormatter","size","style","position"]);return({scales:[n],value:t,theme:e,coordinate:r})=>{var t=t["bbox"],{width:i,height:a}=t,{slider:e={}}=e;const o=(null==(l=n.getFormatter)?void 0:l.call(n))||(t=>t.toString()),s="string"==typeof h?yM(h):h;var l="horizontal"===u;const c=_f(r)&&l;var{trackSize:r=e.trackSize}=f,[t,r]=function(t,e,n){var{x:t,y:r,width:i,height:a}=t;return"left"===e?[t+i-n,r]:"right"===e||"bottom"===e?[t,r]:"top"===e?[t,r+a-n]:void 0}(t,d,r);return new W2({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:r,trackLength:l?i:a,orientation:u,formatter:t=>{var e=s||o,t=c?1-t:t;return e(eO(n,t,!0))}},f),p))})}},oO=(aO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>aO(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),sO=(oO.props=Object.assign(Object.assign({},aO.props),{defaultPosition:"bottom"}),t=>aO(Object.assign(Object.assign({},t),{orientation:"vertical"}))),lO=(sO.props=Object.assign(Object.assign({},aO.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=at(t,["orientation","labelFormatter","style"]);return({scales:[t],value:e,theme:n})=>{var e=e["bbox"],{x:e,y:r,width:i,height:a}=e,{scrollbar:n={}}=n,{ratio:t,range:o}=t.getOptions(),i="horizontal"===s?i:a,a=i/t,[t,o]=o,t=t<o?0:1;return new V2({className:"g2-scrollbar",style:Object.assign({},n,Object.assign(Object.assign(Object.assign(Object.assign({},l),{x:e,y:r,trackLength:i}),c),{orientation:s,value:t,contentLength:a,viewportLength:i}))})}}),cO=(lO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>lO(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),uO=(cO.props=Object.assign(Object.assign({},lO.props),{defaultPosition:"bottom"}),t=>lO(Object.assign(Object.assign({},t),{orientation:"vertical"}))),hO=(uO.props=Object.assign(Object.assign({},lO.props),{defaultPosition:"left"}),t=>()=>new z.Group),fO=(hO.props={},(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}}),dO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},pO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}},gO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},yO=o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:r,strokeOpacity:i,opacity:a}],Object.assign(Object.assign({},n),o))},mO=(yO.props={},o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:r,strokeOpacity:i,opacity:a},{fillOpacity:0,strokeOpacity:0,opacity:0}],Object.assign(Object.assign({},n),o))});function vO(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}mO.props={};const bO=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function xO(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function wO(t,e){var[n,r,i,t]=xO(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g"),require("@antv/g-canvas")):"function"==typeof define&&define.amd?define(["exports","@antv/g","@antv/g-canvas"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={},t.window.G,t.window.G.Canvas2D)}(this,function(T,z,C){"use strict";const N="main-layer",ct="label-layer",ut="element",$="view",ht="plot",ft="component",dt="label",pt="area";var j=function(t,e){return(j=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var m=function(){return(m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function at(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function e(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function K(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function R(r,i){var a,o,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},c={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function t(n){return function(t){var e=[n,t];if(a)throw new TypeError("Generator is already executing.");for(;l=c&&e[c=0]?0:l;)try{if(a=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,o=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3]))l.label=e[1];else if(6===e[0]&&l.label<s[1])l.label=s[1],s=e;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(e)}}e=i.call(r,l)}catch(t){e=[6,t],o=0}finally{a=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function I(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{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(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||0<e--)&&!(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 v(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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function B(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&r:e.has(t))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var D,F,W="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n={exports:{}};function G(){}function H(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function V(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new H(n,r||t,i),r=F?F+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function Y(t,e){0==--t._eventsCount?t._events=new G:delete t._events[e]}function q(){this._events=new G,this._eventsCount=0}r=n,D=Object.prototype.hasOwnProperty,F="~",Object.create&&(G.prototype=Object.create(null),(new G).__proto__||(F=!1)),q.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)D.call(t,e)&&n.push(F?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},q.prototype.listeners=function(t){var t=F?F+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},q.prototype.listenerCount=function(t){t=F?F+t:t,t=this._events[t];return t?t.fn?1:t.length:0},q.prototype.emit=function(t,e,n,r,i,a){var o=F?F+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[f].fn.apply(l[f].context,s)}return!0},q.prototype.on=function(t,e,n){return V(this,t,e,n,!1)},q.prototype.once=function(t,e,n){return V(this,t,e,n,!0)},q.prototype.removeListener=function(t,e,n,r){t=F?F+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||Y(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:Y(this,t)}}else Y(this,t);return this},q.prototype.removeAllListeners=function(t){return t?(t=F?F+t:t,this._events[t]&&Y(this,t)):(this._events=new G,this._eventsCount=0),this},q.prototype.off=q.prototype.removeListener,q.prototype.addListener=q.prototype.on,q.prefixed=F,r.exports=q.EventEmitter=q;var X=n.exports,U=1e-6,Z="undefined"!=typeof Float32Array?Float32Array:Array;function J(){var t=new Z(9);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Q=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=m*r+v*o+n*c,t[7]=m*i+v*s+n*u,t[8]=m*a+v*l+n*e,t};function tt(){var t=new Z(16);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function et(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function nt(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function rt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function it(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]),t}function gt(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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],m=n*s-r*o,v=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,M=i*c-a*l,O=u*g-h*p,k=u*y-f*p,E=u*e-d*p,S=h*y-f*g,_=h*e-d*g,A=f*e-d*y,T=m*A-v*_+b*S+x*E-w*k+M*O;return T?(t[0]=(s*A-l*_+c*S)*(T=1/T),t[1]=(i*_-r*A-a*S)*T,t[2]=(g*M-y*w+e*x)*T,t[3]=(f*w-h*M-d*x)*T,t[4]=(l*E-o*A-c*k)*T,t[5]=(n*A-i*E+a*k)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*_-s*E+c*O)*T,t[9]=(r*E-n*_-a*O)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*k-o*S-l*O)*T,t[13]=(n*S-r*k+i*O)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function yt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function mt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],e=e[15],v=n[0],b=n[1],x=n[2],w=n[3];return t[0]=v*r+b*s+x*h+w*g,t[1]=v*i+b*l+x*f+w*y,t[2]=v*a+b*c+x*d+w*m,t[3]=v*o+b*u+x*p+w*e,v=n[4],b=n[5],x=n[6],w=n[7],t[4]=v*r+b*s+x*h+w*g,t[5]=v*i+b*l+x*f+w*y,t[6]=v*a+b*c+x*d+w*m,t[7]=v*o+b*u+x*p+w*e,v=n[8],b=n[9],x=n[10],w=n[11],t[8]=v*r+b*s+x*h+w*g,t[9]=v*i+b*l+x*f+w*y,t[10]=v*a+b*c+x*d+w*m,t[11]=v*o+b*u+x*p+w*e,v=n[12],b=n[13],x=n[14],w=n[15],t[12]=v*r+b*s+x*h+w*g,t[13]=v*i+b*l+x*f+w*y,t[14]=v*a+b*c+x*d+w*m,t[15]=v*o+b*u+x*p+w*e,t}function vt(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function bt(t,e,n){var r=n[0],i=n[1],n=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function wt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function Mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Ot(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function kt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Et(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function St(t,e){var n=new Z(3),r=(Et(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function _t(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,h=a*l,f=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],y=i[1],i=i[2],m=(1-(d+s))*u,v=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=m,t[1]=v,t[2]=u,t[3]=0,t[4]=f,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(m*g+f*y+p*i),t[13]=n[1]+y-(v*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function At(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tt(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function Pt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var Ct=Pt;function Lt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t}function Nt(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<U&&Math.abs(c-d)<U&&Math.abs(e-n)<U?rt(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function jt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Rt=Object.freeze({__proto__:null,create:tt,clone:function(t){var e=new Z(16);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[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:et,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new Z(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:nt,identity:rt,transpose:it,invert:gt,adjoint: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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:yt,multiply:mt,translate:vt,scale:bt,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M,O,k=r[0],E=r[1],r=r[2],S=Math.hypot(k,E,r);return S<U?null:(k*=S=1/S,E*=S,r*=S,S=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],v=k*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+k*S,w=k*r*i+E*S,M=E*r*i-k*S,O=r*r*i+n,t[0]=a*(n=k*k*i+n)+c*(m=E*k*i+r*S)+d*(r=r*k*i-E*S),t[1]=o*n+u*m+p*r,t[2]=s*n+h*m+g*r,t[3]=l*n+f*m+y*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+h*b+g*x,t[7]=l*v+f*b+y*x,t[8]=a*w+c*M+d*O,t[9]=o*w+u*M+p*O,t[10]=s*w+h*M+g*O,t[11]=l*w+f*M+y*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:xt,rotateY:wt,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:Mt,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<U?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:Ot,fromQuat2:function(t,e){var n=new Z(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),Ot(t,e,n),t},getTranslation:kt,getScaling:Et,getRotation:St,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+h)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:_t,fromQuat:At,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Tt,perspective:Tt,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Pt,ortho:Ct,orthoZO:Lt,lookAt:Nt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:jt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],m=e[0],v=e[1],b=e[2],x=e[3],w=e[4],M=e[5],O=e[6],k=e[7],E=e[8],S=e[9],_=e[10],A=e[11],T=e[12],P=e[13],C=e[14],e=e[15];return Math.abs(n-m)<=U*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=U*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=U*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=U*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=U*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=U*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-O)<=U*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-k)<=U*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-E)<=U*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=U*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-_)<=U*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(d-A)<=U*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-T)<=U*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=U*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-C)<=U*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(t-e)<=U*Math.max(1,Math.abs(t),Math.abs(e))},mul:mt,sub:jt});function It(){var t=new Z(3);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Bt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Dt(t,e,n){var r=new Z(3);return r[0]=t,r[1]=e,r[2]=n,r}function Ft(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2]}function zt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Wt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Ht(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function Vt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Yt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function qt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function Xt(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Ut(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=U*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=U*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=U*Math.max(1,Math.abs(t),Math.abs(e))}var $t=Bt;function Kt(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Zt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function Jt(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Qt(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function te(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function ee(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function ne(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}It(),Kt();var re=function(t,e,n,r){var i=new Z(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ie=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ae=te,oe=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};function se(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}It(),Dt(1,0,0),Dt(0,1,0),Jt(),Jt(),J(),r=new Z(2),Z!=Float32Array&&(r[0]=0,r[1]=0);var le={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var ce={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ue(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return ce[e]===t.length-1&&"achlmqstvz".includes(e)})}function he(t){return ue(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function fe(t){return he(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function de(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ce[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ce[n]))),ce[n]););}function pe(t){return 48<=t&&t<=57}function ge(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function ye(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=ce[s[l].toLowerCase()];if(t.segmentStart=l,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return 1;default:return}}(c)){if(t.index+=1,ge(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(pe(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&pe(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&pe(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;pe(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&pe(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&pe(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),ge(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,ge(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}de(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var me=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function ve(t){var o,s,l,c;return he(t)?se(t):(t=function(t){if(ue(t))return se(t);var e=new me(t);for(ge(e);e.index<e.max&&!e.err.length;)ye(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function be(t){if(fe(t))return se(t);for(var e,n,r,i,a,o,s,l=ve(t),c=m({},le),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function xe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function we(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function Me(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Oe(t,e,n,r,i){var a=Me([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=we([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function ke(t,e,n,r){var t=[t,e],e=[n,r],i=we(t,e,.5),e=we(e,i,.5),a=we(i,e,.5),o=we(e,a,.5),s=we(a,o,.5),t=Oe(t[0],t[1],i[0],i[1],a[0]).point,i=Oe(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function Ee(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=h,t;case"A":return s=[f,d].concat(c),["C"].concat(function t(e,n,r,i,a,o,s,l,c,u){var h=120*Math.PI/180,f=Math.PI/180*(+a||0),d=[],p=(u?(x=u[0],w=u[1],v=u[2],b=u[3]):(e=(y=xe(e,n,-f)).x,n=y.y,1<(p=(g=(e-(l=(y=xe(l,c,-f)).x))/2)*g/(r*r)+(y=(n-(c=y.y))/2)*y/(i*i))&&(r*=p=Math.sqrt(p),i*=p),p=r*r,m=i*i,v=(o=(o===s?-1:1)*Math.sqrt(Math.abs((p*m-p*y*y-m*g*g)/(p*y*y+m*g*g))))*r*y/i+(e+l)/2,b=o*-i*g/r+(n+c)/2,x=Math.asin(((n-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((c-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),x=e<v?Math.PI-x:x,w=l<v?Math.PI-w:w,x<0&&(x=2*Math.PI+x),w<0&&(w=2*Math.PI+w),s&&w<x&&(x-=2*Math.PI),!s&&x<w&&(w-=2*Math.PI)),w-x),g=(Math.abs(p)>h&&(m=w,y=l,o=c,w=x+h*(s&&x<w?1:-1),d=t(l=v+r*Math.cos(w),c=b+i*Math.sin(w),r,i,a,0,s,y,o,[w,m,v,b])),p=w-x,Math.cos(x)),h=Math.sin(x),a=Math.cos(w),s=Math.sin(w),y=Math.tan(p/4),o=4/3*r*y,m=4/3*i*y,v=[e,n],b=[e+o*h,n-m*g],x=[l+o*s,c-m*a],w=[l,c];if(b[0]=2*v[0]-b[0],b[1]=2*v[1]-b[1],u)return b.concat(x,w,d);for(var M=[],O=0,k=(d=b.concat(x,w,d)).length;O<k;O+=1)M[O]=O%2?xe(d[O-1],d[O],f).y:xe(d[O],d[O+1],f).x;return M}(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=h,s=[f,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(ke(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(ke(f,d,p,g))}return t}function Se(t,e){var n;if(void 0===e&&(e=!1),fe(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=se(t),e?[n,[]]:n;for(var r,i=be(t),a=m({},le),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=Ee(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function _e(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Ae(t,e,n,r,i,I,B,a,o,s,l){var c=l.bbox,D=void 0===c||c,c=l.length,F=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],m={x:0,y:0},v=[{x:f,y:d}];h&&s<=0&&(m={x:f,y:d});for(var b,x,w,M,O,k,E,S,_,A,T,P,C,L,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,O=i,k=I,E=B,S=a,_=o,A=R/u,P=j=N=L=C=P=T=void 0,P=Math.abs,C=Math.sin,L=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(M),M=j/180*((O%360+360)%360),f=(T=b===S&&x===_?{x:b,y:x}:0===w||0===P?Oe(b,x,S,_,A).point:(O=(b-S)/2,T=(x-_)/2,O={x:L(M)*O+C(M)*T,y:-C(M)*O+L(M)*T},1<(T=Math.pow(O.x,2)/Math.pow(w,2)+Math.pow(O.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(O.y,2)-Math.pow(P,2)*Math.pow(O.x,2))/(Math.pow(w,2)*Math.pow(O.y,2)+Math.pow(P,2)*Math.pow(O.x,2)),k=(k!==E?1:-1)*N(T<0?0:T),N=w*O.y/P*k,T=-P*O.x/w*k,k=L(M)*N-C(M)*T+(b+S)/2,b=C(M)*N+L(M)*T+(x+_)/2,x=_e({x:1,y:0},S={x:(O.x-N)/w,y:(O.y-T)/P}),_=_e(S,{x:(-O.x-N)/w,y:(-O.y-T)/P}),!E&&0<_?_-=2*j:E&&_<0&&(_+=2*j),S=x+(_%=2*j)*A,N=w*L(S),O=P*C(S),{x:L(M)*N-C(M)*O+k,y:C(M)*N+L(M)*O+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=Me(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(E=(p-s)/(p-g[2]),m={x:y[0]*(1-E)+g[0]*E,y:y[1]*(1-E)+g[1]*E}),g=[f,d,p];return{length:p,point:m=h&&p<=s?{x:a,y:o}:m,min:{x:Math.min.apply(null,v.map(function(t){return t.x})),y:Math.min.apply(null,v.map(function(t){return t.y}))},max:{x:Math.max.apply(null,v.map(function(t){return t.x})),y:Math.max.apply(null,v.map(function(t){return t.y}))}}}function Te(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,m=0,v=[g,y,m],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var M,O,k,E,S,_,A,T,P,C,L=0;L<=d;L+=1)M=t,O=e,k=n,E=r,S=i,_=a,A=o,T=s,C=void 0,C=1-(P=L/d),g=(M={x:Math.pow(C,3)*M+3*Math.pow(C,2)*P*k+3*C*Math.pow(P,2)*S+Math.pow(P,3)*A,y:Math.pow(C,3)*O+3*Math.pow(C,2)*P*E+3*C*Math.pow(P,2)*_+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=Me(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(k=(m-l)/(m-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,y,m];return{length:m,point:x=p&&m<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Pe(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],m=[d,p],v={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(v={x:d,y:p});for(var x,w,M,O,k,E,S,_,A=0;A<=h;A+=1)x=t,w=e,M=n,O=r,k=i,E=a,_=void 0,_=1-(S=A/h),d=(x={x:Math.pow(_,2)*x+2*_*S*M+Math.pow(S,2)*k,y:Math.pow(_,2)*w+2*_*S*O+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=Me(m,[d,p])),m=[d,p],f&&o<=g&&o>y[2]&&(M=(g-o)/(g-y[2]),v={x:m[0]*(1-M)+y[0]*M,y:m[1]*(1-M)+y[1]*M}),y=[d,p,g];return{length:g,point:v=f&&g<=o?{x:i,y:a}:v,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ce(t,e,n){for(var r,i,a,o=be(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},m=y,v=y,b=y,x=0,w=0,M=o.length;w<M;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(m=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=Oe(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point):"A"===i?(g=(r=Ae(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"C"===i?(g=(r=Te(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Q"===i?(g=(r=Pe(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Z"===i&&(g=(r=Oe((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point),s&&x<e&&e<=x+g&&(b=v),p.push(m),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Le(t){return(c=l=s=0)<=Se(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function Ne(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?Te(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=we(n,i,r),i=we(i,a,r),a=we(a,e,r),o=we(n,i,r),i=we(i,a,r),r=we(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var je=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Re=function(t){return"function"==typeof t},p=function(t){return null==t},Ie={}.toString,Be=function(t,e){return Ie.call(t)==="[object "+e+"]"},De=function(t){return Array.isArray?Array.isArray(t):Be(t,"Array")},Fe=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var ze=function(t){return"object"==typeof t&&null!==t},We=function(t){if(!ze(t)||!Be(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},Ge=function(t){if(De(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},He=function(t){if(De(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Ve=function(t,n,e){if(!De(t)&&!We(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(De(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(Fe(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},Ye=function(t){return Be(t,"String")};var qe=function(t,e,n){return t<e?e:n<t?n:t},Xe=function(t){return Be(t,"Number")};function Ue(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function $e(t){return p(t)?"":t.toString()}var Ke=function(t,e){return(t%e+e)%e},Ze=function(t){t=$e(t);return t.charAt(0).toLowerCase()+t.substring(1)};function Je(t){if("object"!=typeof t||null===t)return t;if(De(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Je(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Je(t[i]):e[i]=t[i];return e}var Qe=function(t){t=$e(t);return t.charAt(0).toUpperCase()+t.substring(1)},tn=function(t){return Be(t,"Boolean")},en=function(t){return void 0===t},nn=Je;function rn(r,i,a){var o;return function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}}function an(a,o){var s;if(Re(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var on=5;function sn(t,e){if(t===e)return!0;if(t&&e&&!Ye(t)&&!Ye(e)){if(je(t)||je(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=sn(t[r],e[r]));r++);return n}if(ze(t)||ze(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=sn(t[i[r]],e[i[r]]));r++);return n}}return!1}function ln(t,r){return Ve(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function cn(){}var ot=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)!function t(e,n,r,i){for(var a in r=r||0,i=i||on,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&We(o)?(We(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):De(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},un=sn,hn=function(t,e,n){for(var r=0,i=Ye(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},fn=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function dn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function pn(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function gn(){}var n="\\s*([+-]?\\d+)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",i="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yn=/^#([0-9a-f]{3,8})$/,mn=new RegExp("^rgb\\("+[n,n,n]+"\\)$"),vn=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),bn=new RegExp("^rgba\\("+[n,n,n,r]+"\\)$"),xn=new RegExp("^rgba\\("+[i,i,i,r]+"\\)$"),wn=new RegExp("^hsl\\("+[r,i,i]+"\\)$"),Mn=new RegExp("^hsla\\("+[r,i,i,r]+"\\)$"),On={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 kn(){return this.rgb().formatHex()}function En(){return this.rgb().formatRgb()}function Sn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=yn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_n(e):3===n?new Tn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?An(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?An(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=mn.exec(t))?new Tn(e[1],e[2],e[3],1):(e=vn.exec(t))?new Tn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=bn.exec(t))?An(e[1],e[2],e[3],e[4]):(e=xn.exec(t))?An(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=wn.exec(t))?Nn(e[1],e[2]/100,e[3]/100,1):(e=Mn.exec(t))?Nn(e[1],e[2]/100,e[3]/100,e[4]):On.hasOwnProperty(t)?_n(On[t]):"transparent"===t?new Tn(NaN,NaN,NaN,0):null}function _n(t){return new Tn(t>>16&255,t>>8&255,255&t,1)}function An(t,e,n,r){return new Tn(t=r<=0?e=n=NaN:t,e,n,r)}function Tn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pn(){return"#"+Ln(this.r)+Ln(this.g)+Ln(this.b)}function Cn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ln(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Nn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Rn(t,e,n,r)}function jn(t){var e,n,r,i,a,o,s,l;return t instanceof Rn?new Rn(t.h,t.s,t.l,t.opacity):(t=t instanceof gn?t:Sn(t))?t instanceof Rn?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(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=0<l&&l<1?0:o,new Rn(o,s,l,t.opacity)):new Rn}function Rn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function In(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 Bn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Dn(t,e){var n=Math.min.apply(Math,v([],O(t),!1)),r=Math.min.apply(Math,v([],O(e),!1));return{x:n,y:r,width:Math.max.apply(Math,v([],O(t),!1))-n,height:Math.max.apply(Math,v([],O(e),!1))-r}}function Fn(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d,p,g,h=0;h<u.length;h++){d=t,y=r,p=i,g=u[h];var y=n*Math.cos(p)*Math.cos(g)-y*Math.sin(p)*Math.sin(g)+d;y<l&&(l=y),c<y&&(c=y)}for(var m=Math.atan(r/(n*Math.tan(i))),v=1/0,b=-1/0,x=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var w=m+h;a<o?a<w&&w<o&&x.push(w):o<w&&w<a&&x.push(w)}for(var M,O,k,h=0;h<x.length;h++){M=e,E=r,O=i,k=x[h];var E=n*Math.sin(O)*Math.cos(k)+E*Math.cos(O)*Math.sin(k)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}function zn(t,e,n,r){return Bn(t,e,n,r)}function Wn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Gn(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 Hn(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return Ue(r,0)?Ue(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):Ue(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function Vn(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=Bn(i[0],i[1],a[0],a[1])}return n}function Yn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function qn(t,e,n){n=t+n-2*e;return Ue(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}dn(gn,Sn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:kn,formatHex:kn,formatHsl:function(){return jn(this).formatHsl()},formatRgb:En,toString:En}),dn(Tn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof gn?i:Sn(i))?new Tn((i=i.rgb()).r,i.g,i.b,i.opacity):new Tn:new Tn(t,e,n,null==r?1:r);var i},pn(gn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Tn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Tn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Pn,formatHex:Pn,formatRgb:Cn,toString:Cn})),dn(Rn,function(t,e,n,r){return 1===arguments.length?jn(t):new Rn(t,e,n,null==r?1:r)},pn(gn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Rn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Rn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new Tn(In(240<=t?t-240:120+t,n,e),In(t,n,e),In(t<120?240+t:t-120,n,e),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));function Xn(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,h=e[n],f=r,d=i;for(Un(e,r,n),0<a(e[i],h)&&Un(e,r,i);f<d;){for(Un(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Un(e,r,d):Un(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||$n)}function Un(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function $n(t,e){return t<e?-1:e<t?1:0}function Kn(t,e){Zn(t,0,t.children.length,e,t)}function Zn(t,e,n,r,i){(i=i||ar(null)).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];Jn(i,t.leaf?r(o):o)}return i}function Jn(t,e){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)}function Qn(t,e){return t.minX-e.minX}function tr(t,e){return t.minY-e.minY}function er(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function nr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function rr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ir(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ar(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function or(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Xn(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(n=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()}).prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,n=[];if(ir(t,e))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;ir(t,s)&&(e.leaf?n.push(o):rr(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},n.prototype.collides=function(t){var e=this.data;if(ir(t,e))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(ir(t,a)){if(e.leaf||rr(t,a))return!0;n.push(i)}}e=n.pop()}return!1},n.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=ar([]),this},n.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(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}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!rr(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.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},n.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)Kn(i=ar(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=ar([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));or(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);or(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}Kn(i,this.toBBox)}return i},n.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=er(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.minY))-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]}var h,u;return e},n.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),Jn(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},n.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=ar(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Kn(n,this.toBBox),Kn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},n.prototype._splitRoot=function(t,e){this.data=ar([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Kn(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=Zn(t,0,c,this.toBBox),h=Zn(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=er(u)+er(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},n.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:Qn,i=t.leaf?this.compareMinY:tr;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},n.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=Zn(t,0,e,i),o=Zn(t,n-e,n,i),s=nr(a)+nr(o),l=e;l<n-e;l++){var c=t.children[l];Jn(a,t.leaf?i(c):c),s+=nr(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];Jn(o,t.leaf?i(h):h),s+=nr(o)}return s},n.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)Jn(e[r],t)},n.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():Kn(t[e],this.toBBox)};var b,sr,lr=n,n=((i=b=b||{}).GROUP="g",i.CIRCLE="circle",i.ELLIPSE="ellipse",i.IMAGE="image",i.RECT="rect",i.LINE="line",i.POLYLINE="polyline",i.POLYGON="polygon",i.TEXT="text",i.PATH="path",i.HTML="html",i.MESH="mesh",(r=sr=sr||{})[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",cr.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},cr.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},cr);function cr(){this.plugins=[]}function ur(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function hr(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function fr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function dr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function pr(t){return void 0===t?0:360<t||t<-360?t%360:t}function gr(t,e,n){var r,i;return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?(r=t,(i=new Z(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):Xe(t)?Dt(t,e,n):Dt(t[0],t[1]||e,t[2]||n)}function yr(t){return t*(Math.PI/180)}function mr(t){return t*(180/Math.PI)}function vr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=O(Et(It(),r),3))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function br(t,e,n,r,i){var a,o,s,l,c=Math.cos(t),t=Math.sin(t);return a=r*c,o=i*t,r=-r*t,t=i*c,c=i=0,e=e,n=n,s=1,(l=new Z(9))[0]=a,l[1]=o,l[2]=i,l[3]=r,l[4]=t,l[5]=c,l[6]=e,l[7]=n,l[8]=s,l}function xr(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);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=mr(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var wr=tt(),Mr=tt(),Or=Kt(),d=[It(),It(),It()],kr=It();function Er(t,e,n,r,i,a){if(function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(wr,t)&&(et(Mr,wr),Mr[3]=0,Mr[7]=0,Mr[11]=0,Mr[15]=1,!(Math.abs(yt(Mr))<1e-8))){var t=wr[3],o=wr[7],s=wr[11],l=wr[12],c=wr[13],u=wr[14],h=wr[15];if(0!==t||0!==o||0!==s){if(Or[0]=t,Or[1]=o,Or[2]=s,Or[3]=h,!gt(Mr,Mr))return;it(Mr,Mr),Zt(i,Or,Mr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=wr,(o=d)[0][0]=t[0],o[0][1]=t[1],o[0][2]=t[2],o[1][0]=t[4],o[1][1]=t[5],o[1][2]=t[6],o[2][0]=t[8],o[2][1]=t[9],o[2][2]=t[10],n[0]=Bt(d[0]),Ht(d[0],d[0]),r[0]=Vt(d[0],d[1]),Sr(d[1],d[1],d[0],1,-r[0]),n[1]=Bt(d[1]),Ht(d[1],d[1]),r[0]/=n[1],r[1]=Vt(d[0],d[2]),Sr(d[2],d[2],d[0],1,-r[1]),r[2]=Vt(d[1],d[2]),Sr(d[2],d[2],d[1],1,-r[2]),n[2]=Bt(d[2]),Ht(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Yt(kr,d[1],d[2]),Vt(d[0],kr)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]),d[0][2]>d[2][0]&&(a[1]=-a[1]),d[1][0]>d[0][1]&&(a[2]=-a[2])}}function Sr(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}Ar.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Ar.prototype.update=function(t,e){ur(this.center,t),ur(this.halfExtents,e),hr(this.min,this.center,this.halfExtents),fr(this.max,this.center,this.halfExtents)},Ar.prototype.setMinMax=function(t,e){fr(this.center,e,t),dr(this.center,this.center,.5),hr(this.halfExtents,e,t),dr(this.halfExtents,this.halfExtents,.5),ur(this.min,t),ur(this.max,e)},Ar.prototype.getMin=function(){return this.min},Ar.prototype.getMax=function(){return this.max},Ar.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Ar.isEmpty(t)||(Ar.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},Ar.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),m=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),M=Math.abs(d);n[0]=e[12]+a*i[0]+o*i[1]+s*i[2],n[1]=e[13]+l*i[0]+c*i[1]+u*i[2],n[2]=e[14]+h*i[0]+f*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+y*t[2],r[1]=m*t[0]+v*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],hr(this.min,n,r),fr(this.max,n,r)},Ar.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},Ar.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Ar,i=[0,0,0],n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=[0,0,0],i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},Ar.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?ur([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]]},Ar.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?ur([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]]};var _r=Ar;function Ar(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Cr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Cr.prototype.distanceToPoint=function(t){return Vt(t,this.normal)-this.distance},Cr.prototype.normalize=function(){var t,e,n,r=1/$t(this.normal);t=this.normal,e=this.normal,n=r,t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},Cr.prototype.intersectsLine=function(t,e,n){var r,i,a=this.distanceToPoint(t),a=a/(a-this.distanceToPoint(e)),o=0<=a&&a<=1;return o&&n&&(n=n,e=e,a=a,r=(t=t)[0],i=t[1],t=t[2],n[0]=r+a*(e[0]-r),n[1]=i+a*(e[1]-i),n[2]=t+a*(e[2]-t)),o};var Tr,Pr=Cr;function Cr(t,e){this.distance=t||0,this.normal=e||Dt(0,1,0),this.updatePNVertexFlag()}(i=Tr=Tr||{})[i.OUTSIDE=4294967295]="OUTSIDE",i[i.INSIDE=0]="INSIDE",i[i.INDETERMINATE=2147483647]="INDETERMINATE";Nr.prototype.extractFromVPMatrix=function(t){var t=O(t,16),e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];zt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,zt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,zt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,zt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,zt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,zt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})};var Lr=Nr;function Nr(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Pr)}Rr.prototype.clone=function(){return new Rr(this.x,this.y)},Rr.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var jr=Rr;function Rr(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Br.prototype.toJSON=function(){};var Ir=Br;function Br(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}var Dr,Fr,zr,Wr="Method not implemented.",Gr="Use document.documentElement instead.";(r=Dr=Dr||{})[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",(i=Fr=Fr||{})[i.DEFAULT=0]="DEFAULT",i[i.ROTATIONAL=1]="ROTATIONAL",i[i.TRANSLATIONAL=2]="TRANSLATIONAL",i[i.CINEMATIC=3]="CINEMATIC",(r=zr=zr||{})[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE";var s,Hr,Vr,Yr,qr="updated",i=(a.prototype.isOrtho=function(){return this.projectionMode===zr.ORTHOGRAPHIC},a.prototype.getProjectionMode=function(){return this.projectionMode},a.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},a.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},a.prototype.getFrustum=function(){return this.frustum},a.prototype.getPosition=function(){return this.position},a.prototype.getFocalPoint=function(){return this.focalPoint},a.prototype.getDollyingStep=function(){return this.dollyingStep},a.prototype.getNear=function(){return this.near},a.prototype.getFar=function(){return this.far},a.prototype.getZoom=function(){return this.zoom},a.prototype.getOrthoMatrix=function(){return this.orthoMatrix},a.prototype.getView=function(){return this.view},a.prototype.setEnableUpdate=function(t){this.enableUpdate=t},a.prototype.setType=function(t,e){return this.type=t,this.type===Dr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Dr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},a.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},a.prototype.setTrackingMode=function(t){if(this.type!==Dr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},a.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},a.prototype.getViewTransform=function(){return gt(tt(),this.matrix)},a.prototype.getWorldTransform=function(){return this.matrix},a.prototype.jitterProjectionMatrix=function(t,e){t=Mt(tt(),[t,e,0]);this.jitteredProjectionMatrix=mt(tt(),t,this.projectionMatrix)},a.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},a.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},a.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},a.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},a.prototype.setNear=function(t){return this.projectionMode===zr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},a.prototype.setFar=function(t){return this.projectionMode===zr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},a.prototype.setViewOffset=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===zr.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},a.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===zr.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},a.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===zr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===zr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},a.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=Dt(t.x-r,t.y-n,0),e=Vt(i,this.right)/Bt(this.right),r=Vt(i,this.up)/Bt(this.up);return this.pan(-e,-r),this},a.prototype.setPerspective=function(t,e,n,r){this.projectionMode=zr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,l,c,n=this.near*Math.tan(yr(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,u=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,u+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,u=(a=u)+r,n=(r=n)-e,e=t,t=this.far,o=this.clipSpaceNearZ===sr.ZERO,l=2*e/(r-n),c=(u+a)/(u-a),r=(r+n)/(r-n),n=(o=void 0===o?!1:o)?(s=-t/(t-e),-t*e/(t-e)):(s=-(t+e)/(t-e),-2*t*e/(t-e)),i[0]=2*e/(u-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=c,i[9]=r,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=n,i[15]=0,bt(this.projectionMatrix,this.projectionMatrix,Dt(1,-1,1)),gt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},a.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=zr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),(this.clipSpaceNearZ===sr.NEGATIVE_ONE?Ct:Lt)(this.projectionMatrix,s,n,r,e,i,a),bt(this.projectionMatrix,this.projectionMatrix,Dt(1,-1,1)),gt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},a.prototype.setPosition=function(t,e,n){t=gr(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},a.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=Dt(0,1,0);return this.focalPoint=gr(t,e,n),this.trackingMode===Fr.CINEMATIC&&(t=(r=Gt(It(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Bt(r),e=mr(Math.asin(e/r)),r=90+mr(Math.atan2(n,t)),wt(n=tt(),n,yr(r)),xt(n,n,yr(e)),i=qt(It(),[0,1,0],n)),gt(this.matrix,Nt(tt(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},a.prototype.getDistance=function(){return this.distance},a.prototype.getDistanceVector=function(){return this.distanceVector},a.prototype.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=It(),t=this.distance,n=this.forward,r=this.focalPoint,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},a.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},a.prototype.setMinDistance=function(t){return this.minDistance=t,this},a.prototype.setAzimuth=function(t){return this.azimuth=pr(t),this.computeMatrix(),this._getAxes(),this.type===Dr.ORBITING||this.type===Dr.EXPLORING?this._getPosition():this.type===Dr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},a.prototype.getAzimuth=function(){return this.azimuth},a.prototype.setElevation=function(t){return this.elevation=pr(t),this.computeMatrix(),this._getAxes(),this.type===Dr.ORBITING||this.type===Dr.EXPLORING?this._getPosition():this.type===Dr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},a.prototype.getElevation=function(){return this.elevation},a.prototype.setRoll=function(t){return this.roll=pr(t),this.computeMatrix(),this._getAxes(),this.type===Dr.ORBITING||this.type===Dr.EXPLORING?this._getPosition():this.type===Dr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},a.prototype.getRoll=function(){return this.roll},a.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},a.prototype.computeMatrix=function(){var t=Qt(Jt(),[0,0,1],yr(this.roll)),e=(rt(this.matrix),Qt(Jt(),[1,0,0],yr((this.rotateWorld&&this.type!==Dr.TRACKING||this.type===Dr.TRACKING?1:-1)*this.elevation))),n=Qt(Jt(),[0,1,0],yr((this.rotateWorld&&this.type!==Dr.TRACKING||this.type===Dr.TRACKING?1:-1)*this.azimuth)),n=te(Jt(),n,e),n=te(Jt(),n,t),e=At(tt(),n);this.type===Dr.ORBITING||this.type===Dr.EXPLORING?(vt(this.matrix,this.matrix,this.focalPoint),mt(this.matrix,this.matrix,e),vt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Dr.TRACKING&&(vt(this.matrix,this.matrix,this.position),mt(this.matrix,this.matrix,e))},a.prototype._setPosition=function(t,e,n){this.position=gr(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},a.prototype._getAxes=function(){Ft(this.right,gr(Zt(Kt(),[1,0,0,0],this.matrix))),Ft(this.up,gr(Zt(Kt(),[0,1,0,0],this.matrix))),Ft(this.forward,gr(Zt(Kt(),[0,0,1,0],this.matrix))),Ht(this.right,this.right),Ht(this.up,this.up),Ht(this.forward,this.forward)},a.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Bt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Dr.TRACKING||this.rotateWorld?(this.elevation=mr(Math.asin(e/r)),this.azimuth=mr(Math.atan2(-t,-n))):(this.elevation=-mr(Math.asin(e/r)),this.azimuth=-mr(Math.atan2(-t,-n)))},a.prototype._getPosition=function(){Ft(this.position,gr(Zt(Kt(),[0,0,0,1],this.matrix))),this._getDistance()},a.prototype._getFocalPoint=function(){var t,e;Xt(this.distanceVector,[0,0,-this.distance],(t=J(),e=this.matrix,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)),Wt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},a.prototype._getDistance=function(){this.distanceVector=Gt(It(),this.focalPoint,this.position),this.distance=Bt(this.distanceVector),this.dollyingStep=this.distance/100},a.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===zr.ORTHOGRAPHIC&&(t=this.position,e=Qt(Jt(),[0,0,1],-this.roll*Math.PI/180),_t(this.orthoMatrix,e,Dt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Dt(this.zoom,this.zoom,1),t))},a.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=mt(tt(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(qr))},a.prototype.rotate=function(t,e,n){throw new Error(Wr)},a.prototype.pan=function(t,e){throw new Error(Wr)},a.prototype.dolly=function(t){throw new Error(Wr)},a.prototype.createLandmark=function(t,e){throw new Error(Wr)},a.prototype.gotoLandmark=function(t,e){throw new Error(Wr)},a.prototype.cancelLandmarkAnimation=function(){throw new Error(Wr)},a);function a(){this.clipSpaceNearZ=sr.NEGATIVE_ONE,this.eventEmitter=new X,this.matrix=tt(),this.right=Dt(1,0,0),this.up=Dt(0,1,0),this.forward=Dt(0,0,1),this.position=Dt(0,0,1),this.focalPoint=Dt(0,0,0),this.distanceVector=Dt(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=tt(),this.projectionMatrixInverse=tt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Dr.EXPLORING,this.trackingMode=Fr.DEFAULT,this.projectionMode=zr.PERSPECTIVE,this.frustum=new Lr,this.orthoMatrix=tt()}function Xr(a,o){if("function"!=typeof a||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),s.cache=i.set(r,n)||i,n)}return s.cache=new(Xr.Cache||Map),s}Xr.Cache=Map,(r=s=s||{})[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",(r=Hr=Hr||{})[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",(r=Vr=Vr||{})[r.kYes=0]="kYes",r[r.kNo=1]="kNo",(r=Yr=Yr||{})[r.kYes=0]="kYes",r[r.kNo=1]="kNo";function Ur(t){var e=1;switch(t){case s.kPixels:case s.kDegrees:case s.kSeconds:break;case s.kMilliseconds:e=.001;break;case s.kRadians:e=180/Math.PI;break;case s.kGradians:e=.9;break;case s.kTurns:e=360}return e}function $r(t){switch(t){case s.kNumber:case s.kInteger:return"";case s.kPercentage:return"%";case s.kEms:return"em";case s.kRems:return"rem";case s.kPixels:return"px";case s.kDegrees:return"deg";case s.kRadians:return"rad";case s.kGradians:return"grad";case s.kMilliseconds:return"ms";case s.kSeconds:return"s";case s.kTurns:return"turn"}return""}var Kr,Zr=[{name:"em",unit_type:s.kEms},{name:"px",unit_type:s.kPixels},{name:"deg",unit_type:s.kDegrees},{name:"rad",unit_type:s.kRadians},{name:"grad",unit_type:s.kGradians},{name:"ms",unit_type:s.kMilliseconds},{name:"s",unit_type:s.kSeconds},{name:"rem",unit_type:s.kRems},{name:"turn",unit_type:s.kTurns}],Jr=((r=Kr=Kr||{})[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Zr.find(function(t){return t.name===e}).unit_type}),r=(Qr.isAngle=function(t){return t===s.kDegrees||t===s.kRadians||t===s.kGradians||t===s.kTurns},Qr.isLength=function(t){return t>=s.kEms&&t<s.kDegrees},Qr.isRelativeUnit=function(t){return t===s.kPercentage||t===s.kEms||t===s.kRems},Qr.isTime=function(t){return t===s.kSeconds||t===s.kMilliseconds},Qr.prototype.toString=function(){return this.buildCSSText(Vr.kNo,Yr.kNo,"")},Qr.prototype.isNumericValue=function(){return this.getType()>=Kr.kUnitType&&this.getType()<=Kr.kClampType},Qr);function Qr(){}t(ri,ti=r),ri.prototype.getType=function(){return Kr.kColorType},ri.prototype.to=function(t){return this};var ti,ei,ni=ri;function ri(t){var e=ti.call(this)||this;return e.colorSpace=t,e}(o=ei=ei||{})[o.Constant=0]="Constant",o[o.LinearGradient=1]="LinearGradient",o[o.RadialGradient=2]="RadialGradient";t(oi,ii=r),oi.prototype.clone=function(){return new oi(this.type,this.value)},oi.prototype.buildCSSText=function(t,e,n){return n},oi.prototype.getType=function(){return Kr.kColorType};var ii,ai=oi;function oi(t,e){var n=ii.call(this)||this;return n.type=t,n.value=e,n}t(ci,si=r),ci.prototype.clone=function(){return new ci(this.value)},ci.prototype.getType=function(){return Kr.kKeywordType},ci.prototype.buildCSSText=function(t,e,n){return n+this.value};var si,li=ci;function ci(t){var e=si.call(this)||this;return e.value=t,e}function ui(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var hi=Xr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function fi(t){return"function"==typeof t}function di(t,e){void 0===e&&(e="");var n="";if(Number.isFinite(t)){if(!Number.isNaN(t))throw new Error;n="NaN"}else n=0<t?"infinity":"-infinity";return n+e}function pi(t){switch(function(t){switch(t){case s.kNumber:case s.kInteger:return Hr.kUNumber;case s.kPercentage:return Hr.kUPercent;case s.kPixels:return Hr.kULength;case s.kMilliseconds:case s.kSeconds:return Hr.kUTime;case s.kDegrees:case s.kRadians:case s.kGradians:case s.kTurns:return Hr.kUAngle;default:return Hr.kUOther}}(t)){case Hr.kUNumber:return s.kNumber;case Hr.kULength:return s.kPixels;case Hr.kUPercent:return s.kPercentage;case Hr.kUTime:return s.kSeconds;case Hr.kUAngle:return s.kDegrees;default:return s.kUnknown}}var gi,yi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},mi=Xr(function(t){var t=hi(t),e=yi[t];return(null==e?void 0:e.alias)||t}),vi=(t(bi,gi=r),bi.prototype.clone=function(){return new bi(this.value,this.unit)},bi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},bi.prototype.getType=function(){return Kr.kUnitType},bi.prototype.convertTo=function(t){var e;return this.unit===t?new bi(this.value,this.unit):(e=pi(this.unit))!==pi(t)||e===s.kUnknown?null:(e=Ur(this.unit)/Ur(t),new bi(this.value*e,t))},bi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case s.kUnknown:break;case s.kInteger:i=Number(this.value).toFixed(0);break;case s.kNumber:case s.kPercentage:case s.kEms:case s.kRems:case s.kPixels:case s.kDegrees:case s.kRadians:case s.kGradians:case s.kMilliseconds:case s.kSeconds:case s.kTurns:var r,i,a=this.value,o=$r(this.unit);i=a<-999999||999999<a?(r=$r(this.unit),!Number.isFinite(a)||Number.isNaN(a)?di(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},bi);function bi(t,e){void 0===e&&(e=s.kNumber);var n=gi.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?s.kNumber:"percent"===r||"%"===r?s.kPercentage:Jr(r):s.kUnknown:e;return n.unit=r,n.value=t,n}var xi,wi=new vi(0,"px"),Mi=(new vi(1,"px"),new vi(0,"deg")),Oi=(t(ki,xi=ni),ki.prototype.clone=function(){return new ki(this.r,this.g,this.b,this.alpha)},ki.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},ki);function ki(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=xi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function Ei(t){return Ti[t]||(Ti[t]=new li(t)),Ti[t]}var Si,_i,Ai=new li("unset"),o=new li("initial"),r=new li("inherit"),Ti={"":Ai,unset:Ai,initial:o,inherit:r},Pi=new Oi(0,0,0,0,!0),Ci=new Oi(0,0,0,0),Li=Xr(function(t,e,n,r){return new Oi(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ni=function(t,e){return void 0===e&&(e=s.kNumber),new vi(t,e)},ji=new vi(50,"%"),Ri=(Si=Si||{},Si[Si.Standard=0]="Standard",(ni=_i=_i||{})[ni.ADDED=0]="ADDED",ni[ni.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(ni[ni.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ir(0,0,0,0)});(o=h=h||{}).COORDINATE="<coordinate>",o.COLOR="<color>",o.PAINT="<paint>",o.NUMBER="<number>",o.ANGLE="<angle>",o.OPACITY_VALUE="<opacity-value>",o.SHADOW_BLUR="<shadow-blur>",o.LENGTH="<length>",o.PERCENTAGE="<percentage>",o.LENGTH_PERCENTAGE="<length> | <percentage>",o.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",o.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",o.LIST_OF_POINTS="<list-of-points>",o.PATH="<path>",o.FILTER="<filter>",o.Z_INDEX="<z-index>",o.OFFSET_DISTANCE="<offset-distance>",o.DEFINED_PATH="<defined-path>",o.MARKER="<marker>",o.TRANSFORM="<transform>",o.TRANSFORM_ORIGIN="<transform-origin>",o.TEXT="<text>",o.TEXT_TRANSFORM="<text-transform>";Ii={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},Bi="";var Ii,Bi,Di=function(t){return Bi=t,zi()};function Fi(t){throw new Error(Bi+": "+t)}function zi(){var t=Ki(Wi);return 0<Bi.length&&Fi("Invalid input not EOF"),t}function Wi(){return Gi("linear-gradient",Ii.linearGradient,Vi)||Gi("repeating-linear-gradient",Ii.repeatingLinearGradient,Vi)||Gi("radial-gradient",Ii.radialGradient,Yi)||Gi("repeating-radial-gradient",Ii.repeatingRadialGradient,Yi)||Gi("conic-gradient",Ii.conicGradient,Yi)}function Gi(n,t,r){return Hi(t,function(t){var e=r();return e&&!ra(Ii.comma)&&Fi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Ki(Zi)}})}function Hi(t,e){t=ra(t);if(t)return ra(Ii.startCall)||Fi("Missing ("),e=e(t),ra(Ii.endCall)||Fi("Missing )"),e}function Vi(){return na("directional",Ii.sideOrCorner,1)||na("angular",Ii.angleValue,1)}function Yi(){var t,e,n=qi();return n&&((t=[]).push(n),e=Bi,ra(Ii.comma))&&((n=qi())?t.push(n):Bi=e),t}function qi(){var t,e=function(){var t=na("shape",/^(circle)/i,0);t&&(t.style=ea()||Xi());return t}()||function(){var t=na("shape",/^(ellipse)/i,0);t&&(t.style=Qi()||Xi());return t}();return e?e.at=Ui():(t=Xi())?(e=t,(t=Ui())&&(e.at=t)):(t=$i())&&(e={type:"default-radial",at:t}),e}function Xi(){return na("extent-keyword",Ii.extentKeywords,1)}function Ui(){var t;if(na("position",/^at/,0))return(t=$i())||Fi("Missing positioning value"),t}function $i(){var t={x:Qi(),y:Qi()};if(t.x||t.y)return{type:"position",value:t}}function Ki(t){var e=t(),n=[];if(e)for(n.push(e);ra(Ii.comma);)(e=t())?n.push(e):Fi("One extra comma");return n}function Zi(){var t=na("hex",Ii.hexColor,1)||Hi(Ii.rgbaColor,function(){return{type:"rgba",value:Ki(Ji)}})||Hi(Ii.rgbColor,function(){return{type:"rgb",value:Ki(Ji)}})||na("literal",Ii.literalColor,0);return t||Fi("Expected color definition"),t.length=Qi(),t}function Ji(){return ra(Ii.number)[1]}function Qi(){return na("%",Ii.percentageValue,1)||ta()||ea()}function ta(){return na("position-keyword",Ii.positionKeywords,1)}function ea(){return na("px",Ii.pixelValue,1)||na("em",Ii.emValue,1)}function na(t,e,n){e=ra(e);if(e)return{type:t,value:e[n]}}function ra(t){var e=/^[\n\r\t\s]+/.exec(Bi),e=(e&&ia(e[0].length),t.exec(Bi));return e&&ia(e[0].length),e}function ia(t){Bi=Bi.substring(t)}var aa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,oa=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,sa=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,la=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ca={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},ua=Xr(function(t){t="angular"===t.type?Number(t.value):ca[t.value]||0;return Ni(t,"deg")}),ha=Xr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:Ni(n,i),cy:Ni(r,a)}}),fa=Xr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return Di(t).map(function(t){for(var e,n=t.type,r=t.orientation,t=t.colorStops,i=t,a=i.length,o=(i[a-1].length=null!=(d=i[a-1].length)?d:{type:"%",value:"100"},1<a&&(i[0].length=null!=(d=i[0].length)?d:{type:"%",value:"0"}),0),s=Number(i[0].length.value),l=1;l<a;l++){var c=null==(e=i[l].length)?void 0:e.value;if(!p(c)&&!p(s)){for(var u=1;u<l-o;u++)i[o+u].length={type:"%",value:"".concat(s+(Number(c)-s)*u/(l-o))};o=l,s=Number(c)}}var h,f,d=t.map(function(t){return{offset:Ni(Number(t.length.value),"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#".concat(t):"literal"===e?t:("rgb"===e?"rgb(":"rgba(").concat(t.join(","),")"))};var e});return"linear-gradient"===n?new ai(ei.LinearGradient,{angle:r?ua(r):Mi,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=ha(r[0].at)).cx,t=t.cy,f=void 0,r[0].style&&(h=(r=r[0].style).type,r=r.value,f="extent-keyword"===h?Ei(r):Ni(r,h)),new ai(ei.RadialGradient,{cx:n,cy:t,size:f,steps:d})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=aa.exec(t);if(n)return r=(null==(r=n[2].match(la))?void 0:r.map(function(t){return t.split(":")}))||[],[new ai(ei.LinearGradient,{angle:Ni(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=O(t,2),e=t[0],t=t[1];return{offset:Ni(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=oa.exec(t);if(t)return t=(null==(t=t[4].match(la))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ni(50,"%"),cy:Ni(50,"%"),steps:t.map(function(t){var t=O(t,2),e=t[0],t=t[1];return{offset:Ni(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!Ye(n))return[new ai(ei.RadialGradient,n)]}else if("p"===e){var r=t;if(r=sa.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function da(t){return t&&!p(t.r)&&!p(t.g)&&!p(t.b)}var pa=Xr(function(t){var e;return(e=t)&&e.image?m({repetition:"repeat"},t):"transparent"===(t=p(t)?"":t)?Ci:fa(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=Sn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),Li.apply(void 0,v([],O(e),!1)))});function ga(t,e){if(da(t)&&da(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(qe(e[n],0,255));return e[3]=qe(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ya(t,e){if(p(e))return Ni(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ni(Number(e),"px");if(0<="deg".search(t))return Ni(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return Ni(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var ma=Xr(function(t){return ya(new RegExp("px","g"),t)}),va=(Xr(function(t){return ya(new RegExp("%","g"),t)}),function(t){return Xe(t)||isFinite(Number(t))?Ni(Number(t)||0,"px"):ya(new RegExp("px|%|em|rem","g"),t)}),ba=Xr(function(t){return ya(new RegExp("deg|rad|grad|turn","g"),t)});function xa(t){var e=0;return t.unit===s.kDegrees?e=t.value:t.unit===s.kRadians?e=mr(Number(t.value)):t.unit===s.kTurns&&(e=360*Number(t.value)),e}function wa(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Ye(t)?n=t.split(" ").map(function(t){return Number(t)}):Xe(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]: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]]}function Ma(t){return Ye(t)?t.split(" ").map(function(t){return va(t)}):t.map(function(t){return va(t.toString())})}function Oa(t,e,n){return 0===t.value?0:t.unit===s.kPixels?Number(t.value):t.unit===s.kPercentage&&n?(n=n.nodeName===b.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var ka=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ea(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))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,-1<ka.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ya(/deg|rad|grad|turn|px|%/g,t)||pa(t)})}),n.lastIndex===t.length)return r}return[]}function Sa(t){return t.toString()}var _a=Xr(function(t){return"number"==typeof t?Ni(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ni(Number(t)):Ni(0)});function Aa(t,e){return[t,e,Sa]}function Ta(n,r){return function(t,e){return[t,e,function(t){return Sa(qe(t,n,r))}]}}function Pa(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Ca(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ce(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function La(t,e){return t[0]===e[0]&&t[1]===e[1]}function Na(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(k=t[p]).currentPoint,y=k.params,m=k.prePoint,v=void 0;switch(k.command){case"Q":b=m[0],n=m[1],r=y[1],i=y[2],a=y[3],o=y[4],u=c=l=s=void 0,s=qn(b,r,a)[0],l=qn(n,i,o)[0],c=[b,a],u=[n,o],void 0!==s&&c.push(Yn(b,r,a,s)),void 0!==l&&u.push(Yn(n,i,o,l)),v=Dn(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Hn(t,n,i,o),h=Hn(e,r,a,s),f=0;f<u.length;f++)l.push(Gn(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(Gn(e,r,a,s,h[f]));return Dn(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=k.arcParams,v=Fn(b.cx,b.cy,b.rx,b.ry,b.xRotation,b.startAngle,b.endAngle);break;default:h.push(g[0]),f.push(g[1])}v&&(k.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===k.command||"M"===k.command)&&k.prePoint&&k.nextPoint&&d.push(k)}var h=h.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),f=f.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),x=He(h),w=He(f),M=Ge(h),O=Ge(f);if(0!==d.length)for(p=0;p<d.length;p++){var k;(g=(k=d[p]).currentPoint)[0]===x?x-=ja(k,e).xExtra:g[0]===M&&(M+=ja(k,e).xExtra),g[1]===w?w-=ja(k,e).yExtra:g[1]===O&&(O+=ja(k,e).yExtra)}return{x:x,y:w,width:M-x,height:O-w}}function ja(t,e){var n=t.prePoint,r=t.currentPoint,t=t.nextPoint,i=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),n=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),n=Math.acos((i+a-n)/(2*Math.sqrt(i)*Math.sqrt(a)));return!n||0===Math.sin(n)||Ue(n,0)?{xExtra:0,yExtra:0}:(i=Math.abs(Math.atan2(t[1]-r[1],t[0]-r[0])),a=Math.abs(Math.atan2(t[0]-r[0],t[1]-r[1])),i=i>Math.PI/2?Math.PI-i:i,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(n/2-i)*(e/2*(1/Math.sin(n/2)))-e/2||0,yExtra:Math.cos(a-n/2)*(e/2*(1/Math.sin(n/2)))-e/2||0})}function Ra(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xr(function(t){return(Ye(t)?t.split(" "):t).map(_a)});function Ia(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=yr(r=Ke(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=Ba({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=Ba(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var Ba=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)};function Da(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],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 h=function(t,e){var n=e[1],r=e[2],i=Ke(yr(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=Ga([1,0],p),h=Ga(p,u);Wa(p,u)<=-1&&(h=Math.PI);1<=Wa(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:La(t,[c,e])?0:n,ry:La(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):n=[l[(v=l.length)-2],l[v-1]],r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&La(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,m,v=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=v,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(f=Ra((d=e[s-1]).currentPoint,b),"Q"===d.command?(u.command="Q",u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(p=[l[1],l[2]],g=[l[3],l[4]],u.startTangent=[b[0]-p[0],b[1]-p[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[p[0]-g[0],p[1]-g[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[g[0]-p[0],g[1]-p[1]])):"S"===c?(p=Ra((d=e[s-1]).currentPoint,b),g=[l[1],l[2]],"C"===d.command?(u.command="C",u.startTangent=[b[0]-p[0],b[1]-p[1]]):(u.command="SQ",u.startTangent=[b[0]-g[0],b[1]-g[1]]),u.endTangent=[n[0]-g[0],n[1]-g[1]]):"A"===c&&(c=(b=Fa(u,0)).x,b=b.y,y=(m=Fa(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Fa(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=Ia({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Ia({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function za(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Wa(t,e){return za(t)*za(e)?(t[0]*e[0]+t[1]*e[1])/(za(t)*za(e)):1}function Ga(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Wa(t,e))}function Ha(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=be(e)}catch(t){n=be(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}var e=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}(n),t=(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 0<r.length&&n.push(r),{polygons:e,polylines:n}}(n)).polygons,r=r.polylines,i=Da(n),a=(l=Na(i,0)).x,o=l.y,s=l.width,l=l.height;return{absolutePath:n,hasArc:e,segments:i,polygons:t,polylines:r,totalLength:0,rect:{x:Number.isFinite(a)?a:0,y:Number.isFinite(o)?o:0,width:Number.isFinite(s)?s:0,height:Number.isFinite(l)?l:0}}}var Va=Xr(Ha);function Ya(t){return(Ye(t)?Va:Ha)(t)}function qa(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=Se(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=Se(e.absolutePath,!1),e.curve=d),[f,d]),f=Le((t=f.length!==d.length?function t(e,n,r){var i,e=Ne(e),n=Ne(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],h=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Le(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):se(t[0]);return[f,(i=t[1],a=f,c=i.length-1,u=[],h=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){h+=Me(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Xa(t,e){var n,r,i=Ye(t)?t.split(" ").map(function(t){var t=O(t.split(","),2),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Vn(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=zn(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,v([],O(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,v([],O(i.map(function(t){return t[1]})),!1));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function Ua(t,e){return[t.points,e.points,function(t){return t}]}var $a=null;function Ka(t){return function(e){var n=0;return t.map(function(t){return t===$a?e[n++]:t})}}function Za(t){return t}var Ja={matrix:["NNNNNN",[$a,$a,0,0,$a,$a,0,0,0,0,1,0,$a,$a,0,1],Za],matrix3d:["NNNNNNNNNNNNNNNN",Za],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ka([$a,$a,new vi(1)]),Za],scalex:["N",Ka([$a,new vi(1),new vi(1)]),Ka([$a,new vi(1)])],scaley:["N",Ka([new vi(1),$a,new vi(1)]),Ka([new vi(1),$a])],scalez:["N",Ka([new vi(1),new vi(1),$a])],scale3d:["NNN",Za],skew:["Aa",null,Za],skewx:["A",null,Ka([$a,Mi])],skewy:["A",null,Ka([Mi,$a])],translate:["Tt",Ka([$a,$a,wi]),Za],translatex:["T",Ka([$a,wi,wi]),Ka([$a,wi])],translatey:["T",Ka([wi,$a,wi]),Ka([wi,$a])],translatez:["L",Ka([wi,wi,$a])],translate3d:["TTL",Za]};function Qa(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=Ja[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?Mi:ba(t)},N:_a,T:va,L:ma}[f.toUpperCase()](h):{a:Mi,n:c[0],t:wi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function to(t){switch(t.t){case"rotatex":return i=yr(xa(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=yr(xa(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=yr(xa(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":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=yr(xa(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,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":o=yr(xa(t.d[0])),a=yr(xa(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=yr(xa(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=yr(xa(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=Oa(t.d[0],0,null)||0,n=Oa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oa(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=Oa(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=Oa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oa(t.d[0],0,null)||0,n=Oa(t.d[1],0,null)||0,r=Oa(t.d[2],0,null)||0,1];case"perspective":a=Oa(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a: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 eo(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 no(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 Er(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(to).reduce(eo),e,n,r,i,a),[[e,n,r,a,i]]}var ro=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(o=0;o<3;o++)for(var s=0;s<3;s++)a[3][o]+=t[s]*a[s][o];var l=r[0],c=r[1],u=r[2],r=r[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=(h[0][0]=1-2*(c*c+u*u),h[0][1]=2*(l*c-u*r),h[0][2]=2*(l*u+c*r),h[1][0]=2*(l*c+u*r),h[1][1]=1-2*(l*l+u*u),h[1][2]=2*(c*u-l*r),h[2][0]=2*(l*u-c*r),h[2][1]=2*(c*u+l*r),h[2][2]=1-2*(l*l+c*c),a=io(a,h),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);for(n[2]&&(u[2][1]=n[2],a=io(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=io(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=io(a,u)),o=0;o<3;o++)for(s=0;s<3;s++)a[o][s]*=e[o];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])};function io(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}function ao(t){return t.toFixed(6).replace(".000000","")}function oo(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=no(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=no(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,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),i=(r=qe(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+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}(r[0][3],i[0][3],t[5]);return ro(t[0],t[1],t[2],e,t[4]).map(ao).join(",")}])}function so(t){return t.replace(/[xy]/,"")}function lo(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var co=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function uo(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?Ni(n):Ni(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=oo(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];else for(n=0;n<r.length;n++){var l=r[n].t,c=i[n].t,u=r[n].d,h=i[n].d,f=Ja[l],d=Ja[c],p=void 0;if(co(l,c)){var g=oo([r[n]],[i[n]]);a.push(g[0]),o.push(g[1]),s.push(["matrix",[g[2]]])}else{if(l===c)p=l;else if(f[2]&&d[2]&&so(l)===so(c))p=so(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||lo(l)!==lo(c)){a=[(g=oo(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=lo(l),u=f[1](u),h=d[1](h)}for(var y=[],m=[],v=[],b=0;b<u.length;b++){g=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=pi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=$r(t.unit)):(vi.isLength(t.unit)||vi.isLength(e.unit))&&(o=Oa(t,i,n),s=Oa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(u[b],h[b],t,!1,b);y[b]=g[0],m[b]=g[1],v.push(g[2])}a.push(y),o.push(m),s.push([p,v])}}return e&&(e=a,a=o,o=e),[a,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var ho=Xr(function(t){var e;return Ye(t)?"text-anchor"===t?[Ni(0,"px"),Ni(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[va(fo(e[0])),va(fo(e[1]))]):[Ni(t[0]||0,"px"),Ni(t[1]||0,"px")]});function fo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var po=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:h.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:h.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:h.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:h.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:h.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:h.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:h.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:h.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:h.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:h.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:h.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:h.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:h.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:h.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:h.FILTER},{n:"clipPath",syntax:h.DEFINED_PATH},{n:"textPath",syntax:h.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:h.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===b.CIRCLE||t===b.ELLIPSE?"center":t===b.TEXT?"text-anchor":"left top"},l:!0,syntax:h.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===b.CIRCLE||t===b.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:h.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:h.COORDINATE},{n:"cy",int:!0,d:"0",syntax:h.COORDINATE},{n:"cz",int:!0,d:"0",syntax:h.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:h.COORDINATE},{n:"y",int:!0,d:"0",syntax:h.COORDINATE},{n:"z",int:!0,d:"0",syntax:h.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:h.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:h.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:h.COORDINATE},{n:"y1",int:!0,l:!0,syntax:h.COORDINATE},{n:"z1",int:!0,l:!0,syntax:h.COORDINATE},{n:"x2",int:!0,l:!0,syntax:h.COORDINATE},{n:"y2",int:!0,l:!0,syntax:h.COORDINATE},{n:"z2",int:!0,l:!0,syntax:h.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:h.PATH,p:50},{n:"points",int:!0,l:!0,syntax:h.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:h.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:h.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:h.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:h.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:h.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:h.NUMBER,d:function(t){return t===b.PATH||t===b.POLYGON||t===b.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:h.MARKER},{n:"markerEnd",syntax:h.MARKER},{n:"markerMid",syntax:h.MARKER},{n:"markerStartOffset",syntax:h.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:h.LENGTH,l:!0,int:!0,d:"0"}],go=po.filter(function(t){return!!t.l}).map(function(t){return t.n}),yo={},mo=new WeakMap,r=(vo.prototype.registerMetadata=function(e){v([e.n],O(e.a||[]),!1).forEach(function(t){yo[t]=e})},vo.prototype.unregisterMetadata=function(t){delete yo[t]},vo.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},vo.prototype.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),this.runtime.enableCSSParsing){var i=t.skipUpdateAttribute,a=t.skipParse,o=t.forceUpdateGeometry,s=t.usedAttributes,l=o,c=Object.keys(e);c.forEach(function(t){i||(n.attributes[t]=e[t]),!l&&null!=(t=yo[t])&&t.l&&(l=!0)}),a||c.forEach(function(t){n.computedStyle[t]=r.parseProperty(t,n.attributes[t],n)}),(c=null!=s&&s.length?Array.from(new Set(c.concat(s))):c).forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=r.computeProperty(t,n.computedStyle[t],n))}),l&&this.updateGeometry(n),c.forEach(function(t){t in n.parsedStyle&&r.postProcessProperty(t,n,c)}),this.runtime.enableCSSParsing&&n.children.length&&c.forEach(function(e){e in n.parsedStyle&&r.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(n.attributes,e);var o=Object.keys(e),a=n.parsedStyle.clipPath,s=n.parsedStyle.offsetPath,u=(n.parsedStyle=Object.assign(n.parsedStyle,e),!!t.forceUpdateGeometry);if(!u)for(var h=0;h<go.length;h++)if(go[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=pa(e.fill)),e.stroke&&(n.parsedStyle.stroke=pa(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=pa(e.shadowColor)),e.filter&&(n.parsedStyle.filter=Ea(e.filter)),p(e.radius)||(n.parsedStyle.radius=wa(e.radius,4)),p(e.lineDash)||(n.parsedStyle.lineDash=wa(e.lineDash,2)),e.points&&(n.parsedStyle.points=Xa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Ri)),e.path&&(n.parsedStyle.path=Ya(e.path),n.parsedStyle.defX=n.parsedStyle.path.rect.x,n.parsedStyle.defY=n.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,n,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,n,this.runtime),e.anchor&&(n.parsedStyle.anchor=wa(e.anchor,2)),e.transform&&(n.parsedStyle.transform=Qa(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=ho(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==b.CIRCLE&&n.nodeName!==b.ELLIPSE||p(e.cx)&&p(e.cy))&&(n.nodeName!==b.RECT&&n.nodeName!==b.IMAGE&&n.nodeName!==b.GROUP&&n.nodeName!==b.HTML&&n.nodeName!==b.TEXT&&n.nodeName!==b.MESH||p(e.x)&&p(e.y)&&p(e.z))&&(n.nodeName!==b.LINE||p(e.x1)&&p(e.y1)&&p(e.z1)&&p(e.x2)&&p(e.y2)&&p(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),p(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(n,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,o),p(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},vo.prototype.parseProperty=function(t,e,n){var r,t=yo[t],i=e;return"unset"===(e=""!==e&&!p(e)?e:"unset")||"initial"===e||"inherit"===e?i=Ei(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Ei(e):t&&t.parser&&(i=t.parser(e,n))),i},vo.prototype.computeProperty=function(t,e,n){var r=yo[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof li){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))p(r)||(e=this.parseProperty(t,fi(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),p(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this.runtime)):e instanceof li?e.value:e}return a},vo.prototype.postProcessProperty=function(t,e,n){var t=yo[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},vo.prototype.addUnresolveProperty=function(t,e){var n=mo.get(t);n||(mo.set(t,[]),n=mo.get(t)),-1===n.indexOf(e)&&n.push(e)},vo.prototype.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=mo.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},vo.prototype.recalc=function(e){var n,t=mo.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),mo.delete(e))},vo.prototype.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y=t.nodeName,m=this.runtime.geometryUpdaterFactory[y];m&&((s=t.geometry).contentBounds||(s.contentBounds=new _r),s.renderBounds||(s.renderBounds=new _r),e=t.parsedStyle,n=(m=m.update(e,t)).width,r=m.height,h=void 0===(h=m.depth)?0:h,u=void 0===(u=m.offsetX)?0:u,p=void 0===(p=m.offsetY)?0:p,m=void 0===(m=m.offsetZ)?0:m,h=[Math.abs(n)/2,Math.abs(r)/2,h/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,f=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,y===b.TEXT?delete e.anchor:y===b.MESH&&(e.anchor[2]=.5),u=[(1-2*(o&&o[0]||0))*n/2+u,(1-2*(o&&o[1]||0))*r/2+p,(1-2*(o&&o[2]||0))*h[2]+m],s.contentBounds.update(u,h),p=y===b.POLYLINE||y===b.POLYGON||y===b.PATH?Math.SQRT2:.5,l&&!l.isNone&&(h[0]+=m=((c||0)+(g||0))*p,h[1]+=m),s.renderBounds.update(u,h),f&&d&&"inner"!==d&&(l=(y=s.renderBounds).min,c=y.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,m=e.shadowOffsetY||0,u=l[0]-g+p,h=c[0]+g+p,f=l[1]-g+m,d=c[1]+g+m,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),s.renderBounds.setMinMax(l,c)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,fr(s.renderBounds.halfExtents,s.renderBounds.halfExtents,[i,i,0]))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,y=r<0,g=((p=n<0)?-1:1)*(a?Oa(a[0],0,t):0),m=(y?-1:1)*(a?Oa(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,m-=(y?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,m),this.runtime.sceneGraphService.dirtifyToRoot(t))},vo.prototype.isPropertyInheritable=function(t){t=yo[t];return!!t&&t.inh},vo);function vo(t){var e=this;this.runtime=t,po.forEach(function(t){e.registerMetadata(t)})}bo.prototype.calculator=function(t,e,n,r){return xa(n)};ni=bo;function bo(){this.parser=ba,this.parserWithCSSDisabled=null,this.mixer=Aa}xo.prototype.calculator=function(t,e,n,r,i){return n instanceof li&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};o=xo;function xo(){}Mo.prototype.calculator=function(t,e,n,r){return n instanceof li?"none"===n.value?Pi:Ci:n};var wo=Mo;function Mo(){this.parser=pa,this.parserWithCSSDisabled=pa,this.mixer=ga}ko.prototype.calculator=function(t,e,n){return n instanceof li?[]:n};var Oo=ko;function ko(){this.parser=Ea}function Eo(t){t=t.parsedStyle.fontSize;return p(t)?null:t}_o.prototype.calculator=function(t,e,n,r,i){var a,o;return Xe(n)?n:vi.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===s.kPercentage?0:n.unit===s.kEms?r.parentNode&&(o=Eo(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===s.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=Eo(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var So=_o;function _o(){this.parser=va,this.parserWithCSSDisabled=null,this.mixer=Aa}To.prototype.parser=function(t){t=Ma(Xe(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},To.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ao=To;function To(){this.mixer=Pa}Co.prototype.parser=function(t){t=Ma(Xe(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},Co.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Po=Co;function Co(){this.mixer=Pa}var Lo=tt();function No(t,l){var c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0;l.resetLocalTransform(),l.setLocalPosition(c,u),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?l.translateLocal((e=t||[wi,wi])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[wi])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[wi])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[wi])[0].value):"translate3d"===s?l.translateLocal((e=t||[wi,wi,wi])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,xa((t||[Mi])[0])):"rotatex"===s?l.rotateLocal(xa((t||[Mi])[0]),0,0):"rotatey"===s?l.rotateLocal(0,xa((t||[Mi])[0]),0):"rotatez"===s?l.rotateLocal(0,0,xa((t||[Mi])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(yr(n[0]),yr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(yr(n[0]),l.getLocalSkew()[1])):"skewy"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],yr(n[0]))):"matrix"===s?(e=(o=O(t.map(function(t){return t.value}),6))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(nt(Lo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(nt.apply(Rt,v([Lo],O(t.map(function(t){return t.value})),!1)),Lo[12]+=c,Lo[13]+=u,l.setLocalTransform(Lo)))}),l.getLocalTransform()}t(Io,jo=So),Io.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case b.CIRCLE:case b.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;p(a)||(l=a),p(o)||(c=o),p(i)||(u=i);break;case b.LINE:var a=t.parsedStyle,o=a.x1,i=a.x2,s=a.y1,a=a.y2,l=Math.min(o,i),c=Math.min(s,a),u=0;break;case b.RECT:case b.IMAGE:case b.GROUP:case b.HTML:case b.TEXT:case b.MESH:p(t.parsedStyle.x)||(l=t.parsedStyle.x),p(t.parsedStyle.y)||(c=t.parsedStyle.y),p(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==b.PATH&&t.nodeName!==b.POLYLINE&&t.nodeName!==b.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),p(l)&&p(c)&&p(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?No(e,t):(n=(e=O(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(p(l)?n:l,p(c)?r:c,p(u)?e:u)))};var jo,Ro=Io;function Io(){return null!==jo&&jo.apply(this,arguments)||this}Do.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof li?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Bo=Do;function Do(){}zo.prototype.calculator=function(t,e,n){return n.value};var Fo=zo;function zo(){this.mixer=Aa,this.parser=_a,this.parserWithCSSDisabled=null}Go.prototype.calculator=function(t,e,n){return n.value},Go.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==b.LINE&&e!==b.PATH&&e!==b.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var Wo=Go;function Go(){this.parser=_a,this.parserWithCSSDisabled=null,this.mixer=Ta(0,1)}Vo.prototype.calculator=function(t,e,n){return n.value};var Ho=Vo;function Vo(){this.parser=_a,this.parserWithCSSDisabled=null,this.mixer=Ta(0,1)}qo.prototype.calculator=function(t,e,n){return n instanceof li&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ir(0,0,0,0)}:n},qo.prototype.postProcessor=function(t,e){var n;t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===b.PATH&&-1===e.indexOf("transform")&&(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(void 0===n?0:n,void 0===e?0:e))};var Yo=qo;function qo(){this.parser=Ya,this.parserWithCSSDisabled=Ya,this.mixer=qa}Uo.prototype.postProcessor=function(t,e){var n;t.nodeName!==b.POLYGON&&t.nodeName!==b.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var Xo=Uo;function Uo(){this.parser=Xa,this.mixer=Ua}t(Zo,$o=So);var $o,Ko=Zo;function Zo(){var t=null!==$o&&$o.apply(this,arguments)||this;return t.mixer=Ta(0,1/0),t}Qo.prototype.calculator=function(t,e,n,r){return n instanceof li?"unset"===n.value?"":n.value:"".concat(n)},Qo.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var Jo=Qo;function Qo(){}es.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value};var ts=es;function es(){}var ns={},rs=0;var is="undefined"!=typeof window&&void 0!==window.document;function as(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function os(t,e){if(is)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function ss(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-ms)?0:16-e,r=fs();return ys[r]=t,1<Object.keys(ys).length||setTimeout(function(){ms=n;var e=ys;ys={},Object.keys(e).forEach(function(t){return e[t](gs())})},e),r}function ls(t){delete ys[t]}function cs(t){return"string"!=typeof t?ss:""===t?ds.requestAnimationFrame:ds[t+"RequestAnimationFrame"]}var us={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},hs=1,fs=function(){return hs++},ds="object"==typeof self&&self.self==self?self:"object"==typeof W&&W.global==W?W:{},ps=Date.now(),gs=function(){return ds.performance&&"function"==typeof ds.performance.now?ds.performance.now():Date.now()-ps},ys={},ms=Date.now(),vs=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],cs),bs=cs(vs),xs="string"!=typeof(vs=vs)?ls:""===vs?ds.cancelAnimationFrame:ds[vs+"CancelAnimationFrame"]||ds[vs+"CancelRequestAnimationFrame"],ws=(ds.requestAnimationFrame=bs,ds.cancelAnimationFrame=xs,Ms.prototype.getCallbacksNum=function(){return this.callbacks.length},Ms.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ms.prototype.promise=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,v([],O(e),!1))}))},Ms);function Ms(){this.callbacks=[]}ks.prototype.tapPromise=function(t,e){this.callbacks.push(e)},ks.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return K(this,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,v([],O(i),!1))]:[3,6];case 1:e=t.sent(),n=0,t.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=t.sent(),t.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}})})};var Os=ks;function ks(){this.callbacks=[]}Ss.prototype.tap=function(t,e){this.callbacks.push(e)},Ss.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Es=Ss;function Ss(){this.callbacks=[]}As.prototype.tap=function(t,e){this.callbacks.push(e)},As.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;e<this.callbacks.length-1;e++)t=(0,this.callbacks[e])(t);return t}return null};var _s=As;function As(){this.callbacks=[]}var Ts=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ps=/([\"\'])[^\'\"]+\1/;Cs.prototype.calculator=function(t,e,n,r){return n instanceof li?[]:n},Cs.prototype.postProcessor=function(t){No(t.parsedStyle.transform,t)};vs=Cs;function Cs(){this.parser=Qa,this.parserWithCSSDisabled=Qa,this.mixer=uo}var Ls=function(){this.parser=ho},Ns=(js.prototype.calculator=function(t,e,n,r){return n.value},js.prototype.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0,t.dirtyReason=_i.Z_INDEX_CHANGED)},js);function js(){this.parser=_a}Is.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Rs=Is;function Is(){}Ds.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Bs=Ds;function Ds(){}zs.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}};var Fs=zs;function zs(){}Gs.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Ws=Gs;function Gs(){}Vs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,v([],O(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,v([],O(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,v([],O(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,v([],O(t.map(function(t){return t[1]})),!1))-r}};var Hs=Vs;function Vs(){}qs.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!Ye(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var Ys=qs;function qs(){}Us.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!p(t)},Us.prototype.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,l=t.dx,c=t.dy,u=((null==(u=null==(u=null==e?void 0:e.ownerDocument)?void 0:u.defaultView)?void 0:u.getConfig())||{}).offscreenCanvas;return this.isReadyToMeasure(t,e)?(e=this.globalRuntime.textService.measureText(i,t,u),i=(t.metrics=e).width,u=e.height,n=e.lineHeight,e=e.fontProperties,i=[i/2,u/2,0],u=[0,1],r=0,"center"===a||"middle"===a?(r=o/2,u=[.5,1]):"right"!==a&&"end"!==a||(r=o,u=[1,1]),a=0,"middle"===s?a=i[1]:"top"===s||"hanging"===s?a=2*i[1]:"alphabetic"===s?a=this.globalRuntime.enableCSSParsing?n-e.ascent:0:"bottom"!==s&&"ideographic"!==s||(a=0),l&&(r+=l),c&&(a+=c),t.anchor=[u[0],u[1],0],{width:2*i[0],height:2*i[1],offsetX:r,offsetY:a}):(t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0})};var Xs=Us;function Us(t){this.globalRuntime=t}Object.defineProperty(Ks.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(Ks.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),Ks.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(Ks.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),Ks.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},Ks.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},Ks.prototype.stopPropagation=function(){this.propagationStopped=!0},Ks.prototype.initEvent=function(){},Ks.prototype.initUIEvent=function(){},Ks.prototype.clone=function(){throw new Error(Wr)};var $s=Ks;function Ks(t){this.eventPhase=Ks.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new jr,this.page=new jr,this.canvas=new jr,this.viewport=new jr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(Qs,Zs=$s),Object.defineProperty(Qs.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(Qs.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),Qs.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},Qs.prototype.initMouseEvent=function(){throw new Error(Wr)};var Zs,Js=Qs;function Qs(){var t=null!==Zs&&Zs.apply(this,arguments)||this;return t.client=new jr,t.movement=new jr,t.offset=new jr,t.global=new jr,t.screen=new jr,t}t(nl,tl=Js),nl.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},nl.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},nl.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var tl,el=nl;function nl(){var t=null!==tl&&tl.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(al,rl=Js),al.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var rl,il=al;function al(){return null!==rl&&rl.apply(this,arguments)||this}t(ll,ol=$s);var ol,sl=ll;function ll(t,e){var n=ol.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}cl.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},cl.prototype.addEventListener=function(t,e,n){var r,i,a,o=tn(n)&&n||Fe(n)&&n.capture,n=Fe(n)&&n.once,s=fi(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=O(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=fi(e)?e:e.handleEvent,l&&(a=e,e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null==(t=e[0].target)?void 0:t.name)===c&&a.apply(void 0,v([],O(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},cl.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},cl.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},cl.prototype.removeEventListener=function(t,e,n){var n=tn(n)&&n||Fe(n)&&n.capture,r=fi(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=fi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},cl.prototype.emit=function(t,e){this.dispatchEvent(new sl(t,e))},cl.prototype.dispatchEvent=function(t,e){var n;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented};Js=cl;function cl(){this.emitter=new X}t(g,ul=Js),g.isNode=function(t){return!!t.childNodes},Object.defineProperty(g.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===b.TEXT&&(n+=this.style.text);try{for(var r=I(this.childNodes),i=r.next();!i.done;i=r.next()){var a=i.value;a.nodeName===b.TEXT?n+=a.nodeValue:n+=a.textContent}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===b.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),g.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},g.prototype.hasChildNodes=function(){return 0<this.childNodes.length},g.prototype.isDefaultNamespace=function(t){throw new Error(Wr)},g.prototype.lookupNamespaceURI=function(t){throw new Error(Wr)},g.prototype.lookupPrefix=function(t){throw new Error(Wr)},g.prototype.normalize=function(){throw new Error(Wr)},g.prototype.isEqualNode=function(t){return this===t},g.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(g.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),g.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!=(e=n.parentNode)?e:r.parentNode;)n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r;if(n!==r)return g.DOCUMENT_POSITION_DISCONNECTED|g.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|g.DOCUMENT_POSITION_PRECEDING;var o=a.length<i.length?i:a,s=o===i?a:i;if(o[o.length-s.length]===s[0])return o===i?g.DOCUMENT_POSITION_CONTAINED_BY|g.DOCUMENT_POSITION_FOLLOWING:g.DOCUMENT_POSITION_CONTAINS|g.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===i?g.DOCUMENT_POSITION_PRECEDING:g.DOCUMENT_POSITION_FOLLOWING:o===i?g.DOCUMENT_POSITION_PRECEDING:g.DOCUMENT_POSITION_FOLLOWING}return g.DOCUMENT_POSITION_FOLLOWING},g.prototype.contain=function(t){return this.contains(t)},g.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},g.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},g.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},g.DOCUMENT_POSITION_DISCONNECTED=1,g.DOCUMENT_POSITION_PRECEDING=2,g.DOCUMENT_POSITION_FOLLOWING=4,g.DOCUMENT_POSITION_CONTAINS=8,g.DOCUMENT_POSITION_CONTAINED_BY=16,g.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ul,hl=g;function g(){var t=null!==ul&&ul.apply(this,arguments)||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}dl.prototype.init=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)},dl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},dl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new jr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},dl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new jr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},dl.prototype.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=mt(this.tmpMatrix,n,a),a=zt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return qt(a,a,n),new jr(a[0],a[1])},dl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=mt(this.tmpMatrix,n,e),e=zt(this.tmpVec3,t.x,t.y,0),t=(qt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new jr((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},dl.prototype.setPickHandler=function(t){this.pickHandler=t},dl.prototype.addEventMapping=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})},dl.prototype.mapEvent=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))}},dl.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},dl.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;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(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},dl.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)hl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},dl.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,r=r.height;return!(e<0||n<0||i<e||r<n)&&(this.pickHandler(t)||this.rootTarget)||null},dl.prototype.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},dl.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=I(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.globalRuntime.nativeHTMLMap.get(a);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},dl.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},dl.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(el),t=(this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,this.getExistedHTML(i));return i.target=null!=n?n:t||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},dl.prototype.createWheelEvent=function(t){var e=this.allocateEvent(il),t=(this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,this.getExistedHTML(e));return e.target=t||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},dl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},dl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(il);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},dl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(el);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},dl.prototype.copyPointerData=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},dl.prototype.copyMouseData=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)},dl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},dl.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},dl.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},dl.prototype.freeEvent=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)},dl.prototype.notifyTarget=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)},dl.prototype.notifyListeners=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)},dl.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||hl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},dl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=hl.isNode(e)&&e.parentNode}};var fl=dl;function dl(t,e){var c=this;this.globalRuntime=t,this.context=e,this.emitter=new X,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=tt(),this.tmpVec3=It(),this.onPointerDown=function(t){var e,n=c.createPointerEvent(t);c.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?c.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(e=2===n.button,c.dispatchEvent(n,e?"rightdown":"mousedown")),c.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),c.freeEvent(n)},this.onPointerUp=function(t){var e=performance.now(),n=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),r=(c.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?c.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.dispatchEvent(n,o?"rightup":"mouseup")),c.trackingData(t.pointerId)),i=c.findMountedTarget(r.pressTargetsByButton[t.button]),a=i;if(i&&!n.composedPath().includes(i)){for(var o,s=i;s&&!n.composedPath().includes(s);)n.currentTarget=s,c.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?c.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.notifyTarget(n,o?"rightupoutside":"mouseupoutside")),hl.isNode(s)&&(s=s.parentNode);delete r.pressTargetsByButton[t.button],a=s}a&&((i=c.clonePointerEvent(n,"click")).target=a,i.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e}),(a=r.clicksByButton[t.button]).target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,null!=(r=n.detail)&&r.preventClick||(c.context.config.useNativeClickEvent||"mouse"!==i.pointerType&&"touch"!==i.pointerType||c.dispatchEvent(i,"click"),c.dispatchEvent(i,"pointertap")),c.freeEvent(i)),c.freeEvent(n)},this.onPointerMove=function(t){var e=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=c.trackingData(t.pointerId),i=c.findMountedTarget(r.overTargets);if(r.overTargets&&i!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",a=c.createPointerEvent(t,a,i||void 0);if(c.dispatchEvent(a,"pointerout"),n&&c.dispatchEvent(a,"mouseout"),!e.composedPath().includes(i)){var o=c.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!e.composedPath().includes(o.target);)o.currentTarget=o.target,c.notifyTarget(o),n&&c.notifyTarget(o,"mouseleave"),hl.isNode(o.target)&&(o.target=o.target.parentNode);c.freeEvent(o)}c.freeEvent(a)}if(i!==e.target){for(var a="mousemove"===t.type?"mouseover":"pointerover",t=c.clonePointerEvent(e,a),s=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),i&&hl.isNode(i)&&i.parentNode);s&&s!==(hl.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(hl.isNode(c.rootTarget)&&c.rootTarget.parentNode)){var l=c.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==i&&l.target!==(hl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),hl.isNode(l.target)&&(l.target=l.target.parentNode);c.freeEvent(l)}c.freeEvent(t)}c.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&c.dispatchEvent(e,"touchmove"),n&&(c.dispatchEvent(e,"mousemove"),c.cursor=c.getCursor(e.target)),r.overTargets=e.composedPath(),c.freeEvent(e)},this.onPointerOut=function(t){var e=c.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=c.findMountedTarget(e.overTargets),i=c.createPointerEvent(t,"pointerout",r||void 0),a=(c.dispatchEvent(i),n&&c.dispatchEvent(i,"mouseout"),c.createPointerEvent(t,"pointerleave",r||void 0));for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(hl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),hl.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,c.freeEvent(i),c.freeEvent(a)}c.cursor=null},this.onPointerOver=function(t){var e=c.trackingData(t.pointerId),t=c.createPointerEvent(t),n="mouse"===t.pointerType||"pen"===t.pointerType,r=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),"mouse"===t.pointerType&&(c.cursor=c.getCursor(t.target)),c.clonePointerEvent(t,"pointerenter"));for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==(hl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),hl.isNode(r.target)&&(r.target=r.target.parentNode);e.overTargets=t.composedPath(),c.freeEvent(t),c.freeEvent(r)},this.onPointerUpOutside=function(t){var e=c.trackingData(t.pointerId),n=c.findMountedTarget(e.pressTargetsByButton[t.button]),r=c.createPointerEvent(t);if(n){for(var i=n;i;)r.currentTarget=i,c.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||c.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),hl.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}c.freeEvent(r)},this.onWheel=function(t){t=c.createWheelEvent(t);c.dispatchEvent(t),c.freeEvent(t)},this.onClick=function(t){c.context.config.useNativeClickEvent&&(t=c.createPointerEvent(t),c.dispatchEvent(t),c.freeEvent(t))},this.onPointerCancel=function(t){t=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0);c.dispatchEvent(t),c.freeEvent(t)}}yl.prototype.getOrCreateCanvas=function(t,e){if(!this.canvas){if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",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",e)}this.canvas.width=10,this.canvas.height=10}return this.canvas},yl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var pl,gl=yl;function yl(){}(xl=pl=pl||{})[xl.CAMERA_CHANGED=0]="CAMERA_CHANGED",xl[xl.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",xl[xl.NONE=2]="NONE";vl.prototype.init=function(t){var e=this,n=m(m({},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()})},vl.prototype.getStats=function(){return this.stats},vl.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(pl.CAMERA_CHANGED)},vl.prototype.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach(function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)}),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},vl.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable);a.dirty&&(this.sort(t,a),a.dirty=!1,a.dirtyChildren=[],a.dirtyReason=void 0),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)})},vl.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==_i.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(t){var e;-1===n.childNodes.indexOf(t)?0<=(e=r.sorted.indexOf(t))&&r.sorted.splice(e,1):0===r.sorted.length?r.sorted.push(t):(e=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;as(t[i],e)<0?n=1+i:r=i}return n}(r.sorted,t),r.sorted.splice(e,0,t))}):r.sorted=n.childNodes.slice().sort(as)},vl.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},vl.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(pl.DISPLAY_OBJECT_CHANGED)};var ml=vl;function vl(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Es,initAsync:new ws,dirtycheck:new _s,cull:new _s,beginFrame:new Es,beforeRender:new Es,render:new Es,afterRender:new Es,endFrame:new Es,destroy:new Es,pick:new Os,pickSync:new _s,pointerDown:new Es,pointerUp:new Es,pointerMove:new Es,pointerOut:new Es,pointerOver:new Es,pointerWheel:new Es,pointerCancel:new Es,click:new Es}}var bl=/\[\s*(.*)=(.*)\s*\]/,xl=(wl.prototype.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},wl.prototype.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},wl.prototype.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},wl.prototype.getIdOrClassname=function(t){return t.substring(1)},wl.prototype.getAttribute=function(t){var t=t.match(bl),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},wl.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!p(t))&&t.toString?t.toString():""},wl);function wl(){}t(El,Ml=$s),El.ADDITION=2,El.MODIFICATION=1,El.REMOVAL=3;var Ml,Ol,kl=El;function El(t,e,n,r,i,a,o,s){var l=Ml.call(this,null)||this;return l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}function Sl(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}($s=Ol=Ol||{}).REPARENT="reparent",$s.DESTROY="destroy",$s.ATTR_MODIFIED="DOMAttrModified",$s.INSERTED="DOMNodeInserted",$s.REMOVED="removed",$s.MOUNTED="DOMNodeInsertedIntoDocument",$s.UNMOUNTED="DOMNodeRemovedFromDocument",$s.BOUNDS_CHANGED="bounds-changed",$s.CULLED="culled";var _l=new kl(Ol.REPARENT,null,"","","",0,"",""),$s=(l.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},l.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},l.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},l.prototype.attach=function(t,e,n){var r=!1,n=(t.parentNode&&(r=t.parentNode!==e,this.detach(t)),t.parentNode=e,p(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t),e.sortable),e=((null!=(e=null==n?void 0:n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=_i.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(_l)},l.prototype.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(r=null==(n=t.parentNode.sortable)?void 0:n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=_i.REMOVED),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},l.prototype.getOrigin=function(t){return t.transformable.origin},l.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=t.transformable;(e="number"==typeof e?[e,n,r]:e)[0]===i.origin[0]&&e[1]===i.origin[1]&&e[2]===i.origin[2]||((n=i.origin)[0]=e[0],n[1]=e[1],n[2]=e[2]||0,this.dirtifyLocal(t,i))},l.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));n=t.transformable;ne(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},l.prototype.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=Dt(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},l.prototype.setLocalScale=function(t,e){var n=t.transformable,e=Dt(e[0],e[1],e[2]||n.localScale[2]);Ut(e,n.localScale)||(Ft(n.localScale,e),this.dirtifyLocal(t,n))},l.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=re(e,n,r,i));n=t.transformable;ie(n.localRotation,e),this.dirtifyLocal(t,n)},l.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new Z(2))[0]=i,r[1]=n,e=r);var r,i=t.transformable;n=i.localSkew,r=e,n[0]=r[0],n[1]=r[1],this.dirtifyLocal(t,i)},l.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},l.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},l.prototype.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var t=O(t,2),e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},l.prototype.clearPendingEvents=function(){this.pendingEvents=[]},l.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Sl(n),n=n.parentNode;e&&t.forEach(function(t){Sl(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},l.prototype.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},l.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new kl(Ol.ATTR_MODIFIED,t,n,n,e,kl.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},l.prototype.getPosition=function(t){var e=t.transformable;return kt(e.position,this.getWorldTransform(t,e))},l.prototype.getRotation=function(t){var e=t.transformable;return St(e.rotation,this.getWorldTransform(t,e))},l.prototype.getScale=function(t){var e=t.transformable;return Et(e.scaling,this.getWorldTransform(t,e))},l.prototype.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},l.prototype.getLocalPosition=function(t){return t.transformable.localPosition},l.prototype.getLocalRotation=function(t){return t.transformable.localRotation},l.prototype.getLocalScale=function(t){return t.transformable.localScale},l.prototype.getLocalSkew=function(t){return t.transformable.localSkew},l.prototype.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},l.prototype.setLocalTransform=function(t,e){var n=kt(It(),e),r=St(Jt(),e),e=Et(It(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},l.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},l.prototype.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return _r.isEmpty(e)?null:((n=n||new _r).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},l.prototype.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new _r},l.prototype.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new _r).update(t.center,t.halfExtents))}),e&&(t=function(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new _r)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},l.prototype.getLocalBounds=function(t){if(t.parentNode){var e,n=tt(),r=(t.parentNode.transformable&&(n=gt(tt(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!_r.isEmpty(r))return(e=new _r).setFromTransformedAABB(r,n),e}return this.getBounds(t)},l.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(_r.isEmpty(i)||(r=new _r).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=O(r.getMin(),2))[0],t=t[1],n=(r=O(r.getMax(),2))[0],r=r[1],new Ir(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Ir((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},l.prototype.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},l.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},l.prototype.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?mt(e.worldTransform,n.worldTransform,e.localTransform):et(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},l.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},l);function l(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new sl(Ol.BOUNDS_CHANGED),this.rotate=(o=Jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(ne(r=Jt(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),ie(o,a),ee(o,o),te(r,o,r),te(n.localRotation,r,i),oe(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));n=t.transformable;ne(i,e[0],e[1],e[2]),ae(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(ne(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),ie(a,ee(Jt(),r)),ae(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Dt(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ut(e,It())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,Wt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=tt(),s=It(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ut(g.getPosition(t),s)||(Ft(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,et(r,e.worldTransform),gt(r,r),qt(n.localPosition,s,r)):Ft(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=It(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ut(n.localPosition,l)||(Ft(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=It(),u=It(),h=It(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ut(e="number"==typeof e?zt(u,e,n,r):e,c)||(Wt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Jt();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=re(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),ie(o,n),ee(o,o),te(a.localRotation,o,e),oe(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=tt(),f=It(),d=re(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(_t(t.localTransform,t.localRotation,t.localPosition,Dt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=rt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),mt(t.localTransform,t.localTransform,e)),e=_t(n,d,f,t.localScale,t.origin),mt(t.localTransform,t.localTransform,e)):_t(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Al={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]},Tl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Pl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Cl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ll=(Nl.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),e=this.runtime.offscreenCanvas.getOrCreateContext(e,{willReadFrequently:!0}),i=(e.font=t,Al.MetricsString+Al.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Al.BaselineSymbol).width),s=Al.HeightMultiplier*o,o=o*Al.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},Nl.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=Xe(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Ps.test(s)&&Ts.indexOf(s)<0&&(s='"'.concat(s,'"')),a[o]=s}return"".concat(r," ").concat(i," ").concat(t," ").concat(e," ").concat(a.join(","))}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),m=0;if(!u){for(M=0;M<g.length;M++){var v=p.measureText(g[M]).width+(g[M].length-1)*c;y[M]=v,m=Math.max(m,v)}var b=m+o,x=a||d.fontSize+o,r=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-r/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-r:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:b,height:r,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:m,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Ir(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var M=0;M<g.length;M++)var b=p.measureText(g[M]).width+(g[M].length-1)*c},Nl.prototype.setGraphemeOnPath=function(){},Nl.prototype.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),c=i+a,u="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),m=Array.from(t),v=0;v<m.length;v++){var b=m[v],x=t[v-1],w=t[v+1],M=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+M){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var O=h[f].length,k=0,E=O,S=0;S<O;S++){var _=g(h[f][S]);if(c<k+_+y){E=S;break}k+=_}h[f]=(h[f]||"").slice(0,E)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=M,h[f]=(h[f]||"")+b}}return h.join("\n")},Nl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Al.BreakingSpaces.indexOf(t.charCodeAt(0))},Nl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Al.Newlines.indexOf(t.charCodeAt(0))},Nl.prototype.trimToBreakable=function(t){var e,t=v([],O(t),!1),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},Nl.prototype.canBreakInLastChar=function(t){return!t||!Tl.test(t)},Nl.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},Nl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!Tl.test(t[e]))return e;return-1},Nl.prototype.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},Nl);function Nl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Cl.exec(e)&&!Pl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=v([],O(t),!1),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t}}var jl,k={},Rs=(Ys=new Ys,Hs=new Hs,(ph={})[b.CIRCLE]=new Rs,ph[b.ELLIPSE]=new Bs,ph[b.RECT]=Ys,ph[b.IMAGE]=Ys,ph[b.GROUP]=Ys,ph[b.LINE]=new Fs,ph[b.TEXT]=new Xs(k),ph[b.POLYLINE]=Hs,ph[b.POLYGON]=Hs,ph[b.PATH]=new Ws,ph[b.HTML]=null,ph[b.MESH]=null,ph),Xs=(Bs=new wo,Ys=new So,(Fs={})[h.PERCENTAGE]=null,Fs[h.NUMBER]=new Fo,Fs[h.ANGLE]=new ni,Fs[h.DEFINED_PATH]=new o,Fs[h.PAINT]=Bs,Fs[h.COLOR]=Bs,Fs[h.FILTER]=new Oo,Fs[h.LENGTH]=Ys,Fs[h.LENGTH_PERCENTAGE]=Ys,Fs[h.LENGTH_PERCENTAGE_12]=new Ao,Fs[h.LENGTH_PERCENTAGE_14]=new Po,Fs[h.COORDINATE]=new Ro,Fs[h.OFFSET_DISTANCE]=new Wo,Fs[h.OPACITY_VALUE]=new Ho,Fs[h.PATH]=new Yo,Fs[h.LIST_OF_POINTS]=new Xo,Fs[h.SHADOW_BLUR]=new Ko,Fs[h.TEXT]=new Jo,Fs[h.TEXT_TRANSFORM]=new ts,Fs[h.TRANSFORM]=new vs,Fs[h.TRANSFORM_ORIGIN]=new Ls,Fs[h.Z_INDEX]=new Ns,Fs[h.MARKER]=new Bo,Fs),Rl=(k.CameraContribution=i,k.AnimationTimeline=null,k.EasingFunction=null,k.offscreenCanvas=new gl,k.nativeHTMLMap=new WeakMap,k.sceneGraphSelector=new xl,k.sceneGraphService=new $s(k),k.textService=new Ll(k),k.geometryUpdaterFactory=Rs,k.CSSPropertySyntaxFactory=Xs,k.styleValueRegistry=new r(k),k.layoutRegistry=null,k.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==W)return W;throw new Error("Unable to locate global `this`")}(),k.enableCSSParsing=!0,k.enableDataset=!1,k.enableStyleSyntax=!0,0),Il=new kl(Ol.INSERTED,null,"","","",0,"",""),Bl=new kl(Ol.REMOVED,null,"","","",0,"",""),Dl=new sl(Ol.DESTROY),Hs=(t(c,jl=hl),Object.defineProperty(c.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(t){return""!==t})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"nextSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"previousSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null},enumerable:!1,configurable:!0}),c.prototype.cloneNode=function(t){throw new Error(Wr)},c.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return k.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Il.relatedNode=this,t.dispatchEvent(Il),t},c.prototype.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},c.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},c.prototype.removeChild=function(t){var e;return Bl.relatedNode=this,t.dispatchEvent(Bl),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),k.sceneGraphService.detach(t),t},c.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];this.removeChild(e)}},c.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},c.prototype.matches=function(t){return k.sceneGraphService.matches(t,this)},c.prototype.getElementById=function(t){return k.sceneGraphService.querySelector("#".concat(t),this)},c.prototype.getElementsByName=function(t){return k.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},c.prototype.getElementsByClassName=function(t){return k.sceneGraphService.querySelectorAll(".".concat(t),this)},c.prototype.getElementsByTagName=function(t){return k.sceneGraphService.querySelectorAll(t,this)},c.prototype.querySelector=function(t){return k.sceneGraphService.querySelector(t,this)},c.prototype.querySelectorAll=function(t){return k.sceneGraphService.querySelectorAll(t,this)},c.prototype.closest=function(t){var e=this;do{if(k.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},c.prototype.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},c.prototype.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},c.prototype.after=function(){for(var r,i=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.parentNode&&(r=this.parentNode.childNodes.indexOf(this),t.forEach(function(t,e){var n;return null==(n=i.parentNode)?void 0:n.appendChild(t,r+e+1)}))},c.prototype.before=function(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),e=(n=O(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,v([],O(n),!1)))},c.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,v([],O(t),!1)),this.remove()},c.prototype.append=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(t){return e.appendChild(t)})},c.prototype.prepend=function(){for(var n=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];t.forEach(function(t,e){return n.appendChild(t,e)})},c.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,v([],O(t),!1))},c.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},c.prototype.destroy=function(){this.dispatchEvent(Dl),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},c.prototype.getGeometryBounds=function(){return k.sceneGraphService.getGeometryBounds(this)},c.prototype.getRenderBounds=function(){return k.sceneGraphService.getBounds(this,!0)},c.prototype.getBounds=function(){return k.sceneGraphService.getBounds(this)},c.prototype.getLocalBounds=function(){return k.sceneGraphService.getLocalBounds(this)},c.prototype.getBoundingClientRect=function(){return k.sceneGraphService.getBoundingClientRect(this)},c.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},c.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},c.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},c.prototype.getAttribute=function(t){var e;return"symbol"==typeof t?k.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=mi(t),e=this.attributes[t],k.enableCSSParsing)&&p(e)?null:e},c.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},c.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},c.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},c.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},c.prototype.getAttributeNS=function(t,e){throw new Error(Wr)},c.prototype.getAttributeNode=function(t){throw new Error(Wr)},c.prototype.getAttributeNodeNS=function(t,e){throw new Error(Wr)},c.prototype.hasAttributeNS=function(t,e){throw new Error(Wr)},c.prototype.removeAttributeNS=function(t,e){throw new Error(Wr)},c.prototype.removeAttributeNode=function(t){throw new Error(Wr)},c.prototype.setAttributeNS=function(t,e,n){throw new Error(Wr)},c.prototype.setAttributeNode=function(t){throw new Error(Wr)},c.prototype.setAttributeNodeNS=function(t){throw new Error(Wr)},c.prototype.toggleAttribute=function(t,e){throw new Error(Wr)},c);function c(){var t=null!==jl&&jl.apply(this,arguments)||this;return t.entity=Rl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:Si.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!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.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle=k.enableCSSParsing?{anchor:Ai,opacity:Ai,fillOpacity:Ai,strokeOpacity:Ai,fill:Ai,stroke:Ai,transform:Ai,transformOrigin:Ai,visibility:Ai,pointerEvents:Ai,lineWidth:Ai,lineCap:Ai,lineJoin:Ai,increasedLineWidthForHitTesting:Ai,fontSize:Ai,fontFamily:Ai,fontStyle:Ai,fontWeight:Ai,fontVariant:Ai,textAlign:Ai,textBaseline:Ai,textTransform:Ai,zIndex:Ai,filter:Ai,shadowType:Ai}:null,t.parsedStyle={},t.attributes={},t}function Fl(t){return null!=t&&t.nodeName}var zl,Wl=new kl(Ol.ATTR_MODIFIED,null,null,null,null,kl.MODIFICATION,null,null),Gl={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Hl={anchor:[0,0],fill:Pi,stroke:Pi,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Vl=m(m({},Hl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Yl=v(v([],O(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),ql=(t(u,zl=Hs),u.prototype.destroy=function(){zl.prototype.destroy.call(this),this.getAnimations().forEach(function(t){t.cancel()})},u.prototype.cloneNode=function(e,t){var n,r=m({},this.attributes);for(n in r){var i=r[n];Fl(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},u.prototype.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(k.enableCSSParsing&&(r.usedAttributes=Yl),{});for(e in t)i[mi(e)]=t[e];k.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},u.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=mi(t);en(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),zl.prototype.setAttribute.call(this,t,e))},u.prototype.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(k.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Wl.relatedNode=this,Wl.prevValue=i,Wl.newValue=e,Wl.attrName=t,Wl.prevParsedValue=a,Wl.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Wl):(Wl.target=this).ownerDocument.defaultView.dispatchEvent(Wl,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},u.prototype.getBBox=function(){var t=this.getBounds(),e=O(t.getMin(),2),n=e[0],e=e[1],t=O(t.getMax(),2),r=t[0],t=t[1];return new Ir(n,e,r-n,t-e)},u.prototype.setOrigin=function(t,e,n){return k.sceneGraphService.setOrigin(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getOrigin=function(){return k.sceneGraphService.getOrigin(this)},u.prototype.setPosition=function(t,e,n){return k.sceneGraphService.setPosition(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.setLocalPosition=function(t,e,n){return k.sceneGraphService.setLocalPosition(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translate=function(t,e,n){return k.sceneGraphService.translate(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translateLocal=function(t,e,n){return k.sceneGraphService.translateLocal(this,gr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getPosition=function(){return k.sceneGraphService.getPosition(this)},u.prototype.getLocalPosition=function(){return k.sceneGraphService.getLocalPosition(this)},u.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},u.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=gr(t,e=e||t,n=n||t)),k.sceneGraphService.scaleLocal(this,t),this},u.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=gr(t,e=e||t,n=n||t)),k.sceneGraphService.setLocalScale(this,t),this},u.prototype.getLocalScale=function(){return k.sceneGraphService.getLocalScale(this)},u.prototype.getScale=function(){return k.sceneGraphService.getScale(this)},u.prototype.getEulerAngles=function(){return mr(O(vr(It(),k.sceneGraphService.getWorldTransform(this)),3)[2])},u.prototype.getLocalEulerAngles=function(){return mr(O(vr(It(),k.sceneGraphService.getLocalRotation(this)),3)[2])},u.prototype.setEulerAngles=function(t){return k.sceneGraphService.setEulerAngles(this,0,0,t),this},u.prototype.setLocalEulerAngles=function(t){return k.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},u.prototype.rotateLocal=function(t,e,n){return p(e)&&p(n)?k.sceneGraphService.rotateLocal(this,0,0,t):k.sceneGraphService.rotateLocal(this,t,e,n),this},u.prototype.rotate=function(t,e,n){return p(e)&&p(n)?k.sceneGraphService.rotate(this,0,0,t):k.sceneGraphService.rotate(this,t,e,n),this},u.prototype.setRotation=function(t,e,n,r){return k.sceneGraphService.setRotation(this,t,e,n,r),this},u.prototype.setLocalRotation=function(t,e,n,r){return k.sceneGraphService.setLocalRotation(this,t,e,n,r),this},u.prototype.setLocalSkew=function(t,e){return k.sceneGraphService.setLocalSkew(this,t,e),this},u.prototype.getRotation=function(){return k.sceneGraphService.getRotation(this)},u.prototype.getLocalRotation=function(){return k.sceneGraphService.getLocalRotation(this)},u.prototype.getLocalSkew=function(){return k.sceneGraphService.getLocalSkew(this)},u.prototype.getLocalTransform=function(){return k.sceneGraphService.getLocalTransform(this)},u.prototype.getWorldTransform=function(){return k.sceneGraphService.getWorldTransform(this)},u.prototype.setLocalTransform=function(t){return k.sceneGraphService.setLocalTransform(this,t),this},u.prototype.resetLocalTransform=function(){k.sceneGraphService.resetLocalTransform(this)},u.prototype.getAnimations=function(){return this.activeAnimations},u.prototype.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},u.prototype.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},Object.defineProperty(u.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),u.prototype.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},u.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},u.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,v([],O(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))+1),this},u.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,v([],O(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))-1),this},u.prototype.getConfig=function(){return this.config},u.prototype.attr=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=O(t,2),i=r[0],r=r[1];return i?Fe(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===t.length?(this.setAttribute(i,r),this):this.attributes[i]:this.attributes},u.prototype.getMatrix=function(t){var t=t||this.getWorldTransform(),e=O(kt(It(),t),2),n=e[0],e=e[1],r=O(Et(It(),t),2),i=r[0],r=r[1],t=St(Jt(),t),t=O(vr(It(),t),3),a=t[0],t=t[2];return br(a||t,n,e,i,r)},u.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},u.prototype.setMatrix=function(t){var t=O(xr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},u.prototype.setLocalMatrix=function(t){var t=O(xr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},u.prototype.show=function(){k.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},u.prototype.hide=function(){k.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(t){t.style.visibility="hidden"})},u.prototype.getCount=function(){return this.childElementCount},u.prototype.getParent=function(){return this.parentElement},u.prototype.getChildren=function(){return this.children},u.prototype.getFirst=function(){return this.firstElementChild},u.prototype.getLast=function(){return this.lastElementChild},u.prototype.getChildByIndex=function(t){return this.children[t]||null},u.prototype.add=function(t,e){return this.appendChild(t,e)},u.prototype.setClip=function(t){this.style.clipPath=t},u.prototype.set=function(t,e){this.config[t]=e},u.prototype.get=function(t){return this.config[t]},u.prototype.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},u.prototype.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},u.prototype.setZIndex=function(t){return this.style.zIndex=t,this},u);function u(t){var r=this,t=((r=zl.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||b.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,k.enableCSSParsing?Hl:Vl,r.config.initialParsedStyle),k.enableCSSParsing&&Object.assign(r.attributes,Gl),r.initAttributes(r.config.style),k.globalThis.Proxy||function(){});return k.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(ui(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(ui(e)),n),!0}})),k.enableStyleSyntax&&(r.style=new t({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}t(Kl,Xl=ql);var Xl,Ul,$l=Kl;function Kl(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Xl.call(this,m({type:b.CIRCLE,style:k.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:k.enableCSSParsing?null:[ji,ji]}},t))||this}function Zl(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=Ul.call(this,m({style:k.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(Zl,Ul=ql);t(tc,Jl=ql);var Jl,Ql=tc;function tc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Jl.call(this,m({type:b.ELLIPSE,style:k.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:k.enableCSSParsing?null:[ji,ji]}},t))||this}t(rc,ec=ql);var ec,nc=rc;function rc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return ec.call(this,m({type:b.GROUP,style:k.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(oc,ic=ql),oc.prototype.getDomElement=function(){return this.parsedStyle.$el},oc.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},oc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},oc.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null==(r=null==(r=this.ownerDocument)?void 0:r.defaultView)?void 0:r.getContextService().getBoundingClientRect();return r?(t=n.left-r.left,r=n.top-r.top,(e=new _r).setMinMax([t,r,0],[t+n.width,r+n.height,0]),e):null},oc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=gt(tt(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!_r.isEmpty(n))return(t=new _r).setFromTransformedAABB(n,e),t}return this.getBounds()};var ic,ac=oc;function oc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=ic.call(this,m({type:b.HTML,style:k.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(cc,sc=ql);var sc,lc=cc;function cc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return sc.call(this,m({type:b.IMAGE,style:k.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(fc,uc=ql),fc.prototype.attributeChangedCallback=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&&Fl(r)&&(this.markerStartAngle=0,r.remove()),i&&Fl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Fl(r)&&(this.markerEndAngle=0,r.remove()),i)&&Fl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},fc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&Fl(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},fc.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=Wn(r,i,a,o,t),i=r.x,a=r.y,o=qt(It(),Dt(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new jr(o[0],o[1])},fc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},fc.prototype.getTotalLength=function(){var t=this.parsedStyle;return zn(t.x1,t.y1,t.x2,t.y2)};var uc,hc=fc;function fc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=uc.call(this,m({type:b.LINE,style:m({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},n)},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),t=n.markerStart,n=n.markerEnd;return t&&Fl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Fl(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(gc,dc=ql),gc.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===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&&Fl(r)&&(this.markerStartAngle=0,r.remove()),i&&Fl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fl(r)&&(this.markerEndAngle=0,r.remove()),i&&Fl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},gc.prototype.transformMarker=function(t){var e,n,r,i,a,o,s,l=this.parsedStyle,c=l.markerStart,u=l.markerEnd,h=l.markerStartOffset,f=l.markerEndOffset,d=l.defX,l=l.defY,c=t?c:u;c&&Fl(c)&&(u=0,h=t?(o=(t=O(this.getStartTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=h||0,this.markerStartAngle):(o=(t=O(this.getEndTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=f||0,this.markerEndAngle),u=Math.atan2(i,r),c.setLocalEulerAngles(180*u/Math.PI+h),c.setLocalPosition(e+Math.cos(u)*a,n+Math.sin(u)*a))},gc.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Fl(t))for(var a=1;a<n.length-1;a++){var o=O(n[a].currentPoint,2),s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},gc.prototype.getTotalLength=function(){return Ca(this)},gc.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ce(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=qt(It(),Dt(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new jr(n[0],n[1])},gc.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Ca(this),e)},gc.prototype.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},gc.prototype.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i};var dc,pc=gc;function gc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=dc.call(this,m({type:b.PATH,style:k.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:k.enableCSSParsing?null:{miterLimit:4,path:m({},Ri)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&Fl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Fl(n)&&e.placeMarkerMid(n),r&&Fl(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(vc,yc=ql),vc.prototype.attributeChangedCallback=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&&Fl(r)&&(this.markerStartAngle=0,r.remove()),i&&Fl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fl(r)&&(this.markerEndAngle=0,r.remove()),i&&Fl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},vc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&Fl(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.parsedStyle.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},vc.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Fl(t))for(var a=1;a<(this.parsedStyle.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}};var yc,mc=vc;function vc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=yc.call(this,m({type:b.POLYGON,style:k.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:k.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&Fl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Fl(n)&&e.placeMarkerMid(n),r&&Fl(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(wc,bc=mc),wc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},wc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},wc.prototype.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),Wn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=qt(It(),Dt(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new jr(a[0],a[1])},wc.prototype.getStartTangent=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},wc.prototype.getEndTangent=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};var bc,xc=wc;function wc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return bc.call(this,m({type:b.POLYLINE,style:k.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:k.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(kc,Mc=ql);var Mc,Oc=kc;function kc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Mc.call(this,m({type:b.RECT,style:k.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(_c,Ec=ql),_c.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},_c.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},_c.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var Ec,Sc=_c;function _c(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Ec.call(this,m({type:b.TEXT,style:k.enableCSSParsing?m({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0},e):m({fill:"black"},e),initialParsedStyle:k.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},t))||this}Tc.prototype.define=function(t,e){this.registry[t]=e},Tc.prototype.get=function(t){return this.registry[t]};var Ac=Tc;function Tc(){this.registry={},this.define(b.CIRCLE,$l),this.define(b.ELLIPSE,Ql),this.define(b.RECT,Oc),this.define(b.IMAGE,lc),this.define(b.LINE,hc),this.define(b.GROUP,nc),this.define(b.PATH,pc),this.define(b.POLYGON,mc),this.define(b.POLYLINE,xc),this.define(b.TEXT,Sc),this.define(b.HTML,ac)}t(Lc,Pc=hl),Object.defineProperty(Lc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Lc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Lc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Lc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Lc.prototype.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Sc:nc),(t=new n(e)).ownerDocument=this,t)},Lc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Lc.prototype.cloneNode=function(t){throw new Error(Wr)},Lc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Lc.prototype.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.displayObject,e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},Lc.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},Lc.prototype.elementFromPoint=function(a,o){return K(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,null]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return[2,(i=t.sent().picked)&&i[0]||this.documentElement]}})})},Lc.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},Lc.prototype.elementsFromPoint=function(a,o){return K(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,[]]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return(i=t.sent().picked)[i.length-1]!==this.documentElement&&i.push(this.documentElement),[2,i]}})})},Lc.prototype.appendChild=function(t,e){throw new Error(Gr)},Lc.prototype.insertBefore=function(t,e){throw new Error(Gr)},Lc.prototype.removeChild=function(t,e){throw new Error(Gr)},Lc.prototype.replaceChild=function(t,e,n){throw new Error(Gr)},Lc.prototype.append=function(){throw new Error(Gr)},Lc.prototype.prepend=function(){throw new Error(Gr)},Lc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Lc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Lc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Lc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Lc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Lc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Lc.prototype.find=function(t){return this.documentElement.find(t)},Lc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var Pc,Cc=Lc;function Lc(){var t=Pc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new k.AnimationTimeline(t)}catch(t){}var r={};return po.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=fi(t)?t(b.GROUP):t)}),t.documentElement=new nc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}jc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(jc.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new sl(Ol.CULLED)),null))}),e.hooks.afterRender.tap(jc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},jc.tag="Culling";var Nc=jc;function jc(t){this.strategies=t}Ic.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(Ic.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},Ic.tag="DirtyCheck";var Rc=Ic;function Ic(){}Dc.prototype.apply=function(t){var c=this,t=(this.context=t).renderingService,u=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return c.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),t.hooks.pointerWheel.tap(Dc.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(Dc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.normalizeToPointerEvent(t,u);!c.autoPreventDefault||!r[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerUp.tap(Dc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.context.contextService.getDomElement(),i="outside";try{i=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":""}catch(t){}r=c.normalizeToPointerEvent(t,u);try{for(var a=I(r),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,u,t);l.type+=i,c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerMove.tap(Dc.tag,this.onPointerMove),t.hooks.pointerOver.tap(Dc.tag,this.onPointerMove),t.hooks.pointerOut.tap(Dc.tag,this.onPointerMove),t.hooks.click.tap(Dc.tag,this.onClick),t.hooks.pointerCancel.tap(Dc.tag,function(t){var e,n,r=c.normalizeToPointerEvent(t,u);try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)})},Dc.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||p(n)||p(r)?(e=(i=this.context.eventService.client2Viewport(new jr(i,t))).x,i.y):(e=n,r),{x:e,y:t}},Dc.prototype.bootstrapEvent=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 e=(n=this.getViewportXY(e)).x,n=n.y,n=(t.viewport.x=e,t.viewport.y=n,(e=this.context.eventService.viewport2Canvas(t.viewport)).x),e=e.y;return t.canvas.x=n,t.canvas.y=e,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=us[t.type]||t.type),t},Dc.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,(r=this.getViewportXY(t)).x),r=r.y,r=(e.viewport.x=n,e.viewport.y=r,(n=this.context.eventService.viewport2Canvas(e.viewport)).x),n=n.y;return e.canvas.x=r,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},Dc.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.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},Dc.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},Dc.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];en(i.button)&&(i.button=0),en(i.buttons)&&(i.buttons=1),en(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),en(i.width)&&(i.width=i.radiusX||1),en(i.height)&&(i.height=i.radiusY||1),en(i.tiltX)&&(i.tiltX=0),en(i.tiltY)&&(i.tiltY=0),en(i.pointerType)&&(i.pointerType="touch"),en(i.pointerId)&&(i.pointerId=i.identifier||0),en(i.pressure)&&(i.pressure=i.force||.5),en(i.twist)&&(i.twist=0),en(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(en((e=t).isPrimary)&&(e.isPrimary=!0),en(e.width)&&(e.width=1),en(e.height)&&(e.height=1),en(e.tiltX)&&(e.tiltX=0),en(e.tiltY)&&(e.tiltY=0),en(e.pointerType)&&(e.pointerType="mouse"),en(e.pointerId)&&(e.pointerId=1),en(e.pressure)&&(e.pressure=.5),en(e.twist)&&(e.twist=0),en(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},Dc.tag="Event";var Bc=Dc;function Dc(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new el(null),this.rootWheelEvent=new il(null),this.onPointerMove=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}},this.onClick=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView,i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}var Fc=[b.CIRCLE,b.ELLIPSE,b.IMAGE,b.RECT,b.LINE,b.POLYLINE,b.POLYGON,b.TEXT,b.PATH,b.HTML],zc=(Wc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!_r.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=null==(r=e.parentNode)?void 0:r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Tr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Tr.OUTSIDE,i.visible))},Wc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Tr.OUTSIDE||n===Tr.INSIDE)return n;for(var i=Tr.INSIDE,a=-1<Fc.indexOf(t.nodeName),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,c=c.distance;if(Vt(u,e.getPositiveFarPoint(r[o]))+c<0)return Tr.OUTSIDE;Vt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Wc);function Wc(){}Vc.prototype.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,k.enableCSSParsing&&k.styleValueRegistry.recalc(t),k.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),k.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tap(Vc.tag,function(){l.addEventListener(Ol.MOUNTED,r),l.addEventListener(Ol.UNMOUNTED,i),l.addEventListener(Ol.ATTR_MODIFIED,e),l.addEventListener(Ol.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(Vc.tag,function(){l.removeEventListener(Ol.MOUNTED,r),l.removeEventListener(Ol.UNMOUNTED,i),l.removeEventListener(Ol.ATTR_MODIFIED,e),l.removeEventListener(Ol.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(Vc.tag,function(){a.syncRTree()})},Vc.prototype.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=O(a.getMin(),2))[0],n=n[1],r=(a=O(a.getMax(),2))[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},Vc.tag="Prepare";var Gc,Hc=Vc;function Vc(){this.toSync=new Set}(Ws=Gc=Gc||{}).READY="ready",Ws.BEFORE_RENDER="beforerender",Ws.RERENDER="rerender",Ws.AFTER_RENDER="afterrender",Ws.BEFORE_DESTROY="beforedestroy",Ws.AFTER_DESTROY="afterdestroy",Ws.RESIZE="resize",Ws.DIRTY_RECTANGLE="dirtyrectangle",Ws.RENDERER_CHANGED="rendererchanged";var Yc,qc=new sl(Ol.MOUNTED),Xc=new sl(Ol.UNMOUNTED),Uc=new sl(Gc.BEFORE_RENDER),$c=new sl(Gc.RERENDER),Kc=new sl(Gc.AFTER_RENDER);function Zc(t){var e=Yc.call(this)||this,n=(e.Element=ql,e.inited=!1,e.context={},e.document=new Cc,(e.document.defaultView=e).customElements=new Ac,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,m=t.supportsCSSTransform,v=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,x=t.isTouchEvent,t=t.isMouseEvent,w=(M=e,(w=n)&&(w="string"==typeof w?w:w.id||rs++,ns[w]&&ns[w].destroy(),ns[w]=M),a),M=o,O=s;return r&&(O=1<=(O=s||is&&window.devicePixelRatio||1)?Math.ceil(O):1,w=a||("auto"===(a=os(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/O,M=o||("auto"===(a=os(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/O),e.devicePixelRatio=O,e.requestAnimationFrame=null!=f?f:bs.bind(k.globalThis),e.cancelAnimationFrame=null!=d?d:xs.bind(k.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in k.globalThis,e.supportsPointerEvents=null!=g?g:!!k.globalThis.PointerEvent,e.isTouchEvent=null!=x?x:function(t){return e.supportsTouchEvents&&t instanceof k.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!k.globalThis.MouseEvent||t instanceof k.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof k.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:w,height:M,renderer:l,offscreenCanvas:i,devicePixelRatio:O,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:m,useNativeClickEvent:v,alwaysTriggerPointerEventOnCanvas:b}),e.initDefaultCamera(w,M,l.clipSpaceNearZ),e.initRenderer(l,!0),e}t(Zc,Yc=Js),Zc.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},Zc.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new k.CameraContribution;i.clipSpaceNearZ=n,i.setType(Dr.EXPLORING,Fr.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(qr,function(){r.context.renderingContext.renderReasons.add(pl.CAMERA_CHANGED)}),this.context.camera=i},Zc.prototype.getConfig=function(){return this.context.config},Zc.prototype.getRoot=function(){return this.document.documentElement},Zc.prototype.getCamera=function(){return this.context.camera},Zc.prototype.getContextService=function(){return this.context.contextService},Zc.prototype.getEventService=function(){return this.context.eventService},Zc.prototype.getRenderingService=function(){return this.context.renderingService},Zc.prototype.getRenderingContext=function(){return this.context.renderingContext},Zc.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(Zc.prototype,"ready",{get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Zc.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new sl(Gc.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new sl(Gc.AFTER_DESTROY))},Zc.prototype.changeSize=function(t,e){this.resize(t,e)},Zc.prototype.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===zr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new sl(Gc.RESIZE,{width:t,height:e}))},Zc.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},Zc.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},Zc.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},Zc.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},Zc.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},Zc.prototype.render=function(){var t=this;this.dispatchEvent(Uc),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent($c)}),this.dispatchEvent(Kc)},Zc.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},Zc.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Bc,new Hc,new Rc,new Nc([new zc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},k),this.context)),this.context.renderingService=new ml(k,this.context),this.context.eventService=new fl(k,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then(function(){n.initRenderingService(t,e)})},Zc.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init(function(){r.inited=!0,e?(n?r.requestAnimationFrame(function(){r.dispatchEvent(new sl(Gc.READY))}):r.dispatchEvent(new sl(Gc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new sl(Gc.RENDERER_CHANGED)),e||r.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()})},Zc.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(k)})},Zc.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),v([],O(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(k)}),this.initRenderer(t))},Zc.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},Zc.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(Xc):(Xc.target=t,this.dispatchEvent(Xc,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},Zc.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(qc):(qc.target=t,this.dispatchEvent(qc,!0))):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)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},Zc.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},Zc.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},Zc.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},Zc.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},Zc.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},Zc.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})};Qc.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===d,f=h&&n.dragndropPluginOptions.isDocumentDraggable?d:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],i.addEventListener("pointermove",e=function(i){return K(n,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:if(!a){if(e=i.timeStamp-o,n=Me([i.clientX,i.clientY],s),e<=this.dragndropPluginOptions.dragstartTimeThreshold||n<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];i.type="dragstart",f.dispatchEvent(i),a=!0}return(i.type="drag",i.dx=i.clientX-c[0],i.dy=i.clientY-c[1],f.dispatchEvent(i),c=[i.clientX,i.clientY],h)?[3,2]:(e="pointer"===this.dragndropPluginOptions.overlap?[i.canvasX,i.canvasY]:u.getBounds().center,[4,d.elementsFromPoint(e[0],e[1])]);case 1:n=t.sent(),r=n[n.indexOf(u)+1],r=(null==r?void 0:r.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?d:null),l!==r&&(l&&(i.type="dragleave",(i.target=l).dispatchEvent(i)),r&&(i.type="dragenter",(i.target=r).dispatchEvent(i)),l=r)&&(i.type="dragover",(i.target=l).dispatchEvent(i)),t.label=2;case 2:return[2]}})})}),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",f.dispatchEvent(t),a=!1),i.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var n=this,r=t.renderingService,d=t.renderingContext.root.ownerDocument,i=d.defaultView;r.hooks.init.tap(Qc.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(Qc.tag,function(){i.removeEventListener("pointerdown",e)})},Qc.tag="Dragndrop";var Jc=Qc;function Qc(t){this.dragndropPluginOptions=t}t(nu,tu=n),nu.prototype.init=function(){this.addRenderingPlugin(new Jc(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},nu.prototype.destroy=function(){this.removeAllRenderingPlugins()},nu.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var tu,eu=nu;function nu(t){void 0===t&&(t={});var e=tu.call(this)||this;return e.options=t,e.name="dragndrop",e}iu.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},iu.prototype.once=function(t,e){return this.on(t,e,!0)},iu.prototype.emit=function(a){for(var o=this,s=[],t=1;t<arguments.length;t++)s[t-1]=arguments[t];function e(t){for(var e,n,r=t.length,i=0;i<r;i++)t[i]&&(n=(e=t[i]).callback,e.once&&(t.splice(i,1),0===t.length&&delete o._events[a],r--,i--),n.apply(o,s))}var n=this._events[a]||[],r=this._events["*"]||[];e(n),e(r)},iu.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},iu.prototype.getEvents=function(){return this._events};var ru=iu;function iu(){this._events={}}const au=()=>[["cartesian"]],ou=(au.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),su=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=ou(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},lu=(su.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),cu=(lu.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),uu=(cu.props={transform:!0},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...cu(),...su({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),hu=(uu.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),fu=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=hu(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...su({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},du=(fu.props={},()=>[["parallel",0,1,0,1]]),pu=(du.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),gu=(pu.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...du(),...su({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),yu=(gu.props={},({value:e})=>t=>t.map(()=>e)),mu=(yu.props={},({value:e})=>t=>t.map(e)),vu=(mu.props={},({value:e})=>t=>t.map(t=>t[e])),bu=(vu.props={},({value:t})=>()=>t);function xu(t,e){return t.parent===e.parent?1:2}function wu(t,e){return t+e.x}function Mu(t,e){return Math.max(t,e.y)}function Ou(){var s=xu,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(wu,0)/e.length,t.y=1+n.reduce(Mu,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function ku(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function Eu(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=_u)):void 0===e&&(e=Su);for(var n,r,i,a,o,t=new Pu(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new Pu(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(Tu)}function Su(t){return t.children}function _u(t){return Array.isArray(t)?t[1]:null}function Au(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Tu(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function Pu(t){this.data=t,this.depth=this.height=0,this.parent=null}function Cu(t){return null==t?null:Lu(t)}function Lu(t){if("function"!=typeof t)throw new Error;return t}function Nu(){return 0}function ju(t){return function(){return t}}bu.props={},Pu.prototype=Eu.prototype={constructor:Pu,count:function(){return this.eachAfter(ku)},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,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);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(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},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 e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return Eu(this).eachBefore(Au)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const Ru=4294967296;function Iu(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&Du(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return zu(t[0],t[1]);case 3:return Wu(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Fu(e,t))return[e];for(n=0;n<t.length;++n)if(Bu(e,t[n])&&Fu(zu(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Bu(zu(t[n],t[r]),e)&&Bu(zu(t[n],e),t[r])&&Bu(zu(t[r],e),t[n])&&Fu(Wu(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function Bu(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function Du(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Fu(t,e){for(var n=0;n<e.length;++n)if(!Du(t,e[n]))return;return 1}function zu(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function Wu(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,h=i-o,f=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function Gu(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function Hu(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Vu(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function Yu(t){this._=t,this.next=null,this.previous=null}function qu(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,h,f,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;Gu(r,d,i=t[2]),d=new Yu(d),r=new Yu(r),i=new Yu(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){Gu(d._,r._,i=t[l]),i=new Yu(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(Hu(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(Hu(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=Vu(d);(i=i.next)!==r;)(s=Vu(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=Iu(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Xu(t){return Math.sqrt(t.value)}function Uu(){var n=null,r=1,i=1,a=Nu;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Ru)/Ru}();return t.x=r/2,t.y=i/2,n?t.eachBefore($u(n)).eachAfter(Ku(a,.5,e)).eachBefore(Zu(1)):t.eachBefore($u(Xu)).eachAfter(Ku(Nu,1,e)).eachAfter(Ku(a,t.r/Math.min(r,i),e)).eachBefore(Zu(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=Cu(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:ju(+t),e):a},e}function $u(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Ku(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=qu(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function Zu(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function Ju(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 Qu(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}var th={depth:-1},eh={},nh={};function rh(t){return t.id}function ih(t){return t.parentId}function ah(){var y,m=rh,v=ih;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=m,h=v,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=sh(t,e-1)&&!sh(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(oh);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(oh(r)),c.push(nh));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new Pu(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?eh:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===eh)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=y){for(;i.data===nh&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===nh;--t)o.data=null}if(i.parent=th,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(Tu),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=Cu(t),e):m},e.parentId=function(t){return arguments.length?(v=Cu(t),e):v},e.path=function(t){return arguments.length?(y=Cu(t),e):y},e}function oh(t){let e=t.length;if(e<2)return"";for(;1<--e&&!sh(t,e););return t.slice(0,e)}function sh(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function lh(t,e){return t.parent===e.parent?1:2}function ch(t){var e=t.children;return e?e[0]:t.t}function uh(t){var e=t.children;return e?e[e.length-1]:t.t}function hh(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function fh(){var f=lh,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new hh(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new hh(r[i],i)),n.parent=e;return(t.parent=new hh(null,0)).children=[t],t}(t);return s.eachAfter(h),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:f(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function h(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,h=s.m;o=uh(o),i=ch(i),o&&i;)s=ch(s),(a=uh(a)).a=t,0<(r=o.z+u-i.z-l+f(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,h+=s.m,c+=a.m;o&&!uh(a)&&(a.t=o,a.m+=u-c),i&&!ch(s)&&(s.t=i,s.m+=l-h,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(f=t,e):f},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function dh(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}hh.prototype=Object.create(Pu.prototype);var ph=(1+Math.sqrt(5))/2;function gh(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,m=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){for(l=i-n,c=a-r;!(u=v[x++].value)&&x<w;);for(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=v[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}m.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?Qu(o,n,r,i,M?r+=c*u/M:a):dh(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var yh=function e(a){function t(t,e,n,r,i){gh(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ph);function mh(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function vh(t,e,n,r,i){(1&t.depth?dh:Qu)(t,e,n,r,i)}var bh=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?Qu(o,e,n,r,f?n+=(i-n)*o.value/f:i):dh(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=gh(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ph);function xh(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{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 wh(t={}){return[...xh(t),{name:"title",scale:"identity"}]}function Mh(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function Oh(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function kh(t={}){return xh(t)}function Eh(){return[{type:"maybeKey"}]}function Sh(t,e){return t.getBandWidth(t.invert(e))}function _h(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:h=r,bandOffsetY:f=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?Sh(l,a[e]):0;var r=p?Sh(c,o[e]):0,e=g&&s?(Sh(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function Ah(t){return parseFloat(t)/100}function Th(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?Ah(e)*o:+e,"string"==typeof t?Ah(t)*s:+t]]})]}function Ph(e){return"function"==typeof e?e:t=>t[e]}function Ch(t,e){return Array.from(t,Ph(e))}function Lh(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=Ch(t,e),o=Ch(t,n),s=Ch(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}function Nh(t,e){return t.getBandWidth(t.invert(e))}const jh=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=Nh(c,a[t]),n=e*(u?Nh(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};jh.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Eh(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Oh()],interaction:{shareTooltip:!0}};const Rh=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};function Ih(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function Bh(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=Ih,o=(t,e)=>Ih(n(t),e),(t,e)=>n(t)-e):(a=n===Ih||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:Dh,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function Dh(){return 0}function Fh(t){return null===t?NaN:+t}Rh.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeZeroY1"}],postInference:[...Oh()],interaction:{shareTooltip:!0}};wo=Bh(Ih);const zh=wo.right,Wh=wo.left,Gh=Bh(Fh).center;function Hh(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function Vh(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function Yh(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class qh{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class Xh extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Uh(this,t))}has(t){return super.has(Uh(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function Uh({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function $h(t){return t}function Kh(t,...e){return tf(t,$h,$h,e)}function Zh(t,...e){return tf(t,Array.from,$h,e)}function Jh(t,e,...n){return tf(t,$h,e,n)}function Qh(t,e,...n){return tf(t,Array.from,e,n)}function tf(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Xh,i=f[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function ef(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=rf(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>rf(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(nf(n))}function nf(r=Ih){if(r===Ih)return rf;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function rf(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var af=Array.prototype.slice;function of(t){return()=>t}const sf=Math.sqrt(50),lf=Math.sqrt(10),cf=Math.sqrt(2);function uf(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=sf?10:r>=lf?5:r>=cf?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/s<t&&++a,o/s>e&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*s<t&&++a,o*s>e&&--o),o<a&&.5<=n&&n<2?uf(t,e,2*n):[a,o,s]}function hf(t,e,n){return uf(t=+t,e=+e,n=+n)[2]}function ff(t){return Math.max(1,Math.ceil(Math.log(Hh(t))/Math.LN2)+1)}function df(){var m=$h,v=Yh,b=ff;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=m(t[a],a,t);var o=v(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(v===Yh&&([s,l]=function(t,e,n){let r;for(;;){var i=hf(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(s,l,u)),(c=function(t,e,n){if(!(0<(n=+n)))return[];if((t=+t)===(e=+e))return[t];var r=e<t,[i,a,o]=r?uf(e,t,n):uf(t,e,n);if(!(i<=a))return[];var s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(s,l,u))[0]<=s&&(n=hf(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===Yh){const n=hf(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[zh(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:of(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:of([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:of(Array.isArray(t)?af.call(t):t),e):b},e}function pf(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function gf(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function yf(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function mf(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function vf(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?rf:nf(o);i<a;){600<a-i&&(s=a-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),u=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),vf(n,r,Math.max(i,Math.floor(r-l*c/s+u)),Math.min(a,Math.floor(r+(s-l)*c/s+u)),o));var s,l,c,u,h=n[r];let t=i,e=a;for(bf(n,i,r),0<o(n[a],h)&&bf(n,i,a);t<e;){for(bf(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?bf(n,i,e):bf(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function bf(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function xf(t,e,n){var r;if((n=(t=Float64Array.from(function*(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?yf(t):1<=e?pf(t):(n=(n-1)*e,(r=pf(vf(t,e=Math.floor(n)).subarray(0,e+1)))+(yf(t.subarray(e+1))-r)*(n-e))}function wf(n,t,r=Fh){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>Fh(r(n[e],e,n))),t<=0?mf(i):1<=t?gf(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,vf(e,t=Math.floor(a*t),0,a,(t,e)=>rf(i[t],i[e])),0<=(t=function(e,n){let r,i=!1;if(1===n.length){let t;for(const o of e){var a=n(o);(i?0<Ih(a,t):0===Ih(a,a))&&(r=o,t=a,i=!0)}}else for(const t of e)(i?0<n(t,r):0===n(t,t))&&(r=t,i=!0);return r}(e.subarray(0,t+1),t=>i[t]))?t:-1)}function Mf(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function Of(t,e){return xf(t,.5,e)}function kf(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Ef(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function Sf(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function _f(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function Af(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function Tf(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function Pf(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function Cf(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function Lf(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function Nf(t){return Pf(t)||Af(t)}function jf(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function Rf(t,e=!0){var t=t.getOptions()["transformations"],[,t,n]=t.find(t=>"polar"===t[0]);return e?[180*+t/Math.PI,180*+n/Math.PI]:[t,n]}const If=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(Kh(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]).filter(t=>void 0!==t);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},Bf=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},Df=()=>(t,e,n,r)=>{return(Cf(r)?Bf:If)(t,e,n,r)};Df.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Eh(),{type:"maybeGradient"},{type:"maybeSeries"}],postInference:[...Oh(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Ff=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=_h(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/h,r=r/f,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};Ff.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Eh(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...Mh()]};const zf=s=>{var{cartesian:t=!1}=s;return t?Th:(t,e,n,r)=>{const{x:i,y:a}=n,o=_h(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};zf.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Eh(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Mh()]};const Wf=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};Wf.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Eh(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...Mh()]};const Gf=()=>(t,e,n,a)=>{var r;const{x:o,y:s,y1:l,series:i}=n;var{x:n,y:e}=e,t=i?Array.from(Kh(t,t=>i[t]).values()):[t],c=t.map(t=>t[0]).filter(t=>void 0!==t);const u=((null==(r=null==n?void 0:n.getBandWidth)?void 0:r.call(n))||0)/2,h=((null==(r=null==e?void 0:e.getBandWidth)?void 0:r.call(e))||0)/2;return[c,Array.from(t,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i]+u,+s[i]+h]),r[n+t]=a.map([+o[i]+u,+l[i]+h])}return r}),t]};Gf.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Eh(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...Oh()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Hf=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=_h(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};Hf.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...Mh()]};const Vf=s=>{var t=s["cartesian"];return t?Th:(t,e,n,r)=>{const{x:i,y:a}=n,o=_h(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};Vf.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Eh(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Mh()]};const Yf=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};Yf.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh()],postInference:[...Mh()]};const qf=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+h[t],+f[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]},Xf=(qf.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Eh(),{type:"maybeZeroX"}],postInference:[...Oh()],interaction:{shareTooltip:!0}},()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]});Xf.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Eh()],postInference:[...Mh()]};const Uf=()=>(t,e,n,r)=>{const i=n["y"];return[t,Array.from(t,t=>{return[[0,i[t]],[1,i[t]]].map(t=>r.map(t))})]};Uf.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["line"]}),{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeTupleY"}],postInference:[]};const $f=()=>(t,e,n,r)=>{const i=n["x"];return[t,Array.from(t,t=>{return[[i[t],1],[i[t],0]].map(t=>r.map(t))})]};$f.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["line"]}),{name:"x",required:!0}],preInference:[...Eh(),{type:"maybeTupleX"}],postInference:[]};const Kf=(...t)=>Hf(...t);function Zf(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function Jf(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=Zf("x",r,n,e.x),o=Zf("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}Kf.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh()],postInference:[]};const Qf=()=>Jf();Qf.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh()],postInference:[]};const td=()=>Jf({extendY:!0});td.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["range"]}),{name:"x",required:!0}],preInference:[...Eh()],postInference:[]};const ed=()=>Jf({extendX:!0});function nd(t){return t.target.depth}function rd(t,e){return t.sourceLinks.length?t.depth:e-1}function id(t){return function(){return t}}function ad(t,e){return sd(t.source,e.source)||t.index-e.index}function od(t,e){return sd(t.target,e.target)||t.index-e.index}function sd(t,e){return t.y0-e.y0}function ld(t){return t.value}function cd(t){return t.index}function ud(t){return t.nodes}function hd(t){return t.links}function fd(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function dd({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function pd(){let x=0,w=0,M=1,O=1,k=24,E=8,S,_=cd,A=rd,T,P,C,L=ud,N=hd,j=6;function e(e){e={nodes:L(e),links:N(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[_(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=fd(g,n)),"object"!=typeof r&&(r=t.target=fd(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=C)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(C),r.sort(C)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(Sf(y.sourceLinks,ld),Sf(y.targetLinks,ld)):y.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(T){var s,l=Math.max(pf(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(pf(t,t=>t.depth)+1,0),n=(M-x-k)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(A.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+k,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(E,(O-w)/(pf(u,t=>t.length)-1)),u),h=yf(t,t=>(O-w-(t.length-1)*S)/Sf(t,ld));for(const m of t){let e=w;for(const v of m){v.y0=e,v.y1=e+v.value*h,e=v.y1+S;for(const b of v.sourceLinks)b.width=b.value*h}e=(O-e+S)/(m.length+1);for(let t=0;t<m.length;++t){var f=m[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===C)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(od),n.sort(ad)}(m)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(sd),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(sd),o.length&&R(o,i)}}(u,d,p)}return dd(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,O,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+S}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-S}}function I({sourceLinks:t,targetLinks:e}){if(void 0===C){for(const{source:{sourceLinks:t}}of e)t.sort(od);for(const{target:{targetLinks:e}}of t)e.sort(ad)}}return e.update=function(t){return dd(t),t},e.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:id(t),e):_},e.nodeAlign=function(t){return arguments.length?(A="function"==typeof t?t:id(t),e):A},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(k=+t,e):k},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(L="function"==typeof t?t:id(t),e):L},e.links=function(t){return arguments.length?(N="function"==typeof t?t:id(t),e):N},e.linkSort=function(t){return arguments.length?(C=t,e):C},e.size=function(t){return arguments.length?(x=w=0,M=+t[0],O=+t[1],e):[M-x,O-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],O=+t[1][1],e):[[x,w],[M,O]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}ed.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...kh({shapes:["range"]}),{name:"y",required:!0}],preInference:[...Eh()],postInference:[]};const gd={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},yd={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?yf(t.sourceLinks,nd)-1:0},justify:rd};const md=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},gd,h),l=pd().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?yd[n]||rd:"function"==c?n:rd).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}};function vd(t){return t}function bd(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),vd)}function xd(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function wd(t=""){throw new Error(t)}function Md(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function Od(t){return null!=t&&!Number.isNaN(t)}function st(t,e){return kd(t,e)||{}}function kd(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Ze(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Ed(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function Sd(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function _d(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Ad(t){return null===t||!1===t}function Td(t,e,n={},r=!1){return Ad(t)||Array.isArray(t)&&r?t:(r=st(t,e),ot(n,r))}function Pd(t,e={}){return!Ad(t)&&!Array.isArray(t)&&Cd(t)?ot(e,t):t}function Cd(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function Ld(t,e){return"object"==typeof t?st(t,e):t}md.props={};const Nd={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},jd={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},Rd={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},Id={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},Bd=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,{links:t,nodes:c}=Lh(t,e),u=st(e,"node"),e=st(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=md(Object.assign(Object.assign(Object.assign({},Nd),{nodeId:Ph(h)}),i))({links:t,nodes:c});const d=st(r,"label"),{text:p=h,spacing:g=5}=d,y=at(d,["text","spacing"]),m=Ph(h);c=Td(l,"node",{title:m,items:[{field:"value"}]},!0),h=Td(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},jd,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:st(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},Id),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:Ld(s,"node"),axis:!1}),ot({},Rd,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},st(r,"link")),tooltip:h,animate:Ld(s,"link")})]},Dd=(Bd.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);function Fd(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:mh,treemapDice:Qu,treemapSlice:dh,treemapSliceDice:vh,treemapSquarify:yh,treemapResquarify:bh};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?ah().path(p):ah():Eu)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(Ju),t}function y(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:Ph(r)(t)).sort(e.sort):p.count(),o=yh,i=!1,s=a=1,l=[0],d=f=h=u=c=Nu,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=Lu(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:ju(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:ju(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:ju(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:ju(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:ju(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}Dd.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...Eh()],postInference:[]};const zd={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},Wd={title:t=>t.data.name,items:[{field:"value"}]},Gd=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a,style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),r=Fd(r,ot({},(r=e,u=n,{tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[r,u],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}),s),i),u=st(o,"label");return ot({},{type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,e],range:[0,1]},y:{domain:[0,n],range:[0,1]}},style:{stroke:"#fff"}},Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},zd),u),...l]},t),{tooltip:Pd(c,Wd),axis:!1}))},Hd=(Gd.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),Vd={title:t=>t.data.name,items:[{field:"value"}]},Yd=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a={},style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,e]},y:{domain:[0,n]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:i.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:i.color?void 0:t=>0===t.height?"":"#000"}},r=((t,e,n)=>{const r=n["value"];n=(De(t)?ah().path(e.path):Eu)(t);return r?n.sum(t=>Ph(r)(t)).sort(e.sort):n.count(),Uu().size(e.size).padding(e.padding)(n),n.descendants()})(r,ot({},{size:[e,n],padding:0,sort:(t,e)=>e.value-t.value},s),ot({},u.encode,i)),e=st(o,"label");return ot({},u,Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},Hd),e),...l]},t),{tooltip:Pd(c,Vd),axis:!1}))};function qd(t,e){return yf(t,t=>e[t])}function Xd(t,e){return pf(t,t=>e[t])}function Ud(t,e){const n=2.5*$d(t,e)-1.5*Zd(t,e);return yf(t,t=>e[t]>=n?e[t]:NaN)}function $d(t,e){return xf(t,.25,t=>e[t])}function Kd(t,e){return xf(t,.5,t=>e[t])}function Zd(t,e){return xf(t,.75,t=>e[t])}function Jd(t,e){const n=2.5*Zd(t,e)-1.5*$d(t,e);return pf(t,t=>e[t]<=n?e[t]:NaN)}function Qd(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Kh(t,t=>a[+t]).values()).flatMap(t=>{const e=Ud(t,i),n=Jd(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}Yd.props={};const tp=t=>{var e,{data:n,encode:r,style:i={},tooltip:a={},animate:o}=t,t=at(t,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=i,i=at(i,["point"]),l=r["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:$d,y2:Kd,y3:Zd},u=Td(a,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),a=Td(a,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=st(i,"box"),e=st(i,"point"),[Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:Ud},c),{y4:Jd})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:Ld(o,"box")},t),{type:"point",data:n,transform:[{type:Qd}],encode:r,style:Object.assign({},e),tooltip:a,animate:Ld(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:qd},c),{y4:Xd})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},ep=(tp.props={},s=>{var t=s["cartesian"];return t?Th:(t,e,n,r)=>{const{x:i,y:a}=n,o=_h(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function np(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,!(d=(i=d)[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function rp(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ip(t){return t[0]}function ap(t){return t[1]}function op(t,e,n){e=new sp(null==e?ip:e,null==n?ap:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function sp(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 lp(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}ep.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Eh(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};So=op.prototype=sp.prototype;function cp(t){return function(){return t}}function up(t){return 1e-6*(t()-.5)}function hp(t){return t.index}function fp(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function dp(c){var u,h,a,o,f,d,s=hp,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=cp(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||up(d),o=i.y+i.vy-r.y-r.vy||up(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=fp(r,t.source)),"object"!=typeof t.target&&(t.target=fp(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)h[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:cp(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:cp(+t),g(),e):r},e}So.copy=function(){var t,e,n=new sp(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)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]=lp(e));else n._root=lp(r);return n},So.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return np(this.cover(e,n),e,n,t)},So.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)np(this,i[u],a[u],t[u]);return this},So.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){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;t<n||i<=t||e<r||a<=e;)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)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},So.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},So.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]]},So.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new rp(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new rp(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new rp(y[2],s,c,a,i),new rp(y[1],a,l,o,c),new rp(y[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},So.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},So.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},So.root=function(){return this._root},So.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},So.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new rp(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new rp(e,o,s,i,a)),(e=c[2])&&l.push(new rp(e,n,s,o,a)),(e=c[1])&&l.push(new rp(e,o,r,i,s)),e=c[0])&&l.push(new rp(e,n,r,o,s));return this},So.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new rp(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new rp(i,a,o,c,u)),(i=h[1])&&n.push(new rp(i,c,o,s,u)),(i=h[2])&&n.push(new rp(i,a,u,c,l)),i=h[3])&&n.push(new rp(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},So.x=function(t){return arguments.length?(this._x=t,this):this._x},So.y=function(t){return arguments.length?(this._y=t,this):this._y};var pp={value:()=>{}};function gp(){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 yp(r)}function yp(t){this._=t}function mp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=pp,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}yp.prototype=gp.prototype={constructor:yp,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(0<=n&&(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]=mp(i[n],t.name,e);else if(null==e)for(n in i)i[n]=mp(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new yp(e)},call:function(t,e){if(0<(n=arguments.length-2))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 vp,bp,xp=0,wp=0,Mp=0,Op=1e3,kp=0,Ep=0,Sp=0,_p="object"==typeof performance&&performance.now?performance:Date,Ap="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Tp(){return Ep||(Ap(Pp),Ep=_p.now()+Sp)}function Pp(){Ep=0}function Cp(){this._call=this._time=this._next=null}function Lp(t,e,n){var r=new Cp;return r.restart(t,e,n),r}function Np(){Ep=(kp=_p.now())+Sp,xp=wp=0;try{Tp(),++xp;for(var t,e=vp;e;)0<=(t=Ep-e._time)&&e._call.call(void 0,t),e=e._next;--xp}finally{for(var n,r,i=vp,a=1/(xp=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:vp=r);bp=n,Rp(a),Ep=0}}function jp(){var t=_p.now(),e=t-kp;Op<e&&(Sp-=e,kp=t)}function Rp(t){xp||(wp=wp&&clearTimeout(wp),24<t-Ep?(t<1/0&&(wp=setTimeout(Np,t-_p.now()-Sp)),Mp=Mp&&clearInterval(Mp)):(Mp||(kp=_p.now(),Mp=setInterval(jp,Op)),xp=1,Ap(Np)))}Cp.prototype=Lp.prototype={constructor:Cp,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Tp():+n)+(null==e?0:+e),this._next||bp===this||(bp?bp._next=this:vp=this,bp=this),this._call=t,this._time=n,Rp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rp())}};const Ip=4294967296;function Bp(t){return t.x}function Dp(t){return t.y}var Fp=10,zp=Math.PI*(3-Math.sqrt(5));function Wp(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=Lp(i),n=gp("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Ip)/Ip}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=Fp*Math.sqrt(.5+r),e=r*zp,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}const Gp={joint:!0},Hp={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},Vp={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},Yp={text:""};function qp(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=cp(-30),d=(f=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:cp(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=op(i,Bp,Dp).visitAfter(D);for(u=t,e=0;e<n;++e)l=i[e],r.visit(F)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function D(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=h[e.data.index],e=e.next;);t.value=o}function F(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=up(c))*i),0===a&&(s+=(a=up(c))*a),s<f&&(s=Math.sqrt(f*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=up(c))*i),0===a&&(s+=(a=up(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,m,v,b,x,w,M,O,k,E,S,_,A,T,n=dp(a).id(Ph(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),Wp(t).force("link",n).force("charge",I));function C(t){for(var e,n=0,r=m.length;n<r;++n)(e=m[n]).vy+=(b[n]-e.y)*v[n]*t}function L(){if(m){var t,e=m.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+y(m[t],t,m))?0:+x(m[t],t,m)}}function N(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(k[n]-e.x)*O[n]*t}function j(){if(M){var t,e=M.length;for(O=new Array(e),k=new Array(e),t=0;t<e;++t)O[t]=isNaN(k[t]=+w(M[t],t,M))?0:+E(M[t],t,M)}}function R(){for(var t,e=A.length,n=0,r=0,i=0;i<e;++i)n+=(t=A[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-_)*T,i=0;i<e;++i)(t=A[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==_&&(_=0),R.initialize=function(t){A=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(_=+t,R):_},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=cp(.1),"function"!=typeof w&&(w=cp(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:cp(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:cp(+t),j(),N):w},N)).force("y",(x=cp(.1),"function"!=typeof y&&(y=cp(null==y?0:+y)),C.initialize=function(t){m=t,L()},C.strength=function(t){return arguments.length?(x="function"==typeof t?t:cp(+t),L(),C):x},C.y=function(t){return arguments.length?(y="function"==typeof t?t:cp(+t),L(),C):y},C)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const Xp=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,h=at(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},h),f=st(e,"node"),d=st(e,"link"),{links:t,nodes:p}=Lh(t,e),{nodesData:t,linksData:p}=qp({links:t,nodes:p},ot({},Gp,i),e),i=Td(l,"link",{items:[t=>({name:"source",value:Ph(u)(t.source)}),t=>({name:"target",value:Ph(u)(t.target)})]}),e=Td(l,"node",{items:[t=>({name:"key",value:Ph(c)(t)})]},!0);return[ot({},Hp,{data:p,encode:d,labels:o,style:st(r,"link"),tooltip:i,animate:Ld(s,"link")}),ot({},Vp,{data:t,encode:Object.assign({},f),scale:n,style:st(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},Yp),st(r,"label")),...a],animate:Ld(s,"link")})]},Up=(Xp.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=Eu(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),$p=t=>Up(Ou)(t),Kp=($p.props={},t=>Up(fh)(t)),Zp=(Kp.props={},{sortBy:(t,e)=>e.value-t.value}),Jp={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},Qp={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},t0={text:"",fontSize:10},e0=t=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,c=null==e?void 0:e.value,{nodes:i,edges:c}=Kp(Object.assign(Object.assign(Object.assign({},Zp),i),{field:c}))(t),t=Td(l,"node",{title:"name",items:["value"]},!0),l=Td(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},Qp,{data:c,encode:st(e,"link"),scale:st(n,"link"),labels:o,style:Object.assign({stroke:"#999"},st(r,"link")),tooltip:l,animate:Ld(s,"link")}),ot({},Jp,{data:i,scale:st(n,"node"),encode:st(e,"node"),labels:[Object.assign(Object.assign({},t0),st(r,"label")),...a],style:Object.assign({},st(r,"node")),tooltip:t,animate:Ld(s,"node")})]};e0.props={};var n0={},r0={},i0=34,a0=10,o0=13;function s0(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function l0(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function c0(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function u0(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+c0(-e,6):9999<e?"+"+c0(e,6):c0(e,4))+"-"+c0(t.getUTCMonth()+1,2)+"-"+c0(t.getUTCDate(),2)+(a?"T"+c0(n,2)+":"+c0(r,2)+":"+c0(i,2)+"."+c0(a,3)+"Z":i?"T"+c0(n,2)+":"+c0(r,2)+":"+c0(i,2)+"Z":r||n?"T"+c0(n,2)+":"+c0(r,2)+"Z":"")}function h0(r){var e=new RegExp('["'+r+"\n\r]"),h=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return r0;if(l)return l=!1,n0;var t,e,n=a;if(r.charCodeAt(n)===i0){for(;a++<i&&r.charCodeAt(a)!==i0||r.charCodeAt(++a)===i0;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===a0?l=!0:e===o0&&(l=!0,r.charCodeAt(a)===a0)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===a0)l=!0;else if(e===o0)l=!0,r.charCodeAt(a)===a0&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===a0&&--i,r.charCodeAt(i-1)===o0&&--i;(e=c())!==r0;){for(var u=[];e!==n0&&e!==r0;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?u0(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=s0(n=t),function(t,e){return r(i(t),e,n)}):s0(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?l0(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?l0(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function f0(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;d0&&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 d0=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),p0=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>K(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),h0(i).parse(t,a?f0:vd);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};p0.props={};const g0=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};g0.props={};const y0=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},m0=(y0.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});m0.props={};const v0=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};v0.props={};const b0=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};b0.props={};const x0=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},w0=(x0.props={},t=>{const e=t["value"];return()=>e}),M0=(w0.props={},t=>{const{callback:e=vd}=t;return t=>e(t)}),O0=(M0.props={},t=>{const{callback:e=vd}=t;return t=>Array.isArray(t)?t.map(e):t});O0.props={};var k0=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const E0={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function S0(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:m,sortBy:v}=Object.assign(Object.assign({},E0),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=y(t),t.targetWeight=m(t)});const i=Kh(r,t=>t.source),a=Kh(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=Sf(e,t=>t.sourceWeight)+Sf(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:k0[v])&&r.sort(n),!(n=(r=e).length))throw wd("Invalid nodes: it's empty!");if(h){const o=f/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-f),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!h)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=Kh(e,t=>t.source),l=Kh(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const _0=e=>t=>S0(e)(t),A0=(_0.props={},Math.PI/180),T0=64,P0=2048;function C0(t){return t.text}function L0(){return"serif"}function N0(){return"normal"}function j0(t){return t.value}function R0(){return 90*~~(2*Math.random())}function I0(){return 1}function B0(){}function D0(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(T0<<5)/c,P0/c);let i=0,a=0,n=0;var u,h,f,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*A0),f=Math.cos(o.rotate*A0),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=T0<<5&&(i=0,a+=n,n=0),a+e>=P0)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*A0),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(T0<<5)/c,P0/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,m=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*m;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<y;t++){var v=m*e+(t>>5),b=p[(a+e)*(T0<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*m)}}}function F0(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function z0(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function W0(){return document.createElement("canvas")}function G0(t){return"function"==typeof t?t:function(){return t}}const H0={archimedean:F0,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function V0(){let b=[256,256],r=C0,i=L0,p=j0,g=N0,y=R0,m=I0,x=F0,w=Math.random,v=B0,M=[],O=null,k=1/0;const E=N0,S=W0,_={};return _.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(T0<<5)/e,t.height=P0/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=_.board||z0((b[0]>>5)*b[1]),c=M.length,u=[],h=M.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=E.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=m.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=_.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<k&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,D0(s,i,h,f),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(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}(t,e))){var f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,m=32-y,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<v;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<m|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:_,word:i}),u.push(i),d?_.hasImage||(t=d,e=i,n=void 0,n=t[0],t=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>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}_._tags=u,_._bounds=d,f>=c&&(_.stop(),v.call(null,"end",{cloud:_,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),_},_.stop=function(){return O&&(clearInterval(O),O=null),_},_.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=z0((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}_.board=a,_.hasImage=!0}},_.timeInterval=function(t){k=null==t?1/0:t},_.words=function(t){M=t},_.size=function(t=[]){b=[+t[0],+t[1]]},_.text=function(t){r=G0(t)},_.font=function(t){i=G0(t)},_.fontWeight=function(t){g=G0(t)},_.rotate=function(t){y=G0(t)},_.spiral=function(t){x=H0[t]||t},_.fontSize=function(t){p=G0(t)},_.padding=function(t){m=G0(t)},_.random=function(t){w=G0(t)},_.on=function(t){v=G0(t)},_}const Y0={size:[500,500],fontSize:[14,28]};function q0(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const X0=f=>h=>K(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},Y0,f),e=V0(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return K(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=h.map(t=>t.value),n=t,t=[yf(e),pf(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",q0,e.createMask),e.words([...h]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=at(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function U0(e){return"string"==typeof e?t=>t[e]:e}X0.props={};const $0=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=U0(r),l=U0(t),c=Jh(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},K0=($0.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});K0.props={};var Z0,J0,Q0,tg,Fo={exports:{}},ni={exports:{}};function eg(t){return 1-Math.abs(t)}Z0=(o=ni).exports,o.exports.isNumber=function(t){return"number"==typeof t},o.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},o.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},o.exports.findMinMulti=function(t){for(var e=Z0.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,Z0.findMin(t[n]));return e},o.exports.findMaxMulti=function(t){for(var e=Z0.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,Z0.findMax(t[n]));return e},o.exports.inside=function(t,e,n){return t<=n&&n<=e},Bs=Fo,J0=Math.log(2),Q0=Bs.exports,tg=ni.exports,Bs.exports.getUnifiedMinMax=function(t,e){return Q0.getUnifiedMinMaxMulti([t],e)},Bs.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=tg.isNumber((e=e||{}).width)?e.width:2,a=tg.isNumber(e.size)?e.size:50,o=tg.isNumber(e.min)?e.min:(n=!0,tg.findMinMulti(t)),e=tg.isNumber(e.max)?e.max:(r=!0,tg.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},Bs.exports.create=function(t,e){if(!t||0===t.length)return[];var n=tg.isNumber((e=e||{}).size)?e.size:50,o=tg.isNumber(e.width)?e.width:2,e=Q0.getUnifiedMinMax(t,{size:n,width:o,min:e.min,max:e.max}),s=e.min,e=e.max-s,l=e/(n-1);if(0==e)return[{x:s,y:1}];for(var c=[],r=0;r<n;r++)c.push({x:s+r*l,y:0});var u=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(eg,o),h=u[o],f=u[o-1]-u[o-2],d=0,i=(t.forEach(function(t){var e,n,r,i,a,t=Math.floor((t-s)/l);t+o<0||c.length<=t-o||(r=Math.max(t-o,0),e=t,n=Math.min(t+o,c.length-1),i=u[-o-1+(r=r-(t-o))]||0,a=u[-o-1+(t+o-n)]||0,i=h/(h-i-a),0<r&&(d+=i*(r-1)*f),a=Math.max(0,t-o+1),tg.inside(0,c.length-1,a)&&(c[a].y+=i*f),tg.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),tg.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*f))}),d),a=0,p=0;return c.forEach(function(t){a+=t.y,i+=a,t.y=i,p+=i}),0<p&&c.forEach(function(t){t.y/=p}),c},Bs.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},Bs.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&!(e<=(n+=t[r=i].y));i++);return t[r].x}},Bs.exports.getPerplexity=function(t){var n;if(t&&0!==t.length)return n=0,t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/J0,Math.pow(2,n)};var ng=Fo.exports;const rg=t=>{const{field:r,groupBy:n,as:e=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=e;return t=>{return Array.from(Kh(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=ng.create(t.map(t=>t[r]),{min:i,max:a,size:o,width:s}),n=e.map(t=>t.x),e=e.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:n,[c]:e})})}};rg.props={};var ig={exports:{}};function ag(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function og(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function sg(t){return Math.sqrt(og(t,t))}function lg(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function cg(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function ug(i,a,o,s,l,c,u){var h=o.fx,f=og(o.fxprime,a),d=h,t=h,p=f,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,cg(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=og(s.fxprime,a),h+c*l*f<d||n<=d)e=l;else{if(Math.abs(p)<=-u*f)return l;0<=p*(e-t)&&(e=t),t=l,n=d}return 0}l=l||1,c=c||1e-6,u=u||.1;for(var r=0;r<10;++r){if(cg(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=og(s.fxprime,a),h+c*l*f<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*f)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(Oo=Oo=ig.exports).bisect=function(t,e,n,r){var i=(r=r||{}).maxIterations||100,a=r.tolerance||1e-10,o=t(e),r=t(n),s=n-e;if(0<o*r)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===r)return n;for(var l=0;l<i;++l){var c=e+(s/=2),u=t(c);if(0<=u*o&&(e=c),Math.abs(s)<a||0===u)return c}return e+s},Oo.nelderMead=function(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,a=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,s=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,u=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5,d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e);for(var g=p[0].id=0;g<d;++g){var y=e.slice();y[g]=y[g]?y[g]*a:o,p[g+1]=y,p[g+1].fx=t(y),p[g+1].id=g+1}function m(t){for(var e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}for(var v=function(t,e){return t.fx-e.fx},b=e.slice(),x=e.slice(),w=e.slice(),M=e.slice(),O=0;O<i;++O){for(p.sort(v),n.history&&((E=p.map(function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e})).sort(function(t,e){return t.id-e.id}),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:E})),g=r=0;g<d;++g)r=Math.max(r,Math.abs(p[0][g]-p[1][g]));if(Math.abs(p[0].fx-p[d].fx)<s&&r<l)break;for(g=0;g<d;++g){for(var k=b[g]=0;k<d;++k)b[g]+=p[k][g];b[g]/=d}var E=p[d];if(cg(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)cg(M,1+u,b,-u,E),M.fx=t(M),M.fx<x.fx?m(M):m(x);else if(x.fx>=p[d-1].fx){var S=!1;if(x.fx>E.fx?(cg(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(cg(w,1-h*c,b,h*c,E),w.fx=t(w),w.fx<x.fx?m(w):S=!0),S){if(1<=f)break;for(g=1;g<p.length;++g)cg(p[g],1-f,p[0],f,p[g]),p[g].fx=t(p[g])}}else m(x)}return p.sort(v),{fx:p[0].fx,x:p[0]}},Oo.conjugateGradient=function(t,e,n){var r,i,a={x:e.slice(),fx:0,fxprime:e.slice()},o={x:e.slice(),fx:0,fxprime:e.slice()},s=e.slice(),l=1;i=(n=n||{}).maxIterations||20*e.length,a.fx=t(a.x,a.fxprime),lg(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=ug(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(cg(s,1,o.fxprime,-1,a.fxprime),u=og(a.fxprime,a.fxprime),u=Math.max(0,og(s,o.fxprime)/u),cg(r,u,r,-1,o.fxprime),u=a,a=o,o=u):lg(r,a.fxprime,-1),sg(a.fxprime)<=1e-5)break}n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l});return a},Oo.gradientDescent=function(t,e,n){for(var r=(n=n||{}).maxIterations||100*e.length,i=n.learnRate||.001,a={x:e.slice(),fx:0,fxprime:e.slice()},o=0;o<r&&(a.fx=t(a.x,a.fxprime),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice()}),cg(a.x,1,a.x,-i,a.fxprime),!(sg(a.fxprime)<=1e-5));++o);return a},Oo.gradientDescentLineSearch=function(t,e,n){n=n||{};var r,i={x:e.slice(),fx:0,fxprime:e.slice()},a={x:e.slice(),fx:0,fxprime:e.slice()},o=n.maxIterations||100*e.length,s=n.learnRate||1,l=e.slice(),c=n.c1||.001,u=n.c2||.1,h=[];{var f;n.history&&(f=t,t=function(t,e){return h.push(t.slice()),f(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(lg(l,i.fxprime,-1),s=ug(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:h,learnRate:s,alpha:s}),h=[]),r=i,i=a,a=r,!(0===s||sg(i.fxprime)<1e-5));++d);return i},Oo.zeros=ag,Oo.zerosM=function(t,e){return ag(t).map(function(){return ag(e)})},Oo.norm2=sg,Oo.weightedSum=cg,Oo.scale=lg;const hg=1e-10;function fg(a,t){var e=function(t){var r=[];for(let n=0;n<t.length;++n)for(let e=n+1;e<t.length;++e){var i=yg(t[n],t[e]);for(let t=0;t<i.length;++t){var a=i[t];a.parentIndex=[n,e],r.push(a)}}return r}(a),n=e.filter(function(t){var e=t,n=a;for(let t=0;t<n.length;++t)if(pg(e,n[t])>n[t].radius+hg)return!1;return!0});let o=0,s=0,l;var c=[];if(1<n.length){var r=function(e){var n={x:0,y:0};for(let t=0;t<e.length;++t)n.x+=e[t].x,n.y+=e[t].y;return n.x/=e.length,n.y/=e.length,n}(n);for(l=0;l<n.length;++l){var u=n[l];u.angle=Math.atan2(u.x-r.x,u.y-r.y)}n.sort(function(t,e){return e.angle-t.angle});let i=n[n.length-1];for(l=0;l<n.length;++l){var h=n[l],f=(s+=(i.x+h.x)*(h.y-i.y),{x:(h.x+i.x)/2,y:(h.y+i.y)/2});let r=null;for(let n=0;n<h.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(h.parentIndex[n])){var d=a[h.parentIndex[n]],p=Math.atan2(h.x-d.x,h.y-d.y),g=Math.atan2(i.x-d.x,i.y-d.y);let t=g-p;t<0&&(t+=2*Math.PI);p=g-t/2;let e=pg(f,{x:d.x+d.radius*Math.sin(p),y:d.y+d.radius*Math.cos(p)});e>2*d.radius&&(e=2*d.radius),(null===r||r.width>e)&&(r={circle:d,width:e,p1:h,p2:i})}null!==r&&(c.push(r),o+=dg(r.circle.radius,r.width),i=h)}}else{let t=a[0];for(l=1;l<a.length;++l)a[l].radius<t.radius&&(t=a[l]);let e=!1;for(l=0;l<a.length;++l)if(pg(a[l],t)>Math.abs(t.radius-a[l].radius)){e=!0;break}e?o=s=0:(o=t.radius*t.radius*Math.PI,c.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-hg,y:t.y+t.radius},width:2*t.radius}))}return s/=2,t&&(t.area=o+s,t.arcArea=o,t.polygonArea=s,t.arcs=c,t.innerPoints=n,t.intersectionPoints=e),o+s}function dg(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function pg(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function gg(t,e,n){var r;return t+e<=n?0:n<=Math.abs(t-e)?Math.PI*Math.min(t,e)*Math.min(t,e):(r=e-(n*n-t*t+e*e)/(2*n),dg(t,t-(n*n-e*e+t*t)/(2*n))+dg(e,r))}function yg(t,e){var n,r,i=pg(t,e),a=t.radius,o=e.radius;return a+o<=i||i<=Math.abs(a-o)?[]:(o=(a*a-o*o+i*i)/(2*i),a=Math.sqrt(a*a-o*o),n=t.x+o*(e.x-t.x)/i,o=t.y+o*(e.y-t.y)/i,[{x:n+(r=-(e.y-t.y)*(a/i)),y:o-(e=-(e.x-t.x)*(a/i))},{x:n-r,y:o+e}])}function mg(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||xg;const i=e.lossFunction||wg,a=n(t=function(t){t=t.slice();var e=[],n={};let r,i,a,o;for(r=0;r<t.length;++r){var s=t[r];1==s.sets.length?e.push(s.sets[0]):2==s.sets.length&&(a=s.sets[0],o=s.sets[1],n[[a,o]]=!0,n[[o,a]]=!0)}for(e.sort((t,e)=>e<t?1:-1),r=0;r<e.length;++r)for(a=e[r],i=r+1;i<e.length;++i)o=e[i],[a,o]in n||t.push({sets:[a,o],size:0});return t}(t),e),r=[],o=[];let s;for(s in a)a.hasOwnProperty(s)&&(r.push(a[s].x),r.push(a[s].y),o.push(s));var l=ig.exports.nelderMead(function(e){var n={};for(let t=0;t<o.length;++t){var r=o[t];n[r]={x:e[2*t],y:e[2*t+1],radius:a[r].radius}}return i(n,t)},r,e).x;for(let t=0;t<o.length;++t)s=o[t],a[s].x=l[2*t],a[s].y=l[2*t+1];return a}const vg=1e-10;function bg(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+vg?Math.abs(e-n):ig.exports.bisect(function(t){return gg(e,n,t)-r},0,e+n)}function xg(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:wg,a={},o={};let s;for(let t=0;t<r.length;++t){var e=r[t];1==e.sets.length&&(s=e.sets[0],a[s]={x:1e10,y:1e10,rowid:Object.keys(a).length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},o[s]=[])}r=r.filter(function(t){return 2==t.sets.length});for(let e=0;e<r.length;++e){var n=r[e];let t=n.hasOwnProperty("weight")?n.weight:1;var l=n.sets[0],c=n.sets[1];n.size+vg>=Math.min(a[l].size,a[c].size)&&(t=0),o[l].push({set:c,size:n.size,weight:t}),o[c].push({set:l,size:n.size,weight:t})}var u=[];for(s in o)if(o.hasOwnProperty(s)){let e=0;for(let t=0;t<o[s].length;++t)e+=o[s][t].size*o[s][t].weight;u.push({set:s,size:e})}function h(t,e){return e.size-t.size}u.sort(h);const f={};function d(t){return t.set in f}function p(t,e){a[e].x=t.x,a[e].y=t.y,f[e]=!0}p({x:0,y:0},u[0].set);for(let t=1;t<u.length;++t){var g=u[t].set,y=o[g].filter(d);if(s=a[g],y.sort(h),0===y.length)throw"ERROR: missing pairwise overlap information";var m=[];for(let e=0;e<y.length;++e){var v=a[y[e].set],b=bg(s.radius,v.radius,y[e].size);m.push({x:v.x+b,y:v.y}),m.push({x:v.x-b,y:v.y}),m.push({y:v.y+b,x:v.x}),m.push({y:v.y-b,x:v.x});for(let t=e+1;t<y.length;++t){var x=a[y[t].set],w=bg(s.radius,x.radius,y[t].size),M=yg({x:v.x,y:v.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)m.push(M[t])}}let e=1e50,n=m[0];for(let t=0;t<m.length;++t){a[g].x=m[t].x,a[g].y=m[t].y;var O=i(a,r);O<e&&(e=O,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||wg;return n=8<=t.length&&r(e=function(t,e){var n=(e=e||{}).restarts||10,r=[],i={};let a;for(a=0;a<t.length;++a){var o=t[a];1==o.sets.length&&(i[o.sets[0]]=r.length,r.push(o))}var s=function(t,a,o){const s=ig.exports.zerosM(a.length,a.length),l=ig.exports.zerosM(a.length,a.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){var e=o[t.sets[0]],n=o[t.sets[1]],r=bg(Math.sqrt(a[e].size/Math.PI),Math.sqrt(a[n].size/Math.PI),t.size);s[e][n]=s[n][e]=r;let i=0;t.size+1e-10>=Math.min(a[e].size,a[n].size)?i=1:t.size<=1e-10&&(i=-1),l[e][n]=l[n][e]=i}),{distances:s,constraints:l}}(t,r,i);let y=s.distances;function l(t,r){{var i=t,a=r,o=y,s=m;let e=0,n;for(n=0;n<a.length;++n)a[n]=0;for(n=0;n<o.length;++n){var l=i[2*n],c=i[2*n+1];for(let t=n+1;t<o.length;++t){var u=i[2*t],h=i[2*t+1],f=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(h-c)*(h-c),g=Math.sqrt(p),p=p-f*f;0<d&&g<=f||d<0&&f<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-h),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(h-c))}}return e}}const m=s.constraints,c=ig.exports.norm2(y.map(ig.exports.norm2))/y.length;y=y.map(function(t){return t.map(function(t){return t/c})});let u,h;for(a=0;a<n;++a){var f=ig.exports.zeros(2*y.length).map(Math.random);h=ig.exports.conjugateGradient(l,f,e),(!u||h.fx<u.fx)&&(u=h)}var d=u.x,p={};for(a=0;a<r.length;++a){var g=r[a];p[g.sets[0]]={x:d[2*a]*c,y:d[2*a+1]*c,radius:Math.sqrt(g.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)ig.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function wg(n,r){let i=0;for(let e=0;e<r.length;++e){var a,o,s=r[e];let t;1!=s.sets.length&&(t=2==s.sets.length?(o=n[s.sets[0]],a=n[s.sets[1]],gg(o.radius,a.radius,pg(o,a))):fg(s.sets.map(function(t){return n[t]})),o=s.hasOwnProperty("weight")?s.weight:1,i+=o*(t-s.size)*(t-s.size))}return i}function Mg(t){function e(e){return{max:Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),min:Math.min.apply(null,t.map(function(t){return t[e]-t.radius}))}}return{xRange:e("x"),yRange:e("y")}}const Og=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:o=0}=t,[s,l]=r;return t=>{t=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[s]:t.sets.join("&")}));t.sort((t,e)=>t.sets.length-e.sets.length);const i=mg(t);let a;return t.map(t=>{const r=t[e];return Object.assign(Object.assign({},t),{[l]:({width:t,height:e})=>{a=a||function(t,e,n,r){var i=[],a=[];for(const g in t)t.hasOwnProperty(g)&&(a.push(g),i.push(t[g]));e-=2*r,n-=2*r;var o=(l=Mg(i)).xRange,s=l.yRange;if(o.max==o.min||s.max==s.min)return console.log("not scaling solution: zero size detected"),t;var l=e/(o.max-o.min),c=n/(s.max-s.min),u=Math.min(c,l),h=(e-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2,d={};for(let t=0;t<i.length;++t){var p=i[t];d[a[t]]={radius:u*p.radius,x:r+h+(p.x-o.min)*u,y:r+f+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(fg(t,e),e.arcs);if(0===n.length)return"M 0 0";if(1==n.length)return t=n[0].circle,e=t.x,r=t.y,t=t.radius,(i=[]).push("M",e-=t,r),i.push("A",t,t,0,1,0,e+2*t,r),i.push("A",t,t,0,1,0,e,r),i.join(" ");var r,i,a=["\nM",n[0].p2.x,n[0].p2.y];for(let t=0;t<n.length;++t){var o=n[t],s=o.circle.radius,l=o.width>s;a.push("\nA",s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return a.join(" ")}(r.map(t=>a[t]));return/[zZ]$/.test(n)||(n+=" Z"),n}})})}};Og.props={};const kg=(l,c)=>K(void 0,void 0,void 0,function*(){var{width:t,height:e}=c,{data:n,encode:r={},scale:i,style:a={},layout:o={}}=l,s=at(l,["data","encode","scale","style","layout"]),n=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]}))}(n,r),o=yield X0(Object.assign(Object.assign({},{size:[t,e]}),o))(n);return ot({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},Object.assign(Object.assign({data:o,encode:r,scale:i,style:a},s),{axis:!1}))});function Eg(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Sg(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function _g(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}kg.props={};const Ag=Math.sqrt(50),Tg=Math.sqrt(10),Pg=Math.sqrt(2);function Cg(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=Ag?10:n>=Tg?5:n>=Pg?2:1)*10**t:-(10**-t)/(n>=Ag?10:n>=Tg?5:n>=Pg?2:1)}function Lg(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=Ag?r*=10:n>=Tg?r*=5:n>=Pg&&(r*=2),e<t?-r:r}const Ng=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=Cg(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=Cg(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=Cg(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},jg=36e5,Rg=864e5,Ig=7*Rg;Rg,Rg;function Bg(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}Ys=Bg(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ao=Bg(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),Po=Bg(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),Ro=Bg(jg,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+jg*e)},t=>t.getHours()),Wo=Bg(Rg,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Rg*e)},t=>t.getDate()-1);const Dg=Bg(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());Ho=Bg(Ig,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ig*e)},t=>{var e=Dg.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Ig)}),Yo=Bg(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const Fg={millisecond:Ys,second:Ao,minute:Po,hour:Ro,day:Wo,week:Ho,month:Dg,year:Yo};Xo=Bg(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ko=Bg(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Jo=Bg(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),ts=Bg(jg,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+jg*e)},t=>t.getUTCHours()),vs=Bg(Rg,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Rg*e)},t=>t.getUTCDate()-1);const zg=Bg(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());Ls=Bg(Ig,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ig*e)},t=>{var e=zg.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Ig)}),Ns=Bg(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const Wg={millisecond:Xo,second:Ko,minute:Jo,hour:ts,day:vs,week:Ls,month:zg,year:Ns};function Gg(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?Wg:Fg;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=_g(i,l,0,c,s);let h;return h=u===c?[a,Lg(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(Lg(t,e,n),1)]}const Hg=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Gg(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function Vg(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Yg(t){return Ug(t,"Function")}function qg(t){return null==t}var Xg={}.toString,Ug=function(t,e){return Xg.call(t)==="[object "+e+"]"},$g=function(t){return Array.isArray?Array.isArray(t):Ug(t,"Array")};var Kg=function(t){if("object"!=typeof(e=t)||null===e||!Ug(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},Zg=function(t){return Ug(t,"Number")},Jg=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Yg(n)&&"prototype"===e||r.push(t)};if(e)if($g(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},Qg=5;function t1(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Qg,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Kg(o)?(Kg(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):$g(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function e1(t){return t}var n1,r1=function(t,e){if(!Vg(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r};function i1(t){return qg(t)?0:(Vg(t)?t:Object.keys(t)).length}function a1(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Yg(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(n1=n1||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),n1.measureText(Ug(t,"String")?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],Jg(e=void 0===e?{}:e)).join("")});const o1=e=>t=>-e(-t),s1=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?o1(t):t},l1=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?o1(n):n},c1=(t,e,n,r)=>{var i=t<0,a=s1(r,i),r=l1(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function u1(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return Zg(t)?Math.round(t):t}):i;this.output=Eg(a,r,e,t)},t.prototype.invert=void 0}}var h1,h={exports:{}},Bo={exports:{}},f1=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},d1=Array.prototype.concat,p1=Array.prototype.slice,g1=Bo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];f1(i)?e=d1.call(e,p1.call(i)):e.push(i)}return e},y1=(g1.wrap=function(t){return function(){return t(g1(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),m1=Bo.exports,v1=Object.hasOwnProperty,b1=Object.create(null);for(h1 in y1)v1.call(y1,h1)&&(b1[y1[h1]]=h1);var x1=h.exports={to:{},get:{}};function w1(t,e,n){return Math.min(Math.max(e,t),n)}function M1(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}x1.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=x1.get.hsl(t),n="hsl";break;case"hwb":e=x1.get.hwb(t),n="hwb";break;default:e=x1.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},x1.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:v1.call(y1,e[1])?((i=y1[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]))}e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=w1(i[n],0,255);return i[3]=w1(i[3],0,1),i},x1.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,w1(parseFloat(t[2]),0,100),w1(parseFloat(t[3]),0,100),w1(isNaN(e)?1:e,0,1)]):null},x1.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,w1(parseFloat(t[2]),0,100),w1(parseFloat(t[3]),0,100),w1(isNaN(e)?1:e,0,1)]):null},x1.to.hex=function(){var t=m1(arguments);return"#"+M1(t[0])+M1(t[1])+M1(t[2])+(t[3]<1?M1(Math.round(255*t[3])):"")},x1.to.rgb=function(){var t=m1(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},x1.to.rgb.percent=function(){var t=m1(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},x1.to.hsl=function(){var t=m1(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},x1.to.hwb=function(){var t=m1(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},x1.to.keyword=function(t){return b1[t.slice(0,3)]};var O1=h.exports;function k1(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function E1(t){var e,n,r,t=O1.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*k1(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*k1(n,r,e),255*k1(n,r,e-1/3),t]):null):null}const S1=(e,n)=>t=>e*(1-t)+n*t,_1=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return S1(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=E1(n),c=E1(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},A1=(t,e)=>{const n=S1(t,e);return t=>Math.round(n(t))};function T1({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function P1(t){return"object"==typeof t?t.valueOf():t}class C1 extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=P1,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(T1({map:this.map,initKey:this.initKey},t))}has(t){return super.has(T1({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class L1{constructor(t){this.options=t1({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=t1({},this.options,t),this.rescale(t)}rescale(t){}}const N1=Symbol("defaultUnknown");function j1(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function R1(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==N1)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function I1(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class B1 extends L1{getDefaultOptions(){return{domain:[],range:[],unknown:N1}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&j1(this.domainIndexMap,this.getDomain(),this.domainKey),R1({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&j1(this.rangeIndexMap,this.getRange(),this.rangeKey),R1({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=I1(e),this.rangeKey=I1(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new B1(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function D1(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new C1(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new C1(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:m}}class F1 extends B1{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:N1,flex:[]}}constructor(t){super(t)}clone(){return new F1(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(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return D1(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const z1=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=Cg(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<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}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};class W1 extends L1{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:z1}}map(t){var[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){var[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){var{tickMethod:t,domain:e,tickCount:n}=this.options,[e,r]=e;return Zg(e)&&Zg(r)?t(e,r,n):[]}clone(){return new W1(this.options)}}function G1(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const H1=[1,5,2,2.5,4,3],V1=100*Number.EPSILON;const Y1=(n,r,t=5,i=!0,a=H1,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var m=a[t],v=(h=m,f=a,d=y,p=void 0,p=i1(f),1-r1(f,h)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){y=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*v+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/y/m;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*m*10**t,M=(k=r,M=w*(e-1),(k-=n)<M?1-((M-k)/2)**2/(.1*k)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var O=Math.floor(r/w)*y-(e-1)*y,k=Math.ceil(n/w)*y;if(O<=k){var E=k-O;for(let t=0;t<=E;t+=1){var S=(O+t)*(w/y),_=S+w*(e-1),A=w,T=function(t,e,n,r,i,a){var o=i1(e),e=r1(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<V1||a-t<V1)&&r<=0&&0<=i?1:s)}(m,a,y,S,_,A),P=1-.5*((r-_)**2+(n-S)**2)/(.1*(r-n))**2,C=(l=e,C=n,l=(l-1)/(_-(L=S)),c=((c=s)-1)/(Math.max(_,r)-Math.min(C,L)),2-Math.max(l/c,c/l)),L=o[0]*T+o[1]*P+o[2]*C+ +o[3];g.score<L&&(!i||S<=n&&r<=_)&&(g.lmin=S,g.lmax=_,g.lstep=A,g.score=L)}}t+=1}e+=1}}y+=1}var t=G1(g.lmax),e=G1(g.lmin),N=G1(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=G1(e);for(let t=1;t<j;t+=1)R[t]=G1(R[t-1]+N);return R};class q1 extends L1{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Y1}}map(t){return a1(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new q1(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Zg(t)&&Zg(r)?n(t,r,e):[]}}const X1=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return Eg(o=t<r?(a=Sg(t,r),n(e,i)):(a=Sg(r,t),n(i,e)),a)},U1=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=Sg(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=_g(r,t,1,i)-1,n=a[e];return Eg(o[e],n)(t)}},$1=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?U1:X1)(t,e,r?A1:n)};class K1 extends L1{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:S1,tickCount:5}}map(t){return a1(t)?this.output(t):this.options.unknown}invert(t){return a1(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ng}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return e1}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=$1(n.map(t),r,a,i);this.output=Eg(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=$1(i,r.map(t),S1);this.input=Eg(e,n,i)}}class Z1 extends K1{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:_1,tickMethod:z1,tickCount:5}}chooseTransforms(){return[e1,e1]}clone(){return new Z1(this.options)}}class J1 extends F1{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:N1,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new J1(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Q1=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ty extends K1{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:_1,tickMethod:z1,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[e1,e1]:(t=.5===r?Q1:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new ty(this.options)}}class ey extends ty{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:_1,tickMethod:z1,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ey(this.options)}}class ny extends L1{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return a1(t)?(t=_g(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new ny(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ry=(t,e,n,r=10)=>{var i=t<0,a=l1(r,i),o=s1(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=z1(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=z1(u,h,t).map(a)}return s?f.reverse():f};class iy extends K1{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:_1,tickMethod:ry,tickCount:5}}chooseNice(){return c1}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[s1(t,e),l1(t,e)]}clone(){return new iy(this.options)}}class ay extends ny{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Y1}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=Ng(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new ay(this.options)}}function oy(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class sy extends ny{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Y1}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=oy(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new sy(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ly=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,cy=/\[([^]*?)\]/gm;function uy(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function hy(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a,o=i[r];for(a in o)t[a]=o[a]}return t}function fy(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var dy,Fs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=["January","February","March","April","May","June","July","August","September","October","November","December"],gl=uy(i,3),py=hy({},{dayNamesShort:uy(Fs,3),dayNames:Fs,monthNamesShort:gl,monthNames:i,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),gy={D:function(t){return String(t.getDate())},DD:function(t){return fy(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return fy(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return fy(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return fy(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return fy(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return fy(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return fy(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return fy(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return fy(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return fy(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return fy(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return(t.getHours()<12?e.amPm[0]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+fy(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+fy(Math.floor(Math.abs(t)/60),2)+":"+fy(Math.abs(t)%60,2)}},yy={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const my=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Gg(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function vy(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class by extends K1{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:my,interpolate:S1,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Hg}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?Wg:Fg,s=t?vy:e1;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=yy.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=yy[t]||t).replace(cy,function(t,e){return r.push(e),"@@@"}),hy(hy({},py),n));return(t=t.replace(ly,function(t){return gy[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new by(this.options)}}var xy;let wy=dy=class extends Z1{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e1,tickMethod:z1,tickCount:5}}constructor(t){super(t)}clone(){return new dy(this.options)}};wy=dy=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([u1(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return Eg(S1(0,1),Sg(t,e))})],wy);let My=xy=class extends Z1{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e1,tickMethod:z1,tickCount:5}}constructor(t){super(t)}clone(){return new xy(this.options)}};function Oy(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function ky(t){return t.map((t,e)=>e)}function Ey(t){return t[t.length-1]}function Sy(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function _y(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)_y(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function Ay([t,e],[n,r]){return[t-n,e-r]}function Ty([t,e],[n,r]){return[t+n,e+r]}function Py([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Cy([t,e]){return Math.atan2(e,t)}function Ly([t,e]){return Cy([t,e])+Math.PI/2}function Ny(t,e){t=Cy(t),e=Cy(e);return t<e?e-t:2*Math.PI-(t-e)}function jy(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function Ry([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function L(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function Iy(t,e,n,r,i){e=Cy(Ay(r,e))+Math.PI,n=Cy(Ay(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function By(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=ky(a),[r,o]=Yh(t,t=>a[t]);const s=new Z1({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function Dy(t){var[t,e,n,r]=t;return[r,t,e,n]}function Fy(t,e,n){var[e,r,,i]=_f(t)?Dy(e):e,[n,a]=n,t=t.getCenter(),o=Ly(Ay(e,t)),r=Ly(Ay(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:Py(i,t),outerRadius:Py(e,t)}}function zy(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Wy(t,e){return Af(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function Gy(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function lt(t){return new Hy([t],null,t,t.ownerDocument)}My=xy=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([u1(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=Eg(S1(0,.5),Sg(e,n)),a=Eg(S1(.5,1),Sg(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],My);class Hy{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){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Hy(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Hy(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Hy([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new Hy(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new Hy(n,null,n[0],this._document)}maybeAppend(t,e){var n=this._elements[0],r=n.getElementById(t);return r||((r="string"==typeof e?this.createElement(e):e()).id=t,n.appendChild(r)),new Hy([r],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),h=Kh(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Kh=h.get(d);s.push([f,Kh]);for(const y of Kh)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new Hy([],i,this._parent,this._document),new Hy(a,null,this._parent,this._document),new Hy(o,null,this._parent,this._document),new Hy([],s,this._parent,this._document),new Hy(l,null,this._parent,this._document)];return new Hy(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new Hy(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=Hy.registry[t])?new e:wd("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){var e=this._transitions[t];e?(e=Array.isArray(e)?e:[e],Promise.all(e.map(t=>t.finished)).then(()=>{this._elements[t].remove()})):this._elements[t].remove()}return new Hy([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}Hy.registry={g:z.Group,rect:z.Rect,circle:z.Circle,path:z.Path,text:z.Text,ellipse:z.Ellipse,image:z.Image,line:z.Line,polygon:z.Polygon,polyline:z.Polyline,html:z.HTML};const Vy={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},Yy={style:{shape:(t,e)=>{const l=t["radius"],c=at(t,["shape","radius"]);var t=st(c,"pointer"),n=st(c,"pin");const u=t["shape"],h=at(t,["shape"]),f=n["shape"],d=at(n,["shape"]),{coordinate:p,theme:g}=e;return(t,e)=>{var t=t.map(t=>p.invert(t)),[n,r,i]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(p,"polar");const a=p.clone();var o=e["color"],n=fu({startAngle:n,endAngle:r,innerRadius:i,outerRadius:l});n.push(["cartesian"]),a.update({transformations:n});const s=t.map(t=>a.map(t));var[r,i]=Gy(s),[n,t]=p.getCenter(),r=Object.assign(Object.assign({x1:r,y1:i,x2:n,y2:t,stroke:o},h),c),i=Object.assign(Object.assign({cx:n,cy:t,stroke:o},d),c),n=lt(new z.Group);return Ad(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(L,r).node()),Ad(f)||("function"==typeof f?n.append(()=>f(s,e,a,g)):n.append("circle").call(L,i).node()),n.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},qy={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const Xy=t=>{var n,{data:e={},scale:r={},style:i={},animate:a={}}=t,t=at(t,["data","scale","style","animate","transform"]),{targetData:e,totalData:r,target:o,total:s,scale:l}=function(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=t;var t=a||r,s=a?1:i,e=Object.assign({y:{domain:[0,s]}},e);return o.length?{targetData:[{x:n,y:t,color:"target"}],totalData:o.map((t,e)=>({x:n,y:1<=e?t-o[e-1]:t,color:e})),target:t,total:s,scale:e}:{targetData:[{x:n,y:t,color:"target"}],totalData:[{x:n,y:t,color:"target"},{x:n,y:s-t,color:"total"}],target:t,total:s,scale:e}}(e,r),c=st(i,"text"),u=(n=["pointer","pin"],Object.fromEntries(Object.entries(i).filter(([e])=>n.find(t=>e.startsWith(t)))));return[ot({},Vy,Object.assign({type:"interval",transform:[{type:"stackY"}],data:r,scale:l,style:st(i,"arc"),animate:"object"==typeof a?st(a,"arc"):a},t)),ot({},Vy,Yy,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?st(a,"indicator"):a},t)),ot({},qy,{style:Object.assign({text:([r,{target:i,total:e}]=[c,{target:o,total:s}],(r=r.content)?r(i,e):i.toString())},c),animate:"object"==typeof a?st(a,"text"):a})]},Uy=(Xy.props={},()=>(i,t,e,a)=>{const{x:o,series:s}=e,l=Object.entries(e).filter(([t])=>t.startsWith("y")).map(([,t])=>t),c=Object.entries(e).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===o||void 0===l||void 0===c)throw new Error("Missing encode for x or y or size channel.");const u=t.x,h=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(h?h.getBandWidth(h.invert(+(null===s||void 0===s?void 0:s[n]))):1),t=(+(null===s||void 0===s?void 0:s[n])||0)*t;const r=+o[n]+t+e/2;return[...l.map((t,e)=>[r+ +c[e][n]/i.length,+l[e][n]]),...l.map((t,e)=>[r-+c[e][n]/i.length,+l[e][n]]).reverse()].map(t=>a.map(t))});return[i,e]});Uy.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["density"]}),{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:[...Eh(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Oh()],interaction:{shareTooltip:!0}};const $y=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,t=>{var e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]})]]};$y.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...wh({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Eh(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...Mh()]};const Ky=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Zy=(Ky.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),Jy=(Zy.props={},t=>new F1(t)),Qy=(Jy.props={},t=>new Z1(t)),tm=(Qy.props={},t=>new B1(t)),em=(tm.props={},t=>new q1(t)),nm=(em.props={},t=>new J1(t)),rm=(nm.props={},t=>new by(t)),im=(rm.props={},t=>new iy(t)),am=(im.props={},t=>new ty(t)),om=(am.props={},t=>new ny(t)),sm=(om.props={},t=>new sy(t)),lm=(sm.props={},t=>new ay(t)),cm=(lm.props={},t=>new ey(t)),um=(cm.props={},t=>new wy(t)),hm=(um.props={},t=>new W1(t));function fm(t){return function(){return t}}hm.props={};const dm=Math.abs,pm=Math.atan2,gm=Math.cos,ym=Math.max,mm=Math.min,vm=Math.sin,bm=Math.sqrt,xm=1e-12,wm=Math.PI,Mm=wm/2,Om=2*wm;function km(t){return 1<=t?Mm:t<=-1?-Mm:Math.asin(t)}const Em=Math.PI,Sm=2*Em,_m=1e-6,Am=Sm-_m;function Tm(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class Pm{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Tm:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return Tm;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>_m&&(Math.abs(f*c-u*h)>_m&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((Em-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>_m&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>_m||Math.abs(this._y1-c)>_m)&&this._append`L${l},${c}`,n&&((h=h<0?h%Sm+Sm:h)>Am?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>_m&&this._append`A${n},${n},0,${+(h>=Em)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Cm(){return new Pm}function Lm(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new Pm(r)}function Nm(t){return t.innerRadius}function jm(t){return t.outerRadius}function Rm(t){return t.startAngle}function Im(t){return t.endAngle}function Bm(t){return t&&t.padAngle}function Dm(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/bm(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*bm(ym(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function Fm(){var A=Nm,T=jm,P=fm(0),C=null,L=Rm,N=Im,j=Bm,R=null,I=Lm(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M=+A.apply(this,arguments),O=+T.apply(this,arguments),k=L.apply(this,arguments)-Mm,E=N.apply(this,arguments)-Mm,S=dm(E-k),_=k<E;if(R=R||(t=I()),O<M&&(e=O,O=M,M=e),O>xm?S>Om-xm?(R.moveTo(O*gm(k),O*vm(k)),R.arc(0,0,O,k,E,!_),M>xm&&(R.moveTo(M*gm(E),M*vm(E)),R.arc(0,0,M,E,k,_))):(r=e=k,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>xm&&(C?+C.apply(this,arguments):bm(M*M+O*O)),w=x=s=mm(dm(O-M)/2,+P.apply(this,arguments)),f>xm&&(h=km(f/M*vm(u)),f=km(f/O*vm(u)),(a-=2*h)>xm?(r+=h*=_?1:-1,i-=h):(a=0,r=i=(k+E)/2),(o-=2*f)>xm?(e+=f*=_?1:-1,n-=f):(o=0,e=n=(k+E)/2)),u=O*gm(e),h=O*vm(e),f=M*gm(i),k=M*vm(i),s>xm&&(d=O*gm(n),p=O*vm(n),g=M*gm(r),y=M*vm(r),S<wm)&&((E=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<xm))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,k))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/vm((1<(S=(S*b+v*m)/(bm(S*S+v*v)*bm(b*b+m*m)))?0:S<-1?wm:Math.acos(S))/2),b=bm(E[0]*E[0]+E[1]*E[1]),x=mm(s,(M-b)/(v-1)),w=mm(s,(O-b)/(1+v))):x=w=0),o>xm?w>xm?(l=Dm(g,y,u,h,O,w,_),c=Dm(d,p,f,k,O,w,_),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,pm(l.y01,l.x01),pm(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,w,pm(l.y01,l.x01),pm(l.y11,l.x11),!_),R.arc(0,0,O,pm(l.cy+l.y11,l.cx+l.x11),pm(c.cy+c.y11,c.cx+c.x11),!_),R.arc(c.cx,c.cy,w,pm(c.y11,c.x11),pm(c.y01,c.x01),!_))):(R.moveTo(u,h),R.arc(0,0,O,e,n,!_)):R.moveTo(u,h),M>xm&&a>xm?x>xm?(l=Dm(f,k,d,p,M,-x,_),c=Dm(u,h,g,y,M,-x,_),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,pm(l.y01,l.x01),pm(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,x,pm(l.y01,l.x01),pm(l.y11,l.x11),!_),R.arc(0,0,M,pm(l.cy+l.y11,l.cx+l.x11),pm(c.cy+c.y11,c.cx+c.x11),_),R.arc(c.cx,c.cy,x,pm(c.y11,c.x11),pm(c.y01,c.x01),!_))):R.arc(0,0,M,i,r,_):R.lineTo(f,k)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+A.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+L.apply(this,arguments)+ +N.apply(this,arguments))/2-wm/2;return[gm(e)*t,vm(e)*t]},e.innerRadius=function(t){return arguments.length?(A="function"==typeof t?t:fm(+t),e):A},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:fm(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:fm(+t),e):P},e.padRadius=function(t){return arguments.length?(C=null==t?null:"function"==typeof t?t:fm(+t),e):C},e.startAngle=function(t){return arguments.length?(L="function"==typeof t?t:fm(+t),e):L},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:fm(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:fm(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function zm(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Wm(t){this._context=t}function Gm(t){return new Wm(t)}function Hm(t){return t[0]}function Vm(t){return t[1]}function Ym(o,s){var l=fm(!0),c=null,u=Gm,h=null,f=Lm(e);function e(t){var e,n,r,i=(t=zm(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?Hm:fm(o),s="function"==typeof s?s:void 0===s?Vm:fm(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:fm(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:fm(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:fm(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function qm(u,h,f){var d=null,p=fm(!0),g=null,y=Gm,m=null,v=Lm(e);function e(t){var e,n,r,i,a,o=(t=zm(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(m=y(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),r=e-1;n<=r;--r)m.point(l[r],c[r]);m.lineEnd(),m.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),m.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return m=null,a+""||null}function t(){return Ym().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?Hm:fm(+u),h="function"==typeof h?h:fm(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?Vm:fm(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:fm(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:fm(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:fm(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:fm(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:fm(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:fm(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:fm(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(m=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=m=null:m=y(g=t),e):g},e}Cm.prototype=Pm.prototype,Wm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Xm=$m(Gm);function Um(t){this._curve=t}function $m(e){function t(t){return new Um(e(t))}return t._curve=e,t}function Km(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e($m(t)):e()._curve},t}function Zm(){}function Jm(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Qm(t,e){this._context=t,this._k=(1-e)/6}function tv(t,e){this._context=t,this._k=(1-e)/6}function ev(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>xm&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>xm&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function nv(t,e){this._context=t,this._alpha=e}Um.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Qm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Jm(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Jm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new Qm(t,n)}return t.tension=function(t){return e(+t)},t}(0),tv.prototype={areaStart:Zm,areaEnd:Zm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Jm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new tv(t,n)}return t.tension=function(t){return e(+t)},t}(0),nv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ev(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var rv=function e(n){function t(t){return n?new nv(t,n):new Qm(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function iv(t,e){this._context=t,this._alpha=e}iv.prototype={areaStart:Zm,areaEnd:Zm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ev(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var av=function e(n){function t(t){return n?new iv(t,n):new tv(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function ov(t){this._context=t}function sv(t){return new ov(t)}function lv(t,e){this._context=t,this._t=e}function cv(t){return new lv(t,.5)}function uv(t){return new lv(t,0)}function hv(t){return new lv(t,1)}function fv(t,e,n){return Math.max(e,Math.min(t,n))}function dv(t,e,n,r,i={}){var{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:h=o,radiusBottomRight:f=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:y=1/0}=i,i=at(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!Af(r)&&!Pf(r)){var m=!!_f(r),[v,,b]=m?Dy(e):e;const[k,M]=v;var[b,v]=Ay(b,v),x=(0<b?k:k+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:fv(b,g,y),v=m?fv(s,g,y):s,l=x-(c-b)/2,u=w-(v-s)/2;return lt(t.createElement("rect",{})).style("x",l).style("y",u).style("width",c).style("height",v).style("radius",[d,p,f,h]).call(L,i).node()}const{y:M,y1:O}=n;m=r.getCenter(),g=Fy(r,e,[M,O]),y=Fm().cornerRadius(o).padAngle(a*Math.PI/180);return lt(t.createElement("path",{})).style("path",y(g)).style("transform",`translate(${m[0]}, ${m[1]})`).style("radius",o).style("inset",a).call(L,i).node()}ov.prototype={areaStart:Zm,areaEnd:Zm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},lv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};const pv=(E,t)=>{const{colorAttribute:S,first:_=!0,last:A=!0}=E,T=at(E,["colorAttribute","opacityAttribute","first","last"]),{coordinate:P,document:C}=t;return(t,e,n)=>{var{color:r,radius:i=0}=n,n=at(n,["color","radius"]),a=n.lineWidth||1,{stroke:o,radius:i=i,radiusTopLeft:s=i,radiusTopRight:l=i,radiusBottomRight:c=i,radiusBottomLeft:u=i,innerRadius:h=0,innerRadiusTopLeft:f=h,innerRadiusTopRight:d=h,innerRadiusBottomRight:p=h,innerRadiusBottomLeft:h=h,lineWidth:a="stroke"===S||o?a:0,inset:g=0,insetLeft:y=g,insetRight:m=g,insetBottom:v=g,insetTop:b=g,minWidth:x,maxWidth:w}=T,M=at(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:r=r,opacity:O}=e;const k=[_?s:f,_?l:d,A?c:p,A?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],_f(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,k[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return lt(dv(C,t,e,P,f)).call(L,n).style("fill","transparent").style(S,r).style(zy(E),O).style("lineWidth",a).style("stroke",void 0===o?r:o).call(L,M).node()}},gv=(pv.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>pv(Object.assign({colorAttribute:"fill"},t),e)),yv=(gv.props=Object.assign(Object.assign({},pv.props),{defaultMarker:"square"}),(t,e)=>pv(Object.assign({colorAttribute:"stroke"},t),e));yv.props=Object.assign(Object.assign({},pv.props),{defaultMarker:"hollowSquare"});const mv=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(_f(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,l=at(t,["adjustPoints"]),{coordinate:c,document:u}=e;return(t,e,n,r)=>{var i=e["index"],a=n["color"],n=at(n,["color"]),r=r[i+1],i=s(t,r,c),[t,r,i,o]=!!_f(c)?Dy(i):i,{color:e=a,opacity:a}=e,t=Ym().curve(sv)([t,r,i,o]);return lt(u.createElement("path",{})).call(L,n).style("path",t).style("fill",e).style("fillOpacity",a).call(L,l).node()}};function vv(t,e,n){var[t,r,i,a]=t;if(_f(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}mv.props={defaultMarker:"square"};const bv=(t,e)=>mv(Object.assign({adjustPoints:vv},t),e);function xv(t){const e="function"==typeof t?t:t.render;return class extends z.CustomElement{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}bv.props={defaultMarker:"square"};const wv=xv(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(L,r),lt(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(L,i)});const Mv=(t,e)=>{const{curve:u,gradient:h=!1,gradientColor:f="between",defined:d=t=>!Number.isNaN(t)&&null!=t,connect:p=!1}=t,g=at(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:y,document:m}=e;return(t,e,n)=>{var{color:r,lineWidth:i}=n,n=at(n,["color","lineWidth"]),{color:r=r,size:i=i,seriesColor:a,seriesX:o,seriesY:s}=e,a=h&&a?By(a,o,s,h,f):r,o=Wy(y,e),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a&&{stroke:a}),i&&{lineWidth:i}),o&&{transform:o}),g);let l;if(Af(y)){const c=y.getCenter();l=n=>Km(Ym().curve(Xm)).angle((t,e)=>Ly(Ay(n[e],c))).radius((t,e)=>Py(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=Ym().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>d(t)&&d(e)).curve(u);var[r,e]=function(t,e){var 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,d),n=st(s,"connect"),a=!!e.length;return(!a||p&&!Object.keys(n).length?lt(m.createElement("path",{})).style("d",l(r)||[]).call(L,s):a&&!p?lt(m.createElement("path",{})).style("d",l(t)).call(L,s):lt(new wv).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}},Ov=(Mv.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=Af(i)?sv:Gm;return Mv(Object.assign({curve:e},n),r)(...t)}}),kv=(Ov.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"line"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=Af(a)?av:rv;return Mv(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),Ev=(kv.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"smooth"}),(t,e)=>Mv(Object.assign({curve:hv},t),e)),Sv=(Ev.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"hv"}),(t,e)=>Mv(Object.assign({curve:uv},t),e)),_v=(Sv.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"vh"}),(t,e)=>Mv(Object.assign({curve:cv},t),e));_v.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"hvh"});const Av=(b,t)=>{const x=t["document"];return(e,t,n)=>{var r,i,a,o,s,l,c,u,h,{seriesSize:f,color:t}=t,d=n["color"],n=at(n,["color"]),p=Cm();for(let t=0;t<e.length-1;t++){var g=e[t],y=e[t+1],m=f[t],v=f[t+1];[...g,...y].every(Od)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=Cy(Ay(y=y,g=g)))+Math.PI/2,a=[m/2*Math.cos(i),m/2*Math.sin(i)],i=[v/2*Math.cos(i),v/2*Math.sin(i)],o=[v/2*Math.cos(s),v/2*Math.sin(s)],s=[m/2*Math.cos(s),m/2*Math.sin(s)],l=Ty(g,a),c=Ty(y,i),u=Ty(c,o),h=Ay(o=Ty(y,o),i),y=Ay(y,i),i=Ay(g,a),a=Ay(i,s),g=Ay(g,s),s=Ay(l,s),r.moveTo(...l),r.lineTo(...c),r.arcTo(...u,...o,v/2),r.arcTo(...h,...y,v/2),r.lineTo(...i),r.arcTo(...a,...g,m/2),r.arcTo(...s,...l,m/2),r.closePath())}return lt(x.createElement("path",{})).call(L,n).style("fill",t||d).style("d",p.toString()).call(L,b).node()}};Av.props=Object.assign(Object.assign({},Mv.props),{defaultMarker:"line"});xl=(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"]],xl.style=["fill"],$s=xl.bind(void 0),$s.style=["stroke","lineWidth"],Ll=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],Ll.style=["fill"],Rs=Ll.bind(void 0),Rs.style=["fill"],Xs=Ll.bind(void 0),Xs.style=["stroke","lineWidth"],r=(t,e,n)=>{var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]},r.style=["fill"],Hs=r.bind(void 0),Hs.style=["stroke","lineWidth"],Ws=(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"]]},Ws.style=["fill"],Js=Ws.bind(void 0),Js.style=["stroke","lineWidth"],n=(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"]]},n.style=["fill"],ph=n.bind(void 0),ph.style=["stroke","lineWidth"],wo=(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"]]},wo.style=["fill"],So=wo.bind(void 0),So.style=["stroke","lineWidth"],o=(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"]]},o.style=["fill"],ni=o.bind(void 0),ni.style=["stroke","lineWidth"],Bs=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Bs.style=["stroke","lineWidth"],Fo=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],Fo.style=["stroke","lineWidth"],Oo=(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]],Oo.style=["stroke","lineWidth"],Ys=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],Ys.style=["stroke","lineWidth"],Ao=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Ao.style=["stroke","lineWidth"],Po=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Po.style=["stroke","lineWidth"],Ro=Po.bind(void 0),Ro.style=["stroke","lineWidth"],Wo=(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]],Wo.style=["stroke","lineWidth"],Ho=(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]],Ho.style=["stroke","lineWidth"],Yo=(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]],Yo.style=["stroke","lineWidth"],Xo=(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]],Xo.style=["stroke","lineWidth"],Ko=(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]];Ko.style=["stroke","lineWidth"];const Tv=new Map([["bowtie",o],["cross",Fo],["dash",Ro],["diamond",r],["dot",Po],["hexagon",wo],["hollowBowtie",ni],["hollowDiamond",Hs],["hollowHexagon",So],["hollowPoint",$s],["hollowSquare",Xs],["hollowTriangle",Js],["hollowTriangleDown",ph],["hv",Ho],["hvh",Xo],["hyphen",Ao],["line",Bs],["plus",Ys],["point",xl],["rect",Rs],["smooth",Wo],["square",Ll],["tick",Oo],["triangleDown",n],["triangle",Ws],["vh",Yo],["vhv",Ko]]);const f=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=at(c,["colorAttribute","symbol","mode"]),d=Tv.get(e)||Tv.get("point"),{coordinate:p,document:g}=t;return(t,e,n)=>{var{lineWidth:r,color:i}=n,r=f.stroke?r||1:r,{color:i=i,transform:a,opacity:o}=e,[s,l]=Gy(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||Lf(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(h,t,e,p)||f.r||n.r;return lt(g.createElement("path",{})).call(L,n).style("fill","transparent").style("d",d(s,l,t)).style("lineWidth",r).style("transform",a).style("stroke",i).style(zy(c),o).style(u,i).call(L,f).node()}},Pv=(f.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e)),Cv=(Pv.props=Object.assign({defaultMarker:"bowtie"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e)),Lv=(Cv.props=Object.assign({defaultMarker:"cross"},f.props),(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e)),Nv=(Lv.props=Object.assign({defaultMarker:"diamond"},f.props),(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e)),jv=(Nv.props=Object.assign({defaultMarker:"hexagon"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e)),Rv=(jv.props=Object.assign({defaultMarker:"hollowBowtie"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e)),Iv=(Rv.props=Object.assign({defaultMarker:"hollowDiamond"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e)),Bv=(Iv.props=Object.assign({defaultMarker:"hollowHexagon"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e)),Dv=(Bv.props=Object.assign({defaultMarker:"hollowPoint"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e)),Fv=(Dv.props=Object.assign({defaultMarker:"hollowSquare"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e)),zv=(Fv.props=Object.assign({defaultMarker:"hollowTriangle"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e)),Wv=(zv.props=Object.assign({defaultMarker:"hollowTriangleDown"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e)),Gv=(Wv.props=Object.assign({defaultMarker:"hyphen"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e)),Hv=(Gv.props=Object.assign({defaultMarker:"line"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e)),Vv=(Hv.props=Object.assign({defaultMarker:"plus"},f.props),(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"point"},t),e)),Yv=(Vv.props=Object.assign({defaultMarker:"point"},f.props),(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"square"},t),e)),qv=(Yv.props=Object.assign({defaultMarker:"square"},f.props),(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e)),Xv=(qv.props=Object.assign({defaultMarker:"tick"},f.props),(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e)),Uv=(Xv.props=Object.assign({defaultMarker:"triangle"},f.props),(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e)),$v=(Uv.props=Object.assign({defaultMarker:"triangleDown"},f.props),(t,e)=>{const{arrow:u=!0,arrowSize:h="40%"}=t,f=at(t,["arrow","arrowSize"]),d=e["document"];return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=Cm();return c.moveTo(...t),c.lineTo(...l),u&&([a,o]=(t=t,r=l,i="string"==typeof(i=(i={arrowSize:h})["arrowSize"])?+parseFloat(i)/100*Py(t,r):i,a=Math.PI/6,t=Math.atan2(r[1]-t[1],r[0]-t[0]),o=Math.PI/2-t-a,t-=a,[[r[0]-i*Math.sin(o),r[1]-i*Math.cos(o)],[r[0]-i*Math.cos(t),r[1]-i*Math.sin(t)]]),c.moveTo(...l),c.lineTo(...a),c.moveTo(...l),c.lineTo(...o)),lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,f).node()}});function Kv(t){Jv(t,!0)}function Zv(t){Jv(t,!1)}function Jv(t,e){var n=e?"visible":"hidden";!function e(t,n){n(t),t.children&&t.children.forEach(function(t){t&&e(t,n)})}(t,function(t){t.attr("visibility",n)})}$v.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(eb,Qv=z.Group);var Qv,tb=eb;function eb(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qv.apply(this,v([],O(t),!1))||this;return n.addEventListener(z.ElementEvent.INSERTED,function(){Zv(n)}),n}function nb(t){t=t.appendChild(new tb({class:"offscreen"}));return Zv(t),t}t(ab,rb=z.Text),Object.defineProperty(ab.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=nb(this)),this._offscreen},enumerable:!1,configurable:!0}),ab.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var rb,ib=ab;function ab(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return rb.call(this,m({style:m({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},e)},t))||this}function ob(t){return t*Math.PI/180}function sb(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(cb.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(cb.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(cb.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(cb.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),cb.fromRect=function(t){return new cb(t.x,t.y,t.width,t.height)},cb.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}};var lb=cb;function cb(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}function ub(t,e){return Re(t)?t.apply(void 0,v([],O(e),!1)):t}function hb(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=O(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function fb(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)pb(t,e[r]);return t}var db,pb=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=O(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?We(t)?(We(r[e])||(n[e]={}),a<o?pb(r[e],t,a+1,o):n[e]=i[e]):De(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},gb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},yb=an(function(t,e){var n=Ye(t)?t:t.style.text.toString(),e=e||mb(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(db=db||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),db.measureText(n).width},function(t,e){return[Ye(t)?t:t.style.text.toString(),Object.values(e||mb(t)).join()].join("")}),mb=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,t=t.style.fontSize;return{fontSize:"object"==typeof t?t.value:t,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function vb(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function bb(t,e){t=vb(t);t&&t.attr(e)}function xb(t,e,n){bb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function wb(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}function Mb(t){return"function"==typeof t?t():Ye(t)||Xe(t)?new ib({style:{text:String(t)}}):t}function Ob(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 kb(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var Eb=function(e,n){return function(t){return e*(1-t)+n*t}};function Sb(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?Eb(e,t):Array.isArray(e)&&Array.isArray(t)?(i=e,o=(a=t)?a.length:0,s=i?Math.min(o,i.length):0,function(t){for(var e=new Array(s),n=new Array(o),r=0,r=0;r<s;++r)e[r]=Sb(i[r],a[r]);for(;r<o;++r)n[r]=a[r];for(r=0;r<s;++r)n[r]=e[r](t);return n}):"object"==typeof e&&"object"==typeof t?(void 0===(n=e)&&(n={}),void 0===(t=t)&&(t={}),r={},l={},Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];e in n?r[e]=Sb(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function _b(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,o=O([s+o.width,l+o.height],2),c=o[0],o=o[1];s<e&&(e=s),l<n&&(n=l),r<c&&(r=c),i<o&&(i=o)}return new lb(e,n,r-e,i-n)}function Ab(n,t,e){function r(t){var e=O(u?["height",a]:["width",i],2),n=e[0],r=e[1];switch(c){case"flex-start":return 0;case"flex-end":return r-t[n];case"center":return r/2-t[n]/2;default:return 0}}var i=n.width,a=n.height,o=void 0===(o=e.flexDirection)?"row":o,s=(e.flexWrap,e.justifyContent),l=void 0===s?"flex-start":s;e.alignContent;var c=void 0===(s=e.alignItems)?"flex-start":s,u="row"===o,e="row"===o||"column"===o,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=O([0,0],2))[0],d=s[1],e=_b(o=t.map(function(t){var e=t.width,t=t.height,n=O([f,d],2),r=n[0],n=n[1],i=O([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new lb(r,n,e,t)})),p={"flex-start":0,"flex-end":u?i-e.width:a-e.height,center:u?(i-e.width)/2:(a-e.height)/2};return _b(s=o.map(function(t){var e=t.x,n=t.y,t=lb.fromRect(t);return t.x=u?e+p[l]:e,t.y=u?n:n+p[l],t})),s.map(function(t){var e=t.x,n=t.y,t=lb.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=lb.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function Tb(t,e,n){return[]}function Pb(t,e){return[t[0]*e,t[1]*e]}function Cb(t,e){return[t[0]+e[0],t[1]+e[1]]}function Lb(t,e){return[t[0]-e[0],t[1]-e[1]]}function Nb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function jb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Rb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ib(t){var e;return 0===t[0]&&0===t[1]?[0,0]:(e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),[t[0]/e,t[1]/e])}function Bb(t,e){e=Math.pow(10,e);return~~(t*e)/e}function Db(t,e){var n,r={},i=Array.isArray(e)?e:[e];for(n in t)i.includes(n)||(r[n]=t[n]);return r}function Fb(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r,s=[1/0,1/0],l=[-1/0,-1/0];if(o){s=(r=O(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Nb(s,x=t[c]),l=jb(l,x)}for(var c=0,h=t.length;c<h;c+=1){var f,d,p,g,y,m,v,b,x=t[c];0!==c||n?c!==h-1||n?(f=t[[c?c-1:h-1,c-1][n?0:1]],m=[0,0],m=Pb(m=Lb(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=Rb(x,f))+(g=Rb(x,d)))&&(p/=y,g/=y),y=Pb(m,-p),m=Pb(m,g),v=Cb(x,y),b=Nb(b=Cb(x,m),jb(d,x)),b=jb(b,Nb(d,x)),v=Nb(v=Cb(x,y=Pb(y=Lb(b,x),-p/g)),jb(f,x)),b=Cb(x,m=Pb(m=Lb(x,v=jb(v,Nb(f,x))),g/p)),o&&(v=Nb(v=jb(v,s),l),b=Nb(b=jb(b,s),l)),a.push(i),a.push(v),i=b):(v=x,a.push(i),a.push(v)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],l=O(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var zb=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","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 Wb(t){var e,n,r={};for(e in t)n=e,zb.includes(n)&&(r[e]=t[e]);return r}function Gb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}M.prototype.selectAll=function(t){return new M("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},M.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new M(this._elements,null,this._parent,this._document,void 0,void 0,t)},M.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new M([t],null,t,this._document)},M.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=O(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new M(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new M(r,null,r[0],this._document)},M.prototype.maybeAppend=function(t,e){e=B(this,Hb,"m",Vb).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},M.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=B(this,Hb,"m",Vb).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},M.prototype.maybeAppendByName=function(t,e){e=B(this,Hb,"m",Vb).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},M.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Kh(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var m=f.get(g);l.push([p,m]);try{r=void 0;for(var v=I(m),b=v.next();!b.done;b=v.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new M([],a,this._parent,this._document),new M(o,null,this._parent,this._document),new M(s,null,this._parent,this._document),new M([],l,this._parent,this._document),new M(c,null,this._parent,this._document)];return new M(this._elements,null,this._parent,this._document,w)},M.prototype.merge=function(t){var e=v(v([],O(this._elements),!1),O(t._elements),!1),t=v(v([],O(this._transitions),!1),O(t._transitions),!1);return new M(e,null,this._parent,this._document,void 0,t)},M.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=M.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},M.prototype.join=function(t,e,n,r,i){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()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},M.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new M([],null,this._parent,this._document,void 0,this._transitions)},M.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},M.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},M.prototype.style=function(n,r,t){void 0===t&&(t=!0);var i="function"==typeof r&&t?r:function(){return r};return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},M.prototype.styles=function(t,o){return void 0===t&&(t={}),void 0===o&&(o=!0),this.each(function(r,i){var a=this;Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],n=t[1],t="function"==typeof n&&o?n:function(){return n};void 0!==n&&a.attr(e,t.call(a,r,i))})})},M.prototype.update=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.maybeUpdate=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},M.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},M.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,v([this._parent,this],O(e),!1)),this},M.prototype.node=function(){return this._elements[0]},M.prototype.nodes=function(){return this._elements},M.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},M.prototype.parent=function(){return this._parent},Hb=new WeakSet,Vb=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new M([t],null,this._parent,this._document)},M.registry={g:z.Group,rect:z.Rect,circle:z.Circle,path:z.Path,text:ib,ellipse:z.Ellipse,image:z.Image,line:z.Line,polygon:z.Polygon,polyline:z.Polyline,html:z.HTML};var Hb,Vb,Yb=M;function M(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),Hb.add(this),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}function x(t){return new Yb([t],null,t,t.ownerDocument)}function qb(t,e,n){return t.querySelector(e)?x(t).select(e):x(t).append(n)}function Xb(t){if(Xe(t))return[t,t,t,t];if(De(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 t=t.getLocalBounds(),t=O([t.min,t.max],2),e=O(t[0],2),n=e[0],e=e[1],t=O(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function $b(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Kb(t,e,n){void 0===n&&(n=!0);var e=e||(null==(e=t.match(/^([a-z][a-z0-9]+)/))?void 0:e[0])||"",t=t.replace(new RegExp("^(".concat(e,")")),"");return n?(e=t).toString().charAt(0).toLowerCase()+e.toString().slice(1):t}function w(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=O(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&Kb(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat($b(e)))?a[n]=t:a[n.replace(new RegExp($b(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=Kb(n,r))&&"function"==typeof t||(a[e]=t))}),a}function Zb(t,r){return Object.entries(t).reduce(function(t,e){var e=O(e,2),n=e[0],e=e[1];return n.startsWith("show")?t["show".concat(r).concat(n.slice(4))]=e:t["".concat(r).concat($b(n))]=e,t},{})}function Jb(t,n){void 0===n&&(n=["x","y","class","className"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function Qb(o,t){if(t)try{var e=t.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=(r=o).getBBox()).width,a=r.height,[(r=O([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",e)}catch(t){}}t(e2,t2=z.CustomElement),Object.defineProperty(e2.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=nb(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e2.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e2.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e2.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},e2.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){Jv(this,"hidden"!==this.attributes.visibility)}.call(this)},e2.prototype.update=function(t,e){return this.attr(fb({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},e2.prototype.clear=function(){this.removeChildren()},e2.prototype.bindEvents=function(t,e){};var t2,Jo=e2;function e2(t,e){t=t2.call(this,fb({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function n2(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"]]}function r2(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function i2(t,e,n){return[["M",t-n,e],["L",t+n,e]]}ts=n2,vs=i2;function a2(t){n="default",Fe(e=t)&&e instanceof Image?n="image":Re(e)?n="symbol":Ye(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}t(l2,o2=Jo),l2.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=at(t,["symbol","size"]),o=a2(r);Ob(!!o,x(e),function(t){t.maybeAppendByClassName("marker",o).attr("className","marker ".concat(o,"-marker")).call(function(t){var e,n;"image"===o?t.styles({img:r,width:e=2*i,height:e,x:-i,y:-i}):(e=i/2,n=Re(r)?r:l2.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},l2.MARKER_SYMBOL_MAP=new Map,l2.registerSymbol=function(t,e){l2.MARKER_SYMBOL_MAP.set(t,e)},l2.getSymbol=function(t){return l2.MARKER_SYMBOL_MAP.get(t)};var o2,s2=l2;function l2(){return null!==o2&&o2.apply(this,arguments)||this}s2.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]]}),s2.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),s2.registerSymbol("line",r2),s2.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),s2.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]]}),s2.registerSymbol("circle",n2),s2.registerSymbol("point",ts),s2.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"]]}),s2.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"]]}),s2.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"]]}),s2.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),s2.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"]]}),s2.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"]]}),s2.registerSymbol("line",r2),s2.registerSymbol("dot",i2),s2.registerSymbol("dash",vs),s2.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]]}),s2.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]]}),s2.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]]}),s2.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]]}),s2.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]]});t(h2,c2=z.DisplayObject),h2.prototype.render=function(){var t=this.attributes.columns;x(this.columnsGroup).selectAll(".column").data(t.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()})},h2.prototype.update=function(t){this.attr(fb({},this.attributes,t)),this.render()},h2.prototype.clear=function(){this.removeChildren()};var c2,u2=h2;function h2(t){var e=this,n=t.style,t=at(t,["style"]);return(e=c2.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new z.Group({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(p2,f2=z.DisplayObject),p2.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},p2.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},p2.prototype.update=function(t){this.attr(fb({},this.attributes,t)),this.render()},p2.prototype.renderLines=function(t){x(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()})},p2.prototype.renderAreas=function(t){x(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()})};var f2,d2=p2;function p2(t){var e=this,n=t.style,t=at(t,["style"]);return(e=f2.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new z.Group),e.areasGroup=e.appendChild(new z.Group),e.render(),e}function g2(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return v([e===n?"M":"L"],O(t),!1)});return e?t.reverse():t}function y2(t,e){if(void 0===e&&(e=!1),t.length<=2)return g2(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];un(a,n.slice(-2))||n.push.apply(n,v([],O(a),!1))}var o=Fb(n,!1);return e?o.unshift(v(["M"],O(t[r-1]),!1)):o.unshift(v(["M"],O(t[0]),!1)),o}function m2(t,e,n){t=nn(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function v2(t){return 0===t.length?[0,0]:[He(function(t,e){if(De(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Re(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return He(t)||0})),Ge(function(t,e){if(De(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Re(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return Ge(t)||0}))]}function b2(t){for(var e=nn(t),n=e[0].length,t=O([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}t(M2,x2=Jo),Object.defineProperty(M2.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=nn(t),Xe(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"data",{get:function(){return this.attributes.isStack?b2(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"baseline",{get:function(){var t=this.scales.y,e=O(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"linesStyle",{get:function(){var n=this,t=this.attributes,e=t.type,r=t.isStack,i=t.smooth;if("line"!==e)throw new Error("linesStyle can only be used in line type");var a,o,s,l,c,u,h,f,d,p=w(this.attributes,"area"),g=w(this.attributes,"line"),t=this.containerShape.width,e=this.data;return 0===e[0].length?{lines:[],areas:[]}:(a=this.scales,u=a.x,a=a.y,e=e,o=(u={type:"line",x:u,y:a}).x,s=u.y,l=(u=O(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=O([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),qe(s.map(t),c,l)]})}),u=[],p&&(e=this.baseline,u=r?(i?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=y2(o),l=void 0,l=0===i?m2(s,e,n):(a=y2(t[i-1],!0),o=o[0],a[0][0]="L",v(v(v([],O(s),!1),O(a),!1),[v(["M"],O(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=g2(t[i]),s=void 0,s=0===i?m2(o,e,n):((a=g2(t[i-1],!0))[0][0]="L",v(v(v([],O(o),!1),O(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return m2((h?y2:g2)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?y2:g2)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(M2.prototype,"columnsStyle",{get:function(){var i=this,a=w(this.attributes,"column"),t=this.attributes,o=t.isStack;if("column"!==t.type)throw new Error("columnsStyle can only be used in column type");var t=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=b2(s));var e=this.createScales(s),l=e.x,c=e.y,e=O(v2(s),2),n=e[0],e=e[1],u=new Z1({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return m(m({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),M2.prototype.render=function(t,e){this.container=qb(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=qb(e,".".concat(r),function(){return new("line"===n?d2:u2)({className:r,style:i})}).styles(i).node()},M2.prototype.getColor=function(t){var e=this.attributes.color;return De(e)?e[t%e.length]:Re(e)?e.call(null,t):e},M2.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,i=n.range,i=void 0===i?[]:i,a=n.isGroup,n=n.spacing,o=this.containerShape,s=o.width,o=o.height,l=O(v2(t),2),c=l[0],l=l[1],c=new Z1({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new Z1({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new F1({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},M2.tag="sparkline";var x2,w2=M2;function M2(t){return x2.call(this,t,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff"})||this}function O2(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=O(t,1)[0];return!e.includes(t)})),Object.fromEntries(e.map(function(t){var e;return"boolean"!=typeof(e=n)&&"enter"in e&&"update"in e&&"exit"in e?!1===n[t]?[t,!1]:[t,m(m({},n[t]),r)]:[t,r]}))):{enter:!1,update:!1,exit:!1}}function k2(t,e){t?t.finished.then(e):e()}function E2(t,e){"update"in t?t.update(e):t.attr(e)}function S2(t,e,n){return 0===e.length?null:n?t.animate(e,n):(E2(t,{style:e.slice(-1)[0]}),null)}function _2(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=O(t,2),n=t[0],t=t[1];p(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?S2(r,[i,a],m({fill:"both"},e)):(E2(r,a),null)}function A2(t,e){return t.style.opacity||(t.style.opacity=1),_2(t,{opacity:0},e)}var T2,P2={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},C2={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},L2={orientation:"horizontal",showLabel:!0,type:"start"},N2=hb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),j2=hb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),R2=(t(I2,T2=Jo),I2.prototype.render=function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orientation,t=at(t,["size","radius","orientation"]),a=2.4*n,r=x(e).maybeAppendByClassName(j2.iconRect,"rect").styles(m(m({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(j2.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(j2.iconLine,"-2"),"line").styles(m({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},I2);function I2(){return null!==T2&&T2.apply(this,arguments)||this}t(F2,B2=Jo),F2.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=w(this.attributes,"label"),i=r.transform,r=O(Jb(at(r,["transform"]),[]),2),a=r[0],r=r[1],t=x(t).maybeAppendByClassName(j2.labelGroup,"g").styles(r),r=m(m({},C2),a),o=r.text,s=at(r,["text"]);Ob(!!n,t,function(t){e.label=t.maybeAppendByClassName(j2.label,"text").styles(m(m({},s),{transform:i,text:"".concat(o)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},F2.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},P2),w(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new R2({style:n})}:e;x(t).maybeAppendByClassName(j2.iconGroup,"g").selectAll(j2.icon.class).data([r]).join(function(t){return t.append(r).attr("className",j2.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},F2.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var B2,D2=F2;function F2(t){return B2.call(this,t,L2)||this}t(G2,z2=Jo),Object.defineProperty(G2.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=w(this.attributes,"sparkline"),m(m({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=O(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(G2.prototype,"availableSpace",{get:function(){var t=O(Xb(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),G2.prototype.getValues=function(){return this.values},G2.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attributes.values=t=void 0===t?[0,0]:t;t=!1!==e&&this.attributes.animate;_2(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},G2.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(_2(this.startHandle,this.getHandleStyle("start"),t),_2(this.endHandle,this.getHandleStyle("end"),t))},G2.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.attr("values",t),this.setValues(t),e&&this.onValueChange(n)},G2.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=w(this.attributes,"track");this.trackShape=x(t).maybeAppendByClassName(N2.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},G2.prototype.renderSparkline=function(t){var n=this;Ob("horizontal"===this.attributes.orientation,x(t).maybeAppendByClassName(N2.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(N2.sparkline,function(){return new w2({style:e})}).update(e)})},Object.defineProperty(G2.prototype,"selectionStyle",{get:function(){var t=w(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),G2.prototype.renderHandles=function(){var t,e=this,n=(this.attributes.showHandle?["start","end"]:[]).map(function(t){return{type:t}}),r=this;null!=(t=this.foregroundGroup)&&t.selectAll(N2.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new D2({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(N2.handle.name," ").concat(e,"-handle")),"".concat(e,"Handle"));(r[t]=this).addEventListener("pointerdown",function(t){r.onDragStart(e)(t)})})},function(t){return t.each(function(t){t=t.type;this.update(r.getHandleStyle(t))})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");r[t]=void 0}).remove()})},G2.prototype.renderSelection=function(t){this.foregroundGroup=x(t).maybeAppendByClassName(N2.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(N2.selection,"rect").styles(this.selectionStyle),this.renderHandles()},G2.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},G2.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=O(this.range,2),r=n[0],n=n[1],i=O(this.getValues().map(function(t){return Bb(t,e)}),2),a=i[0],i=i[1],t=O((t||[a,i]).map(function(t){return Bb(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=O([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},G2.prototype.calcMask=function(t){var t=O(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},G2.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=O(this.clampValues(),2),o=a[0],a=a[1],t=("start"===t?o:a)*this.getOrientVal([i,e]);return{x:n+this.getOrientVal([t,i/2]),y:r+this.getOrientVal([e/2,t])}},G2.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},G2.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,h=c.formatter,c=c.autoFitLabel,f=w(this.attributes,"handle"),d=w(f,"label"),f=f.spacing,p=this.getHandleSize(),g=this.clampValues(),h=h("start"===t?g[0]:g[1]),g=new ib({style:m(m(m({},d),this.inferTextStyle(t)),{text:h})}),d=g.getBBox(),y=d.width,d=d.height;return g.destroy(),c?(c=g=0,l=(e=this.availableSpace).width,e=e.height,n=(a=this.calcMask()).x,r=a.y,i=a.width,a=a.height,o=f+p,"horizontal"===u?(s=o+y/2,g="start"===t?0<n-o-y?-s:s:y<l-n-i-o?s:-s):(l=d+o,c="start"===t?d<r-p?-l:o:d<e-(r+a)-p?l:-o),{x:g,y:c,text:h}):(n=f+p+("horizontal"===u?y/2:0),(i={text:h})["horizontal"===u?"x":"y"]="start"===t?-n:n,i)},G2.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=w(this.attributes,"handleLabel"),m(m(m({},e),this.calcHandleText(t)),this.inferTextStyle(t))):{}},G2.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=w(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return m({cursor:n,shape:t,size:r},e)},G2.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,e=e.orientation,r=this.calcHandlePosition(t),i=this.calcHandleText(t);return m(m(m(m({},Zb(this.getHandleIconStyle(),"icon")),Zb(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},G2.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,t=t.height;return e||Math.floor((this.getOrientVal([+t,+n])+4)/2.4)},G2.prototype.getOrientVal=function(t){var t=O(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},G2.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=O(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},G2.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},G2.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new z.CustomEvent(n,{detail:t}))})},G2.prototype.bindEvents=function(){var t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},G2.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},G2.tag="slider";var z2,W2=G2;function G2(t){var a=z2.call(this,t,m(m(m({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",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]},Zb(L2,"handle")),Zb(P2,"handleIcon")),Zb(C2,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(wb(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(wb(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new z.CustomEvent("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(Y2,H2=Jo),Object.defineProperty(Y2.prototype,"padding",{get:function(){return Xb(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"value",{get:function(){var t=this.attributes.value,e=O(this.range,2),n=e[0],e=e[1];return qe(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=O(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=O(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(Y2.prototype,"thumbRadius",{get:function(){var t,e=this.attributes,n=e.isRound,e=e.thumbRadius;return n?(t=(n=this.availableSpace).width,n=n.height,e||this.getOrientVal([n,t])/2):0},enumerable:!1,configurable:!0}),Y2.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=O(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},Y2.prototype.getValue=function(){return this.value},Y2.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=w(this.attributes,"track"),o=w(this.attributes,"thumb"),s=m(m({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:e,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Zb(a,"track")),Zb(o,"selection"));this.slider=x(t).maybeAppendByClassName("scrollbar",function(){return new W2({style:s})}).update(s).node()},Y2.prototype.render=function(t,e){this.renderSlider(e)},Y2.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=O(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(qe(t,i,r)),e),this.onValueChange(n)},Y2.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},Y2.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},Y2.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)},Y2.tag="scrollbar";var H2,V2=Y2;function Y2(t){var a=H2.call(this,t,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.attributes.value;t!==e&&(a.dispatchEvent(new z.CustomEvent("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new z.CustomEvent("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=O(a.getLocalPosition(),2))[0],e=e[1],n=(i=O(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(wb(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new z.CustomEvent("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new z.CustomEvent("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new z.CustomEvent("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new z.CustomEvent("trackMouseleave",{detail:t.detail}))},a}var q2={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 z.Path({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",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",tickStrokeOpacity:.65,labelOverlap:[]},X2=(ot({},q2,{style:{type:"arc"}}),ot({},q2,{style:{}}),hb({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis")),U2=hb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function $2(t){return t.reduce(function(t,e,n){return t.push(v([0===n?"M":"L"],O(e),!1)),t},[])}function K2(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?$2(r):e?(i=Rb(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(v(["M"],O(e),!1)):t.push(v(["A",i,i,0,0,a],O(e),!1)),t},[])):[]):$2(t)}function Z2(t,e,n){function r(t,e){return[l,t,c,e,s].flat()}var i=n.type,a=n.connect,o=n.center,s=n.closed?[["Z"]]:[],n=O([K2(t,n),K2(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=O([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([v(["L"],O(e),!1)],[v(["L"],O(t),!1)]);if(o)return a=(n=O([Rb(e,o),Rb(t,o)],2))[0],i=n[1],r([v(["A",a,a,0,0,1],O(e),!1),v(["L"],O(e),!1)],[v(["A",i,i,0,0,0],O(t),!1),v(["L"],O(t),!1)]);throw new Error("Arc grid need to specified center")}function J2(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=[],l=0;l<e.length-1;l++){var c=O([e[l].points,e[l+1].points],2),c=Z2(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(U2.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=ub(t,[t,e,s]);this.attr(t)}).attr("className",U2.region.name)},function(t){return t.transition(function(t,e){return _2(this,ub(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=A2(this,r.exit);return k2(e,function(){return t.remove()}),e})}).transitions()}t(ex,Q2=Jo),ex.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=at(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=O(e,1)[0];return m(m({},t),{points:v(v([],O(e),!1),[n],!1)})}):s),l=x(e).maybeAppendByClassName(U2.lineGroup,"g"),e=x(e).maybeAppendByClassName(U2.regionGroup,"g"),o=(l=l,r=o,i=(n=t).animate,a=s.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:K2(t.points,n)}}),l.selectAll(U2.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=ub(Wb(m({path:t.path},r)),[t,e,a]);this.attr(m({class:U2.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return _2(this,ub(Wb(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=A2(this,i.exit);return k2(e,function(){return t.remove()}),e})}).transitions()),l=J2(e,s,t);return v(v([],O(o),!1),O(l),!1)};var Q2,tx=ex;function ex(){return null!==Q2&&Q2.apply(this,arguments)||this}function nx(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=O(t,2);return[t[0],ub(t[1],e)]}))}function rx(t,e){return e&&Re(e)?t.filter(e):t}var ix=an(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),ax=an(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=O(e.startPos,2))[0],n=n[1],i=O(e.endPos,2),Ib([(r=O([i[0]-r,i[1]-n],2))[0],r[1]])):(i=ob(ix(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n,r,i,a="linear"===(n=e).type?(a=n.startPos,r=n.endPos,v(v([],O(a),!1),O(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,v(v([a,r],O(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function ox(t,e,n){t=ax(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function sx(t,e){return ox(t,e.labelDirection,e)}var lx=an(function(t,e){var n=O(e.startPos,2),r=n[0],n=n[1],e=O(e.endPos,2),e=O([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return v(v([t],O(e.startPos),!1),O(e.endPos),!1).join()}),cx=an(function(t,e){var n=e.radius,r=O(e.center,2),i=r[0],r=r[1],t=ob(ix(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return v([t,e.startAngle,e.endAngle,e.radius],O(e.center),!1).join()});function ux(t,e){return("linear"===e.type?lx:cx)(t,e)}function hx(t){return 0===ax(0,t)[1]}function fx(t){return 0===ax(0,t)[0]}function dx(t,e){return e-t==360}function px(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=O([i,i],2),l=s[0],s=s[1],c=O([ob(t),ob(e)],2),u=c[0],c=c[1],h=O(a(u),2),f=h[0],h=h[1],d=O(a(c),2),p=d[0],d=d[1];return dx(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=O(a((c+u)/2),2))[0],c[1]],["A",l,s,0,1,0,p,d]]:(u=180<o?1:0,c=e<t?0:1,"M".concat(f,",").concat(h,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function gx(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(X2.line.class).data([{path:px.apply(void 0,v(v([l,c],O(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",X2.line.name).styles(e).styles({path:function(t){return t.path}})},function(t){return t.transition(function(){var t,r,e,n,i,a=this,o=(o=(i=(i=t=this).attributes).startAngle,e=i.endAngle,n=i.center,i=i.radius,o=v(v([o,e],O(n),!1),[i],!1),e=v(v([l,c],O(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=Sb(o,e),o=Math.ceil(+i/16),i=new Array(o).fill(0).map(function(t,e,n){return{__keyframe_data__:r(e/(n.length-1))}}),t.animate(i,m({fill:"both"},n))):(t.attr("__keyframe_data__",e),null));return o&&(o.onframe=i=function(){var t=hn(a.attributes,"__keyframe_data__");a.style.path=px.apply(void 0,v([],O(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function yx(t){var t=O(t,2),e=O(t[0],2),n=e[0],e=e[1],t=O(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function mx(e,t,n,r){function i(t){return e.selectAll(X2.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(X2.line.name," ").concat(t.className)}).styles(n).transition(function(t){return _2(this,yx(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return _2(this,yx(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,h=t.truncRange,f=t.lineExtension,d=O([c,u],2),p=O(d[0],2),g=p[0],p=p[1],d=O(d[1],2),y=d[0],d=d[1],u=O(f?(c=O([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=O(c[0],2))[0],u=u[1],m=(a=O(c[1],2))[0],a=a[1],v=(c=O(c[2],2))[0],c=c[1],f=(m=O([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=O([-v/u,c/u],2))[0],c=m[1],[v*f,v*a,c*f,c*a]):new Array(4).fill(0),4),m=u[0],v=u[1],f=u[2],c=u[3];return l&&h?(u=(a=O(h,2))[0],l=a[1],o=(u=O([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=O([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:X2.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:X2.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:X2.line.name}])}function vx(t,e,n){var r,i,a,o,s,l=e.type,c=w(e,"line"),n=("linear"===l?mx:gx)(t,e,Db(c,"arrow"),n);return t=t,l=l,c=c,r=(e=e).showArrow,i=e.showTrunc,a=e.lineArrow,o=e.lineArrowOffset,s=e.lineArrowSize,l="arc"!==l&&i?t.select(X2.lineSecond.class):t.select(X2.line.class),!r||!a||"arc"===e.type&&dx(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=Mb(a)).attr(c),Gb(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function bx(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function xx(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=O(ux(t,i),2),r=n[0],n=n[1],t=O(Pb(ox(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function wx(t,e,n,r){var i=w(n,"grid"),a=i.type,o=i.areaFill,s=bx(n),l=rx(e,n.gridFilter),e=("segment"===a?xx:function(t,o){var s,l,c=o.gridControlAngles,e=bx(o);if(!e)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(c&&0!==c.length)return e=O(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=O(ux(t.value,o),2),n=t[0],t=t[1],n=O([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=ob(t),t=O([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];a.push([r*e-i*t+s,r*t+i*e+l])}),{points:a,id:e}});throw new Error("Invalid gridControlAngles")})(l,n),c=m(m({},i),{center:s,areaFill:Re(o)?l.map(function(t,e){return ub(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(X2.grid.class).data([1]).join(function(t){return t.append(function(){return new tx({style:c})}).attr("className",X2.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(Ox.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Ox.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),Ox.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*r-t*i+l,t*r+s*i+e],[s*a-t*i+l,t*a+s*i+e]]},Ox.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},Ox.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var Mx=Ox;function Ox(t,e,n,r){this.set(t,e,n,r)}function kx(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=O(r.min,2),a=i[0],i=i[1],r=O(r.max,2),o=r[0],r=r[1],s=Ex(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=vb(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?h=(a+o)/2:"right"!==p&&"end"!==p||(h=o),"middle"===(p=d.style.textBaseline)?f=(i+r)/2:"bottom"===p&&(f=r)),O(Xb(e),4)),d=o[0],p=void 0===d?0:d,r=o[1],e=void 0===r?0:r,d=o[2],r=o[3],o=new Mx((c+=a)-(void 0===r?e:r),(u+=i)-p,c+l+e,u+s+(void 0===d?p:d));return t.setEulerAngles(n),o.rotatedPoints(ob(n),h,f)}function Ex(t){return t.__bbox__||t.getBBox()}function Sx(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 _x(t,e,n){t=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0==t?0:t<0?2:1}function Ax(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,l,c=[e,[9999,e[1]]],u=0,h=0;do{var f=[t[h],t[(h+1)%n]];if(i=c,l=s=o=a=void 0,a=_x((r=f)[0],r[1],i[0]),o=_x(r[0],r[1],i[1]),s=_x(i[0],i[1],r[0]),l=_x(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&Sx(r,i[0])||0===o&&Sx(r,i[1])||0===s&&Sx(i,r[0])||!(0!==l||!Sx(i,r[1]))){if(0===_x(f[0],e,f[1]))return Sx(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function Tx(t,e,n){var r,i=t.x1,a=t.x2,o=t.y1,t=t.y2,o=[[i,o],[a,o],[a,t],[i,t]],a=kx(e,n);return r=o,a.every(function(t){return Ax(r,t)})}function Px(t,c){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 t=t,n=(e=O(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=O(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function Cx(t,e,l){function n(t,e){if(t){var n,r,i=Xb(l),t=kx(t,i).flat(1),a=kx(e,i).flat(1),e=[[t[0],t[1],t[2],t[3]],[t[0],t[1],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[2],t[3],t[6],t[7]]];try{for(var o=I(e),s=o.next();!s.done;s=o.next())if(Px(a,s.value))return}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return 1}var r,i,a,o,s,c,u,h,f,d,p,g,y=e.crossPadding,m=new Set,v=null,b=(y=y,f=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===f?(f=e.center,h=e.radius,u=(f=O(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=O(Xb(y),4))[0],s=d[1],c=d[2],d=d[3],new Mx(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=O(e.startPos,2))[0],o=d[1],s=(u=O(e.endPos,2))[0],f=u[1],c=(h=O(fx(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=Pb(sx(0,e),p),(e=new Mx(a,o,s,f)).x1+=y,e.y1+=c,e.x2+=d+h[0],e.y2+=u+h[1],e)));try{for(var x=I(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!Tx(b,g)?m.add(M):!v||n(v,M)?v=M:(m.add(v),m.add(M))}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}return Array.from(m)}function Lx(t,e){return void 0===e&&(e={}),p(t)?0:"number"==typeof t?t:Math.floor(yb(t,e))}var Nx=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(Zv(t),1))})};var jx=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,u,h=Nx,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,v([1],O(t.map(function(t){return Ex(t).width})),!1));for("linear"===n.type&&(hx(n)||fx(n))&&(s=Ub(t[0]).left,l=Ub(t[i-1]).right,l=Math.abs(l-s)||1,d=Math.max(Math.floor(i*y/l),d)),a&&(c=p.splice(0,1)[0]),o&&(u=p.splice(-1,1)[0],p.reverse()),f(p);d<t.length&&Cx((u?v(v([u],O(g),!1),[c],!1):v([c],O(g),!1)).filter(gb),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=h(f(p),{seq:d}),d++}}],["rotate",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.rotate(t,+e)})}var a,o,s=void 0===(s=e.optionalAngles)?[0,45,90]:s,l=e.margin,e=void 0===(e=e.recoverWhenFailed)||e,c=t.map(function(t){return t.getLocalEulerAngles()});try{for(var u=I(s),h=u.next();!h.done;h=u.next())if(i(h.value),Cx(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}e&&i(c)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i=void 0===(a=e.suffix)?"...":a,a=e.minLength,o=void 0===(o=e.maxLength)?1/0:o,s=void 0===(s=e.step)?" ":s,l=void 0===(e=e.margin)?[0,0,0,0]:e,e=mb(r.getTextShape(t[0])),c=Lx(s,e),u=a?Lx(a,e):c,s=Lx(o,e),h=(!p(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return Ex(t).width}))),t.slice()),f=((a=O(l,4))[0],a[1],a[2],a[3],s);u+c<f;f-=c){var d=function(e){if(h.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(h=Cx(t,n,l)).length<1)return{value:void 0}}(f);if("object"==typeof d)return d.value}}],["wrap",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.wrap(t,l,e,d)})}var a,o,s,l=void 0===(u=e.wordWrapWidth)?50:u,c=void 0===(u=e.maxLines)?3:u,u=void 0===(u=e.recoverWhenFailed)||u,h=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),f=Math.min.apply(Math,v([],O(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&hx(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),Cx(t,n,h).length<1)return;u&&i(e)}}]]);function Rx(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=jx.get(e);!function(t,e,n){if(!(e.labelOverlap.length<1))if("hide"===n){for(var r=t[0];r;){if("offscreen"===r.className)return;r=r.parent}return 1}else return"rotate"===n?!t.some(function(t){return!(null==(t=t.attr("transform"))||!t.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||1<t.filter(function(t){return t.querySelector("text")}).length}(r,i,e)||null==n||n(r,t,i,a)})}function Ix(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var Bx=an(function(t,e){var t=O(t,2),n=t[0],t=t[1],e=O(e,2),r=e[0],e=e[1],n=O([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return v(v([],O(t),!1),O(e),!1).join()});function Dx(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=sx(t.value,n),t=ax(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?Bx([1,0],e):Bx([t[0]<0?-1:1,0],t),kb(n=((n=sb(r))+360)%180,-90,90)||(n+=180),n))}function Fx(t,e,n){var r=n.type,i=n.labelAlign,t=sx(t,n),n=Ix(e),e=Ix(sb(Bx([1,0],t))),a="center",o="middle";return"linear"===r?[90,270].includes(e)&&0===n?(a="center",o=1===t[1]?"top":"bottom"):e%180||![90,270].includes(n)?0===e?(kb(n,0,90,!1,!0)||kb(n,0,90)||kb(n,270,360))&&(a="start"):90===e?kb(n,0,90,!1,!0)?a="start":(kb(n,90,180)||kb(n,270,360))&&(a="end"):270===e?kb(n,0,90,!1,!0)?a="end":(kb(n,90,180)||kb(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(kb(n,0,90)||kb(n,270,360))&&(a="end")):a="center":"parallel"===i?o=kb(e,0,180,!0)?"top":"bottom":"horizontal"===i?kb(e,90,270,!1)?a="end":(kb(e,270,360,!1)||kb(e,0,90))&&(a="start"):"perpendicular"===i&&(a=kb(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function zx(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=ub(s,[t,l,e]),o=O([sx(t.value,n),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(o,a)],2),a=O(Cb(Pb(o[0],s+(1===o[1]?ub(r?i:0,[t,l,e]):0)),ux(t.value,n)),2);return{x:a[0],y:a[1]}}function Wx(t,e){"text"===t.nodeName&&t.attr(e)}function Gx(r){Rx(this.node().childNodes,r,{hide:Zv,show:Kv,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=Fx(t.__data__.value,e,n),(n=t.querySelector(X2.labelItem.class))&&Wx(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&xb(t,e,n)},wrap:function(t,e,n){var r;t&&bb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:t=void 0===(t=n)?2:t,textBaseline:r=void 0===r?"top":r})},getTextShape:function(t){return t.querySelector("text")}})}function Hx(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),h=x(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,Re(c)?function(){return Mb(ub(c,[a,o,s,sx(a.value,l)]))}:function(){return Mb(a.label||"")})).attr("className",X2.labelItem.name).node(),r=O(Jb(nx(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=at(n,["transform"]),f=(Qb(t,r),Dx(e,t,i));return t.setLocalEulerAngles(+f),Wx(h,m(m({},Fx(e.value,f,i)),u)),Qb(t,r),t.attr(n),h}function Vx(n,f,d,p){var t=rx(f,d.labelFilter),g=w(d,"label");return n.selectAll(X2.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",X2.label.name).transition(function(t){return Hx(this,t,f,g,d),this.attr(zx(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return Gx.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l,c=this.querySelector(X2.labelItem.class),u=Hx(this,t,f,g,d),h=(e=c,n=u,c=p.update,void 0===r&&(r="destroy"),u=n,"text"===(i=e).nodeName&&"text"===u.nodeName&&i.attributes.text===u.attributes.text?(e.remove(),[null]):(i=function(){"destroy"===r?e.destroy():"hide"===r&&Zv(e),n.isVisible()&&Kv(n)},c?(u=void 0===(u=c.duration)?0:u,a=void 0===(a=c.delay)?0:a,o=Math.ceil(+u/2),u=+u/4,s=(h=O((l=function(t){var e,n;return"circle"===t.nodeName?(n=(e=O(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],h=h[1],l=O(l(n),2),l=(s=O([(s+l[0])/2-s,(h+l[1])/2-h],2))[0],h=s[1],s=e.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(l,", ").concat(h,")")}],m(m({fill:"both"},c),{duration:a+o+u})),k2(l=n.animate([{opacity:0,transform:"translate(".concat(-l,", ").concat(-h,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],m(m({fill:"both"},c),{duration:o+u,delay:a+o-u})),i),[s,l]):(i(),[null]))),c=_2(this,zx(t,f,d),p.update);return this.__bbox__=t.bbox,v(v([],O(h),!1),[c],!1)}).call(function(t){var e,t=hn(t,"_transitions").flat().filter(gb);e=function(){return Gx.call(n,d)},0===(t=t).length?e():Promise.all(t.map(function(t){return null==t?void 0:t.finished})).then(e)})},function(t){return t.transition(function(){var t=this,e=A2(this.childNodes[0],p.exit);return k2(e,function(){return x(t).remove()}),e})}).transitions()}function Yx(t,e){return ox(t,e.tickDirection,e)}var qx=an(function(t,e){t=O(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return v(v([],O(t),!1),[e],!1).join()});function Xx(t,e,n,r,i,a,o){var s=Yx(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=O(qx(l,ub(a,[c,u,h])),2),a=O(l[0],2),c=a[0],u=a[1],h=O(l[1],2),{x1:c,x2:h[0],y1:u,y2:h[1]}),l=a.x1,c=a.x2,u=a.y1,h=a.y2,a=O(Jb(nx(o,[t,e,n,s])),2),o=a[0],t=a[1];"line"===r.node().nodeName&&r.styles(m({x1:l,x2:c,y1:u,y2:h},o)),i.attr(t),r.styles(o)}function Ux(t,e,n,r,i,a){o=x(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=Yx(s.value,u),u="line",Re(h)&&(u=function(){return ub(h,[s,l,c,f])});Xx(t,e,n,o.append(u).attr("className",X2.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=O(ux(t.value,r),2);return _2(this,{x:e[0],y:e[1]},a)}var $x=hb({text:"text"},"title");function Kx(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function Zx(r,t){t=Object.entries(t).reduce(function(t,e){var e=O(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(tw,Jx=Jo),tw.prototype.getAvailableSpace=function(){var t=this.attributes,r=t.width,i=t.height,e=t.position,n=t.spacing,t=t.inset,a=this.querySelector($x.text.class);if(!a)return new lb(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=O(Xb(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=O([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=Kx(e);if(a.includes("i"))return new lb(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=O(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=O([+r-o-h],1),p=n[0]),"b"===t&&(n=O([+i-s-l],1),g=n[0]),"l"===t&&(n=O(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=O(Xb(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=O([n+a,e+t],2),t=a[0],a=a[1];return new lb(f+n,d+e,p-t,g-a)},tw.prototype.getBBox=function(){return this.title?this.title.getBBox():new lb(0,0,0,0)},tw.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,at(t,["width","height","position","spacing"])),u=O(Jb(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=O([+h/2,+r/2],2),a=(i=O([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=Kx(t)).includes("l")&&(a=(n=O([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=O([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=O([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=O([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;Ob(!!c.text,x(e),function(t){l.title=t.maybeAppendByClassName($x.text,"text").styles(u).call(Zx,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var Jx,Qx=tw;function tw(t){return Jx.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}function ew(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=O(Jb(w(r,"title")),2),p=d[0],d=d[1],g=d.transform,d=at(d,["transform"]),d=(t.styles(p),e.styles(d),g||function(t,e,n){if((t=t.cloneNode(!0)).style.transform="scale(1, 1)",t.style.transform="none",t=t.getBBox().height,"vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(t/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(t/2,")")}return""}(t.node(),p.direction,p.position)),y=(Qb(t.node(),d),g=x(n._offscreen||n.querySelector(X2.mainGroup.class)),p=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=Kx(r),g=g.node().getLocalBounds(),s=(l=O(g.min,2))[0],l=l[1],c=(g=O(g.halfExtents,2))[0],g=g[1],u=(p=O(p.node().getLocalBounds().halfExtents,2))[0],p=p[1],l=(s=O([s+c,l+g],2))[0],s=s[1],m=(a=O(Xb(a),4))[0],h=a[1],f=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(y=n.startPos,n=n.endPos,n=(r=O("start"===r?[y,n]:[n,y],2))[0],y=(r=O(Pb(Ib([-(y=r[1])[0]+n[0],-y[1]+n[1]]),m),2))[0],r=r[1],{x:n[0]+y,y:n[1]+r}):(o.includes("t")&&(s-=g+p+m),o.includes("r")&&(l+=c+u+h),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=g+p+f),{x:l,y:s})),n=y.x,r=y.y,m=_2(e.node(),{x:n,y:r},i);return Qb(t.node(),d),m}function nw(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=Ob(n,t.maybeAppendByClassName(X2.lineGroup,"g"),function(t){return vx(t,e,s)})||[],r=Ob(r,t.maybeAppendByClassName(X2.tickGroup,"g"),function(t){return t=t,r=s,i=rx(o,(n=e).tickFilter),a=w(n,"tick"),t.selectAll(X2.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",X2.tick.name).transition(function(t,e){return Ux.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),Ux.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=A2(this.childNodes[0],r.exit);return k2(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=Ob(i,t.maybeAppendByClassName(X2.labelGroup,"g"),function(t){return Vx(t,o,e,s)})||[];return v(v(v([],O(n),!1),O(r),!1),O(i),!1).filter(function(t){return!!t})}t(aw,rw=Jo),aw.prototype.render=function(o,t,e){var s=this,n=o.titleText,r=o.data,i=o.animate,a=o.showTitle,l=o.showGrid,c=o.dataThreshold,u=o.truncRange,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}(r,c).filter(function(t){t=t.value;return!(u&&t>u[0]&&t<u[1])}),f=O2(void 0===e?i:e),r=Ob(l,x(t).maybeAppendByClassName(X2.gridGroup,"g"),function(t){return wx(t,h,o,f)})||[],c=x(t).maybeAppendByClassName(X2.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&nw(o,x(this.offscreenGroup),h,O2(!1)),nw(o,x(c.node()),h,f)),e=Ob(a,x(t).maybeAppendByClassName(X2.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(X2.title.class).data([{title:a}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(t){return t.append(function(){return Mb(a)}).attr("className",X2.title.name).transition(function(){return ew(x(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return ew(x(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return v(v(v([],O(r),!1),O(i),!1),O(e),!1).flat().filter(function(t){return!!t})};var rw,iw=aw;function aw(t){return rw.call(this,t,q2)||this}var ow,sw=hb({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"),lw=(t(cw,ow=Jo),Object.defineProperty(cw.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return qe(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=O((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,v([],O(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),cw.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(cw.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(cw.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),cw.prototype.getBBox=function(){var t=ow.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new lb(e,t,i+n.width,r)},cw.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this.currPage,i=this.playState,a=this.playWindow,o=this.pageViews;if("idle"!==i||t<0||o.length<=0||t>=o.length)return null;o[r].setLocalPosition(0,0),this.prepareFollowingPage(t);i=O(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=S2(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return k2(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},cw.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?null:(t=t?(n-1+e)%e:qe(n-1,0,e),this.goTo(t))},cw.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?null:(t=t?(n+1)%e:qe(n+1,0,e),this.goTo(t))},cw.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(sw.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},cw.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?Kv:Zv)(t)})},cw.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orientation,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,O("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=O(i.offset,3),o=O(a[0],2),s=o[0],c=o[1],l=O(a[1],2),r=l[0],o=l[1],l=O(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},cw.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(sw.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},cw.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orientation,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},cw.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=O(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},cw.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(sw.controller,"g");Jv(t.node(),u),u&&(u=w(this.attributes,"button"),e=w(this.attributes,"pageNum"),i=(u=O(Jb(u),2))[0],u=u[1],n=i.size,r=at(i,["size"]),i=!t.select(sw.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(sw.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(sw.prevBtn,"path"),u=t.maybeAppendByClassName(sw.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(sw.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),Gb(t.node(),n,!0)}),a=t.maybeAppendByClassName(sw.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(sw.pageInfo,"text").styles(e),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),i)&&(this.prevBtnGroup.addEventListener("click",function(){o.prev()}),this.nextBtnGroup.addEventListener("click",function(){o.next()}))},cw.prototype.render=function(t,e){e=x(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},cw.prototype.bindEvents=function(){var t=this,e=rn(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(z.ElementEvent.INSERTED,e),this.playWindow.addEventListener(z.ElementEvent.REMOVED,e)},cw);function cw(t){var e,n,t=ow.call(this,t,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:[["M",(t=0)-(n=6),(e=0)-n],["L",t+n,e],["L",t-n,e+n],["Z"]],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 t.playState="idle",t.contentGroup=t.appendChild(new z.Group({class:sw.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new z.Group({class:sw.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function uw(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}s2.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"]]}),s2.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),s2.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var hw=hb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");t(pw,fw=Jo),Object.defineProperty(pw.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(pw.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height;return{markerWidth:n,labelWidth:r,valueWidth:i,height:Math.max(n,t,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=O(Xb(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=O(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=O(this.span,2),a=(e=O([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=O(Xb(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=O(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(hw.marker.class))?t.style:{},e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,r=void 0===r?t.strokeWidth:r,i=e.markerLineWidth,i=void 0===i?t.lineWidth:i,e=e.markerStroke,t=void 0===e?t.stroke:e,e=+(r||i||(t?1:0))*Math.sqrt(2),r=this.markerGroup.node().getBBox(),i=r.width,t=r.height;return(1-e/Math.max(i,t))*n},enumerable:!1,configurable:!0}),pw.prototype.renderMarker=function(t){var f=this,d=this.attributes.marker,p=w(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(hw.markerGroup,"g").style("zIndex",0),Ob(!!d,this.markerGroup,function(){var t=f.markerGroup.node(),e=t.getElementsByClassName(hw.marker.name)[0],n=d();if(e)if(n.nodeName===e.nodeName){var r,i,a=e,o=(o=n).attributes;try{for(var s=I(Object.entries(o)),l=s.next();!l.done;l=s.next()){var c=O(l.value,2),u=c[0],h=c[1];"id"!==u&&"className"!==u&&a.attr(u,h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}x(e).styles(p)}else e.remove(),x(n).attr("className",hw.marker.name).styles(p),t.appendChild(n);else x(n).attr("className",hw.marker.name).styles(p),t.appendChild(n);f.markerGroup.node().scale(1/f.markerGroup.node().getScale()[0]),Gb(f.markerGroup.node(),f.scaleSize,!0)})},pw.prototype.renderLabel=function(t){var e=w(this.attributes,"label"),n=e.text,e=at(e,["text"]);this.labelGroup=t.maybeAppendByClassName(hw.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(hw.label,function(){return Mb(n)}).styles(e)},pw.prototype.renderValue=function(t){var e=this,n=w(this.attributes,"value"),r=n.text,i=at(n,["text"]);this.valueGroup=t.maybeAppendByClassName(hw.valueGroup,"g").style("zIndex",0),Ob(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(hw.value,function(){return Mb(r)}).styles(i)})},pw.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=w(this.attributes,"background");this.background=t.maybeAppendByClassName(hw.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(hw.background,"rect").styles(m({width:n,height:e},r))},pw.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=O(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),xb(this.labelGroup.select(hw.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),xb(this.valueGroup.select(hw.value.class).node(),Math.ceil(n)))},pw.prototype.render=function(t,e){e=x(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var fw,dw=pw;function pw(t){return fw.call(this,t,{span:[1,1],marker:function(){return new z.Circle({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function gw(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var yw,mw=hb({page:"item-page",navigator:"navigator",item:"item"},"items"),vw=(t(bw,yw=Jo),Object.defineProperty(bw.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(bw.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(bw.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=w(this.attributes,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:m({layout:o,labelText:r,valueText:i},Object.fromEntries(Object.entries(s).map(function(t){t=O(t,2);return[t[0],ub(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),bw.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=O(this.navigatorShape,1)[0],t=O(this.grid,2),y=t[0],m=t[1],v=m*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(m,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),O(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=O([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=O([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=O([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},bw.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=O(this.navigatorShape,1)[0],r=O(this.grid,2),s=r[0],l=r[1],r=O([e-t,n],2),c=r[0],u=r[1],e=O([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],m=e[6],v=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===m?0:o,i=m+r+n;return i<=c&&gw(g,function(t){return t<l})?(r=O([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=O([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&gw(y,function(t){return t<s})?(r=O([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=O([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],m=i[2],v=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(bw.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),bw.prototype.ifHorizontal=function(t,e){return uw(this.attributes.orientation,t,e)},bw.prototype.flattenPage=function(e){e.querySelectorAll(mw.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(mw.page.class).forEach(function(t){e.removeChild(t).destroy()})},bw.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));x(t).selectAll(mw.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new dw({style:t})}).attr("className",mw.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("pointerenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("pointerleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},bw.prototype.relayoutNavigator=function(){var t=this.attributes,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=O(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},bw.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=O(t,2);return{page:t[0],layouts:t[1]}}),u=v([],O(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new z.Group({className:mw.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=Ye(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(Fe(r[t])||(r[t]=Xe(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},bw.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=w(this.attributes,"nav"),r=fb({orientation:e},n),i=this;return t.selectAll(mw.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new lw({style:r})}).attr("className",mw.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},bw.prototype.getBBox=function(){return this.navigator.getBBox()},bw.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(x(e)),this.renderItems(n.getContainer()),this.adjustLayout())},bw.prototype.dispatchCustomEvent=function(t,e){t=new z.CustomEvent(t,{detail:e});this.dispatchEvent(t)},bw);function bw(t){t=yw.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:cn,mouseenter:cn,mouseleave:cn})||this;return t.navigatorShape=[0,0],t}var xw,ww=hb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Mw={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},Ow=(t(kw,xw=Jo),kw.prototype.render=function(t,e){var n=x(e).maybeAppendByClassName(ww.markerGroup,"g"),n=(this.renderMarker(n),x(e).maybeAppendByClassName(ww.labelGroup,"g"));this.renderLabel(n)},kw.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?uw(n,"horizontalHandle","verticalHandle"):e;Ob(!!i,t,function(t){var e=w(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(ww.marker,function(){return new s2({style:n})}).update(n)})},kw.prototype.renderLabel=function(t){var s=this,e=this.attributes,n=e.showLabel,l=e.orientation,r=e.spacing,c=void 0===r?0:r,u=e.formatter;Ob(n,t,function(t){var e=w(s.attributes,"label"),n=e.text,e=at(e,["text"]),r=(null==(r=t.select(ww.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=O(uw(l,[0,(void 0===r?0:r)+c,"center","top"],[(void 0===i?0:i)+c,0,"start","middle"]),4),i=r[0],a=r[1],o=r[2],r=r[3];t.maybeAppendByClassName(ww.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},kw);function kw(t){return xw.call(this,t,Mw)||this}var Ew,Ls={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Sw=fb({},Ls,{}),_w=fb({},Ls,Zb(Mw,"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"}),Aw=hb({title:"title",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"),Tw=(t(Pw,Ew=Jo),Pw.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=O(Jb(w(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(Aw.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(Aw.title,function(){return new Qx({style:s})}).update(s)},Pw.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=O(Jb(w(this.attributes,"title",!0)),2),o=a[0],a=a[1],s=m(m({},o),{width:i,height:e,x:0,y:0}),l=(this.itemsGroup=t.maybeAppendByClassName(Aw.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(Aw.items.class).data(["items"]).join(function(t){return t.append(function(){return new vw({style:s})}).attr("className",Aw.items.name).each(function(){l.items=x(this)})},function(t){return t.update(s)},function(t){return t.remove()})},Pw.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.title.node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(Pw.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new lb(0,0,n,t)},enumerable:!1,configurable:!0}),Pw.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),h=null==(h=this.items)?void 0:h.node();return u&&h?(h=h,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=h.getBBox(),t=Kx(t),e=(r=O(Xb(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=O(Xb(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=O([r+a,e+o],2))[0],e=r[1],r=(o=O([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new lb(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new lb(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=O([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new lb(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):Ew.prototype.getBBox.call(this)},Pw.prototype.render=function(t,e){var n=t.width,t=t.height,e=x(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},Pw);function Pw(t){return Ew.call(this,t,Sw)||this}var Cw,Lw={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",zIndex:999},Nw=hb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),jw=(t(Rw,Cw=Jo),Rw.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=O(Xb(i.padding),4))[0],e=i[1],n=i[2],i=i[3],a=(r=this.label.node().getLocalBounds()).min,r=r.max,i=[[a[0]-i,a[1]-o],[r[0]+e,r[1]+n]],a=this.getPath(t,i),o=w(this.attributes,"background"),this.background=x(this.group).maybeAppendByClassName(Nw.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},Rw.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=O(Jb(w(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,at(r,["text"]));this.label=x(this.group).maybeAppendByClassName(Nw.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(Nw.label,function(){return Mb(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},Rw.prototype.adjustLayout=function(){var t=O(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},Rw.prototype.getPath=function(n,t){var r=this,t=O(t,2),e=O(t[0],2),i=e[0],e=e[1],t=O(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=O(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[v(["M"],O(t[0]),!1),v(["L"],O(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},Rw.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=O(t,2))[0],t=t[1],r=(e=O(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,v([],O(t),!1)),t=O(t,2),r=O(t[0],2),i=r[0],r=r[1],t=O(t[1],2),a=t[0],t=t[1],a=O(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=O(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=O([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},Rw.prototype.bindEvents=function(){this.label.on(z.ElementEvent.BOUNDS_CHANGED,this.renderBackground)},Rw.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},Rw);function Rw(t){t=Cw.call(this,t,Lw)||this;return t.point=[0,0],t.group=t.appendChild(new z.Group({})),t.isMutationObserved=!0,t}function Iw(t,e){var t=O(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var Bw=hb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Dw(t){var e=t.orientation,n=t.size,t=t.length;return uw(e,[t,n],[n,t])}function Fw(t){var e=t.type,t=O(Dw(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function zw(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Re(r)?new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))}):r).length,l=l.map(function(t){return z.parseColor(t).toString()});return s?1===s?l[0]:n?(i=t,n=e,a=Array.from(l),o=i.length,new Array(o).fill(0).reduce(function(t,e,n){var r=a[n%a.length];return t+" ".concat(i[n],":").concat(r).concat(n<o-1?" ".concat(i[n+1],":").concat(r):"")},"l(".concat("horizontal"===n?"0":"270",")"))):l.reduce(function(t,e,n){return t+" ".concat(n/(s-1),":").concat(e)},"l(".concat(uw(e,"0","270"),")")):""}function Ww(t,e){var n,r,i,a=w(e,"selection"),o=zw(e),t=t.maybeAppendByClassName(Bw.selection,"path").styles(m({path:Fw(e),fill:o},a)),a=t.maybeAppendByClassName(Bw.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=O(Dw(o),2))[0],o=o[1],n=(e=O(e,2))[0],e=e[1],i=uw(a,n*r,0),n=uw(a,0,n*o),r=uw(a,e*r,r),[["M",i,n],["L",i,i=uw(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(Vw,Gw=Jo),Vw.prototype.render=function(t,e){var n,r,i=x(e).maybeAppendByClassName(Bw.trackGroup,"g");i=i,r=w(n=t,"track"),i.maybeAppendByClassName(Bw.track,"path").styles(m({path:Fw(n)},r)),Ww(x(e).maybeAppendByClassName(Bw.selectionGroup,"g"),t)};var Gw,Hw=Vw;function Vw(t){return Gw.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var Yw,qw,Xw,Uw,$w=an(function(t){return{min:Math.min.apply(Math,v([],O(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,v([],O(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),Kw=(t(y,Yw=Jo),Object.defineProperty(y.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),y.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new lb(0,0,e,t)},y.prototype.render=function(t,e){var n=this,t=t.showLabel,r=(this.renderTitle(x(e)),this.availableSpace),i=r.x,r=r.y,e=x(e).maybeAppendByClassName(Aw.contentGroup,"g").styles({x:i,y:r}),i=(Ob(!!t,e.maybeAppendByClassName(Aw.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(Aw.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(Aw.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(y.prototype,"range",{get:function(){var t=this.attributes.data;return $w(t)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonRange",{get:function(){var t=O(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=O(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),y.prototype.ifHorizontal=function(t,e){return uw(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},y.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=w(this.attributes,"title"),o=m(m({},a),{width:i,height:e,text:r}),s=this;t.selectAll(Aw.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new Qx({style:o})}).attr("className",Aw.title.name).each(function(){s.title=this})},function(t){return t.update(o)},function(t){return t.each(function(){s.title=void 0}).remove()})},Object.defineProperty(y.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new lb(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,t=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][t]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(X2.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new lb(0,0,t,e)),this.cacheLabelBBox):new lb(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelShape",{get:function(){var t,e=this.attributes,n=e.showLabel,e=e.labelSpacing,e=void 0===e?0:e;return n?{width:t=(n=this.labelBBox).width,height:n=n.height,size:this.ifHorizontal(n,t)+e+this.labelFixedSpacing,length:this.ifHorizontal(t,n)}:{width:0,height:0,size:0,length:0}},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,t=t.ribbonSize,n=this.availableSpace,r=n.width,n=n.height,i=this.labelShape,a=i.size,i=i.length,r=O(this.ifHorizontal([n,r],[r,n]),2),n=r[0],r=r[1],e=e?this.handleShape:{size:0,length:0},o=e.size,e=e.length,s=this.handleOffsetRatio,l=0,c=this.labelPosition,l=t||(["bottom","right"].includes(c)?Math.min(n-a,(n-o)/s):o<n*(1-s)?Math.max(n-a,0):Math.max((n-a-o)/s,0)),t=Math.max(e,i),n=r-t,o=O(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=O(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new lb(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,t=t.height;return this.ifHorizontal({size:t,length:e},{size:e,length:t})},enumerable:!1,configurable:!0}),y.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=w(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.length,h=h.size,d=fb({x:u,y:s,length:f,size:h,type:r,orientation:i,color:a,block:e,partition:n.map(function(t){return(t.value-l)/(c-l)}),range:this.ribbonRange},o);this.ribbon=t.maybeAppendByClassName(Aw.ribbon,function(){return new Hw({style:d})}).update(d)},y.prototype.getHandleClassName=function(t){return"".concat(Aw.prefix("".concat(t,"-handle")))},y.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=w(this.attributes,"handle"),r=O(this.selection,2),i=r[0],r=r[1],a=m(m({},n),{orientation:t}),t=n.shape,o="basic"===(void 0===t?"slider":t)?Ow:D2,s=this;this.handlesGroup.selectAll(Aw.handle.class).data(e?[{value:i,type:"start"},{value:r,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new o({style:a})}).attr("className",function(t){t=t.type;return"".concat(Aw.handle," ").concat(s.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(s[t]=this).addEventListener("pointerdown",s.onDragStart(e))})},function(t){return t.update(a).each(function(t){t=t.value;this.update({labelText:t})})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");s[t]=void 0}).remove()})},y.prototype.adjustHandles=function(){var t=O(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},y.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,t=t.orientation,n=O(this.getElementsByClassName(Aw.title.name),1)[0],r=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();n&&r&&"top-left"===e&&"horizontal"===t&&(e=O(r.getLocalBounds().min,1)[0],t=O(n.getLocalBounds().min,1)[0],n.style.x=+(this.style.x||0)+(e-t))},Object.defineProperty(y.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new lb(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,t=t.height,n=this.endHandle.getBBox(),r=n.width,n=n.height,e=O([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new lb(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=O(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),y.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,r=r.y,a=this.ribbonShape.size,e=this.getOffset(e),i=O(this.ifHorizontal([i+e,r+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,r+e]),2),a=i[0],r=i[1],e=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null!=e&&e.update({x:a,y:r,formatter:n})},y.prototype.renderIndicator=function(t){var e=w(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Aw.indicator,function(){return new jw({})}).update(e)},Object.defineProperty(y.prototype,"labelData",{get:function(){var s=this;return this.attributes.data.reduce(function(t,e,n,r){var i,a,o=null!=(o=null==e?void 0:e.id)?o:n.toString();return t.push(m(m({},e),{id:o,index:n,type:"value",label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:s.ribbonScale.map(e.value)})),n<r.length-1&&(i=r[n+1],a=((i=(r=O([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(m(m({},e),{id:o,index:n,type:"range",range:[i,r],label:[i,r].join("~"),value:s.ribbonScale.map(a)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelStyle",{get:function(){var t=O(["center","middle"],2),e=t[0],t=t[1],n=this.labelPosition;return"top"===n?t="bottom":"bottom"===n?t="top":"left"===n?e="end":"right"===n&&(e="start"),{labelTextAlign:e,labelTextBaseline:t}},enumerable:!1,configurable:!0}),y.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=w(this.attributes,"tick"),a=w(this.attributes,"label"),o=a.align,n=fb(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Zb(i,"tick"),Zb(a,"label"),{data:this.labelData}),i={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!r||r(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===o&&(!r||r(t,t.index,n.filter(function(t){return t.type===o})))},labelFormatter:e},s=m(m(m({},n),i),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Aw.label,function(){return new iw({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(y.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,t=t.tickLength,i=this.ribbonShape.size,a=this.labelPosition,o=this.labelFixedSpacing,s=O([0,0,0],3),l=s[0],s=(s[1],s[2]),t=null!=t?t:i;return e?(s=t,"positive"===n?"right"===a?s=l=t:"bottom"===a&&(l=s):"negative"!==n||"top"!==a&&"left"!==a||(l=i)):"positive"===n&&"right"!==a&&"bottom"===a&&(l=i+o),{offset:l,spacing:r,tickLength:s}},enumerable:!1,configurable:!0}),y.prototype.adjustLabel=function(){var t,e,n,r,i,a,o;this.attributes.showLabel&&(o=(a=this.ribbonBBox).x,t=a.y,i=a.width,a=a.height,e=(r=this.labelAxisStyle).offset,n=r.spacing,r=r.tickLength,a=(i=O(this.ifHorizontal([[o,t+e],[o+i,t+e]],[[o+e,t+a],[o+e,t]]),2))[0],o=i[1],this.label.update({startPos:a,endPos:o,tickLength:r,labelSpacing:n},!1))},y.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},y.prototype.showIndicator=function(t,e){var n,r,i,a;void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t?(i=(a=this.range).min,a=a.max,n=(r=this.ribbonBBox).x,r=r.y,t=qe(t,i,a),i=this.getOffset(t),a=this.ifHorizontal([i+n,r],[n,i+r]),this.indicator.update({x:a[0],y:a[1],position:this.ifHorizontal("top","left"),labelText:e}),Kv(this.indicator.node())):this.hideIndicator()},y.prototype.hideIndicator=function(){Zv(this.indicator.node())},y.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},y.prototype.setSelection=function(t,e){this.updateSelection(t,e)},y.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=O(this.selection,2),c=l[0],l=l[1],t=O([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=O((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=O(n,2))[0],n=n[1],a=(c=O(c,2))[0],c=c[1],o=(l=O(l,2))[0],l=l[1],c=(a=O([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=O([a,c],2))[0],a=u[1]),n-i<s?[i,n]:c<i?o===i&&l===a?[i,a]:[i,s+i]:n<a?l===n&&o===c?[c,n]:[n-s,n]:[Bb(c,r),Bb(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(y.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return en(t)?Bb(.01*(e-n),0):t},enumerable:!1,configurable:!0}),y.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?Iw(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},y.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=O(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,v([],O(wb(t)),!1));return qe(this.getOffset(i-a,!0),r,n)},y.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},y.prototype.dispatchSelection=function(){var t=new z.CustomEvent("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},y.prototype.dispatchIndicated=function(t,e){t=new z.CustomEvent("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},y);function y(t){var a=Yw.call(this,t,_w)||this;return a.eventToOffsetScale=new Z1({}),a.innerRibbonScale=new Z1({}),a.cacheLabelBBox=null,a.cacheHandleBBox=null,a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=Iw(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),O(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function Zw(t){qw||(qw=document.createElement("table"),Uw=document.createElement("tr"),Xw=/^\s*<(\w+|!)[^>]*>/,Uw={tr:document.createElement("tbody"),tbody:qw,thead:qw,tfoot:qw,td:Uw,th:Uw,"*":document.createElement("div")});var e=Xw.test(t)&&RegExp.$1,e=(e&&e in Uw||(e="*"),Uw[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}function Jw(t){return{CONTAINER:"".concat(t=void 0===t?"":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 Qw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(i5,t5=Jo),Object.defineProperty(i5.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),i5.prototype.getContainer=function(){return this.element},Object.defineProperty(i5.prototype,"position",{set:function(t){var t=O(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(i5.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(i5.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,o=t.template;return e.map(function(t,e){var n,r=t.name,r=void 0===r?"":r,i=t.color,i=void 0===i?"black":i,a=t.index,t=at(t,["name","color","index"]),r=m({name:r,color:i,index:null!=a?a:e},t);return Zw((i=o.item,n=r,i&&n?i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):i))})},enumerable:!1,configurable:!0}),i5.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},i5.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),t5.prototype.destroy.call(this)},i5.prototype.show=function(t,e){var n,r=this;void 0!==t&&void 0!==e&&(n=this.element.style.transition,this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(function(){r.element.style.transition=n},10)),this.element.style.visibility="visible"},i5.prototype.hide=function(){this.element.style.visibility="hidden"},i5.prototype.initShape=function(){var t=this.attributes.template;this.element=Zw(t.container),this.id&&this.element.setAttribute("id",this.id)},i5.prototype.renderCustomContent=function(){var t;(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey)&&(this.prevCustomContentKey=this.attributes.contentKey,t=this.attributes.content)&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))},i5.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=Jw(e.prefixCls),s=this.element;this.element.style.pointerEvents=i?"auto":"none",t?this.renderCustomContent():(n?(s.innerHTML=e.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=n):null!=(t=null==(i=s.getElementsByClassName(o.TITLE))?void 0:i[0])&&t.remove(),e=this.HTMLTooltipItemsElements,(n=document.createElement("ul")).className=o.LIST,n.replaceChildren.apply(n,v([],O(e),!1)),(i=this.element.querySelector(".".concat(o.LIST)))?i.replaceWith(n):s.appendChild(n)),r=s,Object.entries(a).forEach(function(t){var t=O(t,2),e=t[0],n=t[1];v([r],O(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})},i5.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=O(l,2),n=e[0],e=e[1],t=O(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},i5.prototype.setOffsetPosition=function(t){var t=O(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat(+(void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(+i+n+t,"px")},i5.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},i5.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=O(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.bounding,c=c.position;return f?(e=(n=this.element).offsetWidth,n=n.offsetHeight,h=(u=O([+u+l,+h+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=f.x,i=f.y,a={left:h<s,right:s+f.width<h+e,top:u<i,bottom:i+f.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},i5.tag="tooltip",e([(void 0===(e5=100)&&(e5=0),void 0===(n5=!0)&&(n5=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,n5&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},e5))})})],i5.prototype,"updatePosition",null);var t5,e5,n5,r5=i5;function i5(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=Jw(n);return(e=t5.call(this,t,{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(r.CONTAINER,'"></div>'),title:'<div class="'.concat(r.TITLE,'"></div>'),item:'<li class="'.concat(r.LIST_ITEM,'" data-index={index}>\n <span class="').concat(r.NAME,'">\n <span class="').concat(r.MARKER,'" style="background:{color}"></span>\n <span class="').concat(r.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(r.VALUE,'" title="{value}">{value}</span>\n </li>')},style:(t=Jw(t=void 0===(t=n)?"":t),(r={})[".".concat(t.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"},r[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},r[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},r[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},r[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},r[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},r[".".concat(t.NAME_LABEL)]=m({flex:1},Qw),r[".".concat(t.VALUE)]=m({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Qw),r[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r)})||this).prevCustomContentKey=e.attributes.contentKey,e.initShape(),e.render(e.attributes,e),e}t(o5,a5=z.Group),Object.defineProperty(o5.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Xb(t)},enumerable:!1,configurable:!0}),Object.defineProperty(o5.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Xb(t)},enumerable:!1,configurable:!0}),o5.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=O(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new lb(e-i,n-a,r+i+o,t+a+s)},o5.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,a5.prototype.appendChild.call(this,t,e),t},o5.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=O(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=O(this.$margin,4),s=o[0],o=o[3];return new lb(n+o,r+s,e-n-i,t-r-a)},o5.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:Ab,grid:Tb})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},o5.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},o5.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var a5,Ns=o5;function o5(t){var e=a5.call(this,t)||this,t=(e.layoutEvents=[z.ElementEvent.BOUNDS_CHANGED,z.ElementEvent.INSERTED,z.ElementEvent.REMOVED],e.$margin=Xb(0),e.$padding=Xb(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function s5(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return Ym()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[[0,0]]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=Py(l,t),t=Py(t,i),i=Py(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),Ym()(s)}const l5=xv(t=>{var e,n,r,i,a=t.attributes,{labelTransform:o,labelTransformOrigin:s,x:l,y:c,x0:u=l,y0:h=c,background:f,connector:d,startMarker:p,endMarker:g,coordCenter:y}=a,a=at(a,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]);[l,c,u,h].some(t=>!Xe(t))||(e=(n=st(a,"background"))["padding"],n=at(n,["padding"]),{points:r=[]}=i=st(a,"connector"),i=at(i,["points"]),u=[[+u,+h],[+l,+c]],h=lt(t).maybeAppend("text","text").style("zIndex",0).call(L,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},a)).node(),l=s5(lt(t).maybeAppend("background","rect").style("zIndex",-1).call(L,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(h,e)).call(L,f?n:{}).node(),u,r,y),c=p&&new s2({id:"startMarker",style:Object.assign({x:0,y:0},st(a,"startMarker"))}),o=g&&new s2({id:"endMarker",style:Object.assign({x:0,y:0},st(a,"endMarker"))}),lt(t).maybeAppend("connector","path").style("zIndex",0).style("path",l).style("markerStart",c).style("markerEnd",o).call(L,d?i:{}))}),c5=(s,t)=>{const l=t["coordinate"];return(t,e,n)=>{var{color:e,text:r="",fontSize:i,rotate:a=0,transform:o=""}=e,r={text:String(r),stroke:e,fill:e,fontSize:i},[[e,i]]=t;return lt(new l5).style("x",e).style("y",i).call(L,n).style("transform",o+`rotate(${+a})`).style("coordCenter",l.getCenter()).call(L,r).call(L,s).node()}};c5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const u5=xv(t=>{var e=at(t.attributes,["class","x","y"]);const n=st(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(lt(t).maybeAppend("marker",()=>new s2({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());lt(t).maybeAppend("text","text").style("x",i).style("y",a).call(L,e)}),h5=(t,e)=>{const i=at(t,[]);return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,text:r=""}=e,r={text:String(r),stroke:e,fill:e},[[e,t]]=t;return lt(new u5).call(L,n).style("x",e).style("y",t).call(L,r).call(L,i).node()}};h5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const f5=xv(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(L,i),lt(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(L,r)}),d5=(t,e)=>{const{curve:c,gradient:l=!1,defined:u=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,f=at(t,["curve","gradient","defined","connect"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r=n["color"],{color:r=r,seriesColor:i,seriesX:a,seriesY:o}=e,e=Wy(d,e),i=l&&i?By(i,a,o,l):r;const s=Object.assign(Object.assign(Object.assign(Object.assign({},n),{stroke:i,fill:i}),e&&{transform:e}),f);var[a,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,u),r=st(s,"connect"),n=!!o.length,i=t=>lt(p.createElement("path",{})).style("d",t||"").call(L,s).node();return Af(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=qm().curve(Xm),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,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 Km(a())},delete t.lineX0,t.lineEndAngle=function(){return Km(o())},delete t.lineX1,t.lineInnerRadius=function(){return Km(s())},delete t.lineY0,t.lineOuterRadius=function(){return Km(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e($m(t)):e()._curve},t.angle((t,e)=>Ly(Ay(r[e],n))).outerRadius((t,e)=>Py(r[e],n)).innerRadius((t,e)=>Py(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(u)).curve(c)(i);var e,a,o,s,l},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new f5).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(_f(d)?qm().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(u)):qm().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(u))).curve(c)(n)},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new f5).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},p5=(d5.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=Af(i)?sv:Gm;return d5(Object.assign({curve:e},n),r)(...t)}}),g5=(p5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"square"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=Af(a)?av:rv;return d5(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),y5=(g5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"smooth"}),(e,n)=>(...t)=>d5(Object.assign({curve:cv},e),n)(...t)),m5=(y5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"hvh"}),(e,n)=>(...t)=>d5(Object.assign({curve:uv},e),n)(...t)),v5=(m5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"vh"}),(e,n)=>(...t)=>d5(Object.assign({curve:hv},e),n)(...t)),b5=(v5.props=Object.assign(Object.assign({},d5.props),{defaultMarker:"hv"}),(e,n)=>{const{arrow:r=!1}=e;return(...t)=>$v(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)}),x5=(b5.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const o=at(t,[]),s=e["document"];return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,[t,i]=t,a=Cm();return a.moveTo(t[0],t[1]),a.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),lt(s.createElement("path",{})).call(L,n).style("d",a.toString()).style("stroke",e).style("transform",r).call(L,o).node()}});x5.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const w5=(t,e)=>{const{cornerRatio:u=1/3}=t,h=at(t,["cornerRatio"]),{coordinate:f,document:d}=e;return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=(t=t,l=l,r=f,i=u,o=Cm(),Af(r)?(a=Py(t,c=r.getCenter()),a=(Py(l,c)-a)*i+a,o.moveTo(t[0],t[1]),Iy(o,t,l,c,a)):_f(r)?(o.moveTo(t[0],t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,l[1])):(o.moveTo(t[0],t[1]),o.lineTo(t[0],t[1]+(l[1]-t[1])*i),o.lineTo(l[0],t[1]+(l[1]-t[1])*i)),o.lineTo(l[0],l[1]),o);return lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,h).node()}},M5=(w5.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const s=at(t,[]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r,i=n["color"],n=at(n,["color"]),{color:e=i,transform:i}=e,[t,a]=t,o=Cm();return o.moveTo(t[0],t[1]),Af(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):Iy(o,t,a,Ry(t,a),Py(t,a)/2),lt(c.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(L,s).node()}}),O5=(M5.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(u,t)=>{const{coordinate:h,document:f}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,src:r="",size:i=32,transform:a=""}=e,{width:o=i,height:i=i}=u,[[t,s]]=t,[l,c]=h.getSize(),o="string"==typeof o?Ah(o)*l:o,i="string"==typeof i?Ah(i)*c:i,l=t-Number(o)/2,c=s-Number(i)/2;return lt(f.createElement("image",{})).call(L,n).style("x",l).style("y",c).style("img",r).style("stroke",e).style("transform",a).call(L,u).style("width",o).style("height",i).node()}});O5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const k5=(i,t)=>{const{coordinate:a,document:o}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,t=function(i,t){const a=Cm();if(Af(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>Py(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?Iy(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,a);return lt(o.createElement("path",{})).call(L,n).style("d",t.toString()).style("stroke",e).style("fill",e).style("transform",r).call(L,i).node()}};k5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const E5=(t,e)=>{const a=at(t,[]),{coordinate:o,document:s}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:i}=e,t=function(t,e){var n,[t,r,i,a]=t,o=Cm();return Af(e)?(n=Py(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),Iy(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),Iy(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[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(t[0],t[1]),o.closePath()),o}(t,o);return lt(s.createElement("path",{})).call(L,n).style("d",t.toString()).style("fill",e||r).style("stroke",e||r).style("transform",i).call(L,a).node()}};E5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const S5=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,h=Cm(),Af(r)?([i,a]=r=r.getCenter(),o=Cy(Ay(t[0],r)),s=Cy(Ay(t[1],r)),g=Py(r,t[2]),l=Py(r,t[3]),c=Py(r,t[8]),u=Py(r,t[10]),r=Py(r,t[11]),h.moveTo(...t[0]),h.arc(i,a,g,o,s),h.arc(i,a,g,s,o,!0),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.arc(i,a,l,o,s),h.lineTo(...t[6]),h.arc(i,a,u,s,o,!0),h.closePath(),h.moveTo(...t[8]),h.arc(i,a,c,o,s),h.arc(i,a,c,s,o,!0),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.arc(i,a,r,o,s),h.arc(i,a,r,s,o,!0)):(h.moveTo(...t[0]),h.lineTo(...t[1]),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.lineTo(...t[5]),h.lineTo(...t[6]),h.lineTo(...t[7]),h.closePath(),h.moveTo(...t[8]),h.lineTo(...t[9]),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.lineTo(...t[13])),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};S5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _5=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,i=4,h=Cm(),Af(r)?([a,o]=r=r.getCenter(),s=Py(r,t[3]),l=Py(r,t[8]),g=Py(r,t[10]),c=(r=Cy(Ay(t[2],r)))-(u=Math.asin(i/l)),r+=u,h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.arc(a,o,s,c,r),h.lineTo(Math.cos(r)*g+a,Math.sin(r)*g+o),h.arc(a,o,g,r,c,!0),h.lineTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),u=(c+r)/2,h.moveTo(Math.cos(u)*(l+i/2)+a,Math.sin(u)*(l+i/2)+o),h.arc(Math.cos(u)*l+a,Math.sin(u)*l+o,i/2,u,2*Math.PI+u)):(h.moveTo(...t[2]),h.lineTo(...t[3]),h.lineTo(t[3][0]-i,t[3][1]),h.lineTo(t[10][0]-i,t[10][1]),h.lineTo(t[10][0]+i,t[10][1]),h.lineTo(t[3][0]+i,t[3][1]),h.lineTo(...t[3]),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(t[3][0]+i/2,t[8][1]),h.arc(t[3][0],t[8][1],i/2,0,2*Math.PI)),h.closePath(),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};_5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const A5=(t,e)=>{const{arrow:u,arrowSize:h=4}=t,f=at(t,["arrow","arrowSize"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r,i,a,{color:o,lineWidth:s}=n,n=at(n,["color","lineWidth"]),{color:o=o,size:s=s}=e,l=u?(l=p,r=h,i=Object.assign({fill:f.stroke||o,stroke:f.stroke||o},st(f,"arrow")),l.createElement("path",{style:Object.assign({path:`M ${r},${r} L -${r},0 L ${r},-${r} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(r=t,Af(i=d)?(i=i.getCenter(),Fm()({startAngle:0,endAngle:2*Math.PI,outerRadius:Py(r[0],i),innerRadius:Py(r[1],i)})):Ym().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,Af(c)?([c,a]=c.getCenter(),`translate(${c}, ${a}) `+(e||"")):e);return lt(p.createElement("path",{})).call(L,n).style("d",t).style("stroke",o).style("lineWidth",s).style("transform",c).style("markerEnd",l).call(L,f).node()}};function T5(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}A5.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const P5=xv(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=at(e,["points","class","endMarker","direction"]),i=st(e,"endMarker"),n=(n=n,Ym().x(t=>t[0]).y(t=>t[1])(n));lt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new s2({className:"marker",style:Object.assign(Object.assign({},i),{symbol:T5})}):null).call(L,e)});const C5=(t,e)=>{const{offset:o=0,connectLength1:s}=t,l=at(t,["offset","connectLength1"]),c=e["coordinate"];return(t,e,n)=>{var{color:r,connectLength1:i=s}=n,n=at(n,["color","connectLength1"]),{color:e,transform:a}=e,t=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(_f(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(c,t,o,i);return lt(new P5).call(L,n).style("points",t).style("stroke",e||r).style("transform",a).call(L,l).node()}};function L5(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function N5(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=Sd(a.x,c),i=Sd(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function j5(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:h}=Fy(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=I5(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?R5(s,f,n):Ry(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function R5(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function I5(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function B5(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Fy(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:I5(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=R5(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function D5(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function F5(t,e,n,r){var i=n["bounds"];return 1===i.length?D5(0,0,n):(Tf(r)?j5:Nf(r)?B5:N5)(t,e,n,r)}function z5(t,e,n){var{innerRadius:n,outerRadius:t}=Fy(n,t,[e.y,e.y1]);return n+(t-n)}function W5(t,e,n){var{startAngle:n,endAngle:t}=Fy(n,t,[e.y,e.y1]);return(n+t)/2}function G5(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,h=r.getCenter(),f=W5(e,n,r),d=0<Math.sin(f)?1:-1,i=I5(f,i,a),a={textAlign:0<d||Tf(r)?"start":"end",textBaseline:"middle",rotate:i},i=z5(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=R5(t,e,n),[t,r]=R5(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}C5.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var H5=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=gf(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=Cy(Ay(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:F5,bottomLeft:F5,bottomRight:F5,inside:F5,left:F5,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?D5(0,0,n):(Tf(r)?j5:Nf(r)?G5:N5)(t,e,n,r)},right:F5,spider:function(t,e,n,r){var i,a,o,s,l,c;return Nf(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=at(G5(0,e,n,r),[]),s=r.getCenter(),l=z5(e,n,r),e=W5(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return Nf(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=at(G5(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(Nf(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=Ly([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=R5(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:F5,topLeft:F5,topRight:F5});function V5(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:Nf(o)?"inside":_f(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=H5[L5(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const Y5=(s,t)=>{const{coordinate:l,theme:c}=t;return(t,e)=>{var{text:n,transform:r="",transformOrigin:i}=e,a=at(e,["text","x","y","transform","transformOrigin"]),t=V5(t,e,l,c,s),{rotate:e=0,transform:o=""}=t,t=at(t,["rotate","transform"]);return lt(new l5).call(L,t).style("text",""+n).style("labelTransform",(o+` rotate(${+e}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",l.getCenter()).call(L,a).node()}},q5=(Y5.props={defaultMarker:"point"},(t,e)=>{const o=t["colorAttribute"],s=at(t,["arrow","colorAttribute"]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color","stroke"]),{d:e,color:r=r}=e,[i,a]=l.getSize();return lt(c.createElement("path",{})).call(L,n).style("d","function"==typeof e?e({width:i,height:a}):e).style(o,r).call(L,s).node()}}),X5=(q5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>q5(Object.assign({colorAttribute:"fill"},t),e)),U5=(X5.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>q5(Object.assign({fill:"none",colorAttribute:"stroke"},t),e)),$5=(U5.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(s,t)=>{const l=t["document"];return(t,e,n)=>{var r=e["transform"],i=n["color"],n=at(n,["color"]),{color:e=i}=e,[t,...a]=t;const o=Cm();return o.moveTo(...t),a.forEach(([t,e])=>{o.lineTo(t,e)}),o.closePath(),lt(l.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e||i).style("fill",e||i).style("fillOpacity",.4).style("transform",r).call(L,s).node()}});function K5(t){var n,r,i,a=t||1;function o(t,e){++n>a&&(i=r,s(1),++n),r[t]=e}function s(t){n=0,r=Object.create(null),t||(i=Object.create(null))}return s(),{clear:s,has:function(t){return void 0!==r[t]||void 0!==i[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=i[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}function Z5(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}$5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},K5(3);const J5=function(n,r,t=16){const i=K5(t);return(...t)=>{var e=r(...t);i.get(e);return i.has(e)?i.get(e):(t=n(...t),i.set(e,t),t)}}((t,e,n)=>{var n=Z5(n,2*t,2*t),r=n.getContext("2d"),i=t,a=t;return 1===e?(r.beginPath(),r.arc(i,a,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(i,a,t*e,i,a,t)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*t,2*t)),n},t=>""+t);function Q5(t,e,n,r,i,a,o){a=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);a.minOpacity*=255,a.opacity*=255,a.maxOpacity*=255;var s=Z5(o,t,e).getContext("2d"),l=function(t,e){const n=(e=Z5(e,256,1).getContext("2d")).createLinearGradient(0,0,256,1);return("string"==typeof(t=t)?t.split(" ").map(t=>{var[t,e]=t.split(":");return[+t,e]}):t).forEach(([t,e])=>{n.addColorStop(t,e)}),e.fillStyle=n,e.fillRect(0,0,256,1),e.getImageData(0,0,256,1).data}(a.gradient,o);s.clearRect(0,0,t,e);{var c=s,u=n,h=r,f=i,d=o,p=(n=a)["blur"];let t=f.length;for(;t--;){var{x:g,y,value:m,radius:v}=f[t],m=Math.min(m,h),g=g-v,y=y-v,v=J5(v,1-p,d);c.globalAlpha=Math.max((m-u)/(h-u),.001),c.drawImage(v,g,y)}}r=function(t,e,n,r,i){var{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=(i=t.getImageData(0,0,e,n)).data,u=c.length;for(let t=3;t<u;t+=4){var h=c[t],f=4*h;f&&(h=o||Math.max(0,Math.min(s,Math.max(a,h))),c[t-3]=r[f],c[t-2]=r[1+f],c[t-1]=r[2+f],c[t]=l?r[3+f]:h)}return i}(s,t,e,l,a),i=Z5(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const tM=(t,e)=>{const{gradient:u,opacity:h,maxOpacity:f,minOpacity:d,blur:p,useGradientOpacity:g}=t,y=at(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:m,createCanvas:v,document:b}=e;return(t,e,n)=>{var r,i,e=e["transform"],[a,o]=m.getSize(),s=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),l=yf(t,t=>t[2]),t=pf(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?Q5(a,o,l,t,s,(r=c,i=t=>void 0===t,Object.keys(r).reduce((t,e)=>{var n=r[e];return i(n,e)||(t[e]=n),t},{})),v):{canvas:null};return lt(b.createElement("image",{})).call(L,n).style("x",0).style("y",0).style("width",a).style("height",o).style("src",l.canvas).style("transform",e).call(L,y).node()}},eM=(tM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const n=t["render"],r=at(t,["render"]);return t=>{var[[t,e]]=t;return n(Object.assign(Object.assign({},r),{x:t,y:e}))}}),nM=(eM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),rM=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:nM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:nM.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:nM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:nM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:nM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:nM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:nM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:nM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:nM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:nM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:nM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:nM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:nM.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:nM.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:nM.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:nM.BLACK,tickStrokeOpacity:.25,titleFill:nM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,labelAutoRotate:!1,tickDirection:"negative",titlePosition:"right",titleSpacing:0,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",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:nM.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:nM.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:nM.BLACK,navButtonFillOpacity:.65,navPageNumFill:nM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:nM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:nM.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:nM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:nM.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:nM.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:nM.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:nM.BLACK,tickStrokeOpacity:.25},label:{fill:nM.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:nM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:nM.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:nM.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:nM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:nM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{titleFill:nM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:nM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},iM=(rM.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),aM=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:iM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:iM.BLACK,lineWidth:1}},text:{text:{fill:iM.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:iM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:iM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:iM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:iM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:iM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:iM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:iM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:iM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:iM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:iM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:iM.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:iM.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:iM.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:iM.BLACK,tickStrokeOpacity:.25,titleFill:iM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:iM.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:iM.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:iM.BLACK,navButtonFillOpacity:.45,navPageNumFill:iM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:iM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:iM.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:iM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:iM.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:iM.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:iM.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:iM.BLACK,tickStrokeOpacity:.25},label:{fill:iM.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:iM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:iM.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:iM.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:iM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:iM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:iM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:iM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},oM=(aM.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),sM=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:oM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},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,connectFill:oM.BLACK,connectFillOpacity:.1}},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:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:oM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:oM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:oM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:oM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:oM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:oM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:oM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:oM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:oM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:oM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:oM.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:oM.STROKE,tickStrokeOpacity:1,titleFill:oM.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:oM.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:oM.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:oM.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:oM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:oM.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:oM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:oM.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:oM.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:oM.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!0,titleSpacing:4,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontWeight:"bold"},label:{fill:oM.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:oM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:oM.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:oM.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:oM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:oM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:oM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:oM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function lM(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}sM.props={};var cM,uM=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function hM(t){var e;if(e=uM.exec(t))return new fM({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]});throw new Error("invalid format: "+t)}function fM(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 dM(t,e){var n,e=lM(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}hM.prototype=fM.prototype,fM.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 pM={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?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)=>dM(100*t,e),r:dM,s:function(t,e){var n,r,i=lM(t,e);return i?(n=i[0],(i=(i=i[1])-(cM=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+lM(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function gM(t){return t}var yM,mM=Array.prototype.map,vM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bM(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?gM:(s=mM.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",O=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?gM:(e=mM.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",E=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=hM(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,m=t.type,v=("n"===m?(p=!0,m="g"):pM[m]||(void 0===g&&(g=12),y=!0,m="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b="$"===e?i:/[%p]/.test(m)?a:"",x=pM[m],w=/[defgprs%]/.test(m);function n(t){var e,n,r,i=v,a=b;if("c"===m)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),y&&(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;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==h?!1:o)?"("===h?h:E:"-"===h||"("===h?"":h)+i,a=("s"===m?vM[8+cM/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?O+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(t=M(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&f&&(t=M(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return k(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=hM(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=lM(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=vM[8+e/3];return function(t){return n(r*t)+i}}}}function xM(t,e,n){return t.querySelector(e)?lt(t).select(e):lt(t).append(n)}function wM(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function MM(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};var a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","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)}Bo=bM({thousands:",",grouping:[3],currency:["$",""]}),yM=Bo.format,Bo.formatPrefix;class OM extends Ns{get child(){var t;return null==(t=this.children)?void 0:t[0]}update(t){var e,t=(this.attr(t),t)["subOptions"];null!=(e=this.child)&&e.update(t)}}class kM extends OM{update(t){var e=t["subOptions"];this.attr(t),null!=(t=this.child)&&t.update(e)}}function EM(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function SM(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i,crossPadding:a=0}=e,e=["top","bottom","center"].includes(e),[t,o]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:s}=n.props,r=(r||n||t)-2*a,n=i||s||o,[t,a]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:a,size:r,length:n}}function _M(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=at(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Qe(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function AM(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function TM(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function PM(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=Yh(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=t=>!(t instanceof Date)&&"object"==typeof t&&t?t:String(t),h=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,f=function(t,e){if(Af(e))return t=>t;var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new Z1({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),d=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return Lf(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new Z1({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new Z1({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return Af(s)||_f(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=f(a.map(t)+i);return{value:Tf(s)&&"center"===o||_f(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(h(TM(t),e,n)),id:String(e)}}):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0;return{value:d(f(a.map(t)+r)),label:u(h(TM(t),e,n)),id:String(e)}})}function CM(t,e,n){var r;return!(Af(r=e)&&_f(r)||Cf(e))&&(void 0===t?!!n.getTicks:t)}function LM(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+xd(e)]),Object.assign({},n,r)}(n,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(i=a)||i===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var NM,h=s=>i=>{const{labelFormatter:a,labelFilter:o=()=>!0}=i;return t=>{var[e]=t["scales"];const r=(null==(n=e.getTicks)?void 0:n.call(e))||e.getOptions().domain;var n="string"==typeof a?yM(a):a,n=Object.assign(Object.assign({},i),{labelFormatter:n,labelFilter:(t,e,n)=>o(r[e],e,r),scale:e});return s(n)(t)}};const jM=h(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:h,style:f={},title:d,tickCount:p,tickFilter:g,tickMethod:y,transform:m,indexBBox:v}=t,b=at(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],r=LM(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=AM(e);return t.includes("bottom")||t.includes("top")?n:e}(u,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("right"===t)return{endPos:[n,i+o],startPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("number"==typeof e){var[t,s]=r.getCenter(),[l,c]=jf(r);const[u,h]=Rf(r);var a=Math.min(a,o)/2,{insetLeft:o,insetTop:r}=r.getOptions(),l=l*a,c=c*a,[a,t]=[t+n-o,s+i-r],[n,o]=[Math.cos(e),Math.sin(e)];return{startPos:[a+c*n,t+c*o],endPos:[a+l*n,t+l*o],gridClosed:h-u==360,gridCenter:[a,t],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(h-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=PM(t,i,p,l,g,y,u,n),i=v?i.map((t,e)=>{e=v.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):i,i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,crossSize:h,titleText:wM(d),labelOverlap:function(t=[],e){if(0<t.length)return t;var{labelAutoRotate:t,labelAutoHide:e,labelAutoEllipsis:n,labelAutoWrap:r}=e;const i=[];var a=(t,e)=>{e&&i.push(t)};return a({type:"rotate",optionalAngles:[0,15,30,45,60,90]},t),a({type:"ellipsis",minLength:20},n),a({type:"hide"},e),a({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},r),i}(m,r),grid:CM(r.grid,n,t),gridLength:a,line:!0,indexBBox:v}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new iw({className:"axis",style:_M(i)})}}),RM=h(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:h={},indexBBox:f,title:d,grid:p=!1}=t,g=at(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=PM(t,i,c,s,l,u,o,n),i=f?t.map((t,e)=>{e=f.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):t,[t,a]=jf(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=Rf(i),[l,c]=AM(i),a={center:e,radius:a,startAngle:o,endAngle:s,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?({insetLeft:o,insetTop:s}=i.getOptions(),Object.assign(Object.assign({},a),{center:[e[0]-o,e[1]-s],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},a),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(o,e,t,a,n),{axis:t,axisArc:a={}}=r,n=_M(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:wM(d),grid:p},g),h)));return new iw({style:ln(n,["transform"])})}}),IM=(jM.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},RM.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>jM(Object.assign({},{crossPadding:50},e))(...t)),BM=(IM.props=Object.assign(Object.assign({},jM.props),{defaultPosition:"bottom"}),e=>(...t)=>jM(Object.assign({},{crossPadding:10},e))(...t));BM.props=Object.assign(Object.assign({},jM.props),{defaultPosition:"left"});const DM=a=>{const{important:o={}}=a,s=at(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return jM(Object.assign(Object.assign(Object.assign({},s),(e=a.orientation,(e%=2*Math.PI)==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)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[t]=r,r=t.getOptions().name;const[a,o]=Rf(n);var{axisRadar:t={}}=e;return Object.assign(Object.assign({},t),{grid:"position"===r,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{return(o-a)/i.count*e})})}(a,n,r,i)),o)}))(t)}};function FM(t,e,n,r,i={}){const a=(null==(e=null==(e=e["shape."+t])?void 0:e.props)?void 0:e.defaultMarker)||function(t){if(je(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=at(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=Tv.get(t)||Tv.get("point");return(...t)=>{return new z.Path({style:Object.assign(Object.assign({},o),{path:s(...t),stroke:s.style.includes("stroke")?a||r:"",fill:s.style.includes("fill")?a||n:"",lineWidth:s.style.includes("lineWidth")?i||2:0})})}}(a,i)(0,0,6)}function zM(t,{scales:e,library:n,markState:r}){const[i,a]=function(t,e){var n=EM(t,"shape"),r=EM(t,"color");const i=n?n.clone():null,a=[];for(const[c,u]of e){var o=c.type,s=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:u.data).map((t,e)=>{return i?i.map(t||"point"):(null==(t=null===c||void 0===c?void 0:c.style)?void 0:t.shape)||u.defaultShape||"point"});"string"==typeof o&&a.push([o,s])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const l=n.getOptions()["range"];return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){var r=l[t%l.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(e,r),o=(t,e)=>FM(t,n,0,0,{color:e}),s=t=>i+"."+a[t],l=t["itemMarker"];return EM(e,"shape")&&!l?(t,e)=>o(s(e),t.color):"function"==typeof l?(t,e)=>{e=l(t.id,e);return"string"==typeof e?o(e,t.color):e}:(t,e)=>o(l||s(e),t.color)}function WM(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i={itemMarker:zM(t,e),itemMarkerSize:(t=r,e=i.legendCategory.itemMarkerSize,(t=EM(t,"size"))?2*t.map(NaN):e),itemMarkerOpacity:function(t){if(t=EM(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const a="string"==typeof n?yM(n):n,o=EM(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:a(t),color:o.map(t)}))})}DM.props=Object.assign(Object.assign({},jM.props),{defaultPosition:"center"});const GM=o=>{const{layout:s,position:l,title:c,cols:u}=o,h=at(o,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),f=h["gridRow"];return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:e,height:i}=function(t,e,n){var r;if("center"===(r=e["position"])){r=t["bbox"];const{width:i,height:a}=r;return{width:i,height:a}}const{width:i,height:a}=SM(t,e,n);return{width:i,height:a}}(e,o,GM),a=MM(l,s),e=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(l)?"vertical":"horizontal",width:e,height:i,layout:void 0!==u?"grid":"flex"},void 0!==u&&{gridCol:u}),void 0!==f&&{gridRow:f}),{titleText:wM(c)}),WM(o,t)),{legendCategory:i={}}=n,t=_M(Object.assign({},i,e,h)),n=new kM({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new Tw({className:"legend-category",style:t})),n}};function HM(t,e,n,r,i){var a,e=e.thresholds,o=(a=r,t=>({value:t/a,label:String(t)}));return Object.assign(Object.assign({},t),{color:i,data:[n,...e,r].map(o)})}function VM(t){var t=t.getOptions()["domain"],[t,e]=[t[0],Ey(t)];return[t,e]}function YM(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.defaultColor;const s=e||(a=i,i=(e=n||r).getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[z.parseColor(a).toString()]})),e),[l,c]=VM(s);return Object.assign(Object.assign({},t),{data:s.getTicks().map(t=>({value:t})),color:new Array(o).fill(0).map((t,e)=>{var e=(c-l)/(o-1)*e+l,n=s.map(e);const i=r?r.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})})}function qM(t,e,n,r,i,a){var o=EM(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=SM(t,e,n);return e=r-2*i,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}(n,r,i);if(o instanceof ny){var r=o.getOptions()["range"],[i,s]=VM(o);if(o instanceof ay||o instanceof sy)return HM(n,o,i,s,r);{i=n;s=o;const l=[-1/0,...s.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},i),{data:l,color:r,labelFilter:(t,e)=>0<e&&e<l.length-1})}}return YM(n,o,EM(t,"size"),EM(t,"opacity"),e,a)}GM.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const XM=u=>{const{labelFormatter:h,layout:f,position:d,title:p,style:g}=u,y=at(u,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:t,value:e,theme:n,scale:r})=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,l=MM(d,f),{legendContinuous:c={}}=n,c=_M(Object.assign({},c,Object.assign(Object.assign({titleText:wM(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>yM(h)(t.label):h},qM(t,r,e,u,XM,n)),g),y)),t=new OM({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new Kw({style:c})),t}},UM=(XM.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>XM(Object.assign({},{block:!0},e))(...t)),$M=(UM.props=Object.assign(Object.assign({},XM.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=EM(e,"size");return XM(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),KM=($M.props=Object.assign(Object.assign({},XM.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>$M(Object.assign({},{block:!0},t)));function ZM(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"}}}KM.props=Object.assign(Object.assign({},XM.props),{defaultPosition:"top",defaultOrientation:"horizontal"});NM={render(t,e){const{y:n,width:r,title:i,subtitle:a}=t,o=t.style,{spacing:s=2,align:l="left"}=o,c=at(o,["spacing","align"]);t=st(c,"title");const u=st(c,"subtitle"),h=xM(e,".title","text").attr("className","title").call(L,Object.assign(Object.assign(Object.assign({},ZM(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();xM(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},ZM(0,h.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const JM=class extends z.CustomElement{constructor(t){super(t),this.descriptor=NM}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(ot({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},QM=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new JM({style:ot({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function tO(t){return t.getBandWidth}function eO(t,e,n){if(!tO(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=Wh(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function nO(t,e,n){if(!e)return t.getOptions().domain;if(!tO(t))return o=ef(e),n?([i]=o,r=t.getOptions()["range"],[r,a]=r,a=a<r?-1:1,[i,t.invert(t.map(i)+a*n)]):o;var r=t.getOptions()["domain"],i=e[0],a=r.indexOf(i);if(n){const s=a+Math.round(r.length*n);return r.slice(a,s)}var o=e[e.length-1];const s=r.indexOf(o);return r.slice(a,s+1)}function rO(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[eO(o,t,e),eO(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[nO(o,[t[0],e[0]]),nO(s,[t[1],e[1]])]}function iO(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}QM.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const aO=t=>{const{orientation:u,labelFormatter:h,style:f={},position:d}=t,p=at(t,["orientation","labelFormatter","size","style","position"]);return({scales:[n],value:t,theme:e,coordinate:r})=>{var t=t["bbox"],{width:i,height:a}=t,{slider:e={}}=e;const o=(null==(l=n.getFormatter)?void 0:l.call(n))||(t=>t.toString()),s="string"==typeof h?yM(h):h;var l="horizontal"===u;const c=_f(r)&&l;var{trackSize:r=e.trackSize}=f,[t,r]=function(t,e,n){var{x:t,y:r,width:i,height:a}=t;return"left"===e?[t+i-n,r]:"right"===e||"bottom"===e?[t,r]:"top"===e?[t,r+a-n]:void 0}(t,d,r);return new W2({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:r,trackLength:l?i:a,orientation:u,formatter:t=>{var e=s||o,t=c?1-t:t;return e(eO(n,t,!0))}},f),p))})}},oO=(aO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>aO(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),sO=(oO.props=Object.assign(Object.assign({},aO.props),{defaultPosition:"bottom"}),t=>aO(Object.assign(Object.assign({},t),{orientation:"vertical"}))),lO=(sO.props=Object.assign(Object.assign({},aO.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=at(t,["orientation","labelFormatter","style"]);return({scales:[t],value:e,theme:n})=>{var e=e["bbox"],{x:e,y:r,width:i,height:a}=e,{scrollbar:n={}}=n,{ratio:t,range:o}=t.getOptions(),i="horizontal"===s?i:a,a=i/t,[t,o]=o,t=t<o?0:1;return new V2({className:"g2-scrollbar",style:Object.assign({},n,Object.assign(Object.assign(Object.assign(Object.assign({},l),{x:e,y:r,trackLength:i}),c),{orientation:s,value:t,contentLength:a,viewportLength:i}))})}}),cO=(lO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>lO(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),uO=(cO.props=Object.assign(Object.assign({},lO.props),{defaultPosition:"bottom"}),t=>lO(Object.assign(Object.assign({},t),{orientation:"vertical"}))),hO=(uO.props=Object.assign(Object.assign({},lO.props),{defaultPosition:"left"}),t=>()=>new z.Group),fO=(hO.props={},(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}}),dO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},pO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}},gO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=_f(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},yO=o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:r,strokeOpacity:i,opacity:a}],Object.assign(Object.assign({},n),o))},mO=(yO.props={},o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:r,strokeOpacity:i,opacity:a},{fillOpacity:0,strokeOpacity:0,opacity:0}],Object.assign(Object.assign({},n),o))});function vO(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}mO.props={};const bO=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function xO(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function wO(t,e){var[n,r,i,t]=xO(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
|
|
2
2
|
M ${t} ${e}
|
|
3
3
|
L ${t+n} ${e}
|
|
4
4
|
L ${t+n} ${e+r}
|
|
5
5
|
L ${t} ${e+r}
|
|
6
6
|
Z
|
|
7
|
-
`}([f,d,h,s]))}c-=u,l+=1}return o}function MO(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function OO(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function kO(t){var e,t=z.convertToPath(t);if(t&&(OO(e=t,"m")&&OO(e,"M")))return t}function EO(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=kO(e),y=kO(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=xO(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(MO(p,i),xO(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},vO(i,bO)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},vO(p,bO))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(MO(o=new z.Path({style:Object.assign(Object.assign({},vO(c,bO)),{d:a})}),c),o);var m=[Object.assign({path:g},vO(e,bO)),Object.assign({path:y},vO(n,bO))],v=b.animate(m,r);return v.onfinish=()=>{b.style.transform="none",Md(b,n)},b.style.transform="none",v}}const SO=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:wO,n=Object.assign(Object.assign({},n),p),i=t["length"],a=e["length"];if(1===i&&1===a||1<i&&1<a)return[o]=t,[l]=e,EO(o,o,l,n);if(1===i&&1<a){var[o]=t;{var s=o,l=e,c=n,o=r;s.style.visibility="hidden";const f=o(s,l.length);return l.map((t,e)=>{return EO(t,new z.Path({style:Object.assign({path:f[e]},vO(s,bO))}),t,c)})}}if(1<i&&1===a){var[i]=e;{var a=t,u=i,h=n;const d=(e=r)(u,a.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:i=1}=u.style,e=u.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:i}],h);return[...a.map((t,e)=>{return EO(t,t,new z.Path({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},_O=(SO.props={},(m,v)=>{const b=(z.CSS.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:z.PropertySyntax.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!Af(b))return fO(m,v)(t,e,n);const i=b.getCenter();var{__data__:t,style:e}=r,{radius:e=0,inset:a=0,fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=e,{points:t,y:c,y1:u}=t;const h=Fm().cornerRadius(e).padAngle(a*Math.PI/180),f=Fy(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new z.Path({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=z.convertToPath(g);return g.style.transform="",t};e=[{waveInArcAngle:d+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:d+1e-4,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{waveInArcAngle:p,fillOpacity:o,strokeOpacity:s,opacity:l}],a=r.animate(e,Object.assign(Object.assign({},n),m));return a.onframe=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:Number(r.style.waveInArcAngle)}))},a.onfinish=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:p}))},a}}),AO=(_O.props={},s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o}],{width:i,height:a}=r.getBoundingClientRect(),o=(r.setOrigin([i/2,a/2]),r.animate(t,Object.assign(Object.assign({},n),s)));return o.finished.then(()=>r.setOrigin(0,0)),o}}),TO=s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,i=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:a,height:o}=r.getBoundingClientRect(),t=(r.setOrigin([a/2,o/2]),r.animate(i,Object.assign(Object.assign({},n),s)));return t.finished.then(()=>r.setOrigin(0,0)),t}},PO=i=>(t,e,n)=>{var[t]=t,r=(null==(r=t.getTotalLength)?void 0:r.call(t))||0;return t.animate([{lineDash:[0,r]},{lineDash:[r,0]}],Object.assign(Object.assign({},n),i))},CO=(PO.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new z.Path({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=fO(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),LO=(CO.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new z.Path({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=pO(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),NO=(LO.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function jO(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>jO(t,e,n,r))}function RO(t){jO(t,"visibility","hidden",!0)}function IO(t){jO(t,"visibility","visible",!0)}function BO(t){return lt(t).selectAll("."+ut).nodes().filter(t=>!t.__removed__)}function DO(t,e){return FO(t,e).flatMap(({container:t})=>BO(t))}function FO(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function zO(t){return lt(t).select("."+ht).node()}function WO(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getRenderBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function GO(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function HO(t){return t=>t.__data__.color}function VO(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function YO(t){t=Array.isArray(t)?t:[t];const r=new Map(t.flatMap(e=>{return Array.from(e.markState.keys()).map(t=>[e.key+","+t.key,t.data])}));return t=>{var{index:t,markKey:e,viewKey:n}=t.__data__;return r.get(n+","+e)[t]}}function qO(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",h="__ordinal__",i=t=>{var{[u]:e=[],[h]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),s[e]),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){a=t,o=r;var a=null!=(a=t.style[o])?a:NO[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[h]=n}},a=t=>{t[u]||(t[u]=[])};return{setState:(t,...e)=>{a(t),t[u]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[u].indexOf(r);-1!==n&&t[u].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[u].indexOf(e))}}function XO(t,e){var n=(Array.isArray(t)?t:[t]).flatMap(e=>e.marks.map(t=>[e.key+","+t.key,t.state])),r={};for(const i of e){const[l,c]=Array.isArray(i)?i:[i,{}];r[l]=n.reduce((t,e)=>{const[a,n={}]=e;e=void 0===(e=n[l])||"object"==typeof e&&0===Object.keys(e).length?c:n[l];for(const[r,o]of Object.entries(e)){const s=t[r];t[r]=(t,e,n,r)=>{var i=r.__data__.viewKey+","+r.__data__.markKey;return a!==i?null===s||void 0===s?void 0:s(t,e,n,r):"function"!=typeof o?o:o(t,e,n,r)}}return t},{})}return r}function UO(t,r){const i=new Map(t.map((t,e)=>[t,e])),a=r?t.map(r):t;return(t,e)=>{var n;return"function"!=typeof t?t:(n=i.get(e),t(r?r(e):e,n,a,e))}}function $O(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=at(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=ef(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=Cm();const s=e[t-1];var r=e[t],[r,i,a,o]=((t,e)=>{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),Oy(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=at(r,["fill"]),o=new z.Path({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function KO(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return Af(e)?(a=n.__data__["points"],[a,i]=_f(e)?Dy(a):a,r=Ay(a,a=e.getCenter()),i=Ay(i,a),a=Cy(r)+Ny(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):_f(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function ZO(t){var{document:o,background:e,scale:s,coordinate:l,valueof:c}=t,u=at(t,["document","background","scale","coordinate","valueof"]);const h="element-background";if(!e)return[()=>{},()=>{}];const r=(t,e,n)=>{var r=t.invert(e),e=e+t.getBandWidth(r)/2,t=t.getStep(r)/2,r=t*n;return[e-t+r,e+t-r]},f=(t,e)=>{var n=s["x"];return tO(n)?(t=t["__data__"],t=t["x"],[n,t]=r(n,t,e),[n,t]):[0,1]},d=(t,e)=>{var n=s["y"];return tO(n)?(t=t["__data__"],t=t["y"],[n,t]=r(n,t,e),[n,t]):[0,1]},p=(t,e)=>{var n=e["padding"],[r,i]=f(t,n),[n,a]=d(t,n),n=[[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),i=t["__data__"],{y:r,y1:a}=i;return dv(o,n,{y:r,y1:a},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=at(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=Oy(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=at(t,["fill","fillOpacity","zIndex","padding","strokeWidth"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i,padding:a,strokeWidth:o}),n=((()=>{var{x:t,y:e}=s;return[t,e].some(tO)})()?p:g)(e,t);n.className=h,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===h]}function JO(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function QO(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function tk(e,{elements:t,datum:a,groupKey:o=t=>t,link:n=!1,background:r=!1,delay:i=60,scale:s,coordinate:l,emitter:c,state:u={}}){const h=t(e),f=new Set(h),d=Kh(h,o);t=UO(h,a);const[p,g]=$O(Object.assign({elements:h,valueof:t,link:n,coordinate:l},st(u.active,"link"))),[y,m,v]=ZO(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},st(u.active,"background"))),{setState:b,removeState:x,hasState:w}=qO(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return KO(h[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(f.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of h)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&m(i);y(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},k=(t=!0)=>{for(const e of h)x(e,"active","inactive"),m(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},E=t=>{t=t.target;r&&!v(t)||(r||f.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{k(),M=null},i)):k())},S=()=>{k()},_=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||k(!1)}),A=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=QO(h,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",A),c.on("element:unhighlight",_),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",A),c.off("element:unhighlight",_);for(const t of h)m(t),g(t)}}function ek(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,h=at(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return tk(zO(t),Object.assign({elements:BO,datum:YO(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:XO(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function nk(t){return ek(Object.assign(Object.assign({},t),{createGroup:VO}))}function rk(t){return ek(Object.assign(Object.assign({},t),{createGroup:HO}))}function ik(e,{elements:t,datum:f,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:y,state:a={}}){const m=t(e),v=new Set(m),b=Kh(m,d);t=UO(m,f);const[x,w]=$O(Object.assign({link:p,elements:m,valueof:t,coordinate:n},st(a.selected,"link"))),[M,O]=ZO(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},st(a.selected,"background"))),{setState:k,removeState:o,hasState:E}=qO(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return KO(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),O(e);t&&y.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return S();if(g){var[r,i,a=!0]=[t,e,n];if(E(i,"selected"))S();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of m)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[f(i),...o.map(f)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(E(a,"selected")){if(!m.some(t=>!c.has(t)&&E(t,"selected")))return S();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?k(h,"selected"):E(h,"selected")||k(h,"unselected");!e&&p&&x(t),M(a)}o&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:m.filter(t=>E(t,"selected")).map(f)}}))}},l=(e.addEventListener("click",s),t=>{var{nativeEvent:t,data:e}=t;if(!t)for(const r of g?e.data.slice(0,1):e.data){var n=QO(m,r,f);s({target:n,nativeEvent:!1})}}),c=()=>{S(!1)};return y.on("element:select",l),y.on("element:unselect",c),()=>{for(const t of m)w(t);e.removeEventListener("click",s),y.off("element:select",l),y.off("element:unselect",c)}}function ak(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=at(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return ik(zO(t),Object.assign({elements:BO,datum:YO(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:XO(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function ok(t){return ak(Object.assign(Object.assign({},t),{createGroup:VO}))}function sk(t){return ak(Object.assign(Object.assign({},t),{createGroup:HO}))}function lk(t){var{wait:k=20,leading:E,trailing:S=!1,labelFormatter:_=t=>""+t}=t,A=at(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=ef(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=pf(Jh(t,t=>pf(t,t=>+f[t])/yf(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=zO(r),g=r.getElementsByClassName(ut);const y=Kh(r.getElementsByClassName(dt),t=>t.__data__.key.split("-")[0]),m=new z.Line({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},st(A,"rule"))}),v=new z.Text({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},st(A,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[Gh(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",_(e))};let w;var M;const O=fn(t=>{t=WO(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[Bh(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},k,{leading:E,trailing:S});return M=[0,0],$(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,M);x(M,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[Bh(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",O),p.addEventListener("pointermove",O),p.addEventListener("pointerleave",O),()=>{m.remove(),p.removeEventListener("pointerenter",O),p.removeEventListener("pointermove",O),p.removeEventListener("pointerleave",O)}}}function ck({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=zO(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=fn(t=>{var e,n,t=WO(a,t);t?([t,e]=t,(n=function(t){var{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);return r||(n.push(r={type:"fisheye"}),e.transform=n,t.coordinate=e,r)}(o)).focusX=t,n.focusY=e,n.visual=!0,i(o)):i(r)},l,{leading:c,trailing:u});return a.addEventListener("pointerenter",n),a.addEventListener("pointermove",n),a.addEventListener("pointerleave",n),()=>{a.removeEventListener("pointerenter",n),a.removeEventListener("pointermove",n),a.removeEventListener("pointerleave",n)}}}const uk=new Proxy({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"},{get(t,e){if(e in t)return t[e]},set(){return!0}});function hk(t,e){t=t.__data__;const{markKey:n,index:r,seriesIndex:i}=t;t=e.markState;const a=Array.from(t.keys()).find(t=>t.key===n);if(a)return i?i.map(t=>a.data[t]):a.data[r]}function fk(i,a,o,s=t=>!0){return t=>{var e,n,r;s(t)&&(o.emit("plot:"+i,t),r=t["target"],r)&&({className:e,markType:n}=r,"plot"!==e)&&("element"===e?(r=Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:hk(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function dk(){return(t,e,n)=>{const{container:r,view:i}=t,a=fk(uk.CLICK,i,n,t=>1===t.detail),o=fk(uk.DBLCLICK,i,n,t=>2===t.detail),s=fk(uk.POINTER_TAP,i,n),l=fk(uk.POINTER_DOWN,i,n),c=fk(uk.POINTER_UP,i,n),u=fk(uk.POINTER_OVER,i,n),h=fk(uk.POINTER_OUT,i,n),f=fk(uk.POINTER_MOVE,i,n),d=fk(uk.POINTER_ENTER,i,n),p=fk(uk.POINTER_LEAVE,i,n),g=fk(uk.POINTER_UPOUTSIDE,i,n),y=fk(uk.DRAG_START,i,n),m=fk(uk.DRAG,i,n),v=fk(uk.DRAG_END,i,n),b=fk(uk.DRAG_ENTER,i,n),x=fk(uk.DRAG_LEAVE,i,n),w=fk(uk.DRAG_OVER,i,n),M=fk(uk.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",h),r.addEventListener("pointermove",f),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",y),r.addEventListener("drag",m),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{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",h),r.removeEventListener("pointermove",f),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",y),r.removeEventListener("drag",m),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function pk({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,mount:c,bounding:u}){var h,f,d=t.getRootNode().defaultView.getConfig().container,c=(p=t,(c=c)?"string"==typeof c?document.querySelector(c):c:p.getRootNode().defaultView.getConfig().container),p=o?d:t,o=u||function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return{x:t,y:e,width:n-t,height:r-e}}(t),d=(u=c,t=(t=d).getBoundingClientRect(),u=u.getBoundingClientRect(),{x:t.x-u.x,y:t.y-u.y}),{tooltipElement:c=(t=c,u=n,c=r,h=s,f=l,o=o,d=d,u=new r5({className:"tooltip",style:{x:u,y:c,container:d,data:[],bounding:o,position:h,enterable:f,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}}),t.appendChild(u.HTMLTooltipElement),u)}=p,{items:d,title:o=""}=e;c.update(Object.assign({x:n,y:r,data:d,title:o,position:s,enterable:l},void 0!==i&&{content:i(a,{items:d,title:o})})),p.tooltipElement=c}function gk({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});n=t.getRootNode().defaultView.getConfig().container,r=(e?n:t).tooltipElement;r&&r.hide()}function yk(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function mk(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function vk(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof q1)&&!(t instanceof W1);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function bk(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function xk(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function wk(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=xk(t.map(t=>t.title),e).filter(Od),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(Od);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=bk(i),name:n}=t,t=at(t,["color","name"]),n=o?vk(s,r)||n:n||vk(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(mk);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:xk(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function Mk(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:h,insetTop:f}=n,n=at(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const d=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},n);n=e.map(t=>t[1]),e=e.map(t=>t[0]);const p=Mf(n),g=Mf(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=Cy(Ay([g,p],[u=s+h+a/2,h=l+f+o/2])),[u,u+n*Math.cos(a),h,h+n*Math.sin(a)]):c?[s,s+r,p+l,p+l]:[g+s,g+s,l,l+i];0<e.length&&((o=t.ruleY||(f=new z.Line({style:Object.assign({x1:y,x2:m,y1:v,y2:b},d)}),t.appendChild(f),f)).style.x1=y,o.style.x2=m,o.style.y1=v,o.style.y2=b,t.ruleY=o)}function Ok(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function kk(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function Ek(t,e){return void 0===t?e:t}function Sk(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function _k(p,t){var{elements:e,sort:g,filter:y,scale:m,coordinate:v,crosshairs:b,render:x,groupName:w,emitter:M,wait:n=50,leading:r=!0,trailing:i=!1,startX:O=0,startY:k=0,body:E=!0,single:S=!0,position:_,enterable:A,mount:T,bounding:P,disableNative:a=!1,style:o={}}=t,t=at(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","disableNative","style"]),e=e(p);const C=_f(v),L=Af(v);o=ot(o,t);const{innerWidth:D,innerHeight:F,width:z,height:W,insetLeft:G,insetTop:H}=v.getOptions(),N=[],j=[];for(const h of e){var s=h["__data__"],s=s["seriesX"];(s?N:j).push(h)}N.sort((t,e)=>{const n=C?0:1;var r=t=>t.getBounds().min[n];return C?r(e)-r(t):r(t)-r(e)});const V=new Map(N.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[ef(n.map((t,e)=>e),t=>n[+t]),n]]})),Y=st(o,"crosshairs");t=m.x;const R=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,I=t=>{var[t]=v.invert(t);return t-R},q=(t,e)=>{const n=C?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return ef([t[n],e[n]])})(t);return r>=t&&r<=e})},l=fn(t=>{var e=WO(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-O,e[1]-k];h;var n=q(h,j),r=[],i=[];for(const d of N){var[a,o]=V.get(d),a=((t,e,n)=>{var t=I(t),[r,i]=ef([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,Bh(t=>n[+t]).center)(e,t)]})(h,a,o);if(null!==a){r.push(d);o=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,e])=>{e=e[n];return[Ze(t.replace("series","")),e]}))})(d,a);const{x:c,y:u}=o;a=v.map([(c||0)+R,u||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const f=s[mf(s,t=>Math.abs(t-I(h)))];var s=i.filter(t=>t[0].x===f),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=wk(n,m,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),y&&(l.items=l.items.filter(y)),0===n.length||Sk(l)?B():(E&&pk({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:_,enterable:A,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),Mk(p,n,Object.assign(Object.assign({},Y),{plotWidth:D,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:O,startY:k,transposed:C,polar:L}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:eO(m.x,I(h),!0)}}})))}},n,{leading:r,trailing:i}),B=()=>{gk({root:p,single:S,emitter:M,mount:T}),b&&Ok(p)},c=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=m["x"],e=e.map(t),[t,e]=v.map([e,.5]),[n,r]=p.getRenderBounds()["min"],l({offsetX:t+n,offsetY:e+r}))},u=()=>{gk({root:p,single:S,emitter:M,nativeEvent:!1,mount:T})};return M.on("tooltip:show",c),M.on("tooltip:hide",u),a||(p.addEventListener("pointerenter",l),p.addEventListener("pointermove",l),p.addEventListener("pointerleave",B)),()=>{a||(p.removeEventListener("pointerenter",l),p.removeEventListener("pointermove",l),p.removeEventListener("pointerleave",B)),M.off("tooltip:show",c),M.off("tooltip:hide",u),yk(p),b&&Ok(p)}}function Ak(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:h,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:f=t=>t,single:d=!0,position:p,enterable:g,datum:y,view:m,mount:v,bounding:b,body:x=!0,disableNative:i=!1}){const w=t(a),M=new Set(w),O=Kh(w,f),k=fn(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=O.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(Od).map(t=>{var{color:e=bk(n)}=t,t=at(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(mk);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):wk(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),Sk(e))?gk({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&pk({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),h.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:hk(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&gk({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=QO(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),k({target:t,offsetX:e+r/2,offsetY:n+i/2}))},_=({nativeEvent:t}={})=>{t||gk({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",_),i||(a.addEventListener("pointerover",k),a.addEventListener("pointermove",k),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",k),a.removeEventListener("pointermove",k),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",_),yk(a)}}function Tk(t){const{shared:h,crosshairs:f,series:d,item:p=()=>({}),facet:g=!1}=t,y=at(t,["shared","crosshairs","series","name","item","facet"]);return(e,t,n)=>{var{container:r,view:i}=e;const{scale:a,markState:o,coordinate:s}=i;var l=kk(o,"seriesTooltip"),c=kk(o,"crosshairs"),r=zO(r),l=Ek(d,l);if(l&&Array.from(o.values()).some(t=>{var e;return(null==(e=t.interaction)?void 0:e.seriesTooltip)&&t.tooltip})&&!g)return _k(r,Object.assign(Object.assign({},y),{elements:BO,scale:a,coordinate:s,crosshairs:Ek(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=DO(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return _k(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:Ek(f,c),item:p,startX:l,startY:t,emitter:n}))}return Ak(r,Object.assign(Object.assign({},y),{datum:YO(i),elements:BO,scale:a,coordinate:s,groupKey:h?VO(i):void 0,item:p,emitter:n,view:i}))}}const Pk="legend-category",Ck="items-item",Lk="legend-category-item-marker",Nk="legend-category-item-label";function jk(t){return t.getElementsByClassName(Lk)[0]}function Rk(t){return t.getElementsByClassName(Nk)[0]}function Ik(t){return t.getElementsByClassName(Ck)}function Bk(t){return t.getElementsByClassName(Pk)}function Dk(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Fk(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,h=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,f={unselected:st(n,"marker")},n={unselected:st(n,"label")};const{setState:d,removeState:p}=qO(f,void 0),{setState:g,removeState:y}=qO(n,void 0),m=Array.from(e(t));let v=m.map(o);const b=()=>{for(const r of m){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),y):(d(e,"unselected"),g))(n,"unselected")}};for(const E of m){var x=()=>{JO(t,"pointer")},w=()=>{JO(t,"default")},M=n=>$(this,void 0,void 0,function*(){var t=o(E),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...m.map(o)),yield r(v),b(),n);t&&(v.length===m.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});E.addEventListener("click",M),E.addEventListener("pointerenter",x),E.addEventListener("pointerout",w),c.set(E,M),u.set(E,x),h.set(E,w)}const O=n=>$(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(v=t,yield r(v),b()))}),k=e=>$(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of m)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",h.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function zk(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=Bk(i);const l=(r,i)=>$(this,void 0,void 0,function*(){var t=a["scale"];const{[r]:n}=t;t=o.marks,t=t.map(t=>{var e;return"legends"===t.type?t:({transform:e=[]}=t,e=[{type:"filter",[r]:i},...e],ot({},t,{transform:e,scale:{[r]:{domain:n.getOptions().domain}},legend:{[r]:{preserve:!0}}}))}),t=Object.assign(Object.assign({},o),{marks:t});return s(t)}),n=t.map(t=>{const{name:e,domain:n}=Dk(t).scales[0];return Fk(i,{legends:Ik,marker:jk,label:Rk,datum:t=>{t=t.__data__,t=t.index;return n[t]},filter:t=>l(e,t),state:t.attributes.state,channel:e,emitter:r})});return()=>{n.forEach(t=>t())}}}function Wk(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=Bk(n);const o=BO(n);var s=XO(i,["active","inactive"]),l=UO(o,YO(r));const c=[];for(const d of t){const p=t=>{var e=d.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},g=Dk(d).scales[0].name,y=Ik(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=Kh(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=qO(s,l);var h={inactive:st(u,"marker")},u={inactive:st(u,"label")};const{setState:w,removeState:M}=qO(h),{setState:O,removeState:k}=qO(u),E=t=>{for(const r of y){var e=jk(r),n=Rk(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},S=(t,e)=>{var n=p(e),r=new Set(v.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");E(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},_=new Map;for(const C of y){var f=t=>{S(t,C)};C.addEventListener("pointerover",f),_.set(C,f)}const A=t=>{for(const e of o)x(e,"inactive","active");E(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},T=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=y.find(t=>p(t)===r))&&S({nativeEvent:!1},t)}},P=t=>{t=t.nativeEvent;t||A({nativeEvent:!1})};d.addEventListener("pointerleave",A),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(A),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of _)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function Gk(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const Hk=xv(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=at(e,["x","y","width","height","class","renders","handleSize","document"]);if(l&&void 0!==i&&void 0!==a&&void 0!==n&&void 0!==r){var u=s/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},f=st(Ed(c,"handleNW","handleNE"),"handleN"),{render:d=h}=f,f=at(f,["render"]),p=st(c,"handleE"),{render:g=h}=p,p=at(p,["render"]),y=st(Ed(c,"handleSE","handleSW"),"handleS"),{render:m=h}=y,y=at(y,["render"]),v=st(c,"handleW"),{render:b=h}=v,v=at(v,["render"]),x=st(c,"handleNW"),{render:w=h}=x,x=at(x,["render"]),M=st(c,"handleNE"),{render:O=h}=M,M=at(M,["render"]),k=st(c,"handleSE"),{render:E=h}=k,k=at(k,["render"]),S=st(c,"handleSW"),{render:h=h}=S,S=at(S,["render"]);var _=i=>()=>{return new(xv(t=>{return e=i,n=(t=t).id,r=at(t.attributes,["x","y"]),(e=e(t,Object.assign({x:0,y:0},r),l)).id=n,void(e.style.draggable=!0);var e,n,r}))({})},t=lt(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(Gk,Object.assign({width:i,height:a},Ed(c,"handle"))),t.maybeAppend("handle-n",_(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(Gk,f),t.maybeAppend("handle-e",_(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(Gk,p),t.maybeAppend("handle-s",_(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(Gk,y),t.maybeAppend("handle-w",_(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(Gk,v),t.maybeAppend("handle-nw",_(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,x),t.maybeAppend("handle-ne",_(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,M),t.maybeAppend("handle-se",_(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,k),t.maybeAppend("handle-sw",_(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,S)}});function Vk(l,t){var{brushed:a=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(l),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:u=!1,fill:n="#777",fillOpacity:r="0.3",stroke:i="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,f=at(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,y=null,m=null,v=!1;const[b,x,w,M]=s,O=(JO(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(y&&y.remove(),m&&m.remove(),d=[t,e],u)return I();B()}),I=()=>{m=new z.Path({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new Hk({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(m),l.appendChild(y)},B=()=>{y=new Hk({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},f),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(y)},k=(t=!0)=>{y&&y.remove(),m&&m.remove(),d=null,p=null,g=null,v=!1,y=null,m=null,e(t)},E=(t,e,n=!0)=>{var[t,e,r,i]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,r,i]=c(t,e,r,i,s);return(u?F:D)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},D=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},F=(t,e,n,r)=>{m.style.d=`
|
|
7
|
+
`}([f,d,h,s]))}c-=u,l+=1}return o}function MO(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function OO(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function kO(t){var e,t=z.convertToPath(t);if(t&&(OO(e=t,"m")&&OO(e,"M")))return t}function EO(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=kO(e),y=kO(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=xO(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(MO(p,i),xO(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},vO(i,bO)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},vO(p,bO))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(MO(o=new z.Path({style:Object.assign(Object.assign({},vO(c,bO)),{d:a})}),c),o);var m=[Object.assign({path:g},vO(e,bO)),Object.assign({path:y},vO(n,bO))],v=b.animate(m,r);return v.onfinish=()=>{b.style.transform="none",Md(b,n)},b.style.transform="none",v}}const SO=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:wO,n=Object.assign(Object.assign({},n),p),i=t["length"],a=e["length"];if(1===i&&1===a||1<i&&1<a)return[o]=t,[l]=e,EO(o,o,l,n);if(1===i&&1<a){var[o]=t;{var s=o,l=e,c=n,o=r;s.style.visibility="hidden";const f=o(s,l.length);return l.map((t,e)=>{return EO(t,new z.Path({style:Object.assign({path:f[e]},vO(s,bO))}),t,c)})}}if(1<i&&1===a){var[i]=e;{var a=t,u=i,h=n;const d=(e=r)(u,a.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:i=1}=u.style,e=u.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:i}],h);return[...a.map((t,e)=>{return EO(t,t,new z.Path({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},_O=(SO.props={},(m,v)=>{const b=(z.CSS.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:z.PropertySyntax.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!Af(b))return fO(m,v)(t,e,n);const i=b.getCenter();var{__data__:t,style:e}=r,{radius:e=0,inset:a=0,fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=e,{points:t,y:c,y1:u}=t;const h=Fm().cornerRadius(e).padAngle(a*Math.PI/180),f=Fy(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new z.Path({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=z.convertToPath(g);return g.style.transform="",t};e=[{waveInArcAngle:d+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:d+1e-4,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{waveInArcAngle:p,fillOpacity:o,strokeOpacity:s,opacity:l}],a=r.animate(e,Object.assign(Object.assign({},n),m));return a.onframe=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:Number(r.style.waveInArcAngle)}))},a.onfinish=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:p}))},a}}),AO=(_O.props={},s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o}],{width:i,height:a}=r.getBoundingClientRect(),o=(r.setOrigin([i/2,a/2]),r.animate(t,Object.assign(Object.assign({},n),s)));return o.finished.then(()=>r.setOrigin(0,0)),o}}),TO=s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,i=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:a,height:o}=r.getBoundingClientRect(),t=(r.setOrigin([a/2,o/2]),r.animate(i,Object.assign(Object.assign({},n),s)));return t.finished.then(()=>r.setOrigin(0,0)),t}},PO=i=>(t,e,n)=>{var[t]=t,r=(null==(r=t.getTotalLength)?void 0:r.call(t))||0;return t.animate([{lineDash:[0,r]},{lineDash:[r,0]}],Object.assign(Object.assign({},n),i))},CO=(PO.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new z.Path({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=fO(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),LO=(CO.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new z.Path({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=pO(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),NO=(LO.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function jO(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>jO(t,e,n,r))}function RO(t){jO(t,"visibility","hidden",!0)}function IO(t){jO(t,"visibility","visible",!0)}function BO(t){return lt(t).selectAll("."+ut).nodes().filter(t=>!t.__removed__)}function DO(t,e){return FO(t,e).flatMap(({container:t})=>BO(t))}function FO(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function zO(t){return lt(t).select("."+ht).node()}function WO(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getRenderBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function GO(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function HO(t){return t=>t.__data__.color}function VO(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function YO(t){t=Array.isArray(t)?t:[t];const r=new Map(t.flatMap(e=>{return Array.from(e.markState.keys()).map(t=>[e.key+","+t.key,t.data])}));return t=>{var{index:t,markKey:e,viewKey:n}=t.__data__;return r.get(n+","+e)[t]}}function qO(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",h="__ordinal__",i=t=>{var{[u]:e=[],[h]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),s[e]),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){a=t,o=r;var a=null!=(a=t.style[o])?a:NO[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[h]=n}},a=t=>{t[u]||(t[u]=[])};return{setState:(t,...e)=>{a(t),t[u]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[u].indexOf(r);-1!==n&&t[u].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[u].indexOf(e))}}function XO(t,e){var n=(Array.isArray(t)?t:[t]).flatMap(e=>e.marks.map(t=>[e.key+","+t.key,t.state])),r={};for(const i of e){const[l,c]=Array.isArray(i)?i:[i,{}];r[l]=n.reduce((t,e)=>{const[a,n={}]=e;e=void 0===(e=n[l])||"object"==typeof e&&0===Object.keys(e).length?c:n[l];for(const[r,o]of Object.entries(e)){const s=t[r];t[r]=(t,e,n,r)=>{var i=r.__data__.viewKey+","+r.__data__.markKey;return a!==i?null===s||void 0===s?void 0:s(t,e,n,r):"function"!=typeof o?o:o(t,e,n,r)}}return t},{})}return r}function UO(t,r){const i=new Map(t.map((t,e)=>[t,e])),a=r?t.map(r):t;return(t,e)=>{var n;return"function"!=typeof t?t:(n=i.get(e),t(r?r(e):e,n,a,e))}}function $O(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=at(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=ef(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=Cm();const s=e[t-1];var r=e[t],[r,i,a,o]=((t,e)=>{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),Oy(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=at(r,["fill"]),o=new z.Path({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function KO(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return Af(e)?(a=n.__data__["points"],[a,i]=_f(e)?Dy(a):a,r=Ay(a,a=e.getCenter()),i=Ay(i,a),a=Cy(r)+Ny(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):_f(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function ZO(t){var{document:o,background:e,scale:s,coordinate:l,valueof:c}=t,u=at(t,["document","background","scale","coordinate","valueof"]);const h="element-background";if(!e)return[()=>{},()=>{}];const r=(t,e,n)=>{var r=t.invert(e),e=e+t.getBandWidth(r)/2,t=t.getStep(r)/2,r=t*n;return[e-t+r,e+t-r]},f=(t,e)=>{var n=s["x"];return tO(n)?(t=t["__data__"],t=t["x"],[n,t]=r(n,t,e),[n,t]):[0,1]},d=(t,e)=>{var n=s["y"];return tO(n)?(t=t["__data__"],t=t["y"],[n,t]=r(n,t,e),[n,t]):[0,1]},p=(t,e)=>{var n=e["padding"],[r,i]=f(t,n),[n,a]=d(t,n),n=[[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),i=t["__data__"],{y:r,y1:a}=i;return dv(o,n,{y:r,y1:a},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=at(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=Oy(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=at(t,["fill","fillOpacity","zIndex","padding","strokeWidth"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i,padding:a,strokeWidth:o}),n=((()=>{var{x:t,y:e}=s;return[t,e].some(tO)})()?p:g)(e,t);n.className=h,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===h]}function JO(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function QO(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function tk(e,{elements:t,datum:a,groupKey:o=t=>t,link:n=!1,background:r=!1,delay:i=60,scale:s,coordinate:l,emitter:c,state:u={}}){const h=t(e),f=new Set(h),d=Kh(h,o);t=UO(h,a);const[p,g]=$O(Object.assign({elements:h,valueof:t,link:n,coordinate:l},st(u.active,"link"))),[y,m,v]=ZO(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},st(u.active,"background"))),{setState:b,removeState:x,hasState:w}=qO(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return KO(h[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(f.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of h)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&m(i);y(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},k=(t=!0)=>{for(const e of h)x(e,"active","inactive"),m(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},E=t=>{t=t.target;r&&!v(t)||(r||f.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{k(),M=null},i)):k())},S=()=>{k()},_=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||k(!1)}),A=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=QO(h,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",A),c.on("element:unhighlight",_),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",A),c.off("element:unhighlight",_);for(const t of h)m(t),g(t)}}function ek(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,h=at(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return tk(zO(t),Object.assign({elements:BO,datum:YO(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:XO(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function nk(t){return ek(Object.assign(Object.assign({},t),{createGroup:VO}))}function rk(t){return ek(Object.assign(Object.assign({},t),{createGroup:HO}))}function ik(e,{elements:t,datum:f,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:y,state:a={}}){const m=t(e),v=new Set(m),b=Kh(m,d);t=UO(m,f);const[x,w]=$O(Object.assign({link:p,elements:m,valueof:t,coordinate:n},st(a.selected,"link"))),[M,O]=ZO(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},st(a.selected,"background"))),{setState:k,removeState:o,hasState:E}=qO(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return KO(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),O(e);t&&y.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return S();if(g){var[r,i,a=!0]=[t,e,n];if(E(i,"selected"))S();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of m)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[f(i),...o.map(f)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(E(a,"selected")){if(!m.some(t=>!c.has(t)&&E(t,"selected")))return S();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?k(h,"selected"):E(h,"selected")||k(h,"unselected");!e&&p&&x(t),M(a)}o&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:m.filter(t=>E(t,"selected")).map(f)}}))}},l=(e.addEventListener("click",s),t=>{var{nativeEvent:t,data:e}=t;if(!t)for(const r of g?e.data.slice(0,1):e.data){var n=QO(m,r,f);s({target:n,nativeEvent:!1})}}),c=()=>{S(!1)};return y.on("element:select",l),y.on("element:unselect",c),()=>{for(const t of m)w(t);e.removeEventListener("click",s),y.off("element:select",l),y.off("element:unselect",c)}}function ak(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=at(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return ik(zO(t),Object.assign({elements:BO,datum:YO(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:XO(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function ok(t){return ak(Object.assign(Object.assign({},t),{createGroup:VO}))}function sk(t){return ak(Object.assign(Object.assign({},t),{createGroup:HO}))}function lk(t){var{wait:k=20,leading:E,trailing:S=!1,labelFormatter:_=t=>""+t}=t,A=at(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=ef(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=pf(Jh(t,t=>pf(t,t=>+f[t])/yf(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=zO(r),g=r.getElementsByClassName(ut);const y=Kh(r.getElementsByClassName(dt),t=>t.__data__.key.split("-")[0]),m=new z.Line({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},st(A,"rule"))}),v=new z.Text({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},st(A,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[Gh(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",_(e))};let w;var M;const O=fn(t=>{t=WO(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[Bh(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},k,{leading:E,trailing:S});return M=[0,0],K(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,M);x(M,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[Bh(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",O),p.addEventListener("pointermove",O),p.addEventListener("pointerleave",O),()=>{m.remove(),p.removeEventListener("pointerenter",O),p.removeEventListener("pointermove",O),p.removeEventListener("pointerleave",O)}}}function ck({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=zO(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=fn(t=>{var e,n,t=WO(a,t);t?([t,e]=t,(n=function(t){var{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);return r||(n.push(r={type:"fisheye"}),e.transform=n,t.coordinate=e,r)}(o)).focusX=t,n.focusY=e,n.visual=!0,i(o)):i(r)},l,{leading:c,trailing:u});return a.addEventListener("pointerenter",n),a.addEventListener("pointermove",n),a.addEventListener("pointerleave",n),()=>{a.removeEventListener("pointerenter",n),a.removeEventListener("pointermove",n),a.removeEventListener("pointerleave",n)}}}const uk=new Proxy({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"},{get(t,e){if(e in t)return t[e]},set(){return!0}});function hk(t,e){t=t.__data__;const{markKey:n,index:r,seriesIndex:i}=t;t=e.markState;const a=Array.from(t.keys()).find(t=>t.key===n);if(a)return i?i.map(t=>a.data[t]):a.data[r]}function fk(i,a,o,s=t=>!0){return t=>{var e,n,r;s(t)&&(o.emit("plot:"+i,t),e=t["target"],e)&&(r=e["className"],"plot"!==r)&&(r=function(t){if("element"===t.className)return t;let e=t.parent;for(;e&&"element"!==e.className;)e=e.parent;return e}(e))&&({className:e,markType:n}=r,"element"===e?(r=Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:hk(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function dk(){return(t,e,n)=>{const{container:r,view:i}=t,a=fk(uk.CLICK,i,n,t=>1===t.detail),o=fk(uk.DBLCLICK,i,n,t=>2===t.detail),s=fk(uk.POINTER_TAP,i,n),l=fk(uk.POINTER_DOWN,i,n),c=fk(uk.POINTER_UP,i,n),u=fk(uk.POINTER_OVER,i,n),h=fk(uk.POINTER_OUT,i,n),f=fk(uk.POINTER_MOVE,i,n),d=fk(uk.POINTER_ENTER,i,n),p=fk(uk.POINTER_LEAVE,i,n),g=fk(uk.POINTER_UPOUTSIDE,i,n),y=fk(uk.DRAG_START,i,n),m=fk(uk.DRAG,i,n),v=fk(uk.DRAG_END,i,n),b=fk(uk.DRAG_ENTER,i,n),x=fk(uk.DRAG_LEAVE,i,n),w=fk(uk.DRAG_OVER,i,n),M=fk(uk.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",h),r.addEventListener("pointermove",f),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",y),r.addEventListener("drag",m),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{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",h),r.removeEventListener("pointermove",f),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",y),r.removeEventListener("drag",m),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function pk({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,mount:c,bounding:u}){var h,f,d=t.getRootNode().defaultView.getConfig().container,c=(p=t,(c=c)?"string"==typeof c?document.querySelector(c):c:p.getRootNode().defaultView.getConfig().container),p=o?d:t,o=u||function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return{x:t,y:e,width:n-t,height:r-e}}(t),d=(u=c,t=(t=d).getBoundingClientRect(),u=u.getBoundingClientRect(),{x:t.x-u.x,y:t.y-u.y}),{tooltipElement:c=(t=c,u=n,c=r,h=s,f=l,o=o,d=d,u=new r5({className:"tooltip",style:{x:u,y:c,container:d,data:[],bounding:o,position:h,enterable:f,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}}),t.appendChild(u.HTMLTooltipElement),u)}=p,{items:d,title:o=""}=e;c.update(Object.assign({x:n,y:r,data:d,title:o,position:s,enterable:l},void 0!==i&&{content:i(a,{items:d,title:o})})),p.tooltipElement=c}function gk({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});n=t.getRootNode().defaultView.getConfig().container,r=(e?n:t).tooltipElement;r&&r.hide()}function yk(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function mk(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function vk(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof q1)&&!(t instanceof W1);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function bk(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function xk(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function wk(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=xk(t.map(t=>t.title),e).filter(Od),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(Od);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=bk(i),name:n}=t,t=at(t,["color","name"]),n=o?vk(s,r)||n:n||vk(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(mk);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:xk(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function Mk(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:h,insetTop:f}=n,n=at(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const d=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},n);n=e.map(t=>t[1]),e=e.map(t=>t[0]);const p=Mf(n),g=Mf(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=Cy(Ay([g,p],[u=s+h+a/2,h=l+f+o/2])),[u,u+n*Math.cos(a),h,h+n*Math.sin(a)]):c?[s,s+r,p+l,p+l]:[g+s,g+s,l,l+i];0<e.length&&((o=t.ruleY||(f=new z.Line({style:Object.assign({x1:y,x2:m,y1:v,y2:b},d)}),t.appendChild(f),f)).style.x1=y,o.style.x2=m,o.style.y1=v,o.style.y2=b,t.ruleY=o)}function Ok(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function kk(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function Ek(t,e){return void 0===t?e:t}function Sk(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function _k(p,t){var{elements:e,sort:g,filter:y,scale:m,coordinate:v,crosshairs:b,render:x,groupName:w,emitter:M,wait:n=50,leading:r=!0,trailing:i=!1,startX:O=0,startY:k=0,body:E=!0,single:S=!0,position:_,enterable:A,mount:T,bounding:P,disableNative:a=!1,style:o={}}=t,t=at(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","disableNative","style"]),e=e(p);const C=_f(v),L=Af(v);o=ot(o,t);const{innerWidth:D,innerHeight:F,width:z,height:W,insetLeft:G,insetTop:H}=v.getOptions(),N=[],j=[];for(const h of e){var s=h["__data__"],s=s["seriesX"];(s?N:j).push(h)}N.sort((t,e)=>{const n=C?0:1;var r=t=>t.getBounds().min[n];return C?r(e)-r(t):r(t)-r(e)});const V=new Map(N.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[ef(n.map((t,e)=>e),t=>n[+t]),n]]})),Y=st(o,"crosshairs");t=m.x;const R=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,I=t=>{var[t]=v.invert(t);return t-R},q=(t,e)=>{const n=C?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return ef([t[n],e[n]])})(t);return r>=t&&r<=e})},l=fn(t=>{var e=WO(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-O,e[1]-k];h;var n=q(h,j),r=[],i=[];for(const d of N){var[a,o]=V.get(d),a=((t,e,n)=>{var t=I(t),[r,i]=ef([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,Bh(t=>n[+t]).center)(e,t)]})(h,a,o);if(null!==a){r.push(d);o=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,e])=>{e=e[n];return[Ze(t.replace("series","")),e]}))})(d,a);const{x:c,y:u}=o;a=v.map([(c||0)+R,u||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const f=s[mf(s,t=>Math.abs(t-I(h)))];var s=i.filter(t=>t[0].x===f),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=wk(n,m,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),y&&(l.items=l.items.filter(y)),0===n.length||Sk(l)?B():(E&&pk({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:_,enterable:A,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),Mk(p,n,Object.assign(Object.assign({},Y),{plotWidth:D,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:O,startY:k,transposed:C,polar:L}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:eO(m.x,I(h),!0)}}})))}},n,{leading:r,trailing:i}),B=()=>{gk({root:p,single:S,emitter:M,mount:T}),b&&Ok(p)},c=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=m["x"],e=e.map(t),[t,e]=v.map([e,.5]),[n,r]=p.getRenderBounds()["min"],l({offsetX:t+n,offsetY:e+r}))},u=()=>{gk({root:p,single:S,emitter:M,nativeEvent:!1,mount:T})};return M.on("tooltip:show",c),M.on("tooltip:hide",u),a||(p.addEventListener("pointerenter",l),p.addEventListener("pointermove",l),p.addEventListener("pointerleave",B)),()=>{a||(p.removeEventListener("pointerenter",l),p.removeEventListener("pointermove",l),p.removeEventListener("pointerleave",B)),M.off("tooltip:show",c),M.off("tooltip:hide",u),yk(p),b&&Ok(p)}}function Ak(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:h,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:f=t=>t,single:d=!0,position:p,enterable:g,datum:y,view:m,mount:v,bounding:b,body:x=!0,disableNative:i=!1}){const w=t(a),M=new Set(w),O=Kh(w,f),k=fn(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=O.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(Od).map(t=>{var{color:e=bk(n)}=t,t=at(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(mk);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):wk(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),Sk(e))?gk({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&pk({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),h.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:hk(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&gk({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=QO(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),k({target:t,offsetX:e+r/2,offsetY:n+i/2}))},_=({nativeEvent:t}={})=>{t||gk({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",_),i||(a.addEventListener("pointerover",k),a.addEventListener("pointermove",k),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",k),a.removeEventListener("pointermove",k),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",_),yk(a)}}function Tk(t){const{shared:h,crosshairs:f,series:d,item:p=()=>({}),facet:g=!1}=t,y=at(t,["shared","crosshairs","series","name","item","facet"]);return(e,t,n)=>{var{container:r,view:i}=e;const{scale:a,markState:o,coordinate:s}=i;var l=kk(o,"seriesTooltip"),c=kk(o,"crosshairs"),r=zO(r),l=Ek(d,l);if(l&&Array.from(o.values()).some(t=>{var e;return(null==(e=t.interaction)?void 0:e.seriesTooltip)&&t.tooltip})&&!g)return _k(r,Object.assign(Object.assign({},y),{elements:BO,scale:a,coordinate:s,crosshairs:Ek(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=DO(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return _k(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:Ek(f,c),item:p,startX:l,startY:t,emitter:n}))}return Ak(r,Object.assign(Object.assign({},y),{datum:YO(i),elements:BO,scale:a,coordinate:s,groupKey:h?VO(i):void 0,item:p,emitter:n,view:i}))}}const Pk="legend-category",Ck="items-item",Lk="legend-category-item-marker",Nk="legend-category-item-label";function jk(t){return t.getElementsByClassName(Lk)[0]}function Rk(t){return t.getElementsByClassName(Nk)[0]}function Ik(t){return t.getElementsByClassName(Ck)}function Bk(t){return t.getElementsByClassName(Pk)}function Dk(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Fk(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,h=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,f={unselected:st(n,"marker")},n={unselected:st(n,"label")};const{setState:d,removeState:p}=qO(f,void 0),{setState:g,removeState:y}=qO(n,void 0),m=Array.from(e(t));let v=m.map(o);const b=()=>{for(const r of m){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),y):(d(e,"unselected"),g))(n,"unselected")}};for(const E of m){var x=()=>{JO(t,"pointer")},w=()=>{JO(t,"default")},M=n=>K(this,void 0,void 0,function*(){var t=o(E),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...m.map(o)),yield r(v),b(),n);t&&(v.length===m.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});E.addEventListener("click",M),E.addEventListener("pointerenter",x),E.addEventListener("pointerout",w),c.set(E,M),u.set(E,x),h.set(E,w)}const O=n=>K(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(v=t,yield r(v),b()))}),k=e=>K(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of m)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",h.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function zk(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=Bk(i);const l=(r,i)=>K(this,void 0,void 0,function*(){var t=a["scale"];const{[r]:n}=t;t=o.marks,t=t.map(t=>{var e;return"legends"===t.type?t:({transform:e=[]}=t,e=[{type:"filter",[r]:i},...e],ot({},t,{transform:e,scale:{[r]:{domain:n.getOptions().domain}},legend:{[r]:{preserve:!0}}}))}),t=Object.assign(Object.assign({},o),{marks:t});return s(t)}),n=t.map(t=>{const{name:e,domain:n}=Dk(t).scales[0];return Fk(i,{legends:Ik,marker:jk,label:Rk,datum:t=>{t=t.__data__,t=t.index;return n[t]},filter:t=>l(e,t),state:t.attributes.state,channel:e,emitter:r})});return()=>{n.forEach(t=>t())}}}function Wk(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=Bk(n);const o=BO(n);var s=XO(i,["active","inactive"]),l=UO(o,YO(r));const c=[];for(const d of t){const p=t=>{var e=d.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},g=Dk(d).scales[0].name,y=Ik(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=Kh(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=qO(s,l);var h={inactive:st(u,"marker")},u={inactive:st(u,"label")};const{setState:w,removeState:M}=qO(h),{setState:O,removeState:k}=qO(u),E=t=>{for(const r of y){var e=jk(r),n=Rk(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},S=(t,e)=>{var n=p(e),r=new Set(v.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");E(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},_=new Map;for(const C of y){var f=t=>{S(t,C)};C.addEventListener("pointerover",f),_.set(C,f)}const A=t=>{for(const e of o)x(e,"inactive","active");E(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},T=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=y.find(t=>p(t)===r))&&S({nativeEvent:!1},t)}},P=t=>{t=t.nativeEvent;t||A({nativeEvent:!1})};d.addEventListener("pointerleave",A),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(A),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of _)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function Gk(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const Hk=xv(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=at(e,["x","y","width","height","class","renders","handleSize","document"]);if(l&&void 0!==i&&void 0!==a&&void 0!==n&&void 0!==r){var u=s/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},f=st(Ed(c,"handleNW","handleNE"),"handleN"),{render:d=h}=f,f=at(f,["render"]),p=st(c,"handleE"),{render:g=h}=p,p=at(p,["render"]),y=st(Ed(c,"handleSE","handleSW"),"handleS"),{render:m=h}=y,y=at(y,["render"]),v=st(c,"handleW"),{render:b=h}=v,v=at(v,["render"]),x=st(c,"handleNW"),{render:w=h}=x,x=at(x,["render"]),M=st(c,"handleNE"),{render:O=h}=M,M=at(M,["render"]),k=st(c,"handleSE"),{render:E=h}=k,k=at(k,["render"]),S=st(c,"handleSW"),{render:h=h}=S,S=at(S,["render"]);var _=i=>()=>{return new(xv(t=>{return e=i,n=(t=t).id,r=at(t.attributes,["x","y"]),(e=e(t,Object.assign({x:0,y:0},r),l)).id=n,void(e.style.draggable=!0);var e,n,r}))({})},t=lt(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(Gk,Object.assign({width:i,height:a},Ed(c,"handle"))),t.maybeAppend("handle-n",_(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(Gk,f),t.maybeAppend("handle-e",_(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(Gk,p),t.maybeAppend("handle-s",_(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(Gk,y),t.maybeAppend("handle-w",_(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(Gk,v),t.maybeAppend("handle-nw",_(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,x),t.maybeAppend("handle-ne",_(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,M),t.maybeAppend("handle-se",_(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,k),t.maybeAppend("handle-sw",_(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(Gk,S)}});function Vk(l,t){var{brushed:a=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(l),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:u=!1,fill:n="#777",fillOpacity:r="0.3",stroke:i="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,f=at(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,y=null,m=null,v=!1;const[b,x,w,M]=s,O=(JO(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(y&&y.remove(),m&&m.remove(),d=[t,e],u)return I();B()}),I=()=>{m=new z.Path({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new Hk({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(m),l.appendChild(y)},B=()=>{y=new Hk({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},f),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(y)},k=(t=!0)=>{y&&y.remove(),m&&m.remove(),d=null,p=null,g=null,v=!1,y=null,m=null,e(t)},E=(t,e,n=!0)=>{var[t,e,r,i]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,r,i]=c(t,e,r,i,s);return(u?F:D)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},D=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},F=(t,e,n,r)=>{m.style.d=`
|
|
8
8
|
M${b},${x}L${w},${x}L${w},${M}L${b},${M}Z
|
|
9
9
|
M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z
|
|
10
|
-
`,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},S={"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"}},_=t=>T(t)||A(t),A=t=>{t=t.id;return-1!==h.indexOf(t)&&new Set(Object.keys(S)).has(t)},T=t=>t===y.getElementById("selection"),P=t=>{var e=t["target"],[t,n]=GO(l,t);y&&_(e)?_(e)&&(g=[t,n]):(O(t,n),v=!0)},C=t=>{var e,n,r,i,a,o,s=t["target"],t=GO(l,t);if(d)return g?T(s)?(e=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(n=t)[0]-g[0],n=n[1]-g[1],r=e(r,d[0],p[0],b,w),e=e(n,d[1],p[1],x,M),n=[d[0]+r,d[1]+e],r=[p[0]+r,p[1]+e],void E(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],S[r]?([s,i,a,o]=S[r].vector,E([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):E(d,t)},L=t=>{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=y.style,d=[e,r],p=[e+n,r+i]):(p=GO(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!_(t)&&k()},j=t=>{t=t.target;y&&_(t)&&!v?T(t)?JO(l,"move"):A(t)&&JO(l,S[t.id].cursor):JO(l,"crosshair")},R=()=>{JO(l,"default")};return l.addEventListener("dragstart",P),l.addEventListener("drag",C),l.addEventListener("dragend",L),l.addEventListener("click",N),l.addEventListener("pointermove",j),l.addEventListener("pointerleave",R),{mask:y,move(t,e,n,r,i=!0){y||O(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&k(t)},destroy(){y&&k(!1),JO(l,"default"),l.removeEventListener("dragstart",P),l.removeEventListener("drag",C),l.removeEventListener("dragend",L),l.removeEventListener("click",N),l.removeEventListener("pointermove",j),l.removeEventListener("pointerleave",R)}}}function Yk(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function qk(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:h=!1,key:d=t=>t,bboxOf:f=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}},state:p={},emitter:g}=e,e=at(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),v=m.flatMap(n);i=UO(y,a),n=st(e,"mask");const{setState:b,removeState:x}=qO(p,i),w=new Map,{width:M,height:O,x:k=0,y:E=0}=f(t);a=s||[0,0,M,O];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},_=(t,e,n,r)=>{var i;for(const u of m)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of y){var{min:o,max:s}=h.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?b(h,"inactive"):(b(h,"active"),a.add(d(h)))}for(const f of v)a.has(d(f))?b(f,"active"):b(f,"inactive")},A=()=>{for(const t of y)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},T=(t,e,n,r)=>{var i;for(const o of y){var a=w.get(o)||(a=o,i=void 0,(i=a.cloneNode()).__data__=a.__data__,a.parentNode.appendChild(i),w.set(a,i),i);a.style.clipPath=new z.Rect({style:{x:t+k,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=Vk(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?A:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=rO(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:_)(t,e,n,r)}})),C=({nativeEvent:t,data:e})=>{var n,r;t||(t=e["selection"],[e,t,n,r]=function(t,e,n){var{x:e,y:r}=e,[t,i]=t,t=iO(t,e),e=iO(i,r),i=[t[0],e[0]],r=[t[1],e[1]],[t,e]=n.map(i),[i,n]=n.map(r);return[t,e,i,n]}(t,c,u),P.move(e,t,n,r,!1))},L=(g.on("brush:highlight",C),({nativeEvent:t}={})=>{t||P.remove(!1)}),N=(g.on("brush:remove",L),P.destroy.bind(P));return P.destroy=()=>{g.off("brush:highlight",C),g.off("brush:remove",L),N()},P}function Xk(t){var{facet:g,brushKey:y}=t,m=at(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=zO(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:f,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],qk(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>DO(t,e),datum:YO(FO(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:XO(FO(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=qk(s,Object.assign(Object.assign({elements:BO,key:t=>t.__data__.key,siblings:()=>{return Yk(t,e,y).map(t=>zO(t.container))},datum:YO([l,...Yk(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:XO([c,...Yk(t,e,y).map(t=>t.options)],h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));return s.brush=p,()=>p.destroy()}}function Uk(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function $k(t){return Xk(Object.assign(Object.assign({},t),{brushRegion:Uk,selectedHandles:["handle-e","handle-w"]}))}function Kk(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function Zk(t){return Xk(Object.assign(Object.assign({},t),{brushRegion:Kk,selectedHandles:["handle-n","handle-s"]}))}const Jk="axis",Qk="axis-hot-area";function tE(t){return t.getElementsByClassName(Jk)}function eE(t){return t.getElementsByClassName("axis-line")[0]}function nE(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function rE(t,e){var{cross:n,offsetX:i}=e,e=at(e,["cross","offsetX","offsetY"]),r=nE(t),[t]=eE(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:Kk,hotZone:new z.Rect({className:Qk,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function iE(t,e){var{offsetY:i,cross:n=!1}=e,e=at(e,["offsetY","offsetX","cross"]),r=nE(t),[,t]=eE(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:Uk,hotZone:new z.Rect({className:Qk,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function aE(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:h,coordinate:f}=e,e=at(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:y}=qO(u,UO(d,a)),m=new Map;var v=st(e,"mask");const b=p.map(t=>t.attributes.scale),x=t=>2<t.length?[t[0],t[t.length-1]]:t,w=new Map,M=()=>{w.clear();for(let t=0;t<p.length;t++){var e=b[t].getOptions()["domain"];w.set(t,x(e))}},O=(M(),(t,e)=>{var n=[];for(const r of d)(t=>Array.from(m.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(r))?(g(r,"active"),n.push(r)):g(r,"inactive");w.set(t,((t,e)=>{const n=b[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return x(nO(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!k)return Array.from(w.values());var t,e,n=[];for([t,e]of w){var r=b[t].getOptions()["name"];"x"===r?n[0]=e:n[1]=e}return n})()}})}),k=p.some(s)&&p.some(t=>!s(t)),E=[];for(let a=0;a<p.length;a++){const P=p[a];const{hotZone:C,brushRegion:L,extent:N}=(s(P)?iE:rE)(P,{offsetY:o,offsetX:l,cross:k,zIndex:999,fill:"transparent"});P.parentNode.appendChild(C);var S=Vk(C,Object.assign(Object.assign({},v),{reverse:c,brushRegion:L,brushended(t){if(m.delete(P),0===Array.from(m.entries()).length){var e=t;for(const n of d)y(n,"active","inactive");M(),e&&h.emit("brushAxis:remove",{nativeEvent:!0})}else O(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),O(a,i)}}));E.push(S)}const _=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},A=(t,e,n)=>{var{height:r,width:i}=f.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},T=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<E.length;t++){var r,i=n[t],a=E[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=A(t,e,n),e=A(r,e,n)+((r=e).getStep?r.getStep():0);return s(n)?[t,-1/0,e,1/0]:[-1/0,t,1/0,e]})(i,r,o),!1)):a.remove(!1)}}};return h.on("brushAxis:remove",_),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",_),h.off("brushAxis:highlight",T)}}function oE(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=zO(t).getBBox(),s=r["coordinate"];return aE(t,Object.assign({elements:BO,axes:tE,offsetY:o,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:YO(r),state:XO(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function sE(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=st(at(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:c,height:u}=t.getBBox(),i=i||[0,0,c,u];const h=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),f=Vk(t,Object.assign(Object.assign({},e),{extent:i,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r,i){i.nativeEvent=!0,a(l(t,e,n,r),i),f.remove()}}));function d(t){h(t)&&(t.nativeEvent=!0,n(t))}t.addEventListener("click",d);const p=({nativeEvent:t,data:e})=>{t||(t=e["selection"],a(t,{nativeEvent:!1}))};return s.on("brush:filter",p),()=>{f.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function lE(t){var{hideX:f=!0,hideY:d=!0}=t,p=at(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=zO(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return sE(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{var{scale:i,coordinate:a}=u;return rO(t,e,n,r,i,a)},filter:(r,i)=>$(this,void 0,void 0,function*(){if(!c){c=!0;const[e,n]=r;var t=o["marks"],t=t.map(t=>ot({axis:Object.assign(Object.assign({},f&&{x:{transform:[{type:"hide"}]}}),d&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:e,nice:!1},y:{domain:n,nice:!1}}})),t=(a.emit("brush:filter",Object.assign(Object.assign({},i),{data:{selection:[e,n]}})),Object.assign(Object.assign({},o),{marks:t,clip:!0})),t=yield s(t);u=t.view,c=!1,l=!0}}),reset:t=>{var e,n;!c&&l&&(e=r["scale"],{x:e,y:n}=e,e=e.getOptions().domain,n=n.getOptions().domain,a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[e,n]}})),l=!1,u=r,s(o))},extent:void 0,emitter:a,scale:i,coordinate:h},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function cE(t){return lE(Object.assign(Object.assign({hideX:!0},t),{brushRegion:Uk}))}function uE(t){return lE(Object.assign(Object.assign({hideY:!0},t),{brushRegion:Kk}))}const hE="slider";function fE(t){return[t[0],t[t.length-1]]}function dE({channelDomain:C,className:L=hE,prefix:N="slider",setValue:j=(t,e)=>t.setValues(e),hasState:R=!1,wait:I=50,leading:B=!0,trailing:D=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:h}=t;t=n.getElementsByClassName(L);if(!t.length)return()=>{};let f=!1;const{scale:i,coordinate:a,layout:o}=r,{paddingLeft:d,paddingTop:p,paddingBottom:g,paddingRight:y}=o,{x:s,y:l}=i,m=_f(a);const v=new Map,b=new Set;C=C||{x:s.getOptions().domain,y:l.getOptions().domain};for(const M of t){const O=M.attributes["orientation"],[k,E]=(w=O,x=void 0,x="vertical"===w?"y":"x",w="vertical"===w?"x":"y",m?[w,x]:[x,w]),S=""+N+Qe(k)+":filter",_="x"===k,A=s.getOptions()["ratio"],T=l.getOptions()["ratio"],P=t=>{var e,n;return t.data?(e=t.data["selection"],[e=fE(C.x),n=fE(C.y)]=e,_?[nO(s,e,A),nO(l,n,T)]:[nO(l,n,T),nO(s,e,A)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return nO(e,[eO(e,(n=n?t=>1-t:t=>t)(t),!0),eO(e,n(r),!1)])}(n,i[k],m&&"horizontal"===O),C[E]])};var x=fn(l=>$(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;f||(f=!0,{nativeEvent:t=!0}=l,[e,s]=P(l),C[k]=e,C[E]=s,[n,r,i,a=!1]=[u,{[k]:{domain:e,nice:!1},[E]:{domain:s,nice:!1}},N,R],o=(o=n["marks"]).map(t=>{var e;return ot({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:r,[i]:Object.assign(Object.assign({},(null==(e=t[i])?void 0:e.x)&&{x:Object.assign({preserve:!0},a&&{ratio:null})}),(null==(e=t[i])?void 0:e.y)&&{y:Object.assign({preserve:!0},a&&{ratio:null})}),animate:!1})}),n=Object.assign(Object.assign({},n),{marks:o,clip:!0,animate:!1}),t&&(o=_?e:s,s=_?s:e,c.emit(S,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[fE(o),fE(s)]}}))),yield h(Object.assign(Object.assign({},n),{paddingLeft:d,paddingTop:p,paddingBottom:g,paddingRight:y})),f=!1)}),I,{leading:B,trailing:D}),w=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,M.dispatchEvent(new z.CustomEvent("valuechange",{data:n,nativeEvent:!1})),n=_?iO(t,s):iO(e,l),j(M,n))};c.on(S,w),M.addEventListener("valuechange",x),v.set(M,x),b.add([S,w])}return()=>{for(var[t,e]of v)t.removeEventListener("valuechange",e);for(var[n,r]of b)c.off(n,r)}}}const pE="g2-scrollbar";function gE(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(pE).length?(a=i["scale"],{x:i,y:a}=a,r={x:i.getOptions().domain,y:a.getOptions().domain},i.update({domain:i.getOptions().expectedDomain}),a.update({domain:a.getOptions().expectedDomain}),dE(Object.assign(Object.assign({},o),{channelDomain:r,className:pE,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const yE={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 mE(t){return"text"===t.nodeName&&!!t.isOverflowing()}function vE(t){var{offsetX:f=8,offsetY:d=8}=t,r=at(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=st(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];mE(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new z.HTML({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},yE),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}</${r}>`),x:e,y:n}}),s.appendChild(a),o.tip=a,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];mE(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function bE(n){return(t,...e)=>ot({},n(t,...e),t)}function xE(n){return(t,...e)=>ot({},t,n(t,...e))}function wE(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=at(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const ME=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:o=0,y:s=0,width:l,height:c,data:u}=t;return e.map(t=>{var{data:e,x:n,y:r,width:i,height:a}=t,t=at(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:wE(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},OE=(ME.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=at(g,["data"]),y=wE(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),kE=(OE.props={},()=>t=>{var e=t["children"],t=at(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:h={},transform:f=[]}=t,n=at(t,["data","scale","axis","legend","encode","transform"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={},encode:a={},transform:o=[]}=t,t=at(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:wE(e,s),scale:ot({},l,n),encode:ot({},h,a),transform:[...f,...o],axis:!(!r||!c)&&ot({},c,r),legend:!(!i||!u)&&ot({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),EE=(kE.props={},({static:L=!1}={})=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:E,frame:S,labelTransform:_,parentKey:A,clip:T,viewStyle:P,title:C}=t,t=at(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:k,key:E,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:S,labelTransform:_,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:A,clip:T,style:P},!L&&{title:C}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),L&&{title:C})]})]});EE.props={};class SE{constructor(t){this.$value=t}static of(t){return new SE(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const _E=bE(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=Kh(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}}),AE=bE(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:f,encode:d={},scale:n={},legend:p={}}=r.shift();var s=d["color"],l=n["color"],c=p["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(f)&&r.push(...f)}var t="string"==typeof i?i:"",[u,h]=void 0!==(u=null==(u=null===n||void 0===n?void 0:n.color)?void 0:u.domain)?[u]:void 0===i?[void 0]:(u="function"==typeof i?i:t=>t[i],(u=e.map(u)).some(t=>"number"==typeof t)?[Yh(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:ot({},a,{domain:u,type:h})},legend:{color:ot({title:t},o)}}}),TE=bE(()=>({animate:{enterType:"fadeIn"}})),PE=xE(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),CE=xE(()=>({type:"cell"})),LE=xE(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),NE=xE((t,c=function(t){t=t.points;return jy(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?jE(a,e):(t=e.length?void 0:null,ot({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?jE(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:E=0,shareData:h=!1,key:S}=t,_=e["value"],{x:A,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=ky(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[A]:t,[T]:e}=t,t=void 0===A||t===n,e=void 0===T||e===r;return t&&e}).map(t=>_.filter(t)),v=h?pf(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:A,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=at(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:A?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:_,l={color:{domain:P}},o={x:RE(o,w)(p,r),y:RE(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+k,y:h+m+E,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:ot(s,e,l),axis:ot({},i,o),legend:!1},t),O)})})}}});function jE(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function RE(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const IE=()=>t=>{return[SE.of(t).call(CE).call(AE).call(TE).call(_E).call(PE).call(LE).call(NE).value()]},BE=(IE.props={},bE(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),DE=xE(t=>{const{data:w,children:c,x:M=0,y:O=0,key:k}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=ky(t);const s=t.map(({points:t})=>jy(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=at(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return jE(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return jE(n,e)})(y,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+m+M,y:h+v+O,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:ot({x:{facet:!1},y:{facet:!1}},e),axis:ot({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:ot({},a,{x:p,y:g})},t)})})}}}),FE=xE(t=>{var e=t["encode"],t=at(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=at(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const zE=()=>t=>{return[SE.of(t).call(CE).call(AE).call(DE).call(FE).call(TE).call(PE).call(BE).value()]},WE=bE(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),GE=bE(t=>({coordinate:{type:"polar"}})),HE=t=>{var e=t["encode"],t=at(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function VE(t){return t=>null}function YE(t){var t=t["points"],[t,e,n,r]=t,i=Py(t,r),t=Ay(t,r),r=Ny(t,Ay(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Ly(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const qE=()=>t=>{return[SE.of(t).call(CE).call(HE).call(AE).call(GE).call(LE).call(NE,YE,VE,VE,{frame:!1}).call(TE).call(PE).call(WE).value()]};const XE=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],h=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=ot({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield h[i]),e=i}t++}var a,o,s}};function UE(t,e){if(null!==t)return{type:"column",value:t,field:e}}function $E(t,e){t=UE(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function KE(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function ZE(t,e){var n=[];for(const r of t)n[r]=e;return n}function JE(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function QE(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=JE(t,i);if(null!==n)return[n,r]}return[null,null]}function t3(t){return!(t instanceof Date)&&"object"==typeof t}XE.props={};const e3=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:$E(ZE(t,0))}})]};function n3(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=JE(r,t))?void 0:t[0]]}).filter(([,t])=>Od(t));return Array.from(Kh(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function r3(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:Ih(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>u3(t=>r(e[t]))):"series"===t?o3:"value"===t?s3:"sum"===t?l3:"maxIndex"===t?c3:()=>null}function i3(t,e){for(const n of t)n.sort(e)}function a3(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function o3(t,e,n){return u3(t=>n[t])}function s3(t,e,n){return u3(t=>e[t])}function l3(t,n,e){t=ky(t),t=Array.from(Kh(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return u3(t=>r.get(e[t]))}function c3(t,n,e){t=ky(t),t=Array.from(Kh(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,gf(e,t=>n[t])]));return u3(t=>r.get(e[t]))}function u3(n){return(t,e)=>Ih(n(t),n(e))}e3.props={};const h3=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:C=!1,y:L="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=JE(r,"y"),[s,l]=JE(r,"y1"),[r]=j?QE(r,"series","color"):JE(r,"color"),c=n3(T,t,e),n=r3(P)(n,a,r),u=(n&&i3(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const E of c){C&&E.reverse();var g=s?+s[E[0]]:0,y=[],m=[];for(const S of E){var v=f[S]=+a[S]-g;v<0?m.push(S):0<=v&&y.push(S)}var b=0<y.length?y:m,x=0<m.length?m:y;let t=y.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const _ of m.reverse()){var w=f[_];n=u[_]=(h[_]=n)+w}let r=g;for(const A of y){var M=f[A];0<M?r=u[A]=(h[A]=r)+M:u[A]=h[A]=r}}const O=new Set(d),k=new Set(p);r="y"===L?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:$E(a,o),y:UE(r,o),y1:UE(n,l)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>k.has(e)},i)})]}};function f3(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}h3.props={};const d3=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(f3)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",h3({groupBy:r})(t,e,n))},p3=(d3.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(Ad(r))return[t,e];r=r.title;if(void 0!==r)return[t,e];var i=Object.keys(n).filter(t=>t.startsWith(s)).filter(t=>!n[t].inferred).map(t=>JE(n,t)).filter(([t])=>t).map(t=>t[0]);if(0===i.length)return[t,e];var a=[];for(const o of t)a[o]={value:i.map(t=>t[o]).join(", ")};return[t,ot({},e,{tooltip:{title:a}})]}}),g3=(p3.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:$E(ZE(t,0))},scale:{x:{guide:null}}})]}),y3=(g3.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:$E(ZE(t,0))},scale:{y:{guide:null}}})]}),m3=(y3.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:KE(ZE(t,3))}})]}),v3=(m3.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=at(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,ot({},e,{encode:{key:UE(r)}})]}),b3=(v3.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=JE(n,"color"),[t,ot({},e,{encode:{series:UE(r,i)}})])}),x3=(b3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(t3)?[t,e]:[t,ot({},e,{encode:{y:UE(n)}})]}),w3=(x3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(t3)?[t,e]:[t,ot({},e,{encode:{x:UE(n)}})]}),M3=(w3.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=JE(n,"y"),[t,ot({},e,{encode:{y1:UE([...r])}})])}),O3=(M3.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=JE(n,"x"),[t,ot({},e,{encode:{x1:UE([...r])}})])}),k3=(O3.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return Ad(n)||({items:r=[]}=n,!r)||0<r.length?[t,e]:(r=(Array.isArray(i)?i:[i]).flatMap(e=>Object.keys(a).filter(t=>t.startsWith(e)).map(t=>{var{field:e,value:n,inferred:r=!1,aggregate:i}=a[t];return r?null:i&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t)),[t,ot({},e,{tooltip:{items:r}})])}}),E3=(k3.props={},()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)]),S3=(E3.props={},()=>(t,e)=>{var{style:n={}}=e,r=at(e,["data","style"]),{x:i,y:a}=n,n=at(n,["x","y"]);return null==i||null==a?[t,e]:[[0],ot({},r,{data:[0],cartesian:!0,encode:{x:UE([i||0]),y:UE([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),_3=(S3.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),A3=(_3.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(t3)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,ot({},e,{encode:{x:UE(n),y:UE(r)}})])}),T3=(A3.props={},()=>(t,e)=>{var{style:n={},encode:r}=e,r=r["series"],n=n["gradient"];return!n||r?[t,e]:[t,ot({},e,{encode:{series:KE(ZE(t,void 0))}})]}),P3=(T3.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return at(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=JE(r,"y"),[r]=QE(r,"series","color"),o=a3(r,i),i=n3(c,t,e),n=r3(h)(n,a,r),s=(n&&i3(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,ot({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:UE(s)}})]}}),C3=(P3.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:m=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,JE(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(Kh(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=JE(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[ZE(n,r)]:QE(e,"enterDuration",ZE(n,r));var[l]=QE(e,"enterDelay",ZE(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=pf(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:KE(s),enterDelay:KE(c)}})]}});C3.props={};const L3=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=at(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,JE(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=n3(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>yf(t,t=>e[+t]),max:(t,e)=>pf(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Mf(t,t=>e[+t]),median:(t,e)=>Of(t,t=>e[+t]),sum:(t,e)=>Sf(t,t=>e[+t]),deviation:(t,e)=>Vh(t,t=>e[+t])}[f]||pf;for(const e of i){var c=l(e,o);for(const d of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,h]=s[t];h[d]=+u[d]/c}}var f=Ad(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,ot({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,UE(e,JE(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function N3(t,e,n){return null===t?[-.5,.5]:(t=a3(t,e),[-(e=new F1({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function j3(t,e,n){return e*(1-t)+n*t}L3.props={};const R3=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=JE(n,"x"),[n]=JE(n,"y");const o=N3(a,r,l),s=N3(n,i,c);a=t.map(()=>j3(u(),...s)),r=t.map(()=>j3(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:UE(a),dx:UE(r)}})]}},I3=(R3.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=JE(n,"x");const i=N3(n,r,a);n=t.map(()=>j3(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:UE(n)}})]}}),B3=(I3.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=at(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,JE(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=n3(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Yh(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,ot({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,UE(e,JE(n,t)[1])]))})]}}),D3=(B3.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=JE(n,"y");var[,i]=JE(n,"y1"),n=(h?QE(n,"series","color"):JE(n,"color"),n3(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,ot({},e,{encode:{y1:UE(a,i)}})]}});function F3(t,e){return[t[0]]}function z3(t,e){return[t[t.length-1]]}function W3(t,e){return[t[gf(t,t=>e[t])]]}function G3(t,e){return[t[mf(t,t=>e[t])]]}D3.props={};const H3=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=n3(a,t,e);const[r]=JE(n,o),i="function"==typeof(n=s)?n:{first:F3,last:z3,max:W3,min:G3}[n]||F3;return[t.flatMap(t=>i(t,r)),e]}},V3=(H3.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return H3(Object.assign({channel:"x",selector:e},t))}),Y3=(V3.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return H3(Object.assign({channel:"y",selector:e},t))});function q3(e){return t=>null===t?e:e+" of "+t}function X3(){return[(t,e)=>Mf(t,t=>+e[t]),q3("mean")]}function U3(){return[(t,e)=>Of(t,t=>+e[t]),q3("median")]}function $3(){return[(t,e)=>pf(t,t=>+e[t]),q3("max")]}function K3(){return[(t,e)=>yf(t,t=>+e[t]),q3("min")]}function Z3(){return[(t,e)=>t.length,q3("count")]}function J3(){return[(t,e)=>Sf(t,t=>+e[t]),q3("sum")]}function Q3(){return[(t,e)=>e[t[0]],q3("first")]}function tS(){return[(t,e)=>e[t[t.length-1]],q3("last")]}Y3.props={};const eS=(t={})=>{const i=t["groupBy"],a=at(t,["groupBy"]);return(t,e)=>{const{data:s,encode:l}=e,c=i(t,e);if(!c)return[t,e];var t=Object.entries(a).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:X3,max:$3,count:Z3,first:Q3,last:tS,sum:J3,min:K3,median:U3}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=JE(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=JE(l,e),e):o),o=c.map(t=>n(t,null!==i&&void 0!==i?i:s));return[t,Object.assign(Object.assign({},(t=o,o=(null==r?void 0:r(e))||e,t=UE(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=JE(l,t);return[t,UE(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[ky(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},nS=(eS.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=at(t,["channels"]);return eS(Object.assign(Object.assign({},e),{groupBy:(t,e)=>n3(n,t,e)}))}),rS=(nS.props={},(t={})=>nS(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),iS=(rS.props={},(t={})=>nS(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),aS=(iS.props={},(t={})=>nS(Object.assign(Object.assign({},t),{channels:["color"]})));function oS(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=at(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=JE(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=JE(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>pf(t,t=>+a[t]);if("min"===i)return t=>yf(t,t=>+a[t]);if("sum"===i)return t=>Sf(t,t=>+a[t]);if("median"===i)return t=>Of(t,t=>+a[t]);if("mean"===i)return t=>Mf(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),o=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(t,l,s),n=(s=o,o=t=>l[t],(2!==(c=n).length?ef(Jh(s,c,o),([t,e],[n,r])=>Ih(e,r)||Ih(t,n)):ef(Kh(s,o),([t,e],[n,r])=>c(e,r)||Ih(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,ot(e,{scale:{[a]:{domain:o}}})]}aS.props={};const sS=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=at(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return oS(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=JE(i,r);return i=ef(t,t=>a[t]),n&&i.reverse(),[i,e]}}},lS=(sS.props={},(t={})=>sS(Object.assign(Object.assign({},t),{channel:"x"}))),cS=(lS.props={},(t={})=>sS(Object.assign(Object.assign({},t),{channel:"color"}))),uS=(cS.props={},(t={})=>sS(Object.assign(Object.assign({},t),{channel:"y"})));uS.props={};const hS=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=JE(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):JE(r,s)[0],r=Qh(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>Sf(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,ot({},e,{scale:{x:{flex:r}}})]}};function fS(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const h=a-u*c,f=u<=1?0:h/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=jy(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}hS.props={};const dS=()=>(t,e)=>[t,ot({},e,{modifier:fS,axis:!1})],pS=(dS.props={},"thresholds");function gS(t){var e,[n,r]=Yh(t);return Math.min(200,(n=n,r=r,e=Hh(t=t),t=Vh(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const yS=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=at(t,["groupChannels","binChannels"]),u={};return eS(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(pS)))),Object.fromEntries(l.flatMap(e=>{var t=([t])=>+u[e].get(t).split(",")[1];return[[t.from=e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",t]]}))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=JE(n,t);return t}),a=st(c,pS),o=t.filter(e=>i.every(t=>Od(t[e]))),r=[...s.map(t=>{var[t]=JE(n,t);return t}).filter(Od).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||gS(n),e=df().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(Kh(o,e=>r.map(t=>t(e)).join("-")).values())}}))},mS=(yS.props={},(t={})=>{var e=t["thresholds"];return yS(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function vS(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let h=0,f,d;c.push(h);for(let i=0;i<t-2;i++){let t=0,e=0,n=Math.floor((i+1)*u)+1;for(var p=Math.floor((i+2)*u)+1,g=(p=Math.min(p,a))-n;n<p;n++)t+=s(n),e+=l(n);t/=g,e/=g;let r=Math.floor((i+0)*u)+1;var y=Math.floor((i+1)*u)+1,m=[s(h),l(h)];for(f=-1;r<y;r++)(o=.5*Math.abs((m[0]-t)*(s(r)-m[1])-(m[0]-l(r))*(e-m[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function bS(t){if("function"==typeof t)return t;if("lttb"===t)return vS;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[mf(t,t=>n[t])]],max:(t,e,n)=>[t[gf(t,t=>n[t])]],median:(t,e,n)=>{return[t[wf(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/r))).flatMap(t=>i(t,e,n))}}mS.props={};const xS=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=bS(e);return(t,e)=>{var n=e["encode"],t=n3(o,t,e);const[r]=JE(n,"x"),[i]=JE(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},wS=(xS.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=JE(i,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const r=Array.isArray(e)?e:[e];return 0===r.length?null:t=>r.includes(n[t])}).filter(Od);if(0===r.length)return[t,e];const a=t.filter(e=>r.every(t=>t(e))),o=a.map((t,e)=>e);t=Object.entries(i).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:o.map(t=>e.value[a[t]])})]);return[o,ot({},e,{encode:Object.fromEntries(t),data:a.map(t=>n[t])})]});function MS(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function OS(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}wS.props={};const kS=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{IO(t);const i=t.getLocalBounds();e.some(t=>{var e=MS(i),t=MS(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?RO(t):e.push(t)}),t}};function ES(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const SS=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=ES(),[m,v]=ES();var a,o,s,l,[c,t]=ES(),[u,n]=ES();for(const b of i){var{min:r,max:h}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,h]=h;y(b,g),v(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>Ih(m(t),m(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=m(f);var d=c(f),p=m(e),d=p-(g+d);d<k&&(d=(k-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<O)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function _S(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function AS(t,e,n){return.2126*_S(t)+.7152*_S(e)+.0722*_S(n)}function TS(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=AS(t,n,r),n=AS(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function PS(e,t){return t[gf(t,t=>{return TS(e,"object"==typeof(t=t)?t:z.parseColor(t))})]}const CS=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;TS(t.parsedStyle.fill,e)<n&&t.attr("fill",PS(e,r))}),t)},LS=()=>t=>(t.forEach(t=>{IO(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(OS(t,e)&&OS(n,e))}(MS(t.getLocalBounds()),e)||RO(t)}),t);var P=1e-6,NS=1e-12,jS=Math.PI,RS=jS/2,IS=jS/4,BS=2*jS,DS=180/jS,FS=jS/180,zS=Math.abs,WS=Math.atan,GS=Math.atan2,_=Math.cos,HS=Math.ceil,VS=Math.exp,YS=Math.log,qS=Math.pow,A=Math.sin,XS=Math.sign||function(t){return 0<t?1:t<0?-1:0},US=Math.sqrt,$S=Math.tan;function KS(t){return 1<t?0:t<-1?jS:Math.acos(t)}function ZS(t){return 1<t?RS:t<-1?-RS:Math.asin(t)}function JS(){}function QS(t,e){t&&e4.hasOwnProperty(t.type)&&e4[t.type](t,e)}var t4={Feature:function(t,e){QS(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)QS(n[r].geometry,e)}},e4={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){n4(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)n4(n[r],e,0)},Polygon:function(t,e){r4(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)r4(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)QS(n[r],e)}};function n4(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function r4(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)n4(t[n],e,1);e.polygonEnd()}function i4(t,e){t&&t4.hasOwnProperty(t.type)?t4[t.type](t,e):QS(t,e)}function a4(t){return[GS(t[1],t[0]),ZS(t[2])]}function o4(t){var e=t[0],t=t[1],n=_(t);return[n*_(e),n*A(e),A(t)]}function s4(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function l4(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function c4(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function u4(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function h4(t){var e=US(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function f4(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function d4(t,e){return zS(t)>jS&&(t-=Math.round(t/BS)*BS),[t,e]}function p4(t,e,n){return(t%=BS)?e||n?f4(y4(t),m4(e,n)):y4(t):e||n?m4(e,n):d4}function g4(n){return function(t,e){return zS(t+=n)>jS&&(t-=Math.round(t/BS)*BS),[t,e]}}function y4(t){var e=g4(t);return e.invert=g4(-t),e}function m4(t,e){var i=_(t),a=A(t),o=_(e),s=A(e);function n(t,e){var n=_(e),r=_(t)*n,t=A(t)*n,n=A(e),e=n*i+r*a;return[GS(t*o-e*s,r*i-n*a),ZS(e*o+t*s)]}return n.invert=function(t,e){var n=_(e),r=_(t)*n,t=A(t)*n,n=A(e),e=n*o-t*s;return[GS(t*o+n*s,r*i+e*a),ZS(e*i-r*a)]},n}function v4(t,e){(e=o4(e))[0]-=t,h4(e);t=KS(-e[1]);return((-e[2]<0?-t:t)+BS-P)%BS}function b4(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:JS,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function x4(t,e){return zS(t[0]-e[0])<P&&zS(t[1]-e[1])<P}function w4(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function M4(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(x4(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*P}s.push(n=new w4(r,t,null,!0)),l.push(n.o=new w4(r,null,n,!1)),s.push(n=new w4(i,t,null,!1)),l.push(n.o=new w4(i,null,n,!0))}}),s.length){for(l.sort(e),O4(s),O4(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function O4(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function k4(t){return zS(t[0])<=jS?t[0]:XS(t[0])*((zS(t[0])+jS)%BS-jS)}function E4(y,m,v,b){return function(s){var l,c,u,n=m(s),h=b4(),f=m(h),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=kf(c);var t=function(t,e){var n=k4(e),r=e[1],e=A(r),i=[A(n),-_(n),0],a=0,o=0,s=new qh;1===e?r=RS+P:-1===e&&(r=-RS-P);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=k4(f),p=f[1]/2+IS,g=A(p),y=_(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=k4(v),x=v[1]/2+IS,w=A(x),x=_(x),M=b-d,O=0<=M?1:-1,k=O*M,E=jS<k,S=g*w;s.add(GS(S*O*A(k),y*x+S*_(k))),a+=E?M+O*BS:M,E^n<=d^n<=b&&(h4(S=l4(o4(f),o4(v))),h4(k=l4(i,S)),(O=(E^0<=M?-1:1)*ZS(k[2]))<r||r===O&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-P||a<P&&s<-NS)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),M4(c,_4,t,v,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),v(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),v(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){y(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(S4))}return e}}function S4(t){return 1<t.length}function _4(t,e){return((t=t.x)[0]<0?t[1]-RS-P:RS-t[1])-((e=e.x)[0]<0?e[1]-RS-P:RS-e[1])}d4.invert=d4;var A4=E4(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?jS:-jS,l=zS(t-h);zS(l-jS)<P?(c.point(h,f=0<(f+e)/2?RS:-RS),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&jS<=l&&(zS(h-d)<P&&(h-=d*P),zS(t-s)<P&&(t-=s*P),l=f,i=e,o=A((n=h)-(r=t)),f=zS(o)>P?WS((A(l)*(a=_(i))*A(r)-A(i)*(r=_(l))*A(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*RS,r.point(-jS,i),r.point(0,i),r.point(jS,i),r.point(jS,0),r.point(jS,-i),r.point(0,-i),r.point(-jS,-i),r.point(-jS,0),r.point(-jS,i)):zS(t[0]-e[0])>P?(t=t[0]<e[0]?jS:-jS,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-jS,-RS]);function T4(d){var g=_(d),p=6*FS,h=0<g,f=zS(g)>P;function y(t,e){return _(t)*_(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=l4(o4(t),o4(e)),f=s4(h,h),d=h[0],p=f-d*d;return p?(r=l4(u,h),c4(u=u4(u,g*f/p),u4(h,-g*d/p)),(p=(h=s4(u,f=r))*h-(d=s4(f,f))*(s4(u,u)-1))<0?void 0:(c4(p=u4(f,(-h-(r=US(p)))/d),u),p=a4(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=zS((s=a-i)-jS)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(zS(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:jS<s^(i<=p[0]&&p[0]<=a))?(c4(c=u4(f,(-h+r)/d),u),[p,a4(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:jS-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return E4(y,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=y(t,e),t=h?i?0:v(t,e):i?v(t+(t<0?jS:-jS),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!x4(o,n)&&!x4(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=m(r,o),a.point(n[0],n[1])):(n=m(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=m(r,o,!0))||(u=0,h?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&x4(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=_(r),c=A(r),u=o*a;null==n?(n=r+o*BS,s=r-u/2):(n=v4(l,n),s=v4(l,s),(0<o?n<s:s<n)&&(n+=o*BS));for(var h,f=n;0<o?s<f:f<s;f-=u)h=a4([l,-c*_(f),-c*A(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-jS,d-jS])}var P4=1e9,C4=-P4;function L4(m,v,b,x){function w(t,e){return m<=t&&t<=b&&v<=e&&e<=x}function M(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?m:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return zS(t[0]-m)<P?0<e?0:3:zS(t[0]-b)<P?0<e?2:1:zS(t[1]-v)<P?0<e?1:0:0<e?3:2}function O(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,h,a,o,s,l,c,u,f,d,p,g=r,t=b4(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(m-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(m-r)&&--t;return t}(),e=p&&t,n=(i=kf(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&M4(i,O,t,M,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,h=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(C4,Math.min(P4,c)),u=Math.max(C4,Math.min(P4,u))],r=[t=Math.max(C4,Math.min(P4,t)),e=Math.max(C4,Math.min(P4,e))],m,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function N4(t,e,n){var r=Ef(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function j4(t,e,n){var r=Ef(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function R4(){return g=p=10,y=90,m=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(v)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(v)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],e):[y,m]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(v=+t,u=N4(s,o,90),h=j4(r,n,v),f=N4(c,l,90),d=j4(a,i,v),e):v},e.extentMajor([[-180,-90+P],[180,90-P]]).extentMinor([[-180,-80-P],[180,80+P]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return Ef(HS(a/y)*y,i,y).map(f).concat(Ef(HS(c/m)*m,l,m).map(d)).concat(Ef(HS(r/p)*p,n,p).filter(function(t){return zS(t%y)>P}).map(u)).concat(Ef(HS(s/g)*g,o,g).filter(function(t){return zS(t%m)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var I4,B4,D4,F4,z4=t=>t,W4=new qh,G4=new qh,H4={point:JS,lineStart:JS,lineEnd:JS,polygonStart:function(){H4.lineStart=V4,H4.lineEnd=X4},polygonEnd:function(){H4.lineStart=H4.lineEnd=H4.point=JS,W4.add(zS(G4)),G4=new qh},result:function(){var t=W4/2;return W4=new qh,t}};function V4(){H4.point=Y4}function Y4(t,e){H4.point=q4,I4=D4=t,B4=F4=e}function q4(t,e){G4.add(F4*t-D4*e),D4=t,F4=e}function X4(){q4(I4,B4)}var U4=H4,$4=1/0,K4=$4,Z4=-$4,J4=Z4;var Q4,t6,e6,n6,r6={point:function(t,e){t<$4&&($4=t);Z4<t&&(Z4=t);e<K4&&(K4=e);J4<e&&(J4=e)},lineStart:JS,lineEnd:JS,polygonStart:JS,polygonEnd:JS,result:function(){var t=[[$4,K4],[Z4,J4]];return Z4=J4=-(K4=$4=1/0),t}},i6=0,a6=0,o6=0,s6=0,l6=0,c6=0,u6=0,h6=0,f6=0,d6={point:p6,lineStart:g6,lineEnd:v6,polygonStart:function(){d6.lineStart=b6,d6.lineEnd=x6},polygonEnd:function(){d6.point=p6,d6.lineStart=g6,d6.lineEnd=v6},result:function(){var t=f6?[u6/f6,h6/f6]:c6?[s6/c6,l6/c6]:o6?[i6/o6,a6/o6]:[NaN,NaN];return i6=a6=o6=s6=l6=c6=u6=h6=f6=0,t}};function p6(t,e){i6+=t,a6+=e,++o6}function g6(){d6.point=y6}function y6(t,e){d6.point=m6,p6(e6=t,n6=e)}function m6(t,e){var n=t-e6,r=e-n6,n=US(n*n+r*r);s6+=n*(e6+t)/2,l6+=n*(n6+e)/2,c6+=n,p6(e6=t,n6=e)}function v6(){d6.point=p6}function b6(){d6.point=w6}function x6(){M6(Q4,t6)}function w6(t,e){d6.point=M6,p6(Q4=e6=t,t6=n6=e)}function M6(t,e){var n=t-e6,r=e-n6,n=US(n*n+r*r);s6+=n*(e6+t)/2,l6+=n*(n6+e)/2,c6+=n,u6+=(n=n6*t-e6*e)*(e6+t),h6+=n*(n6+e),f6+=3*n,p6(e6=t,n6=e)}var O6=d6;function k6(t){this._context=t}k6.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,BS)}},result:JS};var E6,S6,_6,A6,T6,P6=new qh,C6={point:JS,lineStart:function(){C6.point=L6},lineEnd:function(){E6&&N6(S6,_6),C6.point=JS},polygonStart:function(){E6=!0},polygonEnd:function(){E6=null},result:function(){var t=+P6;return P6=new qh,t}};function L6(t,e){C6.point=N6,S6=A6=t,_6=T6=e}function N6(t,e){A6-=t,T6-=e,P6.add(US(A6*A6+T6*T6)),A6=t,T6=e}var j6=C6;let R6,I6,B6,D6;class F6{constructor(t){this._append=null==t?z6:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return z6;if(e!==R6){const r=10**e;R6=e,I6=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return I6}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===B6&&this._append===I6||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,B6=n,I6=this._append,D6=this._,this._=r),this._+=D6}}result(){var t=this._;return this._="",t.length?t:null}}function z6(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function W6(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),i4(t,a(o))),o.result()}return s.area=function(t){return i4(t,a(U4)),U4.result()},s.measure=function(t){return i4(t,a(j6)),j6.result()},s.bounds=function(t){return i4(t,a(r6)),r6.result()},s.centroid=function(t){return i4(t,a(O6)),O6.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,z4):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new F6(r)):new k6(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new F6(r)),s},s.projection(e).digits(r).context(n)}function G6(r){return function(t){var e,n=new H6;for(e in r)n[e]=r[e];return n.stream=t,n}}function H6(){}function V6(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),i4(n,t.stream(r6)),e(r6.result()),null!=r&&t.clipExtent(r),t}function Y6(i,a,t){return V6(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function q6(t,e,n){return Y6(t,[[0,0],e],n)}function X6(r,i,t){return V6(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function U6(i,a,t){return V6(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}H6.prototype={constructor:H6,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var $6=16,K6=_(30*FS);function Z6(t,e){return+e?(_=t,A=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:m,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=_(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=o4([t,e]),e=_(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],$6,r),r.point(u,h)}function m(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,$6,r),g.lineEnd=m,m()}return g}):(n=t,G6({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,_,A;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,m,v,b,x,w,M,O,k=o-t,E=s-e,S=k*k+E*E;4*A<S&&f--&&(y=a+h,x=ZS(y/=m=US((p=r+c)*p+(g=i+u)*g+y*y)),v=zS(zS(y)-1)<P||zS(n-l)<P?(n+l)/2:GS(g,p),b=(x=_(v,x))[0],x=x[1],A<(O=E*(w=b-t)-k*(M=x-e))*O/S||.3<zS((k*w+E*M)/S-.5)||r*c+i*u+a*h<K6)&&(T(t,e,n,r,i,a,b,x,v,p/=m,g/=m,y,f,d),d.point(b,x),T(b,x,v,p,g,y,o,s,l,c,u,h,f,d))}}var J6=G6({point:function(t,e){this.stream.point(t*FS,e*FS)}});function Q6(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=_(e),e=A(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,m=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(m-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,v.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},v);function v(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function t_(t){return e_(function(){return t})()}function e_(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,w=1,M=null,O=A4,k=null,E=z4,S=.5;function _(t){return l(t[0]*FS,t[1]*FS)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*DS,t[1]*DS]}function T(){var t=Q6(h,0,0,x,w,b).apply(null,e(p,g)),t=Q6(h,f-t[0],d-t[1],x,w,b);return r=p4(y,m,v),s=f4(e,t),l=f4(r,s),o=Z6(s,S),P()}function P(){return c=u=null,_}return _.stream=function(t){return c&&u===t?c:c=J6((n=r,G6({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(O(o(E(u=t))))));var n},_.preclip=function(t){return arguments.length?(O=t,M=void 0,P()):O},_.postclip=function(t){return arguments.length?(E=t,k=n=i=a=null,P()):E},_.clipAngle=function(t){return arguments.length?(O=+t?T4(M=t*FS):(M=null,A4),P()):M*DS},_.clipExtent=function(t){return arguments.length?(E=null==t?(k=n=i=a=null,z4):L4(k=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==k?null:[[k,n],[i,a]]},_.scale=function(t){return arguments.length?(h=+t,T()):h},_.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},_.center=function(t){return arguments.length?(p=t[0]%360*FS,g=t[1]%360*FS,T()):[p*DS,g*DS]},_.rotate=function(t){return arguments.length?(y=t[0]%360*FS,m=t[1]%360*FS,v=2<t.length?t[2]%360*FS:0,T()):[y*DS,m*DS,v*DS]},_.angle=function(t){return arguments.length?(b=t%360*FS,T()):b*DS},_.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},_.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},_.precision=function(t){return arguments.length?(o=Z6(s,S=t*t),P()):US(S)},_.fitExtent=function(t,e){return Y6(_,t,e)},_.fitSize=function(t,e){return q6(_,t,e)},_.fitWidth=function(t,e){return X6(_,t,e)},_.fitHeight=function(t,e){return U6(_,t,e)},function(){return e=t.apply(this,arguments),_.invert=e.invert&&A,T()}}function n_(t){var e=0,n=jS/3,r=e_(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*FS,n=t[1]*FS):[e*DS,n*DS]},t}function r_(t,e){var n,r,i,a=A(t),o=(a+A(e))/2;return zS(o)<P?(n=_(t),s.invert=function(t,e){return[t/n,ZS(e*n)]},s):(i=US(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=GS(t,zS(e))*XS(e);return e*o<0&&(n-=jS*XS(t)*XS(e)),[n/o,ZS((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,A(e)/n]}function l(t,e){e=US(r-2*o*A(e))/o;return[e*A(t*=o),i-e*_(t)]}}function i_(){return n_(r_).scale(155.424).center([0,33.6442])}function a_(){return i_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function o_(i){return function(t,e){var n=_(t),r=_(e),n=i(n*r);return n===1/0?[2,0]:[n*r*A(t),n*A(e)]}}function s_(a){return function(t,e){var n=US(t*t+e*e),r=a(n),i=A(r),r=_(r);return[GS(t*i,n*r),ZS(n&&e*i/n)]}}var l_=o_(function(t){return US(2/(1+t))});l_.invert=s_(function(t){return 2*ZS(t/2)});var c_=o_(function(t){return(t=KS(t))&&t/A(t)});function u_(t,e){return[t,YS($S((RS+e)/2))]}function h_(r){var i,a,o,s=t_(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=jS*l(),n=s((e=p4((e=s.rotate())[0]*FS,e[1]*FS,2<e.length?e[2]*FS:0),function(t){return(t=e.invert(t[0]*FS,t[1]*FS))[0]*=DS,t[1]*=DS,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===u_?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),h()):null==u?null:[[u,i],[a,o]]},h()}function f_(t){return $S((RS+t)/2)}function d_(t,e){var n=_(t),i=t===e?A(t):YS(n/_(e))/YS(f_(e)/f_(t)),a=n*qS(f_(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=XS(i)*US(t*t+e*e),r=GS(t,zS(e))*XS(e);return e*i<0&&(r-=jS*XS(t)*XS(e)),[r/i,2*WS(qS(a/n,1/i))-RS]},r):u_;function r(t,e){0<a?e<-RS+P&&(e=-RS+P):RS-P<e&&(e=RS-P);e=a/qS(f_(e),i);return[e*A(i*t),a-e*_(i*t)]}}function p_(t,e){return[t,e]}function g_(t,e){var n=_(t),r=t===e?A(t):(n-_(e))/(e-t),i=n/r+t;return zS(r)<P?p_:(a.invert=function(t,e){var e=i-e,n=GS(t,zS(e))*XS(e);return e*r<0&&(n-=jS*XS(t)*XS(e)),[n/r,i-XS(r)*US(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*A(t),i-e*_(t)]}}c_.invert=s_(function(t){return t}),u_.invert=function(t,e){return[t,2*WS(VS(e))-RS]},p_.invert=p_;var y_=1.340264,m_=-.081106,v_=893e-6,b_=.003796,x_=US(3)/2;function w_(t,e){var e=ZS(x_*A(e)),n=e*e,r=n*n*n;return[t*_(e)/(x_*(y_+3*m_*n+r*(7*v_+9*b_*n))),e*(y_+m_*n+r*(v_+b_*n))]}function M_(t,e){var n=_(e),r=_(t)*n;return[n*A(t)/r,A(e)/r]}function O_(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function k_(t,e){return[_(e)*A(t),A(e)]}function E_(t,e){var n=_(e),r=1+_(t)*n;return[n*A(t)/r,A(e)/r]}function S_(t,e){return[YS($S((RS+e)/2)),-t]}w_.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(y_+m_*i+a*(v_+b_*i))-e)/(y_+3*m_*i+a*(7*v_+9*b_*i)))*r)*i*i,!(zS(n)<NS));++o);return[x_*t*(y_+3*m_*i+a*(7*v_+9*b_*i))/_(r),ZS(A(r)/x_)]},M_.invert=s_(WS),O_.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),zS(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},k_.invert=s_(ZS),E_.invert=s_(function(t){return 2*WS(t)}),S_.invert=function(t,e){return[-e,2*WS(VS(t))-RS]};var __=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=a_(),l=i_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=i_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function f(){return e=n=null,h}return h.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},h.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+P,r+.12*e+P],[n-.214*e-P,r+.234*e-P]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+P,r+.166*e+P],[n-.115*e-P,r+.234*e-P]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return Y6(h,t,e)},h.fitSize=function(t,e){return q6(h,t,e)},h.fitWidth=function(t,e){return X6(h,t,e)},h.fitHeight=function(t,e){return U6(h,t,e)},h.scale(1070)},geoAlbers:a_,geoAzimuthalEqualArea:function(){return t_(l_).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:l_,geoAzimuthalEquidistant:function(){return t_(c_).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:c_,geoConicConformal:function(){return n_(d_).scale(109.5).parallels([30,30])},geoConicConformalRaw:d_,geoConicEqualArea:i_,geoConicEqualAreaRaw:r_,geoConicEquidistant:function(){return n_(g_).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:g_,geoEqualEarth:function(){return t_(w_).scale(177.158)},geoEqualEarthRaw:w_,geoEquirectangular:function(){return t_(p_).scale(152.63)},geoEquirectangularRaw:p_,geoGnomonic:function(){return t_(M_).scale(144.049).clipAngle(60)},geoGnomonicRaw:M_,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,m=G6({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=z4;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/y]},x.stream=function(t){return o&&s===t?o:o=m(v(s=t))},x.postclip=function(t){return arguments.length?(v=t,p=e=n=a=null,b()):v},x.clipExtent=function(t){return arguments.length?(v=null==t?(p=e=n=a=null,z4):L4(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=A(d=t%360*FS),r=_(d),b()):d*DS},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return Y6(x,t,e)},x.fitSize=function(t,e){return q6(x,t,e)},x.fitWidth=function(t,e){return X6(x,t,e)},x.fitHeight=function(t,e){return U6(x,t,e)},x},geoProjection:t_,geoProjectionMutator:e_,geoMercator:function(){return h_(u_).scale(961/BS)},geoMercatorRaw:u_,geoNaturalEarth1:function(){return t_(O_).scale(175.295)},geoNaturalEarth1Raw:O_,geoOrthographic:function(){return t_(k_).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:k_,geoStereographic:function(){return t_(E_).scale(250).clipAngle(142)},geoStereographicRaw:E_,geoTransverseMercator:function(){var t=h_(S_),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:S_});function A_(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function T_(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(C_),e.find(t=>t.sphere)?{type:"Sphere"}:A_(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=W6(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function P_(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[R4()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function C_(t){return"geoPath"===t.type}Fs=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=at(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Qe(t);if(e=__[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(P_);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(T_(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=W6(i);const u=new Z1({domain:[t,t+n]}),h=new Z1({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return C_(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:Pd(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},Fs.props={},gl=()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=at(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a,state:s}]})]};gl.props={};const L_={"composition.geoView":Fs,"composition.geoPath":gl};function N_(){return Object.assign({"data.fetch":p0,"data.inline":w0,"data.sortBy":x0,"data.sort":m0,"data.filter":y0,"data.pick":v0,"data.rename":b0,"data.fold":g0,"data.slice":K0,"data.custom":M0,"data.map":O0,"data.cluster":$p,"data.tree":Kp,"data.sankey":md,"data.arc":_0,"data.wordCloud":X0,"data.join":$0,"data.kde":rg,"data.venn":Og,"transform.maybeZeroY1":e3,"transform.maybeZeroX":g3,"transform.maybeStackY":d3,"transform.maybeTitle":p3,"transform.maybeSeries":b3,"transform.maybeZeroPadding":E3,"transform.stackY":h3,"transform.binX":mS,"transform.bin":yS,"transform.dodgeX":P3,"transform.jitter":R3,"transform.jitterX":I3,"transform.symmetryY":B3,"transform.diffY":D3,"transform.stackEnter":C3,"transform.normalizeY":L3,"transform.select":H3,"transform.selectX":V3,"transform.selectY":Y3,"transform.groupX":rS,"transform.groupY":iS,"transform.groupColor":aS,"transform.group":nS,"transform.maybeSize":m3,"transform.maybeZeroY":y3,"transform.maybeKey":v3,"transform.sortX":lS,"transform.sortY":uS,"transform.sortColor":cS,"transform.flexX":hS,"transform.maybeTupleY":x3,"transform.maybeTupleX":w3,"transform.maybeIdentityY":M3,"transform.maybeIdentityX":O3,"transform.maybeTuple":A3,"transform.maybeVisualPosition":S3,"transform.maybeFunctionAttribute":_3,"transform.maybeGradient":T3,"transform.maybeTooltip":k3,"transform.pack":dS,"transform.sample":xS,"transform.filter":wS,"coordinate.cartesian":au,"coordinate.polar":su,"coordinate.helix":lu,"coordinate.transpose":cu,"coordinate.theta":uu,"coordinate.parallel":du,"coordinate.fisheye":pu,"coordinate.radial":fu,"coordinate.radar":gu,"encode.constant":yu,"encode.field":vu,"encode.transform":mu,"encode.column":bu,"mark.interval":jh,"mark.rect":Rh,"mark.line":Df,"mark.point":Ff,"mark.text":zf,"mark.cell":Wf,"mark.area":Gf,"mark.link":Hf,"mark.image":Vf,"mark.polygon":Yf,"mark.box":qf,"mark.vector":Xf,"mark.lineX":$f,"mark.lineY":Uf,"mark.connector":Kf,"mark.range":Qf,"mark.rangeX":td,"mark.rangeY":ed,"mark.sankey":Bd,"mark.path":Dd,"mark.treemap":Gd,"mark.pack":Yd,"mark.boxplot":tp,"mark.shape":ep,"mark.forceGraph":Xp,"mark.gauge":Xy,"mark.tree":e0,"mark.wordCloud":kg,"mark.density":Uy,"mark.heatmap":$y,"palette.category10":Ky,"palette.category20":Zy,"scale.linear":Qy,"scale.ordinal":tm,"scale.band":Jy,"scale.identity":em,"scale.point":nm,"scale.time":rm,"scale.log":im,"scale.pow":am,"scale.sqrt":cm,"scale.threshold":om,"scale.quantile":sm,"scale.quantize":lm,"scale.sequential":um,"scale.constant":hm,"shape.interval.rect":gv,"shape.interval.hollow":yv,"shape.interval.funnel":mv,"shape.interval.pyramid":bv,"shape.rect.rect":gv,"shape.rect.hollow":yv,"shape.cell.cell":gv,"shape.cell.hollow":yv,"shape.line.line":Ov,"shape.line.hv":Ev,"shape.line.vh":Sv,"shape.line.hvh":_v,"shape.line.trail":Av,"shape.line.smooth":kv,"shape.point.bowtie":Pv,"shape.point.cross":Cv,"shape.point.diamond":Lv,"shape.point.hexagon":Nv,"shape.point.hollowBowtie":jv,"shape.point.hollowDiamond":Rv,"shape.point.hollowHexagon":Iv,"shape.point.hollow":Bv,"shape.point.hollowSquare":Dv,"shape.point.hollowTriangle":Fv,"shape.point.hollowTriangleDown":zv,"shape.point.hyphen":Wv,"shape.point.line":Gv,"shape.point.plus":Hv,"shape.point.point":Vv,"shape.point.square":Yv,"shape.point.tick":qv,"shape.point.triangle":Xv,"shape.point.triangleDown":Uv,"shape.text.text":c5,"shape.area.area":p5,"shape.area.smooth":g5,"shape.area.hvh":y5,"shape.area.vh":m5,"shape.area.hv":v5,"shape.link.smooth":x5,"shape.link.vhv":w5,"shape.link.arc":M5,"shape.link.link":b5,"shape.image.image":O5,"shape.polygon.polygon":k5,"shape.polygon.ribbon":E5,"shape.box.box":S5,"shape.box.violin":_5,"shape.vector.vector":$v,"shape.label.label":Y5,"shape.text.badge":h5,"shape.lineX.line":A5,"shape.lineY.line":A5,"shape.shape.shape":eM,"shape.connector.connector":C5,"shape.range.range":gv,"shape.rangeX.range":gv,"shape.rangeY.range":gv,"shape.path.path":X5,"shape.path.hollow":U5,"shape.density.density":$5,"shape.heatmap.heatmap":tM,"theme.classic":rM,"theme.classicDark":aM,"theme.academy":sM,"component.axisX":IM,"component.axisY":BM,"component.axisRadar":DM,"component.axisLinear":jM,"component.axisArc":RM,"component.legendCategory":GM,"component.legendContinuous":XM,"component.legendContinuousBlock":UM,"component.legendContinuousBlockSize":KM,"component.legendContinuousSize":$M,"component.legends":hO,"component.title":QM,"component.sliderX":oO,"component.sliderY":sO,"component.scrollbarX":cO,"component.scrollbarY":uO,"animation.scaleInX":fO,"animation.scaleOutX":dO,"animation.scaleInY":pO,"animation.scaleOutY":gO,"animation.waveIn":_O,"animation.fadeIn":yO,"animation.fadeOut":mO,"animation.zoomIn":AO,"animation.zoomOut":TO,"animation.pathIn":PO,"animation.morphing":SO,"animation.growInX":CO,"animation.growInY":LO,"interaction.elementHighlight":ek,"interaction.elementHighlightByX":nk,"interaction.elementHighlightByColor":rk,"interaction.elementSelect":ak,"interaction.elementSelectByX":ok,"interaction.elementSelectByColor":sk,"interaction.fisheye":ck,"interaction.chartIndex":lk,"interaction.tooltip":Tk,"interaction.legendFilter":zk,"interaction.legendHighlight":Wk,"interaction.brushHighlight":Xk,"interaction.brushXHighlight":$k,"interaction.brushYHighlight":Zk,"interaction.brushAxisHighlight":oE,"interaction.brushFilter":lE,"interaction.brushXFilter":cE,"interaction.brushYFilter":uE,"interaction.sliderFilter":dE,"interaction.scrollbarFilter":gE,"interaction.poptip":vE,"interaction.event":dk,"composition.spaceLayer":ME,"composition.spaceFlex":OE,"composition.mark":EE,"composition.view":kE,"composition.facetRect":IE,"composition.repeatMatrix":zE,"composition.facetCircle":qE,"composition.timingKeyframe":XE,"labelTransform.overlapHide":kS,"labelTransform.overlapDodgeY":SS,"labelTransform.overflowHide":LS,"labelTransform.contrastReverse":CS},L_)}const j_=[["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"]]]]];function R_(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function I_(t,e,n,r,i){var a=t[0],t=t[1],o=J();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function B_(t,e,n,r,i){var a=new Z1({range:[e,e+r]}),o=new Z1({range:[n,n+i]});return{transform:function(t){var e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function D_(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function F_(t,e,n,r,i){return t[0]}function z_(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new Z1({range:[s,t]}),c=new Z1({range:[a,o]}),u=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*h)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=R_(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function W_(t,e,n,r,i){return{transform:function(t){var e=t[0];return[t[1],e]},untransform:function(t){var e=t[0];return[t[1],e]}}}function G_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return U_.apply(void 0,$_([[-1,-1]],e,!1))}function H_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return U_.apply(void 0,$_([[-1,1]],e,!1))}function V_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return U_.apply(void 0,$_([[1,-1]],e,!1))}function Y_(t,e,n,r,i){var a,t=t[0],o=J();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function q_(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new Z1({range:[s,s+.99*l]}),h=new Z1({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=R_(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function X_(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new Z1({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new J1({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var U_=function(t,e,n,r,i){var a=t[0],t=t[1],o=J();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},$_=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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function K_(t){return 1/Math.tan(t)}function Z_(t,e,n,r,i){var a=K_(t[0]);return{transform:function(t){var e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var e=t[0],t=t[1];return[e-t*a,t]}}}function J_(t,e,n,r,i){var a=K_(t[0]);return{transform:function(t){var e=t[0];return[e,t[1]+e*a]},untransform:function(t){var e=t[0];return[e,t[1]-e*a]}}}function Q_(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function tA(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function eA(t,e,n){return n?new Z1({range:[0,1],domain:[0,e]}).map(t):t}function nA(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=eA(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[Q_(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[tA(e,s,o,0,1),t]}}}function rA(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=eA(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],Q_(t[1],s,o,0,1)]},untransform:function(t){return[t[0],tA(t[1],s,o,0,1)]}}}function iA(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=eA(a,r,t=void 0!==t&&t),u=eA(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[Q_(e,c,s,0,1),Q_(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[tA(e,c,s,0,1),tA(t,u,l,0,1)]}}}function aA(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new Z1({range:[0,r]}),u=new Z1({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=Q_(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=tA(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var oA=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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},sA=(lA.prototype.update=function(t){this.options=t1({},this.options,t),this.recoordinate()},lA.prototype.clone=function(){return new lA(this.options)},lA.prototype.getOptions=function(){return this.options},lA.prototype.clear=function(){this.update({transformations:[]})},lA.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},lA.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},lA.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:oA(oA([],n,!0),[oA([],t,!0)],!1)}),this},lA.prototype.map=function(t){return this.output(t)},lA.prototype.invert=function(t){return this.input(t)},lA.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},lA.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?oA([],this.options.transformations,!0).reverse():this.options.transformations,n=t?function(t){return t.untransform}:function(t){return t.transform},r=[],a=[],i=function(t,e){return a.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,r)}return e}):t);var i},o=0,s=e;o<s.length;o++){var l,c,u,h,f=s[o],d=f[0],f=f.slice(1),p=this.transformers[d];p&&(l=(h=this.options).x,c=h.y,u=h.width,h=h.height,p=p(oA([],f,!0),l,c,u,h),(f=p)instanceof Float32Array||f instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||e1,"parallel"!==d)))}return r.length&&i(this.createMatrixTransform(r,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):e1}.apply(void 0,a)},lA.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=J();return e&&t.reverse(),t.forEach(function(t){return Q(p,p,t)}),e&&(e=t=p,(d=new Z(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Xt(t,t,p),[t[0],t[1]]}},lA);function lA(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:B_,translate:I_,custom:D_,matrix:F_,polar:z_,transpose:W_,scale:U_,"shear.x":Z_,"shear.y":J_,reflect:G_,"reflect.x":H_,"reflect.y":V_,rotate:Y_,helix:q_,parallel:X_,fisheye:iA,"fisheye.x":nA,"fisheye.y":rA,"fisheye.circular":aA},this.update(t)}function cA(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||wd("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=at(t,["type"]);return r(n)(t,e)},r]}function uA(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function hA(t,e){var{coordinate:n={}}=t,t=at(t,["coordinate"]),{type:r,transform:i=[]}=n,n=at(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=cA("coordinate",e),{transform:e=!1}=e(r).props||{};if(e)throw new Error(`Unknown coordinate: ${r}.`);return Object.assign(Object.assign({},t),{coordinates:[Object.assign({type:r},n),...i]})}function fA(t,e){return t.filter(t=>t.type===e)}function dA(t){return 0<fA(t,"polar").length}function pA(t){return fA(t,"transpose").length%2==1}function gA(t){return 0<fA(t,"theta").length}function yA(t){return 0<fA(t,"radial").length}function y(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}r=y("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),a=y("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Fo=y("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Ro=y("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),n=y("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Po=y("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),wo=y("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ni=y("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Hs=y("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),So=y("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function mA(t,e,n){(t.prototype=e.prototype=n).constructor=t}function vA(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function bA(){}var xA=1/.7,$s="\\s*([+-]?\\d+)\\s*",Xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Js="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wA=/^#([0-9a-f]{3,8})$/,MA=new RegExp(`^rgb\\(${$s},${$s},${$s}\\)$`),OA=new RegExp(`^rgb\\(${Js},${Js},${Js}\\)$`),kA=new RegExp(`^rgba\\(${$s},${$s},${$s},${Xs}\\)$`),EA=new RegExp(`^rgba\\(${Js},${Js},${Js},${Xs}\\)$`),SA=new RegExp(`^hsl\\(${Xs},${Js},${Js}\\)$`),_A=new RegExp(`^hsla\\(${Xs},${Js},${Js},${Xs}\\)$`),AA={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 TA(){return this.rgb().formatHex()}function PA(){return this.rgb().formatRgb()}function CA(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wA.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?LA(e):3===n?new IA(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?NA(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?NA(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=MA.exec(t))?new IA(e[1],e[2],e[3],1):(e=OA.exec(t))?new IA(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=kA.exec(t))?NA(e[1],e[2],e[3],e[4]):(e=EA.exec(t))?NA(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=SA.exec(t))?GA(e[1],e[2]/100,e[3]/100,1):(e=_A.exec(t))?GA(e[1],e[2]/100,e[3]/100,e[4]):AA.hasOwnProperty(t)?LA(AA[t]):"transparent"===t?new IA(NaN,NaN,NaN,0):null}function LA(t){return new IA(t>>16&255,t>>8&255,255&t,1)}function NA(t,e,n,r){return new IA(t=r<=0?e=n=NaN:t,e,n,r)}function jA(t){return(t=t instanceof bA?t:CA(t))?new IA((t=t.rgb()).r,t.g,t.b,t.opacity):new IA}function RA(t,e,n,r){return 1===arguments.length?jA(t):new IA(t,e,n,null==r?1:r)}function IA(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function BA(){return"#"+WA(this.r)+WA(this.g)+WA(this.b)}function DA(){var t=FA(this.opacity);return(1===t?"rgb(":"rgba(")+zA(this.r)+`, ${zA(this.g)}, `+zA(this.b)+(1===t?")":`, ${t})`)}function FA(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zA(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function WA(t){return((t=zA(t))<16?"0":"")+t.toString(16)}function GA(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new VA(t,e,n,r)}function HA(t){var e,n,r,i,a,o,s,l;return t instanceof VA?new VA(t.h,t.s,t.l,t.opacity):(t=t instanceof bA?t:CA(t))?t instanceof VA?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(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=0<l&&l<1?0:o,new VA(o,s,l,t.opacity)):new VA}function VA(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function YA(t){return(t=(t||0)%360)<0?t+360:t}function qA(t){return Math.max(0,Math.min(1,t||0))}function XA(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}mA(bA,CA,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:TA,formatHex:TA,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return HA(this).formatHsl()},formatRgb:PA,toString:PA}),mA(IA,RA,vA(bA,{brighter(t){return t=null==t?xA:Math.pow(xA,t),new IA(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new IA(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new IA(zA(this.r),zA(this.g),zA(this.b),FA(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:BA,formatHex:BA,formatHex8:function(){return"#"+WA(this.r)+WA(this.g)+WA(this.b)+WA(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:DA,toString:DA})),mA(VA,function(t,e,n,r){return 1===arguments.length?HA(t):new VA(t,e,n,null==r?1:r)},vA(bA,{brighter(t){return t=null==t?xA:Math.pow(xA,t),new VA(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new VA(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,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new IA(XA(240<=t?t-240:120+t,n,e),XA(t,n,e),XA(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new VA(YA(this.h),qA(this.s),qA(this.l),FA(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(){var t=FA(this.opacity);return(1===t?"hsl(":"hsla(")+YA(this.h)+`, ${100*qA(this.s)}%, ${100*qA(this.l)}%`+(1===t?")":`, ${t})`)}}));const UA=Math.PI/180,$A=180/Math.PI;var KA=1.78277,ZA=-.29227,JA=-.90649,QA=1.97294,t8=QA*JA,e8=QA*KA,n8=KA*ZA- -.14861*JA;function r8(t,e,n,r){return 1===arguments.length?(i=t)instanceof i8?new i8(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof IA?i:jA(i)).r/255,o=i.g/255,l=i.b/255,l=(QA*(o-(a=(n8*l+t8*a-e8*o)/(n8+t8-e8)))-ZA*(o=l-a))/JA,new i8((l=(s=Math.sqrt(l*l+o*o)/(QA*a*(1-a)))?Math.atan2(l,o)*$A-120:NaN)<0?l+360:l,s,a,i.opacity)):new i8(t,e,n,null==r?1:r);var i,a,o,s,l}function i8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}mA(i8,r8,vA(bA,{brighter(t){return t=null==t?xA:Math.pow(xA,t),new i8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new i8(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*UA,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new IA(255*(e+n*(-.14861*r+KA*t)),255*(e+n*(ZA*r+JA*t)),255*(e+QA*r*n),this.opacity)}}));var a8=t=>()=>t;function o8(e,n){return function(t){return e+t*n}}function s8(a){return 1==(a=+a)?l8:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):a8(isNaN(t)?e:t);var n,r,i}}function l8(t,e){var n=e-t;return n?o8(t,n):a8(isNaN(t)?e:t)}!function t(e){var o=s8(e);function n(e,t){var n=o((e=RA(e)).r,(t=RA(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=l8(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);c8=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var c8,u8=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=RA(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=c8(r),i=c8(i),a=c8(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function h8(s){return function t(o){function e(e,t){var n=s((e=r8(e)).h,(t=r8(t)).h),r=l8(e.s,t.s),i=l8(e.l,t.l),a=l8(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}h8(function(t,e){var n=e-t;return n?o8(t,180<n||n<-180?n-360*Math.round(n/360):n):a8(isNaN(t)?e:t)});var ph=h8(l8),Ho=t=>u8(t[t.length-1]),Xo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(y),Ao=Ho(Xo),Bs=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(y),Ys=Ho(Bs),xl=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(y),Rs=Ho(xl),Wo=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(y),Ll=Ho(Wo),Oo=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(y),W=Ho(Oo),Ws=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(y),Yo=Ho(Ws),Ko=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(y),ts=Ho(Ko),vs=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(y),Ls=Ho(vs),Jo=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(y),Bo=Ho(Jo),Ns=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(y),u=Ho(Ns),Fs=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(y),gl=Ho(Fs),$s=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(y),Js=Ho($s),Xs=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(y),f8=Ho(Xs),d8=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(y),p8=Ho(d8),g8=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(y),y8=Ho(g8),m8=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(y),v8=Ho(m8),b8=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(y),x8=Ho(b8),w8=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(y),M8=Ho(w8),O8=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(y),k8=Ho(O8),E8=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(y),S8=Ho(E8),_8=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(y),A8=Ho(_8),T8=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(y),P8=Ho(T8),C8=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(y),L8=Ho(C8),N8=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(y),j8=Ho(N8),R8=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(y),I8=Ho(R8),B8=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(y),D8=Ho(B8),F8=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(y),Ho=Ho(F8);var z8=ph(r8(300,.5,0),r8(-240,.5,1)),W8=ph(r8(-100,.75,.35),r8(80,1.5,.8)),ph=ph(r8(260,.75,.35),r8(80,1.5,.8)),G8=r8();var H8=RA(),V8=Math.PI/3,Y8=2*Math.PI/3;function q8(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var X8=q8(y("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),U8=q8(y("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),$8=q8(y("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),K8=q8(y("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Z8=Object.freeze({__proto__:null,schemeCategory10:r,schemeAccent:a,schemeDark2:Fo,schemePaired:Ro,schemePastel1:n,schemePastel2:Po,schemeSet1:wo,schemeSet2:ni,schemeSet3:Hs,schemeTableau10:So,interpolateBrBG:Ao,schemeBrBG:Xo,interpolatePRGn:Ys,schemePRGn:Bs,interpolatePiYG:Rs,schemePiYG:xl,interpolatePuOr:Ll,schemePuOr:Wo,interpolateRdBu:W,schemeRdBu:Oo,interpolateRdGy:Yo,schemeRdGy:Ws,interpolateRdYlBu:ts,schemeRdYlBu:Ko,interpolateRdYlGn:Ls,schemeRdYlGn:vs,interpolateSpectral:Bo,schemeSpectral:Jo,interpolateBuGn:u,schemeBuGn:Ns,interpolateBuPu:gl,schemeBuPu:Fs,interpolateGnBu:Js,schemeGnBu:$s,interpolateOrRd:f8,schemeOrRd:Xs,interpolatePuBuGn:p8,schemePuBuGn:d8,interpolatePuBu:y8,schemePuBu:g8,interpolatePuRd:v8,schemePuRd:m8,interpolateRdPu:x8,schemeRdPu:b8,interpolateYlGnBu:M8,schemeYlGnBu:w8,interpolateYlGn:k8,schemeYlGn:O8,interpolateYlOrBr:S8,schemeYlOrBr:E8,interpolateYlOrRd:A8,schemeYlOrRd:_8,interpolateBlues:P8,schemeBlues:T8,interpolateGreens:L8,schemeGreens:C8,interpolateGreys:j8,schemeGreys:N8,interpolatePurples:I8,schemePurples:R8,interpolateReds:D8,schemeReds:B8,interpolateOranges:Ho,schemeOranges:F8,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:z8,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return G8.h=360*t-100,G8.s=1.5-1.5*e,G8.l=.8-.9*e,G8+""},interpolateWarm:W8,interpolateCool:ph,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,H8.r=255*(e=Math.sin(t))*e,H8.g=255*(e=Math.sin(t+V8))*e,H8.b=255*(e=Math.sin(t+Y8))*e,H8+""},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:X8,interpolateMagma:U8,interpolateInferno:$8,interpolatePlasma:K8});function J8(t,e,n,r,i,a){var o,s,{guide:l={}}=n,c=function(t,e,n){var{type:n,domain:r,range:i}=n;return void 0!==n?n:function(t){return hT(t,_d)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?aT(t):void 0===r?cT(e)?aT(t):uT(e)?"time":oT(t,i):cT([r])?aT(t):uT(e)?"time":oT(t,i)}(t,e,n);return"string"!=typeof c?n:(s=function(t,e,n){const r=n["ratio"];if(void 0===r||null===r)return e;if(nT({type:t}))return function(t,e,n){const r=t.map(Number),i=new Z1({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 rT({type:t})?(n=e,t=r,t=Math.round(n.length*r),n.slice(0,t)):e}(c,o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return sT(function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)Od(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n),n);case"band":case"ordinal":case"point":return lT(e);case"quantile":return function(t){return lT(t).sort()}(e);case"sequential":return sT(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)Od(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e),n);default:return[]}}(c,e,n),n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=_1,nice:n=!1,tickCount:r=5}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);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});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"!==t?"point"===t?.5:0:gA(n)?0:.1}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Qe(e),i=Z8["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(c,t,n,r)),{domain:s,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=iT(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],Ey(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||0,c||1];case"ordinal":return iT(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}(c,t,e,n,s,i,a),expectedDomain:o,guide:l,name:t,type:c}))}function Q8(t,e){var{components:e=[]}=e,n=["scale","encode","axis","legend","data","transform"],r=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),i=new Map(r.map(t=>[t.name,t]));for(const l of e)for(const c of function(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)):[]}(l)){var a=i.get(c),o=(null==(o=l.scale)?void 0:o[c])||{},{independent:s=!1}=o;a&&!s?(s=a["guide"],a.guide=ot({},"boolean"==typeof s?{}:s,l),Object.assign(a,o)):(s=Object.assign(Object.assign({},o),{expectedDomain:o.domain,name:c,guide:ln(l,n)}),r.push(s))}return r}function tT(t,e){var[e]=cA("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[vd,vd];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function eT(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(nT)?Yh(e):t.every(rT)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function nT(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function rT(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function iT(t,e,n,r,i){var[i]=cA("palette",i),{defaultCategory10:r,defaultCategory20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Qe(t),i=Z8["scheme"+e],a=Z8["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function aT(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function oT(t,e){return"color"!==t||e?"linear":"sequential"}function sT(t,e){var n,r;return 0===t.length?t:({domainMin:e,domainMax:n}=e,[t,r]=t,[null!=e?e:t,null!=n?n:r])}function lT(t){return Array.from(new Set(t.flat()))}function cT(t){return hT(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function uT(t){return hT(t,t=>t instanceof Date)}function hT(t,e){for(const n of t)if(n.some(e))return!0;return!1}const fT={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},dT={threshold:"threshold",quantize:"quantize",quantile:"quantile"},pT={ordinal:"ordinal",band:"band",point:"point"},gT={constant:"constant"};function yT(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=cA("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=cA("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?pA(i)?t+"Y":t+"X":"y"===e?pA(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,defaultSize:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);return M.push(...e),r&&(t=x("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:i}=t,M.push(Object.assign({type:"title",position:n,orientation:e,order:t,defaultSize:i},"string"==typeof r?{title:r}:r))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0<n.length,r=r&&0<r.length,["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(t)&&n&&r)||["sequential"].includes(t)&&n&&(r||e)||["constant","identity"].includes(t)&&r));var e,n,r});return[...function(t){const n=["shape","size","color","opacity"],e=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!("constant"===t&&"size"===e)),r=e.filter(({type:t})=>"constant"===t),i=e.filter(({type:t})=>"constant"!==t),a=Zh(i,t=>t.field||Symbol("independent")).map(([t,e])=>[t,[...e,...r]]).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])=>{var e,n,r=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(..._y(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>[t.name,function(t){t=t.type;return"string"!=typeof t?null:t in fT?"continuous":t in pT?"discrete":t in dT?"distribution":t in gT?"constant":null}(t)])}));for([e,n]of j_)for(const{option:i,combination:a}of r)if(n.some(t=>un(s(t),s(i))))return[e,a];return null}).filter(Od);return l}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<fA(n,"helix").length||gA(n))&&(!pA(n)||!dA(n)&&!yA(n))){if(e.startsWith("x"))return dA(n)?["axisArc",[t]]:yA(n)?["axisLinear",[t]]:[pA(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return dA(n)?["axisLinear",[t]]:yA(n)?["axisArc",[t]]:[pA(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<fA(n,"radar").length)return["axisRadar",[t]];if(!dA(n))return["axisY",[t]]}}return null}).filter(Od)}(t,e)]}(w,b).forEach(([t,e])=>{var n=x(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o,defaultLength:s,defaultPadding:l=[0,0],defaultCrossPadding:c=[0,0]}=n,{guide:n,field:u}=ot({},...e);for(const v of Array.isArray(n)?n:[n]){var h,f,d,p,g,[y,m]=function(t,e,n,r,i,a,o){var[s]=bT(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=xT(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=bT(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<fA(t,"parallel").length}(i))return null===(s=xT(n))?e:pA(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=bT(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(dA(i))return["center",null];if(yA(i))return["center",null];if("axisX"===t&&function(t){return 0<fA(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<fA(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&dA(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,v,e,w,b);(y||m)&&(p=(g="left"===y||"right"===y)?l[1]:l[0],g=g?c[1]:c[0],{size:h,order:f=o,length:d=s,padding:p=p,crossPadding:g=g}=v,M.push(Object.assign(Object.assign({title:u},v),{defaultSize:a,length:d,position:y,orientation:m,padding:p,order:f,crossPadding:g,size:h,type:t,scales:e})))}}),M}function mT(t,e,n,r,i){var[a]=cA("component",r),{scaleInstances:o,scale:s,bbox:l}=t,l={bbox:l,library:r};return a(at(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function vT(t,o){const r=["left","right","bottom","top"];return Zh(t,({type:t,position:e,group:n})=>r.includes(e)?void 0===n?t.startsWith("legend")?"legend-"+e:Symbol("independent"):"independent"===n?Symbol("independent"):n:Symbol("independent")).flatMap(([,t],e)=>{if(1===t.length)return t[0];if(void 0!==o){var n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=Sf(n);if(o<r)return t.forEach(t=>t.group=Symbol("independent")),t;const a=(o-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=a)})}var r=pf(t,t=>t.size),n=pf(t,t=>t.order),i=pf(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function bT(t){var e,n=fA(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=ou(n),[n,e]):(n=fA(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=hu(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function xT(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function wT(t,e,n,r,i,a){var o=t["type"];if(["left","right","bottom","top"].includes(r)&&"string"==typeof o){const s=o;return(s.startsWith("axis")?kT:s.startsWith("group")?MT:s.startsWith("legendContinuous")?ET:"legendCategory"===s?ST:s.startsWith("slider")?OT:()=>{})(t,e,n,r,i,a)}}function MT(t,e,n,r,i,a){var o=t["children"];const s=pf(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>wT(t,e,n,r,i,a)),pf(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function OT(t,e,n,r,i,a){i=i.slider;var{trackSize:i,handleIconSize:o}=ot({},i,t.style),i=Math.max(i,2.4*o);t.size=i}function kT(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o="left"===r||"right"===r;const s=PT(t,r,i);var{tickLength:r=0,labelSpacing:i=0,titleSpacing:l=0}=s,c=at(s,["tickLength","labelSpacing","titleSpacing"]),a=_T(t,a),u=AT(t,a,c);if(u){var h=pf(u,t=>t.width),f=pf(u,t=>t.height),r=r+i;if(o)t.size=h+r;else{const{tickFilter:d,style:s={}}=t;i=s["labelTransform"];!function(t,e,n,r,i){var a=Sf(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),CT(t,i)),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;t=t.getBandWidth(e)/2;return t}(o,t)),c=s.map((t,e)=>e),u=-r[0],h=n+r[1],f=(t,e)=>{e=e.width;return[t-e/2,t+e/2]};for(let t=0;t<c.length;t++){var d=l[t],[d,p]=f(d,e[t]);if(d<u||h<p)return 1;d=l[t+1];if(d){var[d]=f(d,e[t+1]);if(d<p)return 1}}return}(a,u,e,n,d)||i?t.size=f+r:(t.style=Object.assign(Object.assign({},s),{labelTransform:"rotate(90)"}),t.size=h+r)}}a=TT(t,c);a&&(t.size+=o?l+a.width:l+a.height)}function ET(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t.style),{labelSpacing:o=0,titleSpacing:s=0}=i,i=at(i,["labelSpacing","titleSpacing"]),r="left"===r||"right"===r,l=st(i,"ribbon")["size"],c=st(i,"handleIcon")["size"],l=Math.max(l,2.4*c),c=(t.size=l,_T(t,a)),l=AT(t,c,i);if(l){const u=r?"width":"height";a=pf(l,t=>t[u]);t.size+=a+o}var c=TT(t,i),{crossPadding:l=0}=(c&&(r?t.size=Math.max(t.size,c.width):t.size+=s+c.height),t);t.size+=2*l}function ST(o,t,e,s,n,r){n=n.legendCategory;const i=ot({},n,o.style),{itemSpacing:a,itemMarkerSize:l,titleSpacing:c,rowPadding:u,colPadding:h}=i,f=at(i,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding"]),{cols:d,length:p}=o,g=void 0===p?t:p;n="left"===s||"right"===s;const y=TT(o,f);t=_T(o,r);const m=AT(o,t,f,"itemLabel"),v=Math.max(m[0].height,l)+u,b=(t,e=0)=>l+t+a[0]+e;if(n){let t=-1/0,e=0,n=1,r=0,i=-1/0,a=-1/0;var x,s=y?y.height:0,w=g-s;for({width:x}of m){var M=b(x);t=Math.max(t,M),e+v>w?(n++,i=Math.max(i,r),a=Math.max(a,e),r=1,e=v):(e+=v,r++)}n<=1&&(i=r,a=e),o.size=t*n,o.length=a+s,ot(o,{cols:n,gridRow:i})}else if("number"==typeof d)r=Math.ceil(m.length/d),t=pf(m,t=>b(t.width))*d,o.size=v*r,o.length=Math.min(t,g);else{let t=1,e=0,n=-1/0;for(var{width:O}of m){O=b(O,h);e+O>g?(n=Math.max(n,e),e=O,t++):e+=O}1===t&&(n=e),o.size=v*t,o.length=n}y&&(n?o.size=Math.max(o.size,y.width):o.size+=c+y.height);var{crossPadding:s=0}=o;o.size+=2*s}function _T(t,e){var[e]=cA("scale",e),{scales:t,tickCount:n,tickMethod:r}=t,t=t.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==n&&(t.tickCount=n),void 0!==r&&(t.tickMethod=r),e(t)}function AT(t,e,n,r="label"){var{labelFormatter:i,tickFilter:a,label:o=!0}=t;if(!o)return null;const s=function(t,e,n){n=CT(t,n),n=n.map(t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e}),e=e?"string"==typeof e?yM(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,i,a),l=st(n,r),c=s.map((n,r)=>Object.fromEntries(Object.entries(l).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]))),u=s.map((t,e)=>{return LT(t,c[e])});return c.some(t=>t.transform)||(o=s.map((t,e)=>e),t.indexBBox=new Map(o.map(t=>[t,[s[t],u[t]]]))),u}function TT(t,e){var n=t=>!1===t||null===t,t=t["title"],r=e["title"];return n(t)||n(r)||void 0===t?null:({direction:r,transform:e}=n=st(e,"title"),LT(Array.isArray(t)?t.join(","):t,Object.assign(Object.assign({},n),{transform:e||"vertical"===r?"rotate(-90)":""})))}function PT(t,e,n){var{axis:n,["axis"+xd(e)]:e}=n;return ot({},n,e,t.style)}function CT(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function LT(t,e){t=(t=t)instanceof z.DisplayObject?t:new z.Text({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function NT(t,o,e,n){var{width:r,height:i,x:a=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:h=l,insetRight:l=l,margin:f=0,marginLeft:d=f,marginBottom:p=f,marginTop:g=f,marginRight:f=f,padding:y,paddingBottom:m=y,paddingLeft:v=y,paddingRight:b=y,paddingTop:y=y}=function(t,e,n,r){var i=e["coordinates"];if(!dA(i))return e;i=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===i.length)return e;const a=i.map(t=>{return PT(t,"axisArc"===t.type?"arc":"linear",n)}),o=pf(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{e=a[e];return AT(t,_T(t,r),e)}).filter(Od),l=pf(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return TT(t,a[e])}).filter(t=>null!==t),u=0===c.length?0:pf(c,t=>t.height),{inset:h=l,insetLeft:f=h,insetBottom:d=h,insetTop:p=h+u,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:f,insetBottom:d,insetTop:p,insetRight:g})}(t,o,e,n);var x=(t,e,n,r,i)=>{var a=o["marks"];return 0===a.length||0<t-r-i-.25*t?[r,i]:(a=.75*t/2,["auto"===e?a:r,"auto"===n?a:i])},w=t=>"auto"!==t&&null!=t?t:30,M=w(y),w=w(m),{paddingLeft:M,paddingRight:w}=jT(t,i-M-w,[M,w],["left","right"],o,e,n),O=r-d-f,[v,b]=x(O,v,b,M,w),M=O-v-b,{paddingTop:w,paddingBottom:O}=jT(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,O,w);return{width:r,height:i,insetLeft:c,insetTop:u,insetBottom:h,insetRight:l,innerWidth:M,innerHeight:t-e-n,paddingLeft:v,paddingRight:b,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:f,x:a,y:s}}function jT(t,n,r,e,i,a,o){var s=Kh(t,t=>t.position),{padding:t,paddingLeft:i=t,paddingRight:l=t,paddingBottom:c=t,paddingTop:t=t}=i,u={paddingBottom:c,paddingLeft:i,paddingTop:t,paddingRight:l};for(const p of e){var h="padding"+xd(L5(p));const t=s.get(p)||[],g=u[h],y=t=>{void 0===t.size&&(t.size=t.defaultSize)};var f,d=t=>{var e;t.size||("auto"!==g?"group"===(e=t).type?(e.children.forEach(y),e.size=pf(e.children,t=>t.size)):e.size=e.defaultSize:(wT(t,n,r,p,a,o),y(t)))};"number"==typeof g?t.forEach(y):0===t.length?u[h]=30:((f=vT(t,n)).forEach(d),d=f.reduce((t,{size:e})=>t+e,0),u[h]=d)}return u}function RT(t,I,e){var B=Kh(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:D,marginLeft:r,marginTop:i,marginBottom:F,marginRight:z,innerHeight:a,innerWidth:o,insetBottom:W,insetLeft:s,insetRight:G,insetTop:l,height:c,width:H}=e,t=t+r,r=n+i,n=e+z,i=D+F,e=[t+s,r+l,o-s-G,a-l-W,"center",null,null],V={top:[t,0,o,r,"vertical",!0,Ih],right:[H-n,r,n,a,"horizontal",!1,Ih],bottom:[t,c-i,o,i,"vertical",!1,Ih],left:[0,r,t,a,"horizontal",!0,Ih],"top-left":[t,0,o,r,"vertical",!0,Ih],"top-right":[t,0,o,r,"vertical",!0,Ih],"bottom-left":[t,c-i,o,i,"vertical",!1,Ih],"bottom-right":[t,c-i,o,i,"vertical",!1,Ih],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=V[j],[h,Y]=Sy(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(h.length){y=g=p=d=f=void 0;var f=h,d=I,p=u,g=j,[f,y]=Sy(f,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),h=(b=v=m=h=void 0,f),m=d,v=p,b=g;if("center"===b)if(!function(t){return Cf(t)&&Af(t)}(m)){if(Af(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;O=void 0;f=h;g=v;var[x,w,M,O]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:O}}else if(Cf(m)){g=void 0;f=void 0;k=void 0;E=void 0;g=h;f=m;var k=v;var E=h[0].orientation;"horizontal"===E?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(g,f,k):"vertical"===E&&function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(g,f,k)}}else{S=void 0;E=void 0;_=void 0;A=void 0;q=void 0;X=void 0;var S=h;E=v;var[_,A,q,X]=E;for(const R of S)R.bbox={x:_,y:A,width:q,height:X},R.radar={index:S.indexOf(R),count:S.length}}else if("inner"===b){T=void 0;g=void 0;f=void 0;U=void 0;$=void 0;k=void 0;P=void 0;C=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,$,,f]=f,[k,P]=g.getCenter(),[g]=jf(g),f=f/2,C=g*f,K=k-C,Z=P-C;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:$+Z,width:2*C,height:2*C}}else if("outer"===b){m=void 0;g=void 0;J=void 0;Q=void 0;tt=void 0;et=void 0;m=h;g=v;var[J,Q,tt,et]=g;for(const at of m)at.bbox={x:J,y:Q,width:tt,height:et}}rt=nt=N=v=h=b=P=f=L=void 0;var L=y,f=d,P=p;if(0!==L.length){var[P,b,h,v]=P,[f]=jf(f),N=v/2*f/Math.sqrt(2),nt=P+h/2,rt=b+v/2;for(let t=0;t<L.length;t++)L[t].bbox={x:nt-N,y:rt-N,width:2*N,height:2*N}}}Y.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],m=(n.sort((t,e)=>null===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=m;t<n.length;t++){var v=n[t],{crossPadding:b=0}=v,x=v["size"];v.bbox={[c]:s?e-x+b:e+b,[h]:f,[d]:x-2*b,[g]:y},e+=x*(s?-1:1)}t=n.filter(t=>"group"===t.type);for(const _ of t){const{bbox:A,children:T}=_;var w=A[g];const P=w/T.length;var M=T.reduce((t,e)=>{e=null==(e=e.layout)?void 0:e.justifyContent;return e||t},"flex-start"),O=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),k=Sf(O),w=w-k,k="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=A[h]+k;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:A[d],[c]:A[c],[h]:e,[g]:O[t]-S},ot(E,{layout:{justifyContent:M}}),e+=O[t]}}}(t,u)}}function IT(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=at(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function BT(t,i,a){return $(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=cA("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=at(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>$(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),vd)}([at(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?ky(n):[],Object.assign(Object.assign({},i),{data:n})]})}function DT(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function FT(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Oy(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return Od(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function zT(t,e,n){var r=e["encode"];return r?(r=Oy(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{constant:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function WT(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=cA("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=Oy(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function GT(t,e,n){var{tooltip:r={}}=e;return Ad(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:_d(r)&&Cd(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function HT(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return Ad(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(_d(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?yM(a):a,s=n&&m[n],a=s&&m[n].field,l=i||a||n,c=[];for(const d of g){var u=t?y[d][t]:s?m[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var h=[];for(const p of g){var f=e(y[p],p,y,m);_d(f)?h[p]=f:h[p]={value:f}}return h},{title:o,items:i=[]}=n,a=at(n,["title","items"]),o=Object.assign({title:r(o),items:Array.isArray(i)?i.map(r):[]},a),[g,Object.assign(Object.assign({},t),{tooltip:o})])}function VT(l,t,e){var n,r=t["encode"],i=at(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=at(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function YT(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return ot(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{var 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 qT(t,e,n){var r=e["animate"];return r||void 0===r||ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function XT(l,c,u){return $(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return $(this,void 0,void 0,function*(){var t=c["library"],[t]=cA("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[IT,BT,DT,FT,zT,WT,VT,qT,YT,GT,...e.map(t),...r.map(t),...n.map(t),HT];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(l,c,{library:u});const{encode:n,scale:f,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=Qh(Object.entries(n).filter(([,t])=>Od(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=a.find(t=>t.name===e);return null!=n&&n.independent?t:e});var s=a.filter(t=>{const{name:e,required:n}=t;if(o.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:c,scaleKey:u,range:h}=t;return o.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=e.some(t=>t.constant),a=f[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=at(a,["independent","key","type"]),a="constant"===i,l=a?void 0:h;return{name:t,values:e,scaleKey:o||a?Symbol("independent"):s,scale:Object.assign({type:i,range:l},r)}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function UT(H,V,Y,q){var X,U;return $(this,void 0,void 0,function*(){const[n]=cA("composition",Y);var[t]=cA("interaction",Y);const I=new Set(Object.keys(Y).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(Od)),r=new Set(Object.keys(Y).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Od)),i=t=>{t=t.type;if("function"==typeof t){var{props:e={}}=t,{composite:e=!0}=e;if(e)return"mark"}return"string"==typeof t&&(I.has(t)||r.has(t))?"mark":t};const a=t=>"standardView"===i(t),B=t=>{t=t.type;return"string"==typeof t&&!!r.has(t)};var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e,static:B(t)})(t))},o=[];const s=new Map;for(var l=new Map,c=[H],u=[];c.length;){var h=c.shift();if(a(h)){var f=l.get(h),[f,d]=f?JT(f,h,Y):yield KT(h,Y),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>hA(t,Y)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>ZT(t,Y)));eT(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),eT(f,"y");for(let t=0;t<p.length;t++){var D=p[t],F=g[t];l.set(D,F)}}}else{d="mark"===i(h)?h:yield o7(h,Y),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(uk.BEFORE_PAINT);const y=new Map,m=new Map,v=[];V.selectAll(u7(K)).data(o,t=>t.key).join(t=>t.append("g").attr("className",K).attr("id",t=>t.key).call($T).each(function(t){QT(t,lt(this),v,Y,q),y.set(t,this)}),t=>t.call($T).each(function(t){QT(t,lt(this),v,Y,q),m.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var b=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(f,d,p){return h=>$(this,void 0,void 0,function*(){var t,[e,n]=yield KT(h,d),r=(QT(e,f,[],d,p),f),i=h,a=e,o=p,[s]=cA("interaction",s=d),l=(l=r.node()).nameInteraction,c=a7(i).find(([t])=>"tooltip"===t);(l=l.get("tooltip"))&&(null!=(t=l.destroy)&&t.call(l),c[1])&&(t=s(Object.assign({type:"tooltip"},c[1])),l={options:i,view:a,container:r.node(),update:t=>Promise.resolve(t)},t(l,[],o.emitter));for(const u of n)UT(u,f,d,p);return{options:h,view:e}})}(lt(e),Y,q)})),x=b(y);for(const P of x){const H=P["options"];var w=new Map;P.container.nameInteraction=w;for(const C of a7(H)){var[M,O]=C;O&&(O=t(Object.assign({type:M},O))(P,x,q.emitter),w.set(M,{destroy:O}))}}var k=b(m);for(const L of k){const{options:H,container:N}=L;var E=N.nameInteraction;for(const j of a7(H)){var[S,_]=j,A=E.get(S);A&&null!=(X=A.destroy)&&X.call(A),_&&(A=t(Object.assign({type:S},_))(L,k,q.emitter),E.set(S,{destroy:A}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>$(this,void 0,void 0,function*(){for(const t of R)yield UT(Object.assign({width:z,height:W},t),V,Y,q);e()}));T.push(G)}q.views=o,null!=(U=q.animations)&&U.forEach(t=>null==t?void 0:t.cancel()),q.animations=v,q.emitter.emit(uk.AFTER_PAINT);b=v.filter(Od).map(r7).map(t=>t.finished);return Promise.all([...b,...T])})}function $T(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function KT(e,n){return $(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=at(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),o=i.map(t=>t.interaction||{}),s=i.map(t=>t.viewStyle||{}),a=[...a,e].reduceRight((t,e)=>ot(t,e),{}),e=[n,...o].reduce((t,e)=>ot(t,e),{}),n=[...s,r].reduce((t,e)=>ot(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(p,g){return $(this,void 0,void 0,function*(){var[t,e]=cA("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Od));const r=p["marks"];for(var i=[],a=[],o=[...r],{width:s,height:l}=function(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-h-f,height:t-p(a)-p(n)-c-o-d-u}}(p),c={options:p,width:s,height:l};o.length;){var[u]=o.splice(0,1),u=yield o7(u,g);const{type:f=wd("G2Mark type is required."),key:d}=u;if(n.has(f))a.push(u);else{var{props:h={}}=e(f),{composite:h=!0}=h;if(h){const r=yield t(u,c);h=Array.isArray(r)?r:[r];o.unshift(...h.map((t,e)=>Object.assign(Object.assign({},t),{key:d+"-"+e})))}else i.push(u)}}return Object.assign(Object.assign({},p),{marks:i,components:a})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,hA(t,n));return JT(yield ZT(t,n),t,n)})}function ZT(p,g){return $(this,void 0,void 0,function*(){var[t]=cA("theme",g),[,e]=cA("mark",g),{theme:n,marks:r,coordinates:i=[]}=p,a=t(i7(n)),o=new Map;for(const h of r){var s,l=h["type"],{props:l={}}=e(l),l=yield XT(h,l,g);l&&([l,s]=l,o.set(l,s))}for(const f of Kh(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=f.reduce((t,{scale:e})=>ot(t,e),{}),u=f[0]["values"],u=Array.from(new Set(u.map(t=>t.field).filter(Od)));const p=ot({guide:{title:0===u.length?void 0:u},field:u[0]},c);u=f[0]["name"];const d=J8(u,f.flatMap(({values:t})=>t.map(t=>t.value)),p,i,a,g);f.forEach(t=>t.scale=d)}return o})}function JT(t,e,n){var[r]=cA("mark",n),[i]=cA("theme",n),[a]=cA("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(i7(I)),c=Array.from(t.values());const u=Q8(c,e);var c=yT(function(t,e,n){for(var[r]of n.entries())if("cell"===r.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;n=e[0].defaultShape;if(!["point","line","rect","hollow"].includes(n))return t;e=(null==(e=t.find(t=>"color"===t.name))?void 0:e.field)||null,e={field:e,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[n]]};return[...t,e]}(Array.from(u),c,t),e,n),h=NT(c,e,i,n),f=function(t,e,n){var[n]=cA("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new sA(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(h,e,n),e=s?ot({mainLineWidth:1,mainStroke:"#000"},l):l,d=(RT(vT(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=tT(w,n);u.push(p),d[z]=p}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:E}=g,{index:S,channels:_,tooltip:A}=y;var v=Oy(Object.fromEntries(_.map(({name:t,scale:e})=>[t,e])),t=>tT(t,n));Object.assign(d,v);const T=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(_,v),[P,C,L]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>Od(t)&&Od(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=O||P.length;const N=k?k(C,b,h):[],j=t=>{var e;return null==(e=null==(e=A.title)?void 0:e[t])?void 0:e.value},R=e=>A.items.map(t=>t[e]);b=P.map((t,e)=>{var n=Object.assign({points:C[e],transform:N[e],index:t,markKey:E,viewKey:o},A&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],L&&(n["series"+Qe(r)]=L[e].map(t=>i[t]));return L&&(n.seriesIndex=L[e]),L&&A&&(n.seriesItems=L[e].map(t=>R(t)),n.seriesTitle=L[e].map(t=>j(t))),n}),b=(y.data=b,y.index=P,null==M?void 0:M(b,v,h));m.push(...b||[])}return[{layout:h,theme:i,coordinate:f,markState:t,key:o,clip:B,scale:d,style:e,components:c,labelTransform:bd(D.map(a))},m]}function QT(tt,et,nt,rt,it){$(this,void 0,void 0,function*(){const{components:t,theme:n,layout:e,markState:r,coordinate:i,key:a,style:I,clip:o,scale:s}=tt,{width:B,height:D}=e,F=at(e,["x","y","width","height"]),l=["view","plot","main","content"];var c,u=l.map((t,e)=>e);const h=l.map(t=>kd(Object.assign({},n,I),t)),z=["a","margin","padding","inset"].map(t=>st(F,t)),f=t=>t.style("x",t=>m[t].x).style("y",t=>m[t].y).style("width",t=>m[t].width).style("height",t=>m[t].height).each(function(t){var e,n,r=lt(this),t=h[t];for([e,n]of Object.entries(t))r.style(e,n)});let d=0,p=0,g=B,y=D;const m=u.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=z[t];return d+=t,p+=e,g-=t+r,y-=e+n,{x:d,y:p,width:g,height:y}}),v=(et.selectAll(u7(pt)).data(u.filter(t=>Od(h[t])),t=>l[t]).join(t=>t.append("rect").attr("className",pt).style("zIndex",-2).call(f),t=>t.call(f),t=>t.remove()),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{enter:r={},update:a={},exit:o={}}=r,{type:s,duration:l=300,delay:c=0}=a,{type:u,duration:h=300,delay:f=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const E of i){var{updateType:y=s,updateDuration:m=l,updateDelay:v=c,enterType:b=u,enterDuration:x=h,enterDelay:w=f,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=E;void 0!==y&&!y||(e=Math.max(e,m+v),n=Math.min(n,v)),void 0!==k&&!k||(e=Math.max(e,M+O),n=Math.min(n,O)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),b=!!v&&{duration:v[1]};for([,c]of Zh(t,t=>t.type+"-"+t.position))c.forEach((t,e)=>t.index=e);var x,w,M,u=et.selectAll(u7(ft)).data(t,t=>`${t.type}-${t.position}-`+t.index).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",ft).append(t=>mT(ot({animate:b,scale:s},t),i,n,rt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=mT(ot({animate:b,scale:s},t),i,n,rt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();nt.push(...u.flat().filter(Od));const O=et.selectAll(u7(ht)).data([e],()=>a).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",ht).call(s7).call(c7,Array.from(r.keys())).call(h7,o),t=>t.call(c7,Array.from(r.keys())).call(t=>{if(!v)return s7(t);{const[l,c]=v;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(h7,o)).transitions();nt.push(...O.flat());for([x,w]of r.entries()){var W=w["data"];const{key:a,class:q,type:A}=x;var k=et.select("#"+a);const T=function(s,t,e,n,r){const[l]=cA("shape",n),c=s["data"],{defaultShape:u,data:i}=t,h=i.map(t=>t.points),{theme:f,coordinate:a}=e,{type:d,style:p={}}=s,g=Object.assign(Object.assign({},r),{document:uA(r),coordinate:a,theme:f});return t=>{var{shape:e=u}=p,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=at(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{index:i});const a=r?r.map(t=>c[t]):c[i],o=r||i;r=Oy(p,t=>t7(t,a,o,c)),i=Object.assign(Object.assign({},r),{type:l7(s,e)});return l(i,g)(n,t,e7(f,d,e,u),h)}}(x,w,tt,rt,it),X=(E=x,M=w,n7("enter",E,M,tt,rt)),P=(E=x,M=w,n7("update",E,M,tt,rt)),U=(E=x,M=w,n7("exit",E,M,tt,rt));var E=function(t,e,n,r){t=t.node().parentElement;return t.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r))}(et,k,q,"element");const O=k.selectAll(u7(ut)).selectFacetAll(E).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",ut).attr("markType",A).transition(function(t){return X(t,[this])}),e=>e.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});e.transition(function(t,e){n=this,r=l,s=c,n.__facet__&&(i=n.parentNode.parentNode,o=r.parentNode,[i,a]=s(i),[s,o]=s(o),i=`translate(${i-s}, ${a-o})`,s=n.style.transform,a="none"===(a=s)||void 0===a?"":s,n.style.transform=(a+" "+i).trimStart(),r.append(n));var n,r,i,a,o=T(t,e),s=P(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?Md(this,o):this.parentNode.replaceChild(o,this)),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return U(t,[this])}).remove(),t=>t.append(T).attr("className",ut).attr("markType",A).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new Hy(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new Hy([],this.__toData__,this.parentNode).append(T).attr("className",ut).attr("markType",A).nodes();return P(t,[this],e)}).remove()).transitions();nt.push(...O.flat())}{var S=tt,G=et,H=rt,V=it,_,Y;const[$]=cA("labelTransform",H),{markState:K,labelTransform:C}=S,Z=G.select(u7(ct)).node(),L=new Map,N=new Map,J=Array.from(K.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[s]=cA("shape",r),l=t["data"],{data:a,defaultLabelShape:c}=e,u=a.map(t=>t.points),{theme:h,coordinate:o}=n,f=Object.assign(Object.assign({},i),{document:uA(i),theme:h,coordinate:o});return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t,style:a}=t,t=at(t,["formatter","transform","style"]),t=Oy(Object.assign(Object.assign({},t),a),t=>t7(t,r,e,l)),{shape:a=c,text:o}=t,t=at(t,["shape","text"]),i="string"==typeof i?yM(i):i,i=Object.assign(Object.assign({},t),{text:i(o,r,e,l)}),o=Object.assign({type:"label."+a},t);return s(o,f)(n,i,e7(h,"label",a,"label"),u)}}(t,e,S,H,V),a=G.select("#"+r).selectAll(u7(ut)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=at(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{L.set(t,i),N.set(t,e)}),t})})}),j=lt(Z).selectAll(u7(dt)).data(J,t=>t.key).join(t=>t.append(t=>L.get(t)(t)).attr("className",dt),t=>t.each(function(t){Md(this,L.get(t)(t))}),t=>t.remove()).nodes(),Q=Kh(j,t=>N.get(t.__data__)),R=S["coordinate"];for([_,Y]of Q){var{transform:_=[]}=_;bd(_.map($))(Y,R)}C&&C(j,R)}})}function t7(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function e7(t,e,n,r){var i;if("string"==typeof e)return i=t["defaultColor"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function n7(o,t,e,n,r){var[,i]=cA("shape",r);const[s]=cA("animation",r);var r=e["defaultShape"],{theme:e,coordinate:n}=n,a=`default${Qe(o)}Animation`;const{[a]:l}=i(l7(t,r)).props,{[o]:c={}}=e,u=(null==(i=t.animate)?void 0:i[o])||{},h={coordinate:n};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||l},u);return t.type?(r={delay:r,duration:i,easing:a},i=s(t,h)(e,n,ot(c,r)),Array.isArray(i)?i:[i]):null}}function r7(t){return t.finished.then(()=>{t.cancel()}),t}function i7(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=at(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function a7(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function o7(r,i){return $(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=at(r,["data"]);return null==e?r:([,{data:e}]=yield BT(0,{data:e},t),Object.assign({data:e},n))})}function s7(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function l7(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function c7(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(u7(C)).data(e,t=>t.key).join(t=>t.append("g").attr("className",C).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(u7(ct)).node())||t.append("g").attr("className",ct).style("zIndex",0)}function u7(...t){return t.map(t=>"."+t).join("")}function h7(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new z.Rect({style:{x:e,y:t,width:n,height:r}})):null})}function f7(t){for(var t=ot({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=ot({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function d7(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||wd('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),f7(t)),{canvas:l=(t=i,h=a,f=new T.Renderer,f.registerPlugin(new eu),new z.Canvas({width:t,height:h,container:document.createElement("div"),renderer:f})),library:c=N_(),emitter:u=new ru}=e;var h,f;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit(uk.BEFORE_RENDER);const d=lt(l.document.documentElement);return l.ready.then(()=>UT(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit(uk.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function p7(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+K))&&r.forEach(t=>{var{nameInteraction:t=new Map}=t;0<(null==t?void 0:t.size)&&Array.from(null==t?void 0:t.values()).forEach(t=>{null!=t&&t.destroy()})}),n?e.destroy():e.destroyChildren()),i.off()}function g7(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function y7(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function m7(t,{name:e,key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length&&"string"!=typeof t?this.attr(r,t):((n=this.attr(r)||{})[t]=1===arguments.length||e,this.attr(r,n))}}function E(r){return t=>{for(const n of r){var e=n["type"];"value"===e?g7(t,n):"array"===e?y7(t,n):"object"===e?m7(t,n):"node"===e?function(t,{name:n,ctor:r}){t.prototype[n]=function(t){var e=this.append(r);return"mark"===n&&(e.type=t),e}}(t,n):"container"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,n):"mix"===e&&function(t,{name:r}){t.prototype[r]=function(t){var e,n;return 0===arguments.length?this.attr(r):Array.isArray(t)?this.attr(r,{items:t}):_d(t)&&(void 0!==t.title||void 0!==t.items)||null===t||!1===t?this.attr(r,t):({items:n=[]}=e=this.attr(r)||{},n.push(t),e.items=n,this.attr(r,e))}}(t,n)}return t}}function v7(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function b7(t,e){for(var n=[t];n.length;){var r=n.shift(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class x7{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],this.push(t),t}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return b7(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return b7(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return b7(this,t=>{n||e===t.type&&(n=t)}),n}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}class w7 extends x7{changeData(t){var e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.getRoot())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.getRoot())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.getRoot())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}}r=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"coordinate",type:"object"},{name:"interaction",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"},{name:"state",type:"object"},{name:"tooltip",type:"mix"}],a=[{name:"scale",type:"object"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"state",type:"object"}],Fo=a;let M7=class extends w7{constructor(){super({})}},O7=(M7=e([E(r)],M7),class extends w7{constructor(){super({},"interval")}}),k7=(O7=e([E(r)],O7),class extends w7{constructor(){super({},"rect")}}),E7=(k7=e([E(r)],k7),class extends w7{constructor(){super({},"point")}}),S7=(E7=e([E(r)],E7),class extends w7{constructor(){super({},"area")}}),_7=(S7=e([E(r)],S7),class extends w7{constructor(){super({},"line")}}),A7=(_7=e([E(r)],_7),class extends w7{constructor(){super({},"cell")}}),T7=(A7=e([E(r)],A7),class extends w7{constructor(){super({},"vector")}}),P7=(T7=e([E(r)],T7),class extends w7{constructor(){super({},"link")}}),C7=(P7=e([E(r)],P7),class extends w7{constructor(){super({},"polygon")}});C7=e([E(r)],C7);Ro=e([E(r)],class extends w7{constructor(){super({},"image")}});let L7=class extends w7{constructor(){super({},"text")}},N7=(L7=e([E(r)],L7),class extends w7{constructor(){super({},"box")}}),j7=(N7=e([E(r)],N7),class extends w7{constructor(){super({},"lineX")}}),R7=(j7=e([E(r)],j7),class extends w7{constructor(){super({},"lineY")}}),I7=(R7=e([E(r)],R7),class extends w7{constructor(){super({},"range")}}),B7=(I7=e([E(r)],I7),class extends w7{constructor(){super({},"rangeX")}}),D7=(B7=e([E(r)],B7),class extends w7{constructor(){super({},"rangeY")}}),F7=(D7=e([E(r)],D7),class extends w7{constructor(){super({},"connector")}}),z7=(F7=e([E(r)],F7),class extends w7{constructor(){super({},"shape")}}),W7=(z7=e([E(r)],z7),class extends w7{constructor(){super({},"sankey")}}),G7=(W7=e([E([...r,{name:"layout",type:"value"}])],W7),class extends w7{constructor(){super({},"treemap")}}),H7=(G7=e([E([...r,{name:"layout",type:"value"}])],G7),class extends w7{constructor(){super({},"boxplot")}}),V7=(H7=e([E(r)],H7),class extends w7{constructor(){super({},"density")}}),Y7=(V7=e([E(r)],V7),class extends w7{constructor(){super({},"heatmap")}}),q7=(Y7=e([E(r)],Y7),class extends w7{constructor(){super({},"path")}}),X7=(q7=e([E(r)],q7),class extends w7{constructor(){super({},"pack")}}),U7=(X7=e([E([...r,{name:"layout",type:"value"}])],X7),class extends w7{constructor(){super({},"forceGraph")}}),$7=(U7=e([E([...r,{name:"layout",type:"value"}])],U7),class extends w7{constructor(){super({},"tree")}}),K7=($7=e([E([...r,{name:"layout",type:"value"}])],$7),class extends w7{constructor(){super({},"wordCloud")}}),Z7=(K7=e([E([...r,{name:"layout",type:"object"}])],K7),class extends w7{constructor(){super({},"gauge")}}),J7=(Z7=e([E(r)],Z7),class extends w7{constructor(){super({},"axisX")}}),Q7=(J7=e([E(a)],J7),class extends w7{constructor(){super({},"axisY")}}),t9=(Q7=e([E(a)],Q7),class extends w7{constructor(){super({},"legends")}});t9=e([E(Fo)],t9);const e9={mark:M7,interval:O7,rect:k7,point:E7,area:S7,line:_7,cell:A7,vector:T7,link:P7,polygon:C7,image:Ro,text:L7,box:N7,lineX:j7,lineY:R7,range:I7,rangeX:B7,rangeY:D7,connector:F7,sankey:W7,treemap:G7,boxplot:H7,density:V7,heatmap:Y7,path:q7,shape:z7,pack:X7,forceGraph:U7,tree:$7,wordCloud:K7,gauge:Z7,axisX:J7,axisY:Q7,legends:t9};class n9 extends x7{changeData(e){var t,n=this.getRoot();if(n)return this.attr("data",e),null!=(t=this.children)&&t.length&&this.children.forEach(t=>{t.attr("data",e)}),null==n?void 0:n.render()}getView(){var t=this.getRoot().getContext()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this._key)}getScale(){var t;return null==(t=this.getView())?void 0:t.scale}getScaleByChannel(t){var e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&IO(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&RO(t)}}let r9=class extends n9{constructor(t={},e="view"){super(t,e)}},i9=(r9=e([E([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...v7(e9)])],r9),class extends n9{constructor(){super({},"spaceLayer")}}),a9=(i9=e([E([{type:"value",name:"data"},...v7(e9)])],i9),class extends n9{constructor(){super({},"spaceFlex")}}),o9=(a9=e([E([{type:"value",name:"data"},...v7(e9)])],a9),class extends n9{constructor(){super({},"facetRect")}}),s9=(o9=e([E([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...v7(e9)])],o9),class extends n9{constructor(){super({},"facetCircle")}}),l9=(s9=e([E([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...v7(e9)])],s9),class extends n9{constructor(){super({},"repeatMatrix")}}),c9=(l9=e([E([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...v7(e9)])],l9),class extends n9{constructor(){super({},"timingKeyframe")}}),u9=(c9=e([E([...v7(e9)])],c9),class extends n9{constructor(){super({},"geoView")}}),h9=(u9=e([E([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...v7(e9)])],u9),class extends n9{constructor(){super({},"geoPath")}});h9=e([E([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"state"},...v7(e9)])],h9);const f9={view:r9,spaceLayer:i9,spaceFlex:a9,facetRect:o9,facetCircle:s9,repeatMatrix:l9,timingKeyframe:c9,geoView:u9,geoPath:h9};for(const O9 of Object.values(f9))E(v7(f9))(O9);const d9=N_();const p9=t=>t?parseInt(t):0;const g9=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function y9(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function m9(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||p9(e.width),r=r.clientHeight||p9(e.height),{width:n-(p9(e.paddingLeft)+p9(e.paddingRight)),height:r-(p9(e.paddingTop)+p9(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function v9(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of g9)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,y9(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=y9(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function b9(t,e,n){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if("function"!=typeof(t=n)&&!new Set(Object.keys(e9)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of g9)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function x9(t){var e=t["type"],t=at(t,["type","children"]),n=new(function(t){if("function"==typeof t)return e9.mark;var e=Object.assign(Object.assign({},e9),f9)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e));return n.value=t,n.type=e,n}function w9(t,e){var n=e["type"],e=at(e,["type","children"]);t.type===n||void 0===n?function t(e,n,r=5,i=0){if(!(r<=i))for(const o of Object.keys(n)){var a=n[o];We(a)&&We(e[o])?t(e[o],a,r,i+1):e[o]=a}}(t.value,e):"string"==typeof n&&(t.type=n,t.value=e)}function M9(t,e,n){for(var r=[[null,t,b9(t,e,n)]];r.length;){var[i,a,o]=r.shift();if(a)if(o){w9(a,o);var s=o["children"],l=a["children"];if(Array.isArray(s)&&Array.isArray(l)){var c=Math.max(s.length,l.length);for(let t=0;t<c;t++){var u=s[t],h=l[t];r.push([a,h,u])}}}else a.remove();else{y=g=p=d=f=void 0;var f=i,d=o;if(f)for(var p=[[f,d]];p.length;){const[f,m]=p.shift();var g=x9(m),y=(Array.isArray(f.children)&&f.push(g),m)["children"];if(Array.isArray(y))for(const v of y)p.push([g,v])}}}}Po=[{name:"data",type:"value"},{name:"width",type:"value"},{name:"height",type:"value"},{name:"coordinate",type:"value"},{name:"interaction",type:"object"},{name:"theme",type:"object"},{name:"title",type:"value"},{name:"transform",type:"array"},{name:"scale",type:"object"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"style",type:"object"},{name:"labelTransform",type:"array"},...v7(e9),...(n=f9,Object.entries(n).map(([t,e])=>({type:"container",name:t,ctor:e})))];S.Chart=class extends r9{constructor(t){var t=t||{},{container:e,canvas:n,renderer:r,plugins:i}=t;super(at(t,["container","canvas","renderer","plugins"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=rn(()=>{this.forceFit()},300),this._renderer=r||new T.Renderer,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new ru,this._context={library:d9,emitter:this._emitter,canvas:n}}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;var t=new Promise((t,e)=>d7(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let n,r;return[new Promise((t,e)=>{r=t,n=e}),r,n]}();return t.then(n).catch(r).then(()=>this._renderTrailing()),e}options(t){var e;return 0===arguments.length?v9(this):(e=t["type"],e&&(this._previousDefinedType=e),M9(this,t,this._previousDefinedType),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(){this.options();this.emit(uk.BEFORE_CLEAR),this._reset(),p7(0,this._context,!1),this.emit(uk.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(uk.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),p7(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(uk.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=m9(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(uk.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(uk.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(uk.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit(uk.AFTER_CHANGE_SIZE)}),t}_reset(){this.type="view",this.value={},this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{var t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{var e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(e){return t=>{this._rendering=!1,e(t)}}_computedOptions(){var t=this.options(),{key:e="G2_CHART_KEY"}=t,{width:n,height:r}=m9(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})}_createCanvas(){var{width:t,height:e}=m9(this.options(),this._container);this._plugins.push(new eu),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new z.Canvas({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){null!=(t=this._trailingResolve)&&t.call(this,this),this._trailing=!0;var t=new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e});return t}_bindAutoFit(){var t=this.options()["autoFit"];this._hasBindAutoFit?t||this._unbindAutoFit():t&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}},S.Chart=e([E(Po)],S.Chart),z.runtime.enableCSSParsing=!1,S.AREA_CLASS_NAME=pt,S.COMPONENT_CLASS_NAME=ft,S.ChartEvent=uk,S.CompositionNode=n9,S.ELEMENT_CLASS_NAME=ut,S.LABEL_CLASS_NAME=dt,S.LABEL_LAYER_CLASS_NAME=ct,S.MAIN_LAYER_CLASS_NAME=C,S.MarkNode=w7,S.PLOT_CLASS_NAME=ht,S.VIEW_CLASS_NAME=K,S.createLibrary=N_,S.register=function(t,e){Object.assign(d9,{[t]:e})},S.render=d7,S.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=f7(t);const{library:o=N_(),group:s=new z.Group,emitter:l=new ru}=e;null!==s&&void 0!==s&&s.parentElement||wd("renderToMountedElement can't render chart to unmounted group.");var c=lt(s);return e.group=s,e.library=o,(e.emitter=l).emit(uk.BEFORE_RENDER),UT(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit(uk.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(S,"__esModule",{value:!0})});
|
|
10
|
+
`,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},S={"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"}},_=t=>T(t)||A(t),A=t=>{t=t.id;return-1!==h.indexOf(t)&&new Set(Object.keys(S)).has(t)},T=t=>t===y.getElementById("selection"),P=t=>{var e=t["target"],[t,n]=GO(l,t);y&&_(e)?_(e)&&(g=[t,n]):(O(t,n),v=!0)},C=t=>{var e,n,r,i,a,o,s=t["target"],t=GO(l,t);if(d)return g?T(s)?(e=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(n=t)[0]-g[0],n=n[1]-g[1],r=e(r,d[0],p[0],b,w),e=e(n,d[1],p[1],x,M),n=[d[0]+r,d[1]+e],r=[p[0]+r,p[1]+e],void E(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],S[r]?([s,i,a,o]=S[r].vector,E([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):E(d,t)},L=t=>{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=y.style,d=[e,r],p=[e+n,r+i]):(p=GO(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!_(t)&&k()},j=t=>{t=t.target;y&&_(t)&&!v?T(t)?JO(l,"move"):A(t)&&JO(l,S[t.id].cursor):JO(l,"crosshair")},R=()=>{JO(l,"default")};return l.addEventListener("dragstart",P),l.addEventListener("drag",C),l.addEventListener("dragend",L),l.addEventListener("click",N),l.addEventListener("pointermove",j),l.addEventListener("pointerleave",R),{mask:y,move(t,e,n,r,i=!0){y||O(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&k(t)},destroy(){y&&k(!1),JO(l,"default"),l.removeEventListener("dragstart",P),l.removeEventListener("drag",C),l.removeEventListener("dragend",L),l.removeEventListener("click",N),l.removeEventListener("pointermove",j),l.removeEventListener("pointerleave",R)}}}function Yk(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function qk(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:h=!1,key:d=t=>t,bboxOf:f=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}},state:p={},emitter:g}=e,e=at(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),v=m.flatMap(n);i=UO(y,a),n=st(e,"mask");const{setState:b,removeState:x}=qO(p,i),w=new Map,{width:M,height:O,x:k=0,y:E=0}=f(t);a=s||[0,0,M,O];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},_=(t,e,n,r)=>{var i;for(const u of m)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of y){var{min:o,max:s}=h.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?b(h,"inactive"):(b(h,"active"),a.add(d(h)))}for(const f of v)a.has(d(f))?b(f,"active"):b(f,"inactive")},A=()=>{for(const t of y)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},T=(t,e,n,r)=>{var i;for(const o of y){var a=w.get(o)||(a=o,i=void 0,(i=a.cloneNode()).__data__=a.__data__,a.parentNode.appendChild(i),w.set(a,i),i);a.style.clipPath=new z.Rect({style:{x:t+k,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=Vk(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?A:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=rO(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:_)(t,e,n,r)}})),C=({nativeEvent:t,data:e})=>{var n,r;t||(t=e["selection"],[e,t,n,r]=function(t,e,n){var{x:e,y:r}=e,[t,i]=t,t=iO(t,e),e=iO(i,r),i=[t[0],e[0]],r=[t[1],e[1]],[t,e]=n.map(i),[i,n]=n.map(r);return[t,e,i,n]}(t,c,u),P.move(e,t,n,r,!1))},L=(g.on("brush:highlight",C),({nativeEvent:t}={})=>{t||P.remove(!1)}),N=(g.on("brush:remove",L),P.destroy.bind(P));return P.destroy=()=>{g.off("brush:highlight",C),g.off("brush:remove",L),N()},P}function Xk(t){var{facet:g,brushKey:y}=t,m=at(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=zO(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:f,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],qk(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>DO(t,e),datum:YO(FO(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:XO(FO(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=qk(s,Object.assign(Object.assign({elements:BO,key:t=>t.__data__.key,siblings:()=>{return Yk(t,e,y).map(t=>zO(t.container))},datum:YO([l,...Yk(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:XO([c,...Yk(t,e,y).map(t=>t.options)],h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));return s.brush=p,()=>p.destroy()}}function Uk(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function $k(t){return Xk(Object.assign(Object.assign({},t),{brushRegion:Uk,selectedHandles:["handle-e","handle-w"]}))}function Kk(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function Zk(t){return Xk(Object.assign(Object.assign({},t),{brushRegion:Kk,selectedHandles:["handle-n","handle-s"]}))}const Jk="axis",Qk="axis-hot-area";function tE(t){return t.getElementsByClassName(Jk)}function eE(t){return t.getElementsByClassName("axis-line")[0]}function nE(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function rE(t,e){var{cross:n,offsetX:i}=e,e=at(e,["cross","offsetX","offsetY"]),r=nE(t),[t]=eE(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:Kk,hotZone:new z.Rect({className:Qk,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function iE(t,e){var{offsetY:i,cross:n=!1}=e,e=at(e,["offsetY","offsetX","cross"]),r=nE(t),[,t]=eE(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:Uk,hotZone:new z.Rect({className:Qk,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function aE(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:h,coordinate:f}=e,e=at(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:y}=qO(u,UO(d,a)),m=new Map;var v=st(e,"mask");const b=p.map(t=>t.attributes.scale),x=t=>2<t.length?[t[0],t[t.length-1]]:t,w=new Map,M=()=>{w.clear();for(let t=0;t<p.length;t++){var e=b[t].getOptions()["domain"];w.set(t,x(e))}},O=(M(),(t,e)=>{var n=[];for(const r of d)(t=>Array.from(m.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(r))?(g(r,"active"),n.push(r)):g(r,"inactive");w.set(t,((t,e)=>{const n=b[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return x(nO(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!k)return Array.from(w.values());var t,e,n=[];for([t,e]of w){var r=b[t].getOptions()["name"];"x"===r?n[0]=e:n[1]=e}return n})()}})}),k=p.some(s)&&p.some(t=>!s(t)),E=[];for(let a=0;a<p.length;a++){const P=p[a];const{hotZone:C,brushRegion:L,extent:N}=(s(P)?iE:rE)(P,{offsetY:o,offsetX:l,cross:k,zIndex:999,fill:"transparent"});P.parentNode.appendChild(C);var S=Vk(C,Object.assign(Object.assign({},v),{reverse:c,brushRegion:L,brushended(t){if(m.delete(P),0===Array.from(m.entries()).length){var e=t;for(const n of d)y(n,"active","inactive");M(),e&&h.emit("brushAxis:remove",{nativeEvent:!0})}else O(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),O(a,i)}}));E.push(S)}const _=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},A=(t,e,n)=>{var{height:r,width:i}=f.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},T=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<E.length;t++){var r,i=n[t],a=E[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=A(t,e,n),e=A(r,e,n)+((r=e).getStep?r.getStep():0);return s(n)?[t,-1/0,e,1/0]:[-1/0,t,1/0,e]})(i,r,o),!1)):a.remove(!1)}}};return h.on("brushAxis:remove",_),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",_),h.off("brushAxis:highlight",T)}}function oE(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=zO(t).getBBox(),s=r["coordinate"];return aE(t,Object.assign({elements:BO,axes:tE,offsetY:o,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:YO(r),state:XO(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function sE(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=st(at(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:c,height:u}=t.getBBox(),i=i||[0,0,c,u];const h=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),f=Vk(t,Object.assign(Object.assign({},e),{extent:i,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r,i){i.nativeEvent=!0,a(l(t,e,n,r),i),f.remove()}}));function d(t){h(t)&&(t.nativeEvent=!0,n(t))}t.addEventListener("click",d);const p=({nativeEvent:t,data:e})=>{t||(t=e["selection"],a(t,{nativeEvent:!1}))};return s.on("brush:filter",p),()=>{f.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function lE(t){var{hideX:f=!0,hideY:d=!0}=t,p=at(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=zO(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return sE(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{var{scale:i,coordinate:a}=u;return rO(t,e,n,r,i,a)},filter:(r,i)=>K(this,void 0,void 0,function*(){if(!c){c=!0;const[e,n]=r;var t=o["marks"],t=t.map(t=>ot({axis:Object.assign(Object.assign({},f&&{x:{transform:[{type:"hide"}]}}),d&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:e,nice:!1},y:{domain:n,nice:!1}}})),t=(a.emit("brush:filter",Object.assign(Object.assign({},i),{data:{selection:[e,n]}})),Object.assign(Object.assign({},o),{marks:t,clip:!0})),t=yield s(t);u=t.view,c=!1,l=!0}}),reset:t=>{var e,n;!c&&l&&(e=r["scale"],{x:e,y:n}=e,e=e.getOptions().domain,n=n.getOptions().domain,a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[e,n]}})),l=!1,u=r,s(o))},extent:void 0,emitter:a,scale:i,coordinate:h},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function cE(t){return lE(Object.assign(Object.assign({hideX:!0},t),{brushRegion:Uk}))}function uE(t){return lE(Object.assign(Object.assign({hideY:!0},t),{brushRegion:Kk}))}const hE="slider";function fE(t){return[t[0],t[t.length-1]]}function dE({channelDomain:C,className:L=hE,prefix:N="slider",setValue:j=(t,e)=>t.setValues(e),hasState:R=!1,wait:I=50,leading:B=!0,trailing:D=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:h}=t;t=n.getElementsByClassName(L);if(!t.length)return()=>{};let f=!1;const{scale:i,coordinate:a,layout:o}=r,{paddingLeft:d,paddingTop:p,paddingBottom:g,paddingRight:y}=o,{x:s,y:l}=i,m=_f(a);const v=new Map,b=new Set;C=C||{x:s.getOptions().domain,y:l.getOptions().domain};for(const M of t){const O=M.attributes["orientation"],[k,E]=(w=O,x=void 0,x="vertical"===w?"y":"x",w="vertical"===w?"x":"y",m?[w,x]:[x,w]),S=""+N+Qe(k)+":filter",_="x"===k,A=s.getOptions()["ratio"],T=l.getOptions()["ratio"],P=t=>{var e,n;return t.data?(e=t.data["selection"],[e=fE(C.x),n=fE(C.y)]=e,_?[nO(s,e,A),nO(l,n,T)]:[nO(l,n,T),nO(s,e,A)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return nO(e,[eO(e,(n=n?t=>1-t:t=>t)(t),!0),eO(e,n(r),!1)])}(n,i[k],m&&"horizontal"===O),C[E]])};var x=fn(l=>K(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;f||(f=!0,{nativeEvent:t=!0}=l,[e,s]=P(l),C[k]=e,C[E]=s,[n,r,i,a=!1]=[u,{[k]:{domain:e,nice:!1},[E]:{domain:s,nice:!1}},N,R],o=(o=n["marks"]).map(t=>{var e;return ot({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:r,[i]:Object.assign(Object.assign({},(null==(e=t[i])?void 0:e.x)&&{x:Object.assign({preserve:!0},a&&{ratio:null})}),(null==(e=t[i])?void 0:e.y)&&{y:Object.assign({preserve:!0},a&&{ratio:null})}),animate:!1})}),n=Object.assign(Object.assign({},n),{marks:o,clip:!0,animate:!1}),t&&(o=_?e:s,s=_?s:e,c.emit(S,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[fE(o),fE(s)]}}))),yield h(Object.assign(Object.assign({},n),{paddingLeft:d,paddingTop:p,paddingBottom:g,paddingRight:y})),f=!1)}),I,{leading:B,trailing:D}),w=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,M.dispatchEvent(new z.CustomEvent("valuechange",{data:n,nativeEvent:!1})),n=_?iO(t,s):iO(e,l),j(M,n))};c.on(S,w),M.addEventListener("valuechange",x),v.set(M,x),b.add([S,w])}return()=>{for(var[t,e]of v)t.removeEventListener("valuechange",e);for(var[n,r]of b)c.off(n,r)}}}const pE="g2-scrollbar";function gE(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(pE).length?(a=i["scale"],{x:i,y:a}=a,r={x:i.getOptions().domain,y:a.getOptions().domain},i.update({domain:i.getOptions().expectedDomain}),a.update({domain:a.getOptions().expectedDomain}),dE(Object.assign(Object.assign({},o),{channelDomain:r,className:pE,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const yE={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 mE(t){return"text"===t.nodeName&&!!t.isOverflowing()}function vE(t){var{offsetX:f=8,offsetY:d=8}=t,r=at(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=st(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];mE(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new z.HTML({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},yE),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}</${r}>`),x:e,y:n}}),s.appendChild(a),o.tip=a,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];mE(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function bE(n){return(t,...e)=>ot({},n(t,...e),t)}function xE(n){return(t,...e)=>ot({},t,n(t,...e))}function wE(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=at(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const ME=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:o=0,y:s=0,width:l,height:c,data:u}=t;return e.map(t=>{var{data:e,x:n,y:r,width:i,height:a}=t,t=at(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:wE(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},OE=(ME.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=at(g,["data"]),y=wE(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),kE=(OE.props={},()=>t=>{var e=t["children"],t=at(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:h={},transform:f=[]}=t,n=at(t,["data","scale","axis","legend","encode","transform"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={},encode:a={},transform:o=[]}=t,t=at(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:wE(e,s),scale:ot({},l,n),encode:ot({},h,a),transform:[...f,...o],axis:!(!r||!c)&&ot({},c,r),legend:!(!i||!u)&&ot({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),EE=(kE.props={},({static:L=!1}={})=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:E,frame:S,labelTransform:_,parentKey:A,clip:T,viewStyle:P,title:C}=t,t=at(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:k,key:E,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:S,labelTransform:_,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:A,clip:T,style:P},!L&&{title:C}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),L&&{title:C})]})]});EE.props={};class SE{constructor(t){this.$value=t}static of(t){return new SE(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const _E=bE(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=Kh(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}}),AE=bE(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:f,encode:d={},scale:n={},legend:p={}}=r.shift();var s=d["color"],l=n["color"],c=p["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(f)&&r.push(...f)}var t="string"==typeof i?i:"",[u,h]=void 0!==(u=null==(u=null===n||void 0===n?void 0:n.color)?void 0:u.domain)?[u]:void 0===i?[void 0]:(u="function"==typeof i?i:t=>t[i],(u=e.map(u)).some(t=>"number"==typeof t)?[Yh(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:ot({},a,{domain:u,type:h})},legend:{color:ot({title:t},o)}}}),TE=bE(()=>({animate:{enterType:"fadeIn"}})),PE=xE(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),CE=xE(()=>({type:"cell"})),LE=xE(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),NE=xE((t,c=function(t){t=t.points;return jy(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?jE(a,e):(t=e.length?void 0:null,ot({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?jE(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:E=0,shareData:h=!1,key:S}=t,_=e["value"],{x:A,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=ky(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[A]:t,[T]:e}=t,t=void 0===A||t===n,e=void 0===T||e===r;return t&&e}).map(t=>_.filter(t)),v=h?pf(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:A,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=at(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:A?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:_,l={color:{domain:P}},o={x:RE(o,w)(p,r),y:RE(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+k,y:h+m+E,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:ot(s,e,l),axis:ot({},i,o),legend:!1},t),O)})})}}});function jE(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function RE(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const IE=()=>t=>{return[SE.of(t).call(CE).call(AE).call(TE).call(_E).call(PE).call(LE).call(NE).value()]},BE=(IE.props={},bE(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),DE=xE(t=>{const{data:w,children:c,x:M=0,y:O=0,key:k}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=ky(t);const s=t.map(({points:t})=>jy(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=at(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return jE(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return jE(n,e)})(y,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+m+M,y:h+v+O,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:ot({x:{facet:!1},y:{facet:!1}},e),axis:ot({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:ot({},a,{x:p,y:g})},t)})})}}}),FE=xE(t=>{var e=t["encode"],t=at(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=at(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const zE=()=>t=>{return[SE.of(t).call(CE).call(AE).call(DE).call(FE).call(TE).call(PE).call(BE).value()]},WE=bE(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),GE=bE(t=>({coordinate:{type:"polar"}})),HE=t=>{var e=t["encode"],t=at(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function VE(t){return t=>null}function YE(t){var t=t["points"],[t,e,n,r]=t,i=Py(t,r),t=Ay(t,r),r=Ny(t,Ay(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Ly(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const qE=()=>t=>{return[SE.of(t).call(CE).call(HE).call(AE).call(GE).call(LE).call(NE,YE,VE,VE,{frame:!1}).call(TE).call(PE).call(WE).value()]};const XE=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],h=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=ot({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield h[i]),e=i}t++}var a,o,s}};function UE(t,e){if(null!==t)return{type:"column",value:t,field:e}}function $E(t,e){t=UE(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function KE(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function ZE(t,e){var n=[];for(const r of t)n[r]=e;return n}function JE(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function QE(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=JE(t,i);if(null!==n)return[n,r]}return[null,null]}function t3(t){return!(t instanceof Date)&&"object"==typeof t}XE.props={};const e3=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:$E(ZE(t,0))}})]};function n3(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=JE(r,t))?void 0:t[0]]}).filter(([,t])=>Od(t));return Array.from(Kh(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function r3(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:Ih(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>u3(t=>r(e[t]))):"series"===t?o3:"value"===t?s3:"sum"===t?l3:"maxIndex"===t?c3:()=>null}function i3(t,e){for(const n of t)n.sort(e)}function a3(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function o3(t,e,n){return u3(t=>n[t])}function s3(t,e,n){return u3(t=>e[t])}function l3(t,n,e){t=ky(t),t=Array.from(Kh(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return u3(t=>r.get(e[t]))}function c3(t,n,e){t=ky(t),t=Array.from(Kh(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,gf(e,t=>n[t])]));return u3(t=>r.get(e[t]))}function u3(n){return(t,e)=>Ih(n(t),n(e))}e3.props={};const h3=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:C=!1,y:L="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=JE(r,"y"),[s,l]=JE(r,"y1"),[r]=j?QE(r,"series","color"):JE(r,"color"),c=n3(T,t,e),n=r3(P)(n,a,r),u=(n&&i3(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const E of c){C&&E.reverse();var g=s?+s[E[0]]:0,y=[],m=[];for(const S of E){var v=f[S]=+a[S]-g;v<0?m.push(S):0<=v&&y.push(S)}var b=0<y.length?y:m,x=0<m.length?m:y;let t=y.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const _ of m.reverse()){var w=f[_];n=u[_]=(h[_]=n)+w}let r=g;for(const A of y){var M=f[A];0<M?r=u[A]=(h[A]=r)+M:u[A]=h[A]=r}}const O=new Set(d),k=new Set(p);r="y"===L?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:$E(a,o),y:UE(r,o),y1:UE(n,l)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>k.has(e)},i)})]}};function f3(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}h3.props={};const d3=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(f3)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",h3({groupBy:r})(t,e,n))},p3=(d3.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(Ad(r))return[t,e];r=r.title;if(void 0!==r)return[t,e];var i=Object.keys(n).filter(t=>t.startsWith(s)).filter(t=>!n[t].inferred).map(t=>JE(n,t)).filter(([t])=>t).map(t=>t[0]);if(0===i.length)return[t,e];var a=[];for(const o of t)a[o]={value:i.map(t=>t[o]).join(", ")};return[t,ot({},e,{tooltip:{title:a}})]}}),g3=(p3.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:$E(ZE(t,0))},scale:{x:{guide:null}}})]}),y3=(g3.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:$E(ZE(t,0))},scale:{y:{guide:null}}})]}),m3=(y3.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:KE(ZE(t,3))}})]}),v3=(m3.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=at(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,ot({},e,{encode:{key:UE(r)}})]}),b3=(v3.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=JE(n,"color"),[t,ot({},e,{encode:{series:UE(r,i)}})])}),x3=(b3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(t3)?[t,e]:[t,ot({},e,{encode:{y:UE(n)}})]}),w3=(x3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(t3)?[t,e]:[t,ot({},e,{encode:{x:UE(n)}})]}),M3=(w3.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=JE(n,"y"),[t,ot({},e,{encode:{y1:UE([...r])}})])}),O3=(M3.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=JE(n,"x"),[t,ot({},e,{encode:{x1:UE([...r])}})])}),k3=(O3.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return Ad(n)||({items:r=[]}=n,!r)||0<r.length?[t,e]:(r=(Array.isArray(i)?i:[i]).flatMap(e=>Object.keys(a).filter(t=>t.startsWith(e)).map(t=>{var{field:e,value:n,inferred:r=!1,aggregate:i}=a[t];return r?null:i&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t)),[t,ot({},e,{tooltip:{items:r}})])}}),E3=(k3.props={},()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)]),S3=(E3.props={},()=>(t,e)=>{var{style:n={}}=e,r=at(e,["data","style"]),{x:i,y:a}=n,n=at(n,["x","y"]);return null==i||null==a?[t,e]:[[0],ot({},r,{data:[0],cartesian:!0,encode:{x:UE([i||0]),y:UE([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),_3=(S3.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),A3=(_3.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(t3)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,ot({},e,{encode:{x:UE(n),y:UE(r)}})])}),T3=(A3.props={},()=>(t,e)=>{var{style:n={},encode:r}=e,r=r["series"],n=n["gradient"];return!n||r?[t,e]:[t,ot({},e,{encode:{series:KE(ZE(t,void 0))}})]}),P3=(T3.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return at(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=JE(r,"y"),[r]=QE(r,"series","color"),o=a3(r,i),i=n3(c,t,e),n=r3(h)(n,a,r),s=(n&&i3(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,ot({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:UE(s)}})]}}),C3=(P3.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:m=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,JE(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(Kh(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=JE(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[ZE(n,r)]:QE(e,"enterDuration",ZE(n,r));var[l]=QE(e,"enterDelay",ZE(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=pf(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:KE(s),enterDelay:KE(c)}})]}});C3.props={};const L3=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=at(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,JE(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=n3(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>yf(t,t=>e[+t]),max:(t,e)=>pf(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Mf(t,t=>e[+t]),median:(t,e)=>Of(t,t=>e[+t]),sum:(t,e)=>Sf(t,t=>e[+t]),deviation:(t,e)=>Vh(t,t=>e[+t])}[f]||pf;for(const e of i){var c=l(e,o);for(const d of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,h]=s[t];h[d]=+u[d]/c}}var f=Ad(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,ot({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,UE(e,JE(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function N3(t,e,n){return null===t?[-.5,.5]:(t=a3(t,e),[-(e=new F1({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function j3(t,e,n){return e*(1-t)+n*t}L3.props={};const R3=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=JE(n,"x"),[n]=JE(n,"y");const o=N3(a,r,l),s=N3(n,i,c);a=t.map(()=>j3(u(),...s)),r=t.map(()=>j3(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:UE(a),dx:UE(r)}})]}},I3=(R3.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=JE(n,"x");const i=N3(n,r,a);n=t.map(()=>j3(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:UE(n)}})]}}),B3=(I3.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=at(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,JE(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=n3(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Yh(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,ot({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,UE(e,JE(n,t)[1])]))})]}}),D3=(B3.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=JE(n,"y");var[,i]=JE(n,"y1"),n=(h?QE(n,"series","color"):JE(n,"color"),n3(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,ot({},e,{encode:{y1:UE(a,i)}})]}});function F3(t,e){return[t[0]]}function z3(t,e){return[t[t.length-1]]}function W3(t,e){return[t[gf(t,t=>e[t])]]}function G3(t,e){return[t[mf(t,t=>e[t])]]}D3.props={};const H3=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=n3(a,t,e);const[r]=JE(n,o),i="function"==typeof(n=s)?n:{first:F3,last:z3,max:W3,min:G3}[n]||F3;return[t.flatMap(t=>i(t,r)),e]}},V3=(H3.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return H3(Object.assign({channel:"x",selector:e},t))}),Y3=(V3.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return H3(Object.assign({channel:"y",selector:e},t))});function q3(e){return t=>null===t?e:e+" of "+t}function X3(){return[(t,e)=>Mf(t,t=>+e[t]),q3("mean")]}function U3(){return[(t,e)=>Of(t,t=>+e[t]),q3("median")]}function $3(){return[(t,e)=>pf(t,t=>+e[t]),q3("max")]}function K3(){return[(t,e)=>yf(t,t=>+e[t]),q3("min")]}function Z3(){return[(t,e)=>t.length,q3("count")]}function J3(){return[(t,e)=>Sf(t,t=>+e[t]),q3("sum")]}function Q3(){return[(t,e)=>e[t[0]],q3("first")]}function tS(){return[(t,e)=>e[t[t.length-1]],q3("last")]}Y3.props={};const eS=(t={})=>{const i=t["groupBy"],a=at(t,["groupBy"]);return(t,e)=>{const{data:s,encode:l}=e,c=i(t,e);if(!c)return[t,e];var t=Object.entries(a).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:X3,max:$3,count:Z3,first:Q3,last:tS,sum:J3,min:K3,median:U3}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=JE(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=JE(l,e),e):o),o=c.map(t=>n(t,null!==i&&void 0!==i?i:s));return[t,Object.assign(Object.assign({},(t=o,o=(null==r?void 0:r(e))||e,t=UE(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=JE(l,t);return[t,UE(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[ky(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},nS=(eS.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=at(t,["channels"]);return eS(Object.assign(Object.assign({},e),{groupBy:(t,e)=>n3(n,t,e)}))}),rS=(nS.props={},(t={})=>nS(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),iS=(rS.props={},(t={})=>nS(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),aS=(iS.props={},(t={})=>nS(Object.assign(Object.assign({},t),{channels:["color"]})));function oS(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=at(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=JE(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=JE(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>pf(t,t=>+a[t]);if("min"===i)return t=>yf(t,t=>+a[t]);if("sum"===i)return t=>Sf(t,t=>+a[t]);if("median"===i)return t=>Of(t,t=>+a[t]);if("mean"===i)return t=>Mf(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),o=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(t,l,s),n=(s=o,o=t=>l[t],(2!==(c=n).length?ef(Jh(s,c,o),([t,e],[n,r])=>Ih(e,r)||Ih(t,n)):ef(Kh(s,o),([t,e],[n,r])=>c(e,r)||Ih(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,ot(e,{scale:{[a]:{domain:o}}})]}aS.props={};const sS=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=at(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return oS(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=JE(i,r);return i=ef(t,t=>a[t]),n&&i.reverse(),[i,e]}}},lS=(sS.props={},(t={})=>sS(Object.assign(Object.assign({},t),{channel:"x"}))),cS=(lS.props={},(t={})=>sS(Object.assign(Object.assign({},t),{channel:"color"}))),uS=(cS.props={},(t={})=>sS(Object.assign(Object.assign({},t),{channel:"y"})));uS.props={};const hS=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=JE(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):JE(r,s)[0],r=Qh(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>Sf(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,ot({},e,{scale:{x:{flex:r}}})]}};function fS(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const h=a-u*c,f=u<=1?0:h/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=jy(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}hS.props={};const dS=()=>(t,e)=>[t,ot({},e,{modifier:fS,axis:!1})],pS=(dS.props={},"thresholds");function gS(t){var e,[n,r]=Yh(t);return Math.min(200,(n=n,r=r,e=Hh(t=t),t=Vh(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const yS=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=at(t,["groupChannels","binChannels"]),u={};return eS(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(pS)))),Object.fromEntries(l.flatMap(e=>{var t=([t])=>+u[e].get(t).split(",")[1];return[[t.from=e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",t]]}))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=JE(n,t);return t}),a=st(c,pS),o=t.filter(e=>i.every(t=>Od(t[e]))),r=[...s.map(t=>{var[t]=JE(n,t);return t}).filter(Od).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||gS(n),e=df().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(Kh(o,e=>r.map(t=>t(e)).join("-")).values())}}))},mS=(yS.props={},(t={})=>{var e=t["thresholds"];return yS(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function vS(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let h=0,f,d;c.push(h);for(let i=0;i<t-2;i++){let t=0,e=0,n=Math.floor((i+1)*u)+1;for(var p=Math.floor((i+2)*u)+1,g=(p=Math.min(p,a))-n;n<p;n++)t+=s(n),e+=l(n);t/=g,e/=g;let r=Math.floor((i+0)*u)+1;var y=Math.floor((i+1)*u)+1,m=[s(h),l(h)];for(f=-1;r<y;r++)(o=.5*Math.abs((m[0]-t)*(s(r)-m[1])-(m[0]-l(r))*(e-m[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function bS(t){if("function"==typeof t)return t;if("lttb"===t)return vS;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[mf(t,t=>n[t])]],max:(t,e,n)=>[t[gf(t,t=>n[t])]],median:(t,e,n)=>{return[t[wf(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/r))).flatMap(t=>i(t,e,n))}}mS.props={};const xS=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=bS(e);return(t,e)=>{var n=e["encode"],t=n3(o,t,e);const[r]=JE(n,"x"),[i]=JE(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},wS=(xS.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=JE(i,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const r=Array.isArray(e)?e:[e];return 0===r.length?null:t=>r.includes(n[t])}).filter(Od);if(0===r.length)return[t,e];const a=t.filter(e=>r.every(t=>t(e))),o=a.map((t,e)=>e);t=Object.entries(i).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:o.map(t=>e.value[a[t]])})]);return[o,ot({},e,{encode:Object.fromEntries(t),data:a.map(t=>n[t])})]});function MS(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function OS(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}wS.props={};const kS=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{IO(t);const i=t.getLocalBounds();e.some(t=>{var e=MS(i),t=MS(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?RO(t):e.push(t)}),t}};function ES(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const SS=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=ES(),[m,v]=ES();var a,o,s,l,[c,t]=ES(),[u,n]=ES();for(const b of i){var{min:r,max:h}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,h]=h;y(b,g),v(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>Ih(m(t),m(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=m(f);var d=c(f),p=m(e),d=p-(g+d);d<k&&(d=(k-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<O)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function _S(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function AS(t,e,n){return.2126*_S(t)+.7152*_S(e)+.0722*_S(n)}function TS(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=AS(t,n,r),n=AS(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function PS(e,t){return t[gf(t,t=>{return TS(e,"object"==typeof(t=t)?t:z.parseColor(t))})]}const CS=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;TS(t.parsedStyle.fill,e)<n&&t.attr("fill",PS(e,r))}),t)},LS=()=>t=>(t.forEach(t=>{IO(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(OS(t,e)&&OS(n,e))}(MS(t.getLocalBounds()),e)||RO(t)}),t);var P=1e-6,NS=1e-12,jS=Math.PI,RS=jS/2,IS=jS/4,BS=2*jS,DS=180/jS,FS=jS/180,zS=Math.abs,WS=Math.atan,GS=Math.atan2,_=Math.cos,HS=Math.ceil,VS=Math.exp,YS=Math.log,qS=Math.pow,A=Math.sin,XS=Math.sign||function(t){return 0<t?1:t<0?-1:0},US=Math.sqrt,$S=Math.tan;function KS(t){return 1<t?0:t<-1?jS:Math.acos(t)}function ZS(t){return 1<t?RS:t<-1?-RS:Math.asin(t)}function JS(){}function QS(t,e){t&&e4.hasOwnProperty(t.type)&&e4[t.type](t,e)}var t4={Feature:function(t,e){QS(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)QS(n[r].geometry,e)}},e4={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){n4(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)n4(n[r],e,0)},Polygon:function(t,e){r4(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)r4(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)QS(n[r],e)}};function n4(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function r4(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)n4(t[n],e,1);e.polygonEnd()}function i4(t,e){t&&t4.hasOwnProperty(t.type)?t4[t.type](t,e):QS(t,e)}function a4(t){return[GS(t[1],t[0]),ZS(t[2])]}function o4(t){var e=t[0],t=t[1],n=_(t);return[n*_(e),n*A(e),A(t)]}function s4(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function l4(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function c4(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function u4(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function h4(t){var e=US(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function f4(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function d4(t,e){return zS(t)>jS&&(t-=Math.round(t/BS)*BS),[t,e]}function p4(t,e,n){return(t%=BS)?e||n?f4(y4(t),m4(e,n)):y4(t):e||n?m4(e,n):d4}function g4(n){return function(t,e){return zS(t+=n)>jS&&(t-=Math.round(t/BS)*BS),[t,e]}}function y4(t){var e=g4(t);return e.invert=g4(-t),e}function m4(t,e){var i=_(t),a=A(t),o=_(e),s=A(e);function n(t,e){var n=_(e),r=_(t)*n,t=A(t)*n,n=A(e),e=n*i+r*a;return[GS(t*o-e*s,r*i-n*a),ZS(e*o+t*s)]}return n.invert=function(t,e){var n=_(e),r=_(t)*n,t=A(t)*n,n=A(e),e=n*o-t*s;return[GS(t*o+n*s,r*i+e*a),ZS(e*i-r*a)]},n}function v4(t,e){(e=o4(e))[0]-=t,h4(e);t=KS(-e[1]);return((-e[2]<0?-t:t)+BS-P)%BS}function b4(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:JS,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function x4(t,e){return zS(t[0]-e[0])<P&&zS(t[1]-e[1])<P}function w4(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function M4(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(x4(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*P}s.push(n=new w4(r,t,null,!0)),l.push(n.o=new w4(r,null,n,!1)),s.push(n=new w4(i,t,null,!1)),l.push(n.o=new w4(i,null,n,!0))}}),s.length){for(l.sort(e),O4(s),O4(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function O4(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function k4(t){return zS(t[0])<=jS?t[0]:XS(t[0])*((zS(t[0])+jS)%BS-jS)}function E4(y,m,v,b){return function(s){var l,c,u,n=m(s),h=b4(),f=m(h),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=kf(c);var t=function(t,e){var n=k4(e),r=e[1],e=A(r),i=[A(n),-_(n),0],a=0,o=0,s=new qh;1===e?r=RS+P:-1===e&&(r=-RS-P);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=k4(f),p=f[1]/2+IS,g=A(p),y=_(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=k4(v),x=v[1]/2+IS,w=A(x),x=_(x),M=b-d,O=0<=M?1:-1,k=O*M,E=jS<k,S=g*w;s.add(GS(S*O*A(k),y*x+S*_(k))),a+=E?M+O*BS:M,E^n<=d^n<=b&&(h4(S=l4(o4(f),o4(v))),h4(k=l4(i,S)),(O=(E^0<=M?-1:1)*ZS(k[2]))<r||r===O&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-P||a<P&&s<-NS)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),M4(c,_4,t,v,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),v(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),v(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){y(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(S4))}return e}}function S4(t){return 1<t.length}function _4(t,e){return((t=t.x)[0]<0?t[1]-RS-P:RS-t[1])-((e=e.x)[0]<0?e[1]-RS-P:RS-e[1])}d4.invert=d4;var A4=E4(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?jS:-jS,l=zS(t-h);zS(l-jS)<P?(c.point(h,f=0<(f+e)/2?RS:-RS),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&jS<=l&&(zS(h-d)<P&&(h-=d*P),zS(t-s)<P&&(t-=s*P),l=f,i=e,o=A((n=h)-(r=t)),f=zS(o)>P?WS((A(l)*(a=_(i))*A(r)-A(i)*(r=_(l))*A(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*RS,r.point(-jS,i),r.point(0,i),r.point(jS,i),r.point(jS,0),r.point(jS,-i),r.point(0,-i),r.point(-jS,-i),r.point(-jS,0),r.point(-jS,i)):zS(t[0]-e[0])>P?(t=t[0]<e[0]?jS:-jS,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-jS,-RS]);function T4(d){var g=_(d),p=6*FS,h=0<g,f=zS(g)>P;function y(t,e){return _(t)*_(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=l4(o4(t),o4(e)),f=s4(h,h),d=h[0],p=f-d*d;return p?(r=l4(u,h),c4(u=u4(u,g*f/p),u4(h,-g*d/p)),(p=(h=s4(u,f=r))*h-(d=s4(f,f))*(s4(u,u)-1))<0?void 0:(c4(p=u4(f,(-h-(r=US(p)))/d),u),p=a4(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=zS((s=a-i)-jS)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(zS(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:jS<s^(i<=p[0]&&p[0]<=a))?(c4(c=u4(f,(-h+r)/d),u),[p,a4(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:jS-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return E4(y,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=y(t,e),t=h?i?0:v(t,e):i?v(t+(t<0?jS:-jS),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!x4(o,n)&&!x4(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=m(r,o),a.point(n[0],n[1])):(n=m(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=m(r,o,!0))||(u=0,h?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&x4(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=_(r),c=A(r),u=o*a;null==n?(n=r+o*BS,s=r-u/2):(n=v4(l,n),s=v4(l,s),(0<o?n<s:s<n)&&(n+=o*BS));for(var h,f=n;0<o?s<f:f<s;f-=u)h=a4([l,-c*_(f),-c*A(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-jS,d-jS])}var P4=1e9,C4=-P4;function L4(m,v,b,x){function w(t,e){return m<=t&&t<=b&&v<=e&&e<=x}function M(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?m:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return zS(t[0]-m)<P?0<e?0:3:zS(t[0]-b)<P?0<e?2:1:zS(t[1]-v)<P?0<e?1:0:0<e?3:2}function O(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,h,a,o,s,l,c,u,f,d,p,g=r,t=b4(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(m-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(m-r)&&--t;return t}(),e=p&&t,n=(i=kf(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&M4(i,O,t,M,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,h=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(C4,Math.min(P4,c)),u=Math.max(C4,Math.min(P4,u))],r=[t=Math.max(C4,Math.min(P4,t)),e=Math.max(C4,Math.min(P4,e))],m,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function N4(t,e,n){var r=Ef(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function j4(t,e,n){var r=Ef(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function R4(){return g=p=10,y=90,m=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(v)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(v)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],e):[y,m]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(v=+t,u=N4(s,o,90),h=j4(r,n,v),f=N4(c,l,90),d=j4(a,i,v),e):v},e.extentMajor([[-180,-90+P],[180,90-P]]).extentMinor([[-180,-80-P],[180,80+P]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return Ef(HS(a/y)*y,i,y).map(f).concat(Ef(HS(c/m)*m,l,m).map(d)).concat(Ef(HS(r/p)*p,n,p).filter(function(t){return zS(t%y)>P}).map(u)).concat(Ef(HS(s/g)*g,o,g).filter(function(t){return zS(t%m)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var I4,B4,D4,F4,z4=t=>t,W4=new qh,G4=new qh,H4={point:JS,lineStart:JS,lineEnd:JS,polygonStart:function(){H4.lineStart=V4,H4.lineEnd=X4},polygonEnd:function(){H4.lineStart=H4.lineEnd=H4.point=JS,W4.add(zS(G4)),G4=new qh},result:function(){var t=W4/2;return W4=new qh,t}};function V4(){H4.point=Y4}function Y4(t,e){H4.point=q4,I4=D4=t,B4=F4=e}function q4(t,e){G4.add(F4*t-D4*e),D4=t,F4=e}function X4(){q4(I4,B4)}var U4=H4,$4=1/0,K4=$4,Z4=-$4,J4=Z4;var Q4,t6,e6,n6,r6={point:function(t,e){t<$4&&($4=t);Z4<t&&(Z4=t);e<K4&&(K4=e);J4<e&&(J4=e)},lineStart:JS,lineEnd:JS,polygonStart:JS,polygonEnd:JS,result:function(){var t=[[$4,K4],[Z4,J4]];return Z4=J4=-(K4=$4=1/0),t}},i6=0,a6=0,o6=0,s6=0,l6=0,c6=0,u6=0,h6=0,f6=0,d6={point:p6,lineStart:g6,lineEnd:v6,polygonStart:function(){d6.lineStart=b6,d6.lineEnd=x6},polygonEnd:function(){d6.point=p6,d6.lineStart=g6,d6.lineEnd=v6},result:function(){var t=f6?[u6/f6,h6/f6]:c6?[s6/c6,l6/c6]:o6?[i6/o6,a6/o6]:[NaN,NaN];return i6=a6=o6=s6=l6=c6=u6=h6=f6=0,t}};function p6(t,e){i6+=t,a6+=e,++o6}function g6(){d6.point=y6}function y6(t,e){d6.point=m6,p6(e6=t,n6=e)}function m6(t,e){var n=t-e6,r=e-n6,n=US(n*n+r*r);s6+=n*(e6+t)/2,l6+=n*(n6+e)/2,c6+=n,p6(e6=t,n6=e)}function v6(){d6.point=p6}function b6(){d6.point=w6}function x6(){M6(Q4,t6)}function w6(t,e){d6.point=M6,p6(Q4=e6=t,t6=n6=e)}function M6(t,e){var n=t-e6,r=e-n6,n=US(n*n+r*r);s6+=n*(e6+t)/2,l6+=n*(n6+e)/2,c6+=n,u6+=(n=n6*t-e6*e)*(e6+t),h6+=n*(n6+e),f6+=3*n,p6(e6=t,n6=e)}var O6=d6;function k6(t){this._context=t}k6.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,BS)}},result:JS};var E6,S6,_6,A6,T6,P6=new qh,C6={point:JS,lineStart:function(){C6.point=L6},lineEnd:function(){E6&&N6(S6,_6),C6.point=JS},polygonStart:function(){E6=!0},polygonEnd:function(){E6=null},result:function(){var t=+P6;return P6=new qh,t}};function L6(t,e){C6.point=N6,S6=A6=t,_6=T6=e}function N6(t,e){A6-=t,T6-=e,P6.add(US(A6*A6+T6*T6)),A6=t,T6=e}var j6=C6;let R6,I6,B6,D6;class F6{constructor(t){this._append=null==t?z6:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return z6;if(e!==R6){const r=10**e;R6=e,I6=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return I6}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===B6&&this._append===I6||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,B6=n,I6=this._append,D6=this._,this._=r),this._+=D6}}result(){var t=this._;return this._="",t.length?t:null}}function z6(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function W6(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),i4(t,a(o))),o.result()}return s.area=function(t){return i4(t,a(U4)),U4.result()},s.measure=function(t){return i4(t,a(j6)),j6.result()},s.bounds=function(t){return i4(t,a(r6)),r6.result()},s.centroid=function(t){return i4(t,a(O6)),O6.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,z4):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new F6(r)):new k6(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new F6(r)),s},s.projection(e).digits(r).context(n)}function G6(r){return function(t){var e,n=new H6;for(e in r)n[e]=r[e];return n.stream=t,n}}function H6(){}function V6(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),i4(n,t.stream(r6)),e(r6.result()),null!=r&&t.clipExtent(r),t}function Y6(i,a,t){return V6(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function q6(t,e,n){return Y6(t,[[0,0],e],n)}function X6(r,i,t){return V6(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function U6(i,a,t){return V6(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}H6.prototype={constructor:H6,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var $6=16,K6=_(30*FS);function Z6(t,e){return+e?(_=t,A=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:m,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=_(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=o4([t,e]),e=_(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],$6,r),r.point(u,h)}function m(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,$6,r),g.lineEnd=m,m()}return g}):(n=t,G6({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,_,A;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,m,v,b,x,w,M,O,k=o-t,E=s-e,S=k*k+E*E;4*A<S&&f--&&(y=a+h,x=ZS(y/=m=US((p=r+c)*p+(g=i+u)*g+y*y)),v=zS(zS(y)-1)<P||zS(n-l)<P?(n+l)/2:GS(g,p),b=(x=_(v,x))[0],x=x[1],A<(O=E*(w=b-t)-k*(M=x-e))*O/S||.3<zS((k*w+E*M)/S-.5)||r*c+i*u+a*h<K6)&&(T(t,e,n,r,i,a,b,x,v,p/=m,g/=m,y,f,d),d.point(b,x),T(b,x,v,p,g,y,o,s,l,c,u,h,f,d))}}var J6=G6({point:function(t,e){this.stream.point(t*FS,e*FS)}});function Q6(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=_(e),e=A(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,m=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(m-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,v.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},v);function v(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function t_(t){return e_(function(){return t})()}function e_(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,w=1,M=null,O=A4,k=null,E=z4,S=.5;function _(t){return l(t[0]*FS,t[1]*FS)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*DS,t[1]*DS]}function T(){var t=Q6(h,0,0,x,w,b).apply(null,e(p,g)),t=Q6(h,f-t[0],d-t[1],x,w,b);return r=p4(y,m,v),s=f4(e,t),l=f4(r,s),o=Z6(s,S),P()}function P(){return c=u=null,_}return _.stream=function(t){return c&&u===t?c:c=J6((n=r,G6({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(O(o(E(u=t))))));var n},_.preclip=function(t){return arguments.length?(O=t,M=void 0,P()):O},_.postclip=function(t){return arguments.length?(E=t,k=n=i=a=null,P()):E},_.clipAngle=function(t){return arguments.length?(O=+t?T4(M=t*FS):(M=null,A4),P()):M*DS},_.clipExtent=function(t){return arguments.length?(E=null==t?(k=n=i=a=null,z4):L4(k=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==k?null:[[k,n],[i,a]]},_.scale=function(t){return arguments.length?(h=+t,T()):h},_.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},_.center=function(t){return arguments.length?(p=t[0]%360*FS,g=t[1]%360*FS,T()):[p*DS,g*DS]},_.rotate=function(t){return arguments.length?(y=t[0]%360*FS,m=t[1]%360*FS,v=2<t.length?t[2]%360*FS:0,T()):[y*DS,m*DS,v*DS]},_.angle=function(t){return arguments.length?(b=t%360*FS,T()):b*DS},_.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},_.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},_.precision=function(t){return arguments.length?(o=Z6(s,S=t*t),P()):US(S)},_.fitExtent=function(t,e){return Y6(_,t,e)},_.fitSize=function(t,e){return q6(_,t,e)},_.fitWidth=function(t,e){return X6(_,t,e)},_.fitHeight=function(t,e){return U6(_,t,e)},function(){return e=t.apply(this,arguments),_.invert=e.invert&&A,T()}}function n_(t){var e=0,n=jS/3,r=e_(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*FS,n=t[1]*FS):[e*DS,n*DS]},t}function r_(t,e){var n,r,i,a=A(t),o=(a+A(e))/2;return zS(o)<P?(n=_(t),s.invert=function(t,e){return[t/n,ZS(e*n)]},s):(i=US(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=GS(t,zS(e))*XS(e);return e*o<0&&(n-=jS*XS(t)*XS(e)),[n/o,ZS((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,A(e)/n]}function l(t,e){e=US(r-2*o*A(e))/o;return[e*A(t*=o),i-e*_(t)]}}function i_(){return n_(r_).scale(155.424).center([0,33.6442])}function a_(){return i_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function o_(i){return function(t,e){var n=_(t),r=_(e),n=i(n*r);return n===1/0?[2,0]:[n*r*A(t),n*A(e)]}}function s_(a){return function(t,e){var n=US(t*t+e*e),r=a(n),i=A(r),r=_(r);return[GS(t*i,n*r),ZS(n&&e*i/n)]}}var l_=o_(function(t){return US(2/(1+t))});l_.invert=s_(function(t){return 2*ZS(t/2)});var c_=o_(function(t){return(t=KS(t))&&t/A(t)});function u_(t,e){return[t,YS($S((RS+e)/2))]}function h_(r){var i,a,o,s=t_(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=jS*l(),n=s((e=p4((e=s.rotate())[0]*FS,e[1]*FS,2<e.length?e[2]*FS:0),function(t){return(t=e.invert(t[0]*FS,t[1]*FS))[0]*=DS,t[1]*=DS,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===u_?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),h()):null==u?null:[[u,i],[a,o]]},h()}function f_(t){return $S((RS+t)/2)}function d_(t,e){var n=_(t),i=t===e?A(t):YS(n/_(e))/YS(f_(e)/f_(t)),a=n*qS(f_(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=XS(i)*US(t*t+e*e),r=GS(t,zS(e))*XS(e);return e*i<0&&(r-=jS*XS(t)*XS(e)),[r/i,2*WS(qS(a/n,1/i))-RS]},r):u_;function r(t,e){0<a?e<-RS+P&&(e=-RS+P):RS-P<e&&(e=RS-P);e=a/qS(f_(e),i);return[e*A(i*t),a-e*_(i*t)]}}function p_(t,e){return[t,e]}function g_(t,e){var n=_(t),r=t===e?A(t):(n-_(e))/(e-t),i=n/r+t;return zS(r)<P?p_:(a.invert=function(t,e){var e=i-e,n=GS(t,zS(e))*XS(e);return e*r<0&&(n-=jS*XS(t)*XS(e)),[n/r,i-XS(r)*US(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*A(t),i-e*_(t)]}}c_.invert=s_(function(t){return t}),u_.invert=function(t,e){return[t,2*WS(VS(e))-RS]},p_.invert=p_;var y_=1.340264,m_=-.081106,v_=893e-6,b_=.003796,x_=US(3)/2;function w_(t,e){var e=ZS(x_*A(e)),n=e*e,r=n*n*n;return[t*_(e)/(x_*(y_+3*m_*n+r*(7*v_+9*b_*n))),e*(y_+m_*n+r*(v_+b_*n))]}function M_(t,e){var n=_(e),r=_(t)*n;return[n*A(t)/r,A(e)/r]}function O_(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function k_(t,e){return[_(e)*A(t),A(e)]}function E_(t,e){var n=_(e),r=1+_(t)*n;return[n*A(t)/r,A(e)/r]}function S_(t,e){return[YS($S((RS+e)/2)),-t]}w_.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(y_+m_*i+a*(v_+b_*i))-e)/(y_+3*m_*i+a*(7*v_+9*b_*i)))*r)*i*i,!(zS(n)<NS));++o);return[x_*t*(y_+3*m_*i+a*(7*v_+9*b_*i))/_(r),ZS(A(r)/x_)]},M_.invert=s_(WS),O_.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),zS(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},k_.invert=s_(ZS),E_.invert=s_(function(t){return 2*WS(t)}),S_.invert=function(t,e){return[-e,2*WS(VS(t))-RS]};var __=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=a_(),l=i_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=i_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function f(){return e=n=null,h}return h.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},h.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+P,r+.12*e+P],[n-.214*e-P,r+.234*e-P]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+P,r+.166*e+P],[n-.115*e-P,r+.234*e-P]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return Y6(h,t,e)},h.fitSize=function(t,e){return q6(h,t,e)},h.fitWidth=function(t,e){return X6(h,t,e)},h.fitHeight=function(t,e){return U6(h,t,e)},h.scale(1070)},geoAlbers:a_,geoAzimuthalEqualArea:function(){return t_(l_).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:l_,geoAzimuthalEquidistant:function(){return t_(c_).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:c_,geoConicConformal:function(){return n_(d_).scale(109.5).parallels([30,30])},geoConicConformalRaw:d_,geoConicEqualArea:i_,geoConicEqualAreaRaw:r_,geoConicEquidistant:function(){return n_(g_).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:g_,geoEqualEarth:function(){return t_(w_).scale(177.158)},geoEqualEarthRaw:w_,geoEquirectangular:function(){return t_(p_).scale(152.63)},geoEquirectangularRaw:p_,geoGnomonic:function(){return t_(M_).scale(144.049).clipAngle(60)},geoGnomonicRaw:M_,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,m=G6({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=z4;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/y]},x.stream=function(t){return o&&s===t?o:o=m(v(s=t))},x.postclip=function(t){return arguments.length?(v=t,p=e=n=a=null,b()):v},x.clipExtent=function(t){return arguments.length?(v=null==t?(p=e=n=a=null,z4):L4(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=A(d=t%360*FS),r=_(d),b()):d*DS},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return Y6(x,t,e)},x.fitSize=function(t,e){return q6(x,t,e)},x.fitWidth=function(t,e){return X6(x,t,e)},x.fitHeight=function(t,e){return U6(x,t,e)},x},geoProjection:t_,geoProjectionMutator:e_,geoMercator:function(){return h_(u_).scale(961/BS)},geoMercatorRaw:u_,geoNaturalEarth1:function(){return t_(O_).scale(175.295)},geoNaturalEarth1Raw:O_,geoOrthographic:function(){return t_(k_).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:k_,geoStereographic:function(){return t_(E_).scale(250).clipAngle(142)},geoStereographicRaw:E_,geoTransverseMercator:function(){var t=h_(S_),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:S_});function A_(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function T_(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(C_),e.find(t=>t.sphere)?{type:"Sphere"}:A_(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=W6(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function P_(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[R4()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function C_(t){return"geoPath"===t.type}Fs=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=at(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Qe(t);if(e=__[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(P_);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(T_(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=W6(i);const u=new Z1({domain:[t,t+n]}),h=new Z1({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return C_(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:Pd(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},Fs.props={},gl=()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=at(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a,state:s}]})]};gl.props={};const L_={"composition.geoView":Fs,"composition.geoPath":gl};function N_(){return Object.assign({"data.fetch":p0,"data.inline":w0,"data.sortBy":x0,"data.sort":m0,"data.filter":y0,"data.pick":v0,"data.rename":b0,"data.fold":g0,"data.slice":K0,"data.custom":M0,"data.map":O0,"data.cluster":$p,"data.tree":Kp,"data.sankey":md,"data.arc":_0,"data.wordCloud":X0,"data.join":$0,"data.kde":rg,"data.venn":Og,"transform.maybeZeroY1":e3,"transform.maybeZeroX":g3,"transform.maybeStackY":d3,"transform.maybeTitle":p3,"transform.maybeSeries":b3,"transform.maybeZeroPadding":E3,"transform.stackY":h3,"transform.binX":mS,"transform.bin":yS,"transform.dodgeX":P3,"transform.jitter":R3,"transform.jitterX":I3,"transform.symmetryY":B3,"transform.diffY":D3,"transform.stackEnter":C3,"transform.normalizeY":L3,"transform.select":H3,"transform.selectX":V3,"transform.selectY":Y3,"transform.groupX":rS,"transform.groupY":iS,"transform.groupColor":aS,"transform.group":nS,"transform.maybeSize":m3,"transform.maybeZeroY":y3,"transform.maybeKey":v3,"transform.sortX":lS,"transform.sortY":uS,"transform.sortColor":cS,"transform.flexX":hS,"transform.maybeTupleY":x3,"transform.maybeTupleX":w3,"transform.maybeIdentityY":M3,"transform.maybeIdentityX":O3,"transform.maybeTuple":A3,"transform.maybeVisualPosition":S3,"transform.maybeFunctionAttribute":_3,"transform.maybeGradient":T3,"transform.maybeTooltip":k3,"transform.pack":dS,"transform.sample":xS,"transform.filter":wS,"coordinate.cartesian":au,"coordinate.polar":su,"coordinate.helix":lu,"coordinate.transpose":cu,"coordinate.theta":uu,"coordinate.parallel":du,"coordinate.fisheye":pu,"coordinate.radial":fu,"coordinate.radar":gu,"encode.constant":yu,"encode.field":vu,"encode.transform":mu,"encode.column":bu,"mark.interval":jh,"mark.rect":Rh,"mark.line":Df,"mark.point":Ff,"mark.text":zf,"mark.cell":Wf,"mark.area":Gf,"mark.link":Hf,"mark.image":Vf,"mark.polygon":Yf,"mark.box":qf,"mark.vector":Xf,"mark.lineX":$f,"mark.lineY":Uf,"mark.connector":Kf,"mark.range":Qf,"mark.rangeX":td,"mark.rangeY":ed,"mark.sankey":Bd,"mark.path":Dd,"mark.treemap":Gd,"mark.pack":Yd,"mark.boxplot":tp,"mark.shape":ep,"mark.forceGraph":Xp,"mark.gauge":Xy,"mark.tree":e0,"mark.wordCloud":kg,"mark.density":Uy,"mark.heatmap":$y,"palette.category10":Ky,"palette.category20":Zy,"scale.linear":Qy,"scale.ordinal":tm,"scale.band":Jy,"scale.identity":em,"scale.point":nm,"scale.time":rm,"scale.log":im,"scale.pow":am,"scale.sqrt":cm,"scale.threshold":om,"scale.quantile":sm,"scale.quantize":lm,"scale.sequential":um,"scale.constant":hm,"shape.interval.rect":gv,"shape.interval.hollow":yv,"shape.interval.funnel":mv,"shape.interval.pyramid":bv,"shape.rect.rect":gv,"shape.rect.hollow":yv,"shape.cell.cell":gv,"shape.cell.hollow":yv,"shape.line.line":Ov,"shape.line.hv":Ev,"shape.line.vh":Sv,"shape.line.hvh":_v,"shape.line.trail":Av,"shape.line.smooth":kv,"shape.point.bowtie":Pv,"shape.point.cross":Cv,"shape.point.diamond":Lv,"shape.point.hexagon":Nv,"shape.point.hollowBowtie":jv,"shape.point.hollowDiamond":Rv,"shape.point.hollowHexagon":Iv,"shape.point.hollow":Bv,"shape.point.hollowSquare":Dv,"shape.point.hollowTriangle":Fv,"shape.point.hollowTriangleDown":zv,"shape.point.hyphen":Wv,"shape.point.line":Gv,"shape.point.plus":Hv,"shape.point.point":Vv,"shape.point.square":Yv,"shape.point.tick":qv,"shape.point.triangle":Xv,"shape.point.triangleDown":Uv,"shape.text.text":c5,"shape.area.area":p5,"shape.area.smooth":g5,"shape.area.hvh":y5,"shape.area.vh":m5,"shape.area.hv":v5,"shape.link.smooth":x5,"shape.link.vhv":w5,"shape.link.arc":M5,"shape.link.link":b5,"shape.image.image":O5,"shape.polygon.polygon":k5,"shape.polygon.ribbon":E5,"shape.box.box":S5,"shape.box.violin":_5,"shape.vector.vector":$v,"shape.label.label":Y5,"shape.text.badge":h5,"shape.lineX.line":A5,"shape.lineY.line":A5,"shape.shape.shape":eM,"shape.connector.connector":C5,"shape.range.range":gv,"shape.rangeX.range":gv,"shape.rangeY.range":gv,"shape.path.path":X5,"shape.path.hollow":U5,"shape.density.density":$5,"shape.heatmap.heatmap":tM,"theme.classic":rM,"theme.classicDark":aM,"theme.academy":sM,"component.axisX":IM,"component.axisY":BM,"component.axisRadar":DM,"component.axisLinear":jM,"component.axisArc":RM,"component.legendCategory":GM,"component.legendContinuous":XM,"component.legendContinuousBlock":UM,"component.legendContinuousBlockSize":KM,"component.legendContinuousSize":$M,"component.legends":hO,"component.title":QM,"component.sliderX":oO,"component.sliderY":sO,"component.scrollbarX":cO,"component.scrollbarY":uO,"animation.scaleInX":fO,"animation.scaleOutX":dO,"animation.scaleInY":pO,"animation.scaleOutY":gO,"animation.waveIn":_O,"animation.fadeIn":yO,"animation.fadeOut":mO,"animation.zoomIn":AO,"animation.zoomOut":TO,"animation.pathIn":PO,"animation.morphing":SO,"animation.growInX":CO,"animation.growInY":LO,"interaction.elementHighlight":ek,"interaction.elementHighlightByX":nk,"interaction.elementHighlightByColor":rk,"interaction.elementSelect":ak,"interaction.elementSelectByX":ok,"interaction.elementSelectByColor":sk,"interaction.fisheye":ck,"interaction.chartIndex":lk,"interaction.tooltip":Tk,"interaction.legendFilter":zk,"interaction.legendHighlight":Wk,"interaction.brushHighlight":Xk,"interaction.brushXHighlight":$k,"interaction.brushYHighlight":Zk,"interaction.brushAxisHighlight":oE,"interaction.brushFilter":lE,"interaction.brushXFilter":cE,"interaction.brushYFilter":uE,"interaction.sliderFilter":dE,"interaction.scrollbarFilter":gE,"interaction.poptip":vE,"interaction.event":dk,"composition.spaceLayer":ME,"composition.spaceFlex":OE,"composition.mark":EE,"composition.view":kE,"composition.facetRect":IE,"composition.repeatMatrix":zE,"composition.facetCircle":qE,"composition.timingKeyframe":XE,"labelTransform.overlapHide":kS,"labelTransform.overlapDodgeY":SS,"labelTransform.overflowHide":LS,"labelTransform.contrastReverse":CS},L_)}const j_=[["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"]]]]];function R_(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function I_(t,e,n,r,i){var a=t[0],t=t[1],o=J();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function B_(t,e,n,r,i){var a=new Z1({range:[e,e+r]}),o=new Z1({range:[n,n+i]});return{transform:function(t){var e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function D_(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function F_(t,e,n,r,i){return t[0]}function z_(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new Z1({range:[s,t]}),c=new Z1({range:[a,o]}),u=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*h)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=R_(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function W_(t,e,n,r,i){return{transform:function(t){var e=t[0];return[t[1],e]},untransform:function(t){var e=t[0];return[t[1],e]}}}function G_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return U_.apply(void 0,$_([[-1,-1]],e,!1))}function H_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return U_.apply(void 0,$_([[-1,1]],e,!1))}function V_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return U_.apply(void 0,$_([[1,-1]],e,!1))}function Y_(t,e,n,r,i){var a,t=t[0],o=J();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function q_(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new Z1({range:[s,s+.99*l]}),h=new Z1({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=R_(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function X_(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new Z1({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new J1({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var U_=function(t,e,n,r,i){var a=t[0],t=t[1],o=J();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},$_=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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function K_(t){return 1/Math.tan(t)}function Z_(t,e,n,r,i){var a=K_(t[0]);return{transform:function(t){var e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var e=t[0],t=t[1];return[e-t*a,t]}}}function J_(t,e,n,r,i){var a=K_(t[0]);return{transform:function(t){var e=t[0];return[e,t[1]+e*a]},untransform:function(t){var e=t[0];return[e,t[1]-e*a]}}}function Q_(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function tA(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function eA(t,e,n){return n?new Z1({range:[0,1],domain:[0,e]}).map(t):t}function nA(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=eA(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[Q_(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[tA(e,s,o,0,1),t]}}}function rA(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=eA(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],Q_(t[1],s,o,0,1)]},untransform:function(t){return[t[0],tA(t[1],s,o,0,1)]}}}function iA(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=eA(a,r,t=void 0!==t&&t),u=eA(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[Q_(e,c,s,0,1),Q_(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[tA(e,c,s,0,1),tA(t,u,l,0,1)]}}}function aA(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new Z1({range:[0,r]}),u=new Z1({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=Q_(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=tA(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var oA=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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},sA=(lA.prototype.update=function(t){this.options=t1({},this.options,t),this.recoordinate()},lA.prototype.clone=function(){return new lA(this.options)},lA.prototype.getOptions=function(){return this.options},lA.prototype.clear=function(){this.update({transformations:[]})},lA.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},lA.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},lA.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:oA(oA([],n,!0),[oA([],t,!0)],!1)}),this},lA.prototype.map=function(t){return this.output(t)},lA.prototype.invert=function(t){return this.input(t)},lA.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},lA.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?oA([],this.options.transformations,!0).reverse():this.options.transformations,n=t?function(t){return t.untransform}:function(t){return t.transform},r=[],a=[],i=function(t,e){return a.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,r)}return e}):t);var i},o=0,s=e;o<s.length;o++){var l,c,u,h,f=s[o],d=f[0],f=f.slice(1),p=this.transformers[d];p&&(l=(h=this.options).x,c=h.y,u=h.width,h=h.height,p=p(oA([],f,!0),l,c,u,h),(f=p)instanceof Float32Array||f instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||e1,"parallel"!==d)))}return r.length&&i(this.createMatrixTransform(r,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):e1}.apply(void 0,a)},lA.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=J();return e&&t.reverse(),t.forEach(function(t){return Q(p,p,t)}),e&&(e=t=p,(d=new Z(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Xt(t,t,p),[t[0],t[1]]}},lA);function lA(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:B_,translate:I_,custom:D_,matrix:F_,polar:z_,transpose:W_,scale:U_,"shear.x":Z_,"shear.y":J_,reflect:G_,"reflect.x":H_,"reflect.y":V_,rotate:Y_,helix:q_,parallel:X_,fisheye:iA,"fisheye.x":nA,"fisheye.y":rA,"fisheye.circular":aA},this.update(t)}function cA(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||wd("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=at(t,["type"]);return r(n)(t,e)},r]}function uA(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function hA(t,e){var{coordinate:n={}}=t,t=at(t,["coordinate"]),{type:r,transform:i=[]}=n,n=at(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=cA("coordinate",e),{transform:e=!1}=e(r).props||{};if(e)throw new Error(`Unknown coordinate: ${r}.`);return Object.assign(Object.assign({},t),{coordinates:[Object.assign({type:r},n),...i]})}function fA(t,e){return t.filter(t=>t.type===e)}function dA(t){return 0<fA(t,"polar").length}function pA(t){return fA(t,"transpose").length%2==1}function gA(t){return 0<fA(t,"theta").length}function yA(t){return 0<fA(t,"radial").length}function E(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}i=E("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),o=E("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Fo=E("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Ro=E("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),r=E("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Po=E("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),wo=E("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ni=E("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Hs=E("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),So=E("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function mA(t,e,n){(t.prototype=e.prototype=n).constructor=t}function vA(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function bA(){}var xA=1/.7,$s="\\s*([+-]?\\d+)\\s*",Xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Js="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wA=/^#([0-9a-f]{3,8})$/,MA=new RegExp(`^rgb\\(${$s},${$s},${$s}\\)$`),OA=new RegExp(`^rgb\\(${Js},${Js},${Js}\\)$`),kA=new RegExp(`^rgba\\(${$s},${$s},${$s},${Xs}\\)$`),EA=new RegExp(`^rgba\\(${Js},${Js},${Js},${Xs}\\)$`),SA=new RegExp(`^hsl\\(${Xs},${Js},${Js}\\)$`),_A=new RegExp(`^hsla\\(${Xs},${Js},${Js},${Xs}\\)$`),AA={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 TA(){return this.rgb().formatHex()}function PA(){return this.rgb().formatRgb()}function CA(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wA.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?LA(e):3===n?new IA(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?NA(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?NA(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=MA.exec(t))?new IA(e[1],e[2],e[3],1):(e=OA.exec(t))?new IA(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=kA.exec(t))?NA(e[1],e[2],e[3],e[4]):(e=EA.exec(t))?NA(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=SA.exec(t))?GA(e[1],e[2]/100,e[3]/100,1):(e=_A.exec(t))?GA(e[1],e[2]/100,e[3]/100,e[4]):AA.hasOwnProperty(t)?LA(AA[t]):"transparent"===t?new IA(NaN,NaN,NaN,0):null}function LA(t){return new IA(t>>16&255,t>>8&255,255&t,1)}function NA(t,e,n,r){return new IA(t=r<=0?e=n=NaN:t,e,n,r)}function jA(t){return(t=t instanceof bA?t:CA(t))?new IA((t=t.rgb()).r,t.g,t.b,t.opacity):new IA}function RA(t,e,n,r){return 1===arguments.length?jA(t):new IA(t,e,n,null==r?1:r)}function IA(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function BA(){return"#"+WA(this.r)+WA(this.g)+WA(this.b)}function DA(){var t=FA(this.opacity);return(1===t?"rgb(":"rgba(")+zA(this.r)+`, ${zA(this.g)}, `+zA(this.b)+(1===t?")":`, ${t})`)}function FA(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zA(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function WA(t){return((t=zA(t))<16?"0":"")+t.toString(16)}function GA(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new VA(t,e,n,r)}function HA(t){var e,n,r,i,a,o,s,l;return t instanceof VA?new VA(t.h,t.s,t.l,t.opacity):(t=t instanceof bA?t:CA(t))?t instanceof VA?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(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=0<l&&l<1?0:o,new VA(o,s,l,t.opacity)):new VA}function VA(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function YA(t){return(t=(t||0)%360)<0?t+360:t}function qA(t){return Math.max(0,Math.min(1,t||0))}function XA(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}mA(bA,CA,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:TA,formatHex:TA,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return HA(this).formatHsl()},formatRgb:PA,toString:PA}),mA(IA,RA,vA(bA,{brighter(t){return t=null==t?xA:Math.pow(xA,t),new IA(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new IA(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new IA(zA(this.r),zA(this.g),zA(this.b),FA(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:BA,formatHex:BA,formatHex8:function(){return"#"+WA(this.r)+WA(this.g)+WA(this.b)+WA(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:DA,toString:DA})),mA(VA,function(t,e,n,r){return 1===arguments.length?HA(t):new VA(t,e,n,null==r?1:r)},vA(bA,{brighter(t){return t=null==t?xA:Math.pow(xA,t),new VA(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new VA(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,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new IA(XA(240<=t?t-240:120+t,n,e),XA(t,n,e),XA(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new VA(YA(this.h),qA(this.s),qA(this.l),FA(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(){var t=FA(this.opacity);return(1===t?"hsl(":"hsla(")+YA(this.h)+`, ${100*qA(this.s)}%, ${100*qA(this.l)}%`+(1===t?")":`, ${t})`)}}));const UA=Math.PI/180,$A=180/Math.PI;var KA=1.78277,ZA=-.29227,JA=-.90649,QA=1.97294,t8=QA*JA,e8=QA*KA,n8=KA*ZA- -.14861*JA;function r8(t,e,n,r){return 1===arguments.length?(i=t)instanceof i8?new i8(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof IA?i:jA(i)).r/255,o=i.g/255,l=i.b/255,l=(QA*(o-(a=(n8*l+t8*a-e8*o)/(n8+t8-e8)))-ZA*(o=l-a))/JA,new i8((l=(s=Math.sqrt(l*l+o*o)/(QA*a*(1-a)))?Math.atan2(l,o)*$A-120:NaN)<0?l+360:l,s,a,i.opacity)):new i8(t,e,n,null==r?1:r);var i,a,o,s,l}function i8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}mA(i8,r8,vA(bA,{brighter(t){return t=null==t?xA:Math.pow(xA,t),new i8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new i8(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*UA,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new IA(255*(e+n*(-.14861*r+KA*t)),255*(e+n*(ZA*r+JA*t)),255*(e+QA*r*n),this.opacity)}}));var a8=t=>()=>t;function o8(e,n){return function(t){return e+t*n}}function s8(a){return 1==(a=+a)?l8:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):a8(isNaN(t)?e:t);var n,r,i}}function l8(t,e){var n=e-t;return n?o8(t,n):a8(isNaN(t)?e:t)}!function t(e){var o=s8(e);function n(e,t){var n=o((e=RA(e)).r,(t=RA(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=l8(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);c8=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var c8,u8=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=RA(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=c8(r),i=c8(i),a=c8(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function h8(s){return function t(o){function e(e,t){var n=s((e=r8(e)).h,(t=r8(t)).h),r=l8(e.s,t.s),i=l8(e.l,t.l),a=l8(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}h8(function(t,e){var n=e-t;return n?o8(t,180<n||n<-180?n-360*Math.round(n/360):n):a8(isNaN(t)?e:t)});var ph=h8(l8),Ho=t=>u8(t[t.length-1]),Xo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(E),Ao=Ho(Xo),Bs=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(E),Ys=Ho(Bs),xl=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(E),Rs=Ho(xl),Wo=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(E),Ll=Ho(Wo),Oo=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(E),n=Ho(Oo),Ws=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(E),Yo=Ho(Ws),Ko=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(E),ts=Ho(Ko),vs=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(E),Ls=Ho(vs),Jo=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(E),Bo=Ho(Jo),Ns=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(E),h=Ho(Ns),Fs=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(E),gl=Ho(Fs),$s=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(E),Js=Ho($s),Xs=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(E),f8=Ho(Xs),d8=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(E),p8=Ho(d8),g8=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(E),y8=Ho(g8),m8=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(E),v8=Ho(m8),b8=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(E),x8=Ho(b8),w8=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(E),M8=Ho(w8),O8=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(E),k8=Ho(O8),E8=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(E),S8=Ho(E8),_8=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(E),A8=Ho(_8),T8=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(E),P8=Ho(T8),C8=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(E),L8=Ho(C8),N8=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(E),j8=Ho(N8),R8=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(E),I8=Ho(R8),B8=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(E),D8=Ho(B8),F8=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(E),Ho=Ho(F8);var z8=ph(r8(300,.5,0),r8(-240,.5,1)),W8=ph(r8(-100,.75,.35),r8(80,1.5,.8)),ph=ph(r8(260,.75,.35),r8(80,1.5,.8)),G8=r8();var H8=RA(),V8=Math.PI/3,Y8=2*Math.PI/3;function q8(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var X8=q8(E("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),U8=q8(E("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),$8=q8(E("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),K8=q8(E("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Z8=Object.freeze({__proto__:null,schemeCategory10:i,schemeAccent:o,schemeDark2:Fo,schemePaired:Ro,schemePastel1:r,schemePastel2:Po,schemeSet1:wo,schemeSet2:ni,schemeSet3:Hs,schemeTableau10:So,interpolateBrBG:Ao,schemeBrBG:Xo,interpolatePRGn:Ys,schemePRGn:Bs,interpolatePiYG:Rs,schemePiYG:xl,interpolatePuOr:Ll,schemePuOr:Wo,interpolateRdBu:n,schemeRdBu:Oo,interpolateRdGy:Yo,schemeRdGy:Ws,interpolateRdYlBu:ts,schemeRdYlBu:Ko,interpolateRdYlGn:Ls,schemeRdYlGn:vs,interpolateSpectral:Bo,schemeSpectral:Jo,interpolateBuGn:h,schemeBuGn:Ns,interpolateBuPu:gl,schemeBuPu:Fs,interpolateGnBu:Js,schemeGnBu:$s,interpolateOrRd:f8,schemeOrRd:Xs,interpolatePuBuGn:p8,schemePuBuGn:d8,interpolatePuBu:y8,schemePuBu:g8,interpolatePuRd:v8,schemePuRd:m8,interpolateRdPu:x8,schemeRdPu:b8,interpolateYlGnBu:M8,schemeYlGnBu:w8,interpolateYlGn:k8,schemeYlGn:O8,interpolateYlOrBr:S8,schemeYlOrBr:E8,interpolateYlOrRd:A8,schemeYlOrRd:_8,interpolateBlues:P8,schemeBlues:T8,interpolateGreens:L8,schemeGreens:C8,interpolateGreys:j8,schemeGreys:N8,interpolatePurples:I8,schemePurples:R8,interpolateReds:D8,schemeReds:B8,interpolateOranges:Ho,schemeOranges:F8,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:z8,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return G8.h=360*t-100,G8.s=1.5-1.5*e,G8.l=.8-.9*e,G8+""},interpolateWarm:W8,interpolateCool:ph,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,H8.r=255*(e=Math.sin(t))*e,H8.g=255*(e=Math.sin(t+V8))*e,H8.b=255*(e=Math.sin(t+Y8))*e,H8+""},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:X8,interpolateMagma:U8,interpolateInferno:$8,interpolatePlasma:K8});function J8(t,e,n,r,i,a){var o,s,{guide:l={}}=n,c=function(t,e,n){var{type:n,domain:r,range:i}=n;return void 0!==n?n:function(t){return fT(t,_d)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?oT(t):void 0===r?uT(e)?oT(t):hT(e)?"time":sT(t,i):uT([r])?oT(t):hT(e)?"time":sT(t,i)}(t,e,n);return"string"!=typeof c?n:(s=function(t,e,n){const r=n["ratio"];if(void 0===r||null===r)return e;if(rT({type:t}))return function(t,e,n){const r=t.map(Number),i=new Z1({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 iT({type:t})?(n=e,t=r,t=Math.round(n.length*r),n.slice(0,t)):e}(c,o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return lT(function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)Od(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n),n);case"band":case"ordinal":case"point":return cT(e);case"quantile":return function(t){return cT(t).sort()}(e);case"sequential":return lT(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)Od(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e),n);default:return[]}}(c,e,n),n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=_1,nice:n=!1,tickCount:r=5}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);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});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"!==t?"point"===t?.5:0:gA(n)?0:.1}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Qe(e),i=Z8["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(c,t,n,r)),{domain:s,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=aT(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],Ey(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||0,c||1];case"ordinal":return aT(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}(c,t,e,n,s,i,a),expectedDomain:o,guide:l,name:t,type:c}))}function Q8(t,e){var{components:e=[]}=e,n=["scale","encode","axis","legend","data","transform"],r=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),i=new Map(r.map(t=>[t.name,t]));for(const l of e)for(const c of function(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)):[]}(l)){var a=i.get(c),o=(null==(o=l.scale)?void 0:o[c])||{},{independent:s=!1}=o;a&&!s?(s=a["guide"],a.guide=ot({},"boolean"==typeof s?{}:s,l),Object.assign(a,o)):(s=Object.assign(Object.assign({},o),{expectedDomain:o.domain,name:c,guide:ln(l,n)}),r.push(s))}return r}function tT(t,e){var n,r=Object.keys(t);for(const i of Object.values(e)){const{name:a,key:o}=i.getOptions();"string"==typeof o?o in t||(t[o]=i):a in t?(n=pf(r.filter(t=>t.startsWith(a)).map(t=>+(t.replace(a,"")||0)))+1,(t[n=""+a+n]=i).getOptions().key=n):t[a]=i}}function eT(t,e){var[e]=cA("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[vd,vd];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function nT(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(rT)?Yh(e):t.every(iT)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function rT(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function iT(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function aT(t,e,n,r,i){var[i]=cA("palette",i),{defaultCategory10:r,defaultCategory20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Qe(t),i=Z8["scheme"+e],a=Z8["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function oT(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function sT(t,e){return"color"!==t||e?"linear":"sequential"}function lT(t,e){var n,r;return 0===t.length?t:({domainMin:e,domainMax:n}=e,[t,r]=t,[null!=e?e:t,null!=n?n:r])}function cT(t){return Array.from(new Set(t.flat()))}function uT(t){return fT(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function hT(t){return fT(t,t=>t instanceof Date)}function fT(t,e){for(const n of t)if(n.some(e))return!0;return!1}const dT={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},pT={threshold:"threshold",quantize:"quantize",quantile:"quantile"},gT={ordinal:"ordinal",band:"band",point:"point"},yT={constant:"constant"};function mT(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=cA("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=cA("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?pA(i)?t+"Y":t+"X":"y"===e?pA(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,defaultSize:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);return M.push(...e),r&&(t=x("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:i}=t,M.push(Object.assign({type:"title",position:n,orientation:e,order:t,defaultSize:i},"string"==typeof r?{title:r}:r))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0<n.length,r=r&&0<r.length,["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(t)&&n&&r)||["sequential"].includes(t)&&n&&(r||e)||["constant","identity"].includes(t)&&r));var e,n,r});return[...function(t){const n=["shape","size","color","opacity"],e=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!("constant"===t&&"size"===e)),r=e.filter(({type:t})=>"constant"===t),i=e.filter(({type:t})=>"constant"!==t),a=Zh(i,t=>t.field||Symbol("independent")).map(([t,e])=>[t,[...e,...r]]).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])=>{var e,n,r=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(..._y(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>[t.name,function(t){t=t.type;return"string"!=typeof t?null:t in dT?"continuous":t in gT?"discrete":t in pT?"distribution":t in yT?"constant":null}(t)])}));for([e,n]of j_)for(const{option:i,combination:a}of r)if(n.some(t=>un(s(t),s(i))))return[e,a];return null}).filter(Od);return l}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<fA(n,"helix").length||gA(n))&&(!pA(n)||!dA(n)&&!yA(n))){if(e.startsWith("x"))return dA(n)?["axisArc",[t]]:yA(n)?["axisLinear",[t]]:[pA(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return dA(n)?["axisLinear",[t]]:yA(n)?["axisArc",[t]]:[pA(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<fA(n,"radar").length)return["axisRadar",[t]];if(!dA(n))return["axisY",[t]]}}return null}).filter(Od)}(t,e)]}(w,b).forEach(([t,e])=>{var n=x(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o,defaultLength:s,defaultPadding:l=[0,0],defaultCrossPadding:c=[0,0]}=n,{guide:n,field:u}=ot({},...e);for(const v of Array.isArray(n)?n:[n]){var h,f,d,p,g,[y,m]=function(t,e,n,r,i,a,o){var[s]=xT(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=wT(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=xT(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<fA(t,"parallel").length}(i))return null===(s=wT(n))?e:pA(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=xT(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(dA(i))return["center",null];if(yA(i))return["center",null];if("axisX"===t&&function(t){return 0<fA(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<fA(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&dA(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,v,e,w,b);(y||m)&&(p=(g="left"===y||"right"===y)?l[1]:l[0],g=g?c[1]:c[0],{size:h,order:f=o,length:d=s,padding:p=p,crossPadding:g=g}=v,M.push(Object.assign(Object.assign({title:u},v),{defaultSize:a,length:d,position:y,orientation:m,padding:p,order:f,crossPadding:g,size:h,type:t,scales:e})))}}),M}function vT(t,e,n,r,i){var[a]=cA("component",r),{scaleInstances:o,scale:s,bbox:l}=t,l={bbox:l,library:r};return a(at(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function bT(t,o){const r=["left","right","bottom","top"];return Zh(t,({type:t,position:e,group:n})=>r.includes(e)?void 0===n?t.startsWith("legend")?"legend-"+e:Symbol("independent"):"independent"===n?Symbol("independent"):n:Symbol("independent")).flatMap(([,t],e)=>{if(1===t.length)return t[0];if(void 0!==o){var n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=Sf(n);if(o<r)return t.forEach(t=>t.group=Symbol("independent")),t;const a=(o-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=a)})}var r=pf(t,t=>t.size),n=pf(t,t=>t.order),i=pf(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function xT(t){var e,n=fA(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=ou(n),[n,e]):(n=fA(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=hu(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function wT(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function MT(t,e,n,r,i,a){var o=t["type"];if(["left","right","bottom","top"].includes(r)&&"string"==typeof o){const s=o;return(s.startsWith("axis")?ET:s.startsWith("group")?OT:s.startsWith("legendContinuous")?ST:"legendCategory"===s?_T:s.startsWith("slider")?kT:()=>{})(t,e,n,r,i,a)}}function OT(t,e,n,r,i,a){var o=t["children"];const s=pf(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>MT(t,e,n,r,i,a)),pf(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function kT(t,e,n,r,i,a){i=i.slider;var{trackSize:i,handleIconSize:o}=ot({},i,t.style),i=Math.max(i,2.4*o);t.size=i}function ET(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o="left"===r||"right"===r;const s=CT(t,r,i);var{tickLength:r=0,labelSpacing:i=0,titleSpacing:l=0}=s,c=at(s,["tickLength","labelSpacing","titleSpacing"]),a=AT(t,a),u=TT(t,a,c);if(u){var h=pf(u,t=>t.width),f=pf(u,t=>t.height),r=r+i;if(o)t.size=h+r;else{const{tickFilter:d,style:s={}}=t;i=s["labelTransform"];!function(t,e,n,r,i){var a=Sf(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),LT(t,i)),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;t=t.getBandWidth(e)/2;return t}(o,t)),c=s.map((t,e)=>e),u=-r[0],h=n+r[1],f=(t,e)=>{e=e.width;return[t-e/2,t+e/2]};for(let t=0;t<c.length;t++){var d=l[t],[d,p]=f(d,e[t]);if(d<u||h<p)return 1;d=l[t+1];if(d){var[d]=f(d,e[t+1]);if(d<p)return 1}}return}(a,u,e,n,d)||i?t.size=f+r:(t.style=Object.assign(Object.assign({},s),{labelTransform:"rotate(90)"}),t.size=h+r)}}a=PT(t,c);a&&(t.size+=o?l+a.width:l+a.height)}function ST(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t.style),{labelSpacing:o=0,titleSpacing:s=0}=i,i=at(i,["labelSpacing","titleSpacing"]),r="left"===r||"right"===r,l=st(i,"ribbon")["size"],c=st(i,"handleIcon")["size"],l=Math.max(l,2.4*c),c=(t.size=l,AT(t,a)),l=TT(t,c,i);if(l){const u=r?"width":"height";a=pf(l,t=>t[u]);t.size+=a+o}var c=PT(t,i),{crossPadding:l=0}=(c&&(r?t.size=Math.max(t.size,c.width):t.size+=s+c.height),t);t.size+=2*l}function _T(o,t,e,s,n,r){n=n.legendCategory;const i=ot({},n,o.style),{itemSpacing:a,itemMarkerSize:l,titleSpacing:c,rowPadding:u,colPadding:h}=i,f=at(i,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding"]),{cols:d,length:p}=o,g=void 0===p?t:p;n="left"===s||"right"===s;const y=PT(o,f);t=AT(o,r);const m=TT(o,t,f,"itemLabel"),v=Math.max(m[0].height,l)+u,b=(t,e=0)=>l+t+a[0]+e;if(n){let t=-1/0,e=0,n=1,r=0,i=-1/0,a=-1/0;var x,s=y?y.height:0,w=g-s;for({width:x}of m){var M=b(x);t=Math.max(t,M),e+v>w?(n++,i=Math.max(i,r),a=Math.max(a,e),r=1,e=v):(e+=v,r++)}n<=1&&(i=r,a=e),o.size=t*n,o.length=a+s,ot(o,{cols:n,gridRow:i})}else if("number"==typeof d)r=Math.ceil(m.length/d),t=pf(m,t=>b(t.width))*d,o.size=v*r,o.length=Math.min(t,g);else{let t=1,e=0,n=-1/0;for(var{width:O}of m){O=b(O,h);e+O>g?(n=Math.max(n,e),e=O,t++):e+=O}1===t&&(n=e),o.size=v*t,o.length=n}y&&(n?o.size=Math.max(o.size,y.width):o.size+=c+y.height);var{crossPadding:s=0}=o;o.size+=2*s}function AT(t,e){var[e]=cA("scale",e),{scales:t,tickCount:n,tickMethod:r}=t,t=t.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==n&&(t.tickCount=n),void 0!==r&&(t.tickMethod=r),e(t)}function TT(t,e,n,r="label"){var{labelFormatter:i,tickFilter:a,label:o=!0}=t;if(!o)return null;const s=function(t,e,n){n=LT(t,n),n=n.map(t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e}),e=e?"string"==typeof e?yM(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,i,a),l=st(n,r),c=s.map((n,r)=>Object.fromEntries(Object.entries(l).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]))),u=s.map((t,e)=>{return NT(t,c[e])});return c.some(t=>t.transform)||(o=s.map((t,e)=>e),t.indexBBox=new Map(o.map(t=>[t,[s[t],u[t]]]))),u}function PT(t,e){var n=t=>!1===t||null===t,t=t["title"],r=e["title"];return n(t)||n(r)||void 0===t?null:({direction:r,transform:e}=n=st(e,"title"),NT(Array.isArray(t)?t.join(","):t,Object.assign(Object.assign({},n),{transform:e||"vertical"===r?"rotate(-90)":""})))}function CT(t,e,n){var{axis:n,["axis"+xd(e)]:e}=n;return ot({},n,e,t.style)}function LT(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function NT(t,e){t=(t=t)instanceof z.DisplayObject?t:new z.Text({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function jT(t,o,e,n){var{width:r,height:i,x:a=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:h=l,insetRight:l=l,margin:f=0,marginLeft:d=f,marginBottom:p=f,marginTop:g=f,marginRight:f=f,padding:y,paddingBottom:m=y,paddingLeft:v=y,paddingRight:b=y,paddingTop:y=y}=function(t,e,n,r){var i=e["coordinates"];if(!dA(i))return e;i=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===i.length)return e;const a=i.map(t=>{return CT(t,"axisArc"===t.type?"arc":"linear",n)}),o=pf(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{e=a[e];return TT(t,AT(t,r),e)}).filter(Od),l=pf(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return PT(t,a[e])}).filter(t=>null!==t),u=0===c.length?0:pf(c,t=>t.height),{inset:h=l,insetLeft:f=h,insetBottom:d=h,insetTop:p=h+u,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:f,insetBottom:d,insetTop:p,insetRight:g})}(t,o,e,n);var x=(t,e,n,r,i)=>{var a=o["marks"];return 0===a.length||0<t-r-i-.25*t?[r,i]:(a=.75*t/2,["auto"===e?a:r,"auto"===n?a:i])},w=t=>"auto"!==t&&null!=t?t:30,M=w(y),w=w(m),{paddingLeft:M,paddingRight:w}=RT(t,i-M-w,[M,w],["left","right"],o,e,n),O=r-d-f,[v,b]=x(O,v,b,M,w),M=O-v-b,{paddingTop:w,paddingBottom:O}=RT(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,O,w);return{width:r,height:i,insetLeft:c,insetTop:u,insetBottom:h,insetRight:l,innerWidth:M,innerHeight:t-e-n,paddingLeft:v,paddingRight:b,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:f,x:a,y:s}}function RT(t,n,r,e,i,a,o){var s=Kh(t,t=>t.position),{padding:t,paddingLeft:i=t,paddingRight:l=t,paddingBottom:c=t,paddingTop:t=t}=i,u={paddingBottom:c,paddingLeft:i,paddingTop:t,paddingRight:l};for(const p of e){var h="padding"+xd(L5(p));const t=s.get(p)||[],g=u[h],y=t=>{void 0===t.size&&(t.size=t.defaultSize)};var f,d=t=>{var e;t.size||("auto"!==g?"group"===(e=t).type?(e.children.forEach(y),e.size=pf(e.children,t=>t.size)):e.size=e.defaultSize:(MT(t,n,r,p,a,o),y(t)))};"number"==typeof g?t.forEach(y):0===t.length?u[h]=30:((f=bT(t,n)).forEach(d),d=f.reduce((t,{size:e})=>t+e,0),u[h]=d)}return u}function IT(t,I,e){var B=Kh(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:D,marginLeft:r,marginTop:i,marginBottom:F,marginRight:z,innerHeight:a,innerWidth:o,insetBottom:W,insetLeft:s,insetRight:G,insetTop:l,height:c,width:H}=e,t=t+r,r=n+i,n=e+z,i=D+F,e=[t+s,r+l,o-s-G,a-l-W,"center",null,null],V={top:[t,0,o,r,"vertical",!0,Ih],right:[H-n,r,n,a,"horizontal",!1,Ih],bottom:[t,c-i,o,i,"vertical",!1,Ih],left:[0,r,t,a,"horizontal",!0,Ih],"top-left":[t,0,o,r,"vertical",!0,Ih],"top-right":[t,0,o,r,"vertical",!0,Ih],"bottom-left":[t,c-i,o,i,"vertical",!1,Ih],"bottom-right":[t,c-i,o,i,"vertical",!1,Ih],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=V[j],[h,Y]=Sy(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(h.length){y=g=p=d=f=void 0;var f=h,d=I,p=u,g=j,[f,y]=Sy(f,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),h=(b=v=m=h=void 0,f),m=d,v=p,b=g;if("center"===b)if(!function(t){return Cf(t)&&Af(t)}(m)){if(Af(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;O=void 0;f=h;g=v;var[x,w,M,O]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:O}}else if(Cf(m)){g=void 0;f=void 0;k=void 0;E=void 0;g=h;f=m;var k=v;var E=h[0].orientation;"horizontal"===E?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(g,f,k):"vertical"===E&&function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(g,f,k)}}else{S=void 0;E=void 0;_=void 0;A=void 0;q=void 0;X=void 0;var S=h;E=v;var[_,A,q,X]=E;for(const R of S)R.bbox={x:_,y:A,width:q,height:X},R.radar={index:S.indexOf(R),count:S.length}}else if("inner"===b){T=void 0;g=void 0;f=void 0;U=void 0;$=void 0;k=void 0;P=void 0;C=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,$,,f]=f,[k,P]=g.getCenter(),[g]=jf(g),f=f/2,C=g*f,K=k-C,Z=P-C;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:$+Z,width:2*C,height:2*C}}else if("outer"===b){m=void 0;g=void 0;J=void 0;Q=void 0;tt=void 0;et=void 0;m=h;g=v;var[J,Q,tt,et]=g;for(const at of m)at.bbox={x:J,y:Q,width:tt,height:et}}rt=nt=N=v=h=b=P=f=L=void 0;var L=y,f=d,P=p;if(0!==L.length){var[P,b,h,v]=P,[f]=jf(f),N=v/2*f/Math.sqrt(2),nt=P+h/2,rt=b+v/2;for(let t=0;t<L.length;t++)L[t].bbox={x:nt-N,y:rt-N,width:2*N,height:2*N}}}Y.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],m=(n.sort((t,e)=>null===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=m;t<n.length;t++){var v=n[t],{crossPadding:b=0}=v,x=v["size"];v.bbox={[c]:s?e-x+b:e+b,[h]:f,[d]:x-2*b,[g]:y},e+=x*(s?-1:1)}t=n.filter(t=>"group"===t.type);for(const _ of t){const{bbox:A,children:T}=_;var w=A[g];const P=w/T.length;var M=T.reduce((t,e)=>{e=null==(e=e.layout)?void 0:e.justifyContent;return e||t},"flex-start"),O=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),k=Sf(O),w=w-k,k="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=A[h]+k;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:A[d],[c]:A[c],[h]:e,[g]:O[t]-S},ot(E,{layout:{justifyContent:M}}),e+=O[t]}}}(t,u)}}function BT(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=at(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function DT(t,i,a){return K(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=cA("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=at(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>K(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),vd)}([at(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?ky(n):[],Object.assign(Object.assign({},i),{data:n})]})}function FT(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function zT(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Oy(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return Od(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function WT(t,e,n){var r=e["encode"];return r?(r=Oy(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{constant:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function GT(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=cA("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=Oy(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function HT(t,e,n){var{tooltip:r={}}=e;return Ad(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:_d(r)&&Cd(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function VT(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return Ad(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(_d(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?yM(a):a,s=n&&m[n],a=s&&m[n].field,l=i||a||n,c=[];for(const d of g){var u=t?y[d][t]:s?m[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var h=[];for(const p of g){var f=e(y[p],p,y,m);_d(f)?h[p]=f:h[p]={value:f}}return h},{title:o,items:i=[]}=n,a=at(n,["title","items"]),o=Object.assign({title:r(o),items:Array.isArray(i)?i.map(r):[]},a),[g,Object.assign(Object.assign({},t),{tooltip:o})])}function YT(l,t,e){var n,r=t["encode"],i=at(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=at(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function qT(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return ot(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{var 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 XT(t,e,n){var r=e["animate"];return r||void 0===r||ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function UT(l,c,u){return K(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return K(this,void 0,void 0,function*(){var t=c["library"],[t]=cA("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[BT,DT,FT,zT,WT,GT,YT,XT,qT,HT,...e.map(t),...r.map(t),...n.map(t),VT];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(l,c,{library:u});const{encode:n,scale:f,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=Qh(Object.entries(n).filter(([,t])=>Od(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=a.find(t=>t.name===e);return null!=n&&n.independent?t:e});var s=a.filter(t=>{const{name:e,required:n}=t;if(o.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:c,scaleKey:u,range:h}=t;return o.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=e.some(t=>t.constant),a=f[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=at(a,["independent","key","type"]),a="constant"===i,l=a?void 0:h;return{name:t,values:e,scaleKey:o||a?Symbol("independent"):s,scale:Object.assign({type:i,range:l},r)}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function $T(H,V,Y,q){var X,U;return K(this,void 0,void 0,function*(){const[n]=cA("composition",Y);var[t]=cA("interaction",Y);const I=new Set(Object.keys(Y).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(Od)),r=new Set(Object.keys(Y).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Od)),i=t=>{t=t.type;if("function"==typeof t){var{props:e={}}=t,{composite:e=!0}=e;if(e)return"mark"}return"string"==typeof t&&(I.has(t)||r.has(t))?"mark":t};const a=t=>"standardView"===i(t),B=t=>{t=t.type;return"string"==typeof t&&!!r.has(t)};var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e,static:B(t)})(t))},o=[];const s=new Map;for(var l=new Map,c=[H],u=[];c.length;){var h=c.shift();if(a(h)){var f=l.get(h),[f,d]=f?QT(f,h,Y):yield ZT(h,Y),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>hA(t,Y)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>JT(t,Y)));nT(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),nT(f,"y");for(let t=0;t<p.length;t++){var D=p[t],F=g[t];l.set(D,F)}}}else{d="mark"===i(h)?h:yield s7(h,Y),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(uk.BEFORE_PAINT);const y=new Map,m=new Map,v=[];V.selectAll(h7($)).data(o,t=>t.key).join(t=>t.append("g").attr("className",$).attr("id",t=>t.key).call(KT).each(function(t){t7(t,lt(this),v,Y,q),y.set(t,this)}),t=>t.call(KT).each(function(t){t7(t,lt(this),v,Y,q),m.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var b=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(f,d,p){return h=>K(this,void 0,void 0,function*(){var t,[e,n]=yield ZT(h,d),r=(t7(e,f,[],d,p),f),i=h,a=e,o=p,[s]=cA("interaction",s=d),l=(l=r.node()).nameInteraction,c=o7(i).find(([t])=>"tooltip"===t);(l=l.get("tooltip"))&&(null!=(t=l.destroy)&&t.call(l),c[1])&&(t=s(Object.assign({type:"tooltip"},c[1])),l={options:i,view:a,container:r.node(),update:t=>Promise.resolve(t)},t(l,[],o.emitter));for(const u of n)$T(u,f,d,p);return{options:h,view:e}})}(lt(e),Y,q)})),x=b(y);for(const P of x){const H=P["options"];var w=new Map;P.container.nameInteraction=w;for(const C of o7(H)){var[M,O]=C;O&&(O=t(Object.assign({type:M},O))(P,x,q.emitter),w.set(M,{destroy:O}))}}var k=b(m);for(const L of k){const{options:H,container:N}=L;var E=N.nameInteraction;for(const j of o7(H)){var[S,_]=j,A=E.get(S);A&&null!=(X=A.destroy)&&X.call(A),_&&(A=t(Object.assign({type:S},_))(L,k,q.emitter),E.set(S,{destroy:A}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>K(this,void 0,void 0,function*(){for(const t of R)yield $T(Object.assign({width:z,height:W},t),V,Y,q);e()}));T.push(G)}q.views=o,null!=(U=q.animations)&&U.forEach(t=>null==t?void 0:t.cancel()),q.animations=v,q.emitter.emit(uk.AFTER_PAINT);b=v.filter(Od).map(i7).map(t=>t.finished);return Promise.all([...b,...T])})}function KT(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function ZT(e,n){return K(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=at(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),o=i.map(t=>t.interaction||{}),s=i.map(t=>t.viewStyle||{}),a=[...a,e].reduceRight((t,e)=>ot(t,e),{}),e=[n,...o].reduce((t,e)=>ot(t,e),{}),n=[...s,r].reduce((t,e)=>ot(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(p,g){return K(this,void 0,void 0,function*(){var[t,e]=cA("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Od));const r=p["marks"];for(var i=[],a=[],o=[...r],{width:s,height:l}=function(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-h-f,height:t-p(a)-p(n)-c-o-d-u}}(p),c={options:p,width:s,height:l};o.length;){var[u]=o.splice(0,1),u=yield s7(u,g);const{type:f=wd("G2Mark type is required."),key:d}=u;if(n.has(f))a.push(u);else{var{props:h={}}=e(f),{composite:h=!0}=h;if(h){const r=yield t(u,c);h=Array.isArray(r)?r:[r];o.unshift(...h.map((t,e)=>Object.assign(Object.assign({},t),{key:d+"-"+e})))}else i.push(u)}}return Object.assign(Object.assign({},p),{marks:i,components:a})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,hA(t,n));return QT(yield JT(t,n),t,n)})}function JT(g,y){return K(this,void 0,void 0,function*(){var[t]=cA("theme",y),[,e]=cA("mark",y),{theme:n,marks:r,coordinates:i=[]}=g,a=t(a7(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield UT(f,l,y);l&&([l,s]=l,o.set(l,s))}for(const d of Kh(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=d.reduce((t,{scale:e})=>ot(t,e),{}),u=d[0]["scaleKey"],h=d[0]["values"],h=Array.from(new Set(h.map(t=>t.field).filter(Od)));const g=ot({guide:{title:0===h.length?void 0:h},field:h[0]},c);h=d[0]["name"],c=d.flatMap(({values:t})=>t.map(t=>t.value));const p=Object.assign(Object.assign({},J8(h,c,g,i,a,y)),{key:u});d.forEach(t=>t.scale=p)}return o})}function QT(t,e,n){var[r]=cA("mark",n),[i]=cA("theme",n),[a]=cA("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(a7(I)),c=Array.from(t.values());const u=Q8(c,e);var c=mT(function(t,e,n){for(var[r]of n.entries())if("cell"===r.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;n=e[0].defaultShape;if(!["point","line","rect","hollow"].includes(n))return t;e=(null==(e=t.find(t=>"color"===t.name))?void 0:e.field)||null,e={field:e,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[n]]};return[...t,e]}(Array.from(u),c,t),e,n),h=jT(c,e,i,n),f=function(t,e,n){var[n]=cA("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new sA(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(h,e,n),e=s?ot({mainLineWidth:1,mainStroke:"#000"},l):l,d=(IT(bT(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=eT(w,n);u.push(p),tT(d,{[z]:p})}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:E}=g,{index:S,channels:_,tooltip:A}=y;var v=Oy(Object.fromEntries(_.map(({name:t,scale:e})=>[t,e])),t=>eT(t,n));tT(d,v);const T=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(_,v),[P,C,L]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>Od(t)&&Od(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=O||P.length;const N=k?k(C,b,h):[],j=t=>{var e;return null==(e=null==(e=A.title)?void 0:e[t])?void 0:e.value},R=e=>A.items.map(t=>t[e]);b=P.map((t,e)=>{var n=Object.assign({points:C[e],transform:N[e],index:t,markKey:E,viewKey:o},A&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],L&&(n["series"+Qe(r)]=L[e].map(t=>i[t]));return L&&(n.seriesIndex=L[e]),L&&A&&(n.seriesItems=L[e].map(t=>R(t)),n.seriesTitle=L[e].map(t=>j(t))),n}),b=(y.data=b,y.index=P,null==M?void 0:M(b,v,h));m.push(...b||[])}return[{layout:h,theme:i,coordinate:f,markState:t,key:o,clip:B,scale:d,style:e,components:c,labelTransform:bd(D.map(a))},m]}function t7(tt,et,nt,rt,it){K(this,void 0,void 0,function*(){const{components:t,theme:n,layout:e,markState:r,coordinate:i,key:a,style:I,clip:o,scale:s}=tt,{width:B,height:D}=e,F=at(e,["x","y","width","height"]),l=["view","plot","main","content"];var c,u=l.map((t,e)=>e);const h=l.map(t=>kd(Object.assign({},n,I),t)),z=["a","margin","padding","inset"].map(t=>st(F,t)),f=t=>t.style("x",t=>m[t].x).style("y",t=>m[t].y).style("width",t=>m[t].width).style("height",t=>m[t].height).each(function(t){var e,n,r=lt(this),t=h[t];for([e,n]of Object.entries(t))r.style(e,n)});let d=0,p=0,g=B,y=D;const m=u.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=z[t];return d+=t,p+=e,g-=t+r,y-=e+n,{x:d,y:p,width:g,height:y}}),v=(et.selectAll(h7(pt)).data(u.filter(t=>Od(h[t])),t=>l[t]).join(t=>t.append("rect").attr("className",pt).style("zIndex",-2).call(f),t=>t.call(f),t=>t.remove()),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{enter:r={},update:a={},exit:o={}}=r,{type:s,duration:l=300,delay:c=0}=a,{type:u,duration:h=300,delay:f=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const E of i){var{updateType:y=s,updateDuration:m=l,updateDelay:v=c,enterType:b=u,enterDuration:x=h,enterDelay:w=f,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=E;void 0!==y&&!y||(e=Math.max(e,m+v),n=Math.min(n,v)),void 0!==k&&!k||(e=Math.max(e,M+O),n=Math.min(n,O)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),b=!!v&&{duration:v[1]};for([,c]of Zh(t,t=>t.type+"-"+t.position))c.forEach((t,e)=>t.index=e);var x,w,M,u=et.selectAll(h7(ft)).data(t,t=>`${t.type}-${t.position}-`+t.index).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",ft).append(t=>vT(ot({animate:b,scale:s},t),i,n,rt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=vT(ot({animate:b,scale:s},t),i,n,rt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();nt.push(...u.flat().filter(Od));const O=et.selectAll(h7(ht)).data([e],()=>a).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",ht).call(l7).call(u7,Array.from(r.keys())).call(f7,o),t=>t.call(u7,Array.from(r.keys())).call(t=>{if(!v)return l7(t);{const[l,c]=v;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(f7,o)).transitions();nt.push(...O.flat());for([x,w]of r.entries()){var W=w["data"];const{key:a,class:q,type:A}=x;var k=et.select("#"+a);const T=function(s,t,e,n,r){const[l]=cA("shape",n),c=s["data"],{defaultShape:u,data:i}=t,h=i.map(t=>t.points),{theme:f,coordinate:a}=e,{type:d,style:p={}}=s,g=Object.assign(Object.assign({},r),{document:uA(r),coordinate:a,theme:f});return t=>{var{shape:e=u}=p,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=at(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{index:i});const a=r?r.map(t=>c[t]):c[i],o=r||i;r=Oy(p,t=>e7(t,a,o,c)),i=Object.assign(Object.assign({},r),{type:c7(s,e)});return l(i,g)(n,t,n7(f,d,e,u),h)}}(x,w,tt,rt,it),X=(E=x,M=w,r7("enter",E,M,tt,rt)),P=(E=x,M=w,r7("update",E,M,tt,rt)),U=(E=x,M=w,r7("exit",E,M,tt,rt));var E=function(t,e,n,r){t=t.node().parentElement;return t.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r))}(et,k,q,"element");const O=k.selectAll(h7(ut)).selectFacetAll(E).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",ut).attr("markType",A).transition(function(t){return X(t,[this])}),t=>t.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});t.transition(function(t,e){n=this,r=l,s=c,n.__facet__&&(i=n.parentNode.parentNode,o=r.parentNode,[i,a]=s(i),[s,o]=s(o),i=`translate(${i-s}, ${a-o})`,s=n.style.transform,a="none"===(a=s)||void 0===a?"":s,n.style.transform=(a+" "+i).trimStart(),r.append(n));var n,r,i,a,o=T(t,e),s=P(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?Md(this,o):(this.parentNode.replaceChild(o,this),o.className=ut,o.markType=A)),s}).attr("markType",A).attr("className",ut)}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return U(t,[this])}).remove(),t=>t.append(T).attr("className",ut).attr("markType",A).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new Hy(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new Hy([],this.__toData__,this.parentNode).append(T).attr("className",ut).attr("markType",A).nodes();return P(t,[this],e)}).remove()).transitions();nt.push(...O.flat())}{var S=tt,G=et,H=rt,V=it,_,Y;const[$]=cA("labelTransform",H),{markState:K,labelTransform:C}=S,Z=G.select(h7(ct)).node(),L=new Map,N=new Map,J=Array.from(K.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[s]=cA("shape",r),l=t["data"],{data:a,defaultLabelShape:c}=e,u=a.map(t=>t.points),{theme:h,coordinate:o}=n,f=Object.assign(Object.assign({},i),{document:uA(i),theme:h,coordinate:o});return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t,style:a}=t,t=at(t,["formatter","transform","style"]),t=Oy(Object.assign(Object.assign({},t),a),t=>e7(t,r,e,l)),{shape:a=c,text:o}=t,t=at(t,["shape","text"]),i="string"==typeof i?yM(i):i,i=Object.assign(Object.assign({},t),{text:i(o,r,e,l)}),o=Object.assign({type:"label."+a},t);return s(o,f)(n,i,n7(h,"label",a,"label"),u)}}(t,e,S,H,V),a=G.select("#"+r).selectAll(h7(ut)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=at(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{L.set(t,i),N.set(t,e)}),t})})}),j=lt(Z).selectAll(h7(dt)).data(J,t=>t.key).join(t=>t.append(t=>L.get(t)(t)).attr("className",dt),t=>t.each(function(t){Md(this,L.get(t)(t))}),t=>t.remove()).nodes(),Q=Kh(j,t=>N.get(t.__data__)),R=S["coordinate"];for([_,Y]of Q){var{transform:_=[]}=_;bd(_.map($))(Y,R)}C&&C(j,R)}})}function e7(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function n7(t,e,n,r){var i;if("string"==typeof e)return i=t["defaultColor"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function r7(o,t,e,n,r){var[,i]=cA("shape",r);const[s]=cA("animation",r);var r=e["defaultShape"],{theme:e,coordinate:n}=n,a=`default${Qe(o)}Animation`;const{[a]:l}=i(c7(t,r)).props,{[o]:c={}}=e,u=(null==(i=t.animate)?void 0:i[o])||{},h={coordinate:n};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||l},u);return t.type?(r={delay:r,duration:i,easing:a},i=s(t,h)(e,n,ot(c,r)),Array.isArray(i)?i:[i]):null}}function i7(t){return t.finished.then(()=>{t.cancel()}),t}function a7(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=at(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function o7(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function s7(r,i){return K(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=at(r,["data"]);return null==e?r:([,{data:e}]=yield DT(0,{data:e},t),Object.assign({data:e},n))})}function l7(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function c7(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function u7(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(h7(N)).data(e,t=>t.key).join(t=>t.append("g").attr("className",N).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(h7(ct)).node())||t.append("g").attr("className",ct).style("zIndex",0)}function h7(...t){return t.map(t=>"."+t).join("")}function f7(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new z.Rect({style:{x:e,y:t,width:n,height:r}})):null})}function d7(t){for(var t=ot({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=ot({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function p7(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||wd('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),d7(t)),{canvas:l=(t=i,h=a,f=new C.Renderer,f.registerPlugin(new eu),new z.Canvas({width:t,height:h,container:document.createElement("div"),renderer:f})),library:c=N_(),emitter:u=new ru}=e;var h,f;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit(uk.BEFORE_RENDER);const d=lt(l.document.documentElement);return l.ready.then(()=>$T(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit(uk.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function g7(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+$))&&r.forEach(t=>{var{nameInteraction:t=new Map}=t;0<(null==t?void 0:t.size)&&Array.from(null==t?void 0:t.values()).forEach(t=>{null!=t&&t.destroy()})}),n?e.destroy():e.destroyChildren()),i.off()}function y7(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function m7(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function v7(t,{name:e,key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length&&"string"!=typeof t?this.attr(r,t):((n=this.attr(r)||{})[t]=1===arguments.length||e,this.attr(r,n))}}function S(r){return t=>{for(const n of r){var e=n["type"];"value"===e?y7(t,n):"array"===e?m7(t,n):"object"===e?v7(t,n):"node"===e?function(t,{name:n,ctor:r}){t.prototype[n]=function(t){var e=this.append(r);return"mark"===n&&(e.type=t),e}}(t,n):"container"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,n):"mix"===e&&function(t,{name:r}){t.prototype[r]=function(t){var e,n;return 0===arguments.length?this.attr(r):Array.isArray(t)?this.attr(r,{items:t}):_d(t)&&(void 0!==t.title||void 0!==t.items)||null===t||!1===t?this.attr(r,t):({items:n=[]}=e=this.attr(r)||{},n.push(t),e.items=n,this.attr(r,e))}}(t,n)}return t}}function b7(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function x7(t,e){for(var n=[t];n.length;){var r=n.shift(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class w7{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],this.push(t),t}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return x7(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return x7(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return x7(this,t=>{n||e===t.type&&(n=t)}),n}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}class M7 extends w7{changeData(t){var e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.getRoot())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.getRoot())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.getRoot())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}}i=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"coordinate",type:"object"},{name:"interaction",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"},{name:"state",type:"object"},{name:"tooltip",type:"mix"}],o=[{name:"scale",type:"object"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"state",type:"object"}],Fo=o;let O7=class extends M7{constructor(){super({})}},k7=(O7=e([S(i)],O7),class extends M7{constructor(){super({},"interval")}}),E7=(k7=e([S(i)],k7),class extends M7{constructor(){super({},"rect")}}),S7=(E7=e([S(i)],E7),class extends M7{constructor(){super({},"point")}}),_7=(S7=e([S(i)],S7),class extends M7{constructor(){super({},"area")}}),A7=(_7=e([S(i)],_7),class extends M7{constructor(){super({},"line")}}),T7=(A7=e([S(i)],A7),class extends M7{constructor(){super({},"cell")}}),P7=(T7=e([S(i)],T7),class extends M7{constructor(){super({},"vector")}}),C7=(P7=e([S(i)],P7),class extends M7{constructor(){super({},"link")}}),L7=(C7=e([S(i)],C7),class extends M7{constructor(){super({},"polygon")}});L7=e([S(i)],L7);Ro=e([S(i)],class extends M7{constructor(){super({},"image")}});let N7=class extends M7{constructor(){super({},"text")}},j7=(N7=e([S(i)],N7),class extends M7{constructor(){super({},"box")}}),R7=(j7=e([S(i)],j7),class extends M7{constructor(){super({},"lineX")}}),I7=(R7=e([S(i)],R7),class extends M7{constructor(){super({},"lineY")}}),B7=(I7=e([S(i)],I7),class extends M7{constructor(){super({},"range")}}),D7=(B7=e([S(i)],B7),class extends M7{constructor(){super({},"rangeX")}}),F7=(D7=e([S(i)],D7),class extends M7{constructor(){super({},"rangeY")}}),z7=(F7=e([S(i)],F7),class extends M7{constructor(){super({},"connector")}}),W7=(z7=e([S(i)],z7),class extends M7{constructor(){super({},"shape")}}),G7=(W7=e([S(i)],W7),class extends M7{constructor(){super({},"sankey")}}),H7=(G7=e([S([...i,{name:"layout",type:"value"}])],G7),class extends M7{constructor(){super({},"treemap")}}),V7=(H7=e([S([...i,{name:"layout",type:"value"}])],H7),class extends M7{constructor(){super({},"boxplot")}}),Y7=(V7=e([S(i)],V7),class extends M7{constructor(){super({},"density")}}),q7=(Y7=e([S(i)],Y7),class extends M7{constructor(){super({},"heatmap")}}),X7=(q7=e([S(i)],q7),class extends M7{constructor(){super({},"path")}}),U7=(X7=e([S(i)],X7),class extends M7{constructor(){super({},"pack")}}),$7=(U7=e([S([...i,{name:"layout",type:"value"}])],U7),class extends M7{constructor(){super({},"forceGraph")}}),K7=($7=e([S([...i,{name:"layout",type:"value"}])],$7),class extends M7{constructor(){super({},"tree")}}),Z7=(K7=e([S([...i,{name:"layout",type:"value"}])],K7),class extends M7{constructor(){super({},"wordCloud")}}),J7=(Z7=e([S([...i,{name:"layout",type:"object"}])],Z7),class extends M7{constructor(){super({},"gauge")}}),Q7=(J7=e([S(i)],J7),class extends M7{constructor(){super({},"axisX")}}),t9=(Q7=e([S(o)],Q7),class extends M7{constructor(){super({},"axisY")}}),e9=(t9=e([S(o)],t9),class extends M7{constructor(){super({},"legends")}});e9=e([S(Fo)],e9);const n9={mark:O7,interval:k7,rect:E7,point:S7,area:_7,line:A7,cell:T7,vector:P7,link:C7,polygon:L7,image:Ro,text:N7,box:j7,lineX:R7,lineY:I7,range:B7,rangeX:D7,rangeY:F7,connector:z7,sankey:G7,treemap:H7,boxplot:V7,density:Y7,heatmap:q7,path:X7,shape:W7,pack:U7,forceGraph:$7,tree:K7,wordCloud:Z7,gauge:J7,axisX:Q7,axisY:t9,legends:e9};class r9 extends w7{changeData(e){var t,n=this.getRoot();if(n)return this.attr("data",e),null!=(t=this.children)&&t.length&&this.children.forEach(t=>{t.attr("data",e)}),null==n?void 0:n.render()}getView(){var t=this.getRoot().getContext()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this._key)}getScale(){var t;return null==(t=this.getView())?void 0:t.scale}getScaleByChannel(t){var e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&IO(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&RO(t)}}let i9=class extends r9{constructor(t={},e="view"){super(t,e)}},a9=(i9=e([S([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...b7(n9)])],i9),class extends r9{constructor(){super({},"spaceLayer")}}),o9=(a9=e([S([{type:"value",name:"data"},...b7(n9)])],a9),class extends r9{constructor(){super({},"spaceFlex")}}),s9=(o9=e([S([{type:"value",name:"data"},...b7(n9)])],o9),class extends r9{constructor(){super({},"facetRect")}}),l9=(s9=e([S([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...b7(n9)])],s9),class extends r9{constructor(){super({},"facetCircle")}}),c9=(l9=e([S([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...b7(n9)])],l9),class extends r9{constructor(){super({},"repeatMatrix")}}),u9=(c9=e([S([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...b7(n9)])],c9),class extends r9{constructor(){super({},"timingKeyframe")}}),h9=(u9=e([S([...b7(n9)])],u9),class extends r9{constructor(){super({},"geoView")}}),f9=(h9=e([S([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...b7(n9)])],h9),class extends r9{constructor(){super({},"geoPath")}});f9=e([S([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"state"},...b7(n9)])],f9);const d9={view:i9,spaceLayer:a9,spaceFlex:o9,facetRect:s9,facetCircle:l9,repeatMatrix:c9,timingKeyframe:u9,geoView:h9,geoPath:f9};for(const k9 of Object.values(d9))S(b7(d9))(k9);const p9=N_();const g9=t=>t?parseInt(t):0;const y9=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function m9(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function v9(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||g9(e.width),r=r.clientHeight||g9(e.height),{width:n-(g9(e.paddingLeft)+g9(e.paddingRight)),height:r-(g9(e.paddingTop)+g9(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function b9(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of y9)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,m9(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=m9(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function x9(t,e,n){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if("function"!=typeof(t=n)&&!new Set(Object.keys(n9)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of y9)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function w9(t){var e=t["type"],t=at(t,["type","children"]),n=new(function(t){if("function"==typeof t)return n9.mark;var e=Object.assign(Object.assign({},n9),d9)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e));return n.value=t,n.type=e,n}function M9(t,e){var n=e["type"],e=at(e,["type","children"]);t.type===n||void 0===n?function t(e,n,r=5,i=0){if(!(r<=i))for(const o of Object.keys(n)){var a=n[o];We(a)&&We(e[o])?t(e[o],a,r,i+1):e[o]=a}}(t.value,e):"string"==typeof n&&(t.type=n,t.value=e)}function O9(t,e,n){for(var r=[[null,t,x9(t,e,n)]];r.length;){var[i,a,o]=r.shift();if(a)if(o){M9(a,o);var s=o["children"],l=a["children"];if(Array.isArray(s)&&Array.isArray(l)){var c=Math.max(s.length,l.length);for(let t=0;t<c;t++){var u=s[t],h=l[t];r.push([a,h,u])}}}else a.remove();else{y=g=p=d=f=void 0;var f=i,d=o;if(f)for(var p=[[f,d]];p.length;){const[f,m]=p.shift();var g=w9(m),y=(Array.isArray(f.children)&&f.push(g),m)["children"];if(Array.isArray(y))for(const v of y)p.push([g,v])}}}}Po=[{name:"data",type:"value"},{name:"width",type:"value"},{name:"height",type:"value"},{name:"coordinate",type:"value"},{name:"interaction",type:"object"},{name:"theme",type:"object"},{name:"title",type:"value"},{name:"transform",type:"array"},{name:"scale",type:"object"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"style",type:"object"},{name:"labelTransform",type:"array"},...b7(n9),...(r=d9,Object.entries(r).map(([t,e])=>({type:"container",name:t,ctor:e})))];T.Chart=class extends i9{constructor(t){var t=t||{},{container:e,canvas:n,renderer:r,plugins:i}=t;super(at(t,["container","canvas","renderer","plugins"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=rn(()=>{this.forceFit()},300),this._renderer=r||new C.Renderer,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new ru,this._context={library:p9,emitter:this._emitter,canvas:n}}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;var t=new Promise((t,e)=>p7(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let n,r;return[new Promise((t,e)=>{r=t,n=e}),r,n]}();return t.then(n).catch(r).then(()=>this._renderTrailing()),e}options(t){var e;return 0===arguments.length?b9(this):(e=t["type"],e&&(this._previousDefinedType=e),O9(this,t,this._previousDefinedType),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(){this.options();this.emit(uk.BEFORE_CLEAR),this._reset(),g7(0,this._context,!1),this.emit(uk.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(uk.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),g7(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(uk.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=v9(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(uk.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(uk.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(uk.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit(uk.AFTER_CHANGE_SIZE)}),t}_reset(){this.type="view",this.value={},this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{var t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{var e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(e){return t=>{this._rendering=!1,e(t)}}_computedOptions(){var t=this.options(),{key:e="G2_CHART_KEY"}=t,{width:n,height:r}=v9(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})}_createCanvas(){var{width:t,height:e}=v9(this.options(),this._container);this._plugins.push(new eu),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new z.Canvas({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){null!=(t=this._trailingResolve)&&t.call(this,this),this._trailing=!0;var t=new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e});return t}_bindAutoFit(){var t=this.options()["autoFit"];this._hasBindAutoFit?t||this._unbindAutoFit():t&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}},T.Chart=e([S(Po)],T.Chart),z.runtime.enableCSSParsing=!1,T.AREA_CLASS_NAME=pt,T.COMPONENT_CLASS_NAME=ft,T.ChartEvent=uk,T.CompositionNode=r9,T.ELEMENT_CLASS_NAME=ut,T.LABEL_CLASS_NAME=dt,T.LABEL_LAYER_CLASS_NAME=ct,T.MAIN_LAYER_CLASS_NAME=N,T.MarkNode=M7,T.PLOT_CLASS_NAME=ht,T.VIEW_CLASS_NAME=$,T.createLibrary=N_,T.register=function(t,e){Object.assign(p9,{[t]:e})},T.render=p7,T.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=d7(t);const{library:o=N_(),group:s=new z.Group,emitter:l=new ru}=e;null!==s&&void 0!==s&&s.parentElement||wd("renderToMountedElement can't render chart to unmounted group.");var c=lt(s);return e.group=s,e.library=o,(e.emitter=l).emit(uk.BEFORE_RENDER),$T(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit(uk.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(T,"__esModule",{value:!0})});
|